import{J as q,K as ee,cc as te,al as ae,aQ as ne,k as w,r as d,s as le,bk as oe,o as ie,a9 as f,e as re,aK as ue,aS as se,aT as T,aU as ce,B as n,aG as R,aV as de,aW as fe,aX as ve,ag as k,bo as xe,bm as ge,V as A,aY as me,aZ as he,ah as D,cd as we,ce as Ve,a_ as Pe}from"#entry";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||{}),be=(e=>(e.AndroidApkFile="androidApkFile",e.AndroidAabFile="androidAabFile",e.IosFile="iosFile",e))(be||{});const Ie=ee({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,...ve(),...fe()},"VTextarea"),ke=q()({name:"VTextarea",directives:{Intersect:te},inheritAttrs:!1,props:Ie(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,H){let{attrs:V,emit:C,slots:r}=H;const l=ae(e,"modelValue"),{isFocused:c,focus:z,blur:G}=ne(e),K=w(()=>typeof e.counterValue=="function"?e.counterValue(l.value):(l.value||"").toString().length),U=w(()=>{if(V.maxlength)return V.maxlength;if(!(!e.counter||typeof e.counter!="number"&&typeof e.counter!="string"))return e.counter});function W(t,a){!e.autofocus||!t||a[0].target?.focus?.()}const S=d(),v=d(),_=le(""),x=d(),L=w(()=>e.persistentPlaceholder||c.value||e.active);function P(){x.value!==document.activeElement&&x.value?.focus(),c.value||z()}function Y(t){P(),C("click:control",t)}function p(t){C("mousedown:control",t)}function E(t){t.stopPropagation(),P(),k(()=>{l.value="",Pe(e["onClick:clear"],t)})}function $(t){const a=t.target;if(l.value=a.value,e.modelModifiers?.trim){const o=[a.selectionStart,a.selectionEnd];k(()=>{a.selectionStart=o[0],a.selectionEnd=o[1]})}}const u=d(),g=d(+e.rows),y=w(()=>["plain","underlined"].includes(e.variant));oe(()=>{e.autoGrow||(g.value=+e.rows)});function s(){e.autoGrow&&k(()=>{if(!u.value||!v.value)return;const t=getComputedStyle(u.value),a=getComputedStyle(v.value.$el),o=parseFloat(t.getPropertyValue("--v-field-padding-top"))+parseFloat(t.getPropertyValue("--v-input-padding-top"))+parseFloat(t.getPropertyValue("--v-field-padding-bottom")),F=u.value.scrollHeight,h=parseFloat(t.lineHeight),b=Math.max(parseFloat(e.rows)*h+o,parseFloat(a.getPropertyValue("--v-input-control-height"))),I=parseFloat(e.maxRows)*h+o||1/0,i=ge(F??0,b,I);g.value=Math.floor((i-o)/h),_.value=xe(i)})}ie(s),f(l,s),f(()=>e.rows,s),f(()=>e.maxRows,s),f(()=>e.density,s);let m;return f(u,t=>{t?(m=new ResizeObserver(s),m.observe(u.value)):m?.disconnect()}),re(()=>{m?.disconnect()}),ue(()=>{const t=!!(r.counter||e.counter||e.counterValue),a=!!(t||r.details),[o,F]=se(V),{modelValue:h,...b}=T.filterProps(e),I=ce(e);return n(T,R({ref:S,modelValue:l.value,"onUpdate:modelValue":i=>l.value=i,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":y.value},e.class],style:e.style},o,b,{centerAffix:g.value===1&&!y.value,focused:c.value}),{...r,default:i=>{let{id:j,isDisabled:M,isDirty:N,isReadonly:J,isValid:Q}=i;return n(he,R({ref:v,style:{"--v-textarea-control-height":_.value},onClick:Y,onMousedown:p,"onClick:clear":E,"onClick:prependInner":e["onClick:prependInner"],"onClick:appendInner":e["onClick:appendInner"]},I,{id:j.value,active:L.value||N.value,centerAffix:g.value===1&&!y.value,dirty:N.value||e.dirty,disabled:M.value,focused:c.value,error:Q.value===!1}),{...r,default:X=>{let{props:{class:O,...B}}=X;return n(A,null,[e.prefix&&n("span",{class:"v-text-field__prefix"},[e.prefix]),D(n("textarea",R({ref:x,class:O,value:l.value,onInput:$,autofocus:e.autofocus,readonly:J.value,disabled:M.value,placeholder:e.placeholder,rows:e.rows,name:e.name,onFocus:P,onBlur:G},B,F),null),[[we("intersect"),{handler:W},null,{once:!0}]]),e.autoGrow&&D(n("textarea",{class:[O,"v-textarea__sizer"],id:`${B.id}-sizer`,"onUpdate:modelValue":Z=>l.value=Z,ref:u,readonly:!0,"aria-hidden":"true"},null),[[Ve,l.value]]),e.suffix&&n("span",{class:"v-text-field__suffix"},[e.suffix])])}})},details:a?i=>n(A,null,[r.details?.(i),t&&n(A,null,[n("span",null,null),n(me,{active:e.persistentCounter||c.value,value:K.value,max:U.value,disabled:e.disabled},r.counter)])]):void 0})}),de({},S,v,x)}});export{Fe as A,ye as T,ke as V,be as a};
