import{$ as Z,a0 as ee,aM as te,a3 as ae,bw as ne,a4 as le,a5 as oe,j as V,r as v,bt as ie,F as re,o as ue,H as x,f as se,a7 as ce,ar as de,aS as A,aI as fe,a8 as ve,a9 as B,aO as xe,z as l,aP as ge,ab as C,R as S,ah as D,bx as me,by as he,aQ as we,aT as Pe,bz as Ve}from"./D8zG9Ut8.js";var ye=(e=>(e.Html="HTML",e.Markdown="MARKDOWN",e))(ye||{}),Fe=(e=>(e.ANDROID_APK="androidApk",e.ANDROID_PLAYSTORE="androidPlayStore",e.IOS_IPA="iosIpa",e.IOS_APPSTORE="iosAppStore",e.WEB_APP="webApp",e.WEB_API="webApi",e.NETWORK="NETWORK",e.YAML="yaml",e))(Fe||{}),Ie=(e=>(e.AndroidApkFile="androidApkFile",e.AndroidAabFile="androidAabFile",e.IosFile="iosFile",e))(Ie||{});const Re=Z({autoGrow:Boolean,autofocus:Boolean,counter:[Boolean,Number,String],counterValue:Function,prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,noResize:Boolean,rows:{type:[Number,String],default:5,validator:e=>!isNaN(parseFloat(e))},maxRows:{type:[Number,String],validator:e=>!isNaN(parseFloat(e))},suffix:String,modelModifiers:Object,...ee(),...te()},"VTextarea"),Ae=ae()({name:"VTextarea",directives:{Intersect:ne},inheritAttrs:!1,props:Re(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,z){let{attrs:y,emit:k,slots:r}=z;const o=le(e,"modelValue"),{isFocused:f,focus:G,blur:U}=oe(e),W=V(()=>typeof e.counterValue=="function"?e.counterValue(o.value):(o.value||"").toString().length),K=V(()=>{if(y.maxlength)return y.maxlength;if(!(!e.counter||typeof e.counter!="number"&&typeof e.counter!="string"))return e.counter});function L(t,n){var a,i;!e.autofocus||!t||(i=(a=n[0].target)==null?void 0:a.focus)==null||i.call(a)}const M=v(),g=v(),N=ie(""),m=v(),$=V(()=>e.persistentPlaceholder||f.value||e.active);function F(){var t;m.value!==document.activeElement&&((t=m.value)==null||t.focus()),f.value||G()}function j(t){F(),k("click:control",t)}function p(t){k("mousedown:control",t)}function E(t){t.stopPropagation(),F(),A(()=>{o.value="",Pe(e["onClick:clear"],t)})}function Y(t){var a;const n=t.target;if(o.value=n.value,(a=e.modelModifiers)!=null&&a.trim){const i=[n.selectionStart,n.selectionEnd];A(()=>{n.selectionStart=i[0],n.selectionEnd=i[1]})}}const c=v(),h=v(+e.rows),I=V(()=>["plain","underlined"].includes(e.variant));re(()=>{e.autoGrow||(h.value=+e.rows)});function d(){e.autoGrow&&A(()=>{if(!c.value||!g.value)return;const t=getComputedStyle(c.value),n=getComputedStyle(g.value.$el),a=parseFloat(t.getPropertyValue("--v-field-padding-top"))+parseFloat(t.getPropertyValue("--v-input-padding-top"))+parseFloat(t.getPropertyValue("--v-field-padding-bottom")),i=c.value.scrollHeight,w=parseFloat(t.lineHeight),R=Math.max(parseFloat(e.rows)*w+a,parseFloat(n.getPropertyValue("--v-input-control-height"))),b=parseFloat(e.maxRows)*w+a||1/0,s=Ve(i??0,R,b);h.value=Math.floor((s-a)/w),N.value=fe(s)})}ue(d),x(o,d),x(()=>e.rows,d),x(()=>e.maxRows,d),x(()=>e.density,d);let u;return x(c,t=>{t?(u=new ResizeObserver(d),u.observe(c.value)):u==null||u.disconnect()}),se(()=>{u==null||u.disconnect()}),ce(()=>{const t=!!(r.counter||e.counter||e.counterValue),n=!!(t||r.details),[a,i]=ve(y),{modelValue:w,...R}=B.filterProps(e),b=xe(e);return l(B,C({ref:M,modelValue:o.value,"onUpdate:modelValue":s=>o.value=s,class:["v-textarea v-text-field",{"v-textarea--prefixed":e.prefix,"v-textarea--suffixed":e.suffix,"v-text-field--prefixed":e.prefix,"v-text-field--suffixed":e.suffix,"v-textarea--auto-grow":e.autoGrow,"v-textarea--no-resize":e.noResize||e.autoGrow,"v-input--plain-underlined":I.value},e.class],style:e.style},a,R,{centerAffix:h.value===1&&!I.value,focused:f.value}),{...r,default:s=>{let{id:P,isDisabled:O,isDirty:_,isReadonly:Q,isValid:q}=s;return l(ge,C({ref:g,style:{"--v-textarea-control-height":N.value},onClick:j,onMousedown:p,"onClick:clear":E,"onClick:prependInner":e["onClick:prependInner"],"onClick:appendInner":e["onClick:appendInner"]},b,{id:P.value,active:$.value||_.value,centerAffix:h.value===1&&!I.value,dirty:_.value||e.dirty,disabled:O.value,focused:f.value,error:q.value===!1}),{...r,default:J=>{let{props:{class:H,...T}}=J;return l(S,null,[e.prefix&&l("span",{class:"v-text-field__prefix"},[e.prefix]),D(l("textarea",C({ref:m,class:H,value:o.value,onInput:Y,autofocus:e.autofocus,readonly:Q.value,disabled:O.value,placeholder:e.placeholder,rows:e.rows,name:e.name,onFocus:F,onBlur:U},T,i),null),[[me("intersect"),{handler:L},null,{once:!0}]]),e.autoGrow&&D(l("textarea",{class:[H,"v-textarea__sizer"],id:`${T.id}-sizer`,"onUpdate:modelValue":X=>o.value=X,ref:c,readonly:!0,"aria-hidden":"true"},null),[[he,o.value]]),e.suffix&&l("span",{class:"v-text-field__suffix"},[e.suffix])])}})},details:n?s=>{var P;return l(S,null,[(P=r.details)==null?void 0:P.call(r,s),t&&l(S,null,[l("span",null,null),l(we,{active:e.persistentCounter||f.value,value:W.value,max:K.value,disabled:e.disabled},r.counter)])])}:void 0})}),de({},M,g,m)}});export{Fe as A,ye as T,Ae as V,Ie as a};
