import{r as l}from"./app-DTeOhhdM.js";import{P as D,C as _,u as T,O as u,m as H,T as N,d,c as U}from"./AuthenticatedLayout-DNj-hWy1.js";import{K as v}from"./inputtext.esm-DvYkLvTo.js";function b(){return b=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},b.apply(this,arguments)}function f(n){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(n)}function C(n,t){if(f(n)!=="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var e=r.call(n,t);if(f(e)!=="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function M(n){var t=C(n,"string");return f(t)==="symbol"?t:String(t)}function k(n,t,r){return t=M(t),t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}var V={root:function(t){var r=t.props,e=t.isFilled;return U("p-inputtextarea p-inputtext p-component",{"p-disabled":r.disabled,"p-filled":e,"p-inputtextarea-resizable":r.autoResize},r.className)}},Y=`
@layer primereact {
    .p-inputtextarea-resizable {
        overflow: hidden;
        resize: none;
    }
    
    .p-fluid .p-inputtextarea {
        width: 100%;
    }
}
`,y=_.extend({defaultProps:{__TYPE:"InputTextarea",__parentMetadata:null,autoResize:!1,keyfilter:null,onBlur:null,onFocus:null,onBeforeInput:null,onInput:null,onKeyDown:null,onKeyUp:null,onPaste:null,tooltip:null,tooltipOptions:null,validateOnly:!1,children:void 0},css:{classes:V,styles:Y}});function h(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),r.push.apply(r,e)}return r}function O(n){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h(Object(r),!0).forEach(function(e){k(n,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})}return n}var $=l.memo(l.forwardRef(function(n,t){var r=l.useContext(D),e=y.getProps(n,r),i=l.useRef(t),c=l.useRef(0),m=y.setMetaData(O(O({props:e},e.__parentMetadata),{},{context:{disabled:e.disabled}})),g=m.ptm,P=m.cx,x=m.isUnstyled;T(y.css.styles,x,{name:"inputtextarea"});var w=function(a){e.autoResize&&p(),e.onFocus&&e.onFocus(a)},I=function(a){e.autoResize&&p(),e.onBlur&&e.onBlur(a)},K=function(a){e.autoResize&&p(),e.onKeyUp&&e.onKeyUp(a)},j=function(a){e.onKeyDown&&e.onKeyDown(a),e.keyfilter&&v.onKeyPress(a,e.keyfilter,e.validateOnly)},B=function(a){e.onBeforeInput&&e.onBeforeInput(a),e.keyfilter&&v.onBeforeInput(a,e.keyfilter,e.validateOnly)},E=function(a){e.onPaste&&e.onPaste(a),e.keyfilter&&v.onPaste(a,e.keyfilter,e.validateOnly)},F=function(a){var o=a.target;e.autoResize&&p(u.isEmpty(o.value)),e.onInput&&e.onInput(a),u.isNotEmpty(o.value)?d.addClass(o,"p-filled"):d.removeClass(o,"p-filled")},p=function(a){var o=i.current;o&&d.isVisible(o)&&(c.current||(c.current=o.scrollHeight,o.style.overflow="hidden"),(c.current!==o.scrollHeight||a)&&(o.style.height="",o.style.height=o.scrollHeight+"px",parseFloat(o.style.height)>=parseFloat(o.style.maxHeight)?(o.style.overflowY="scroll",o.style.height=o.style.maxHeight):o.style.overflow="hidden",c.current=o.scrollHeight))};l.useEffect(function(){u.combinedRefs(i,t)},[i,t]),l.useEffect(function(){e.autoResize&&p(!0)},[e.autoResize]);var R=l.useMemo(function(){return u.isNotEmpty(e.value)||u.isNotEmpty(e.defaultValue)},[e.value,e.defaultValue]),z=u.isNotEmpty(e.tooltip),S=H({ref:i,className:P("root",{isFilled:R}),onFocus:w,onBlur:I,onKeyUp:K,onKeyDown:j,onBeforeInput:B,onInput:F,onPaste:E},y.getOtherProps(e),g("root"));return l.createElement(l.Fragment,null,l.createElement("textarea",S),z&&l.createElement(N,b({target:i,content:e.tooltip},e.tooltipOptions,{pt:g("tooltip")})))}));$.displayName="InputTextarea";export{$ as I};
