import{_ as a,q as o,u as l,c as u,p as h,o as m}from"./_plugin-vue_export-helper.2d9794a3.js";const p={props:{modelValue:{type:[String,Number],default:""},autosize:{type:Boolean,default:!0},minHeight:{type:[Number],default:null},maxHeight:{type:[Number],default:null},important:{type:[Boolean,Array],default:!1}},data(){return{val:null,maxHeightScroll:!1,height:"auto"}},computed:{computedStyles(){return this.autosize?{resize:this.isResizeImportant?"none !important":"none",height:this.height,overflow:this.maxHeightScroll?"auto":this.isOverflowImportant?"hidden !important":"hidden"}:{height:this.minHeight?this.minHeight+"px":""}},isResizeImportant(){const t=this.important;return t===!0||Array.isArray(t)&&t.includes("resize")},isOverflowImportant(){const t=this.important;return t===!0||Array.isArray(t)&&t.includes("overflow")},isHeightImportant(){const t=this.important;return t===!0||Array.isArray(t)&&t.includes("height")}},watch:{value(t){this.val=t},val(t){this.$nextTick(this.resize),this.$emit("update:modelValue",t)},minHeight(){this.$nextTick(this.resize)},maxHeight(){this.$nextTick(this.resize)},autosize(t){t&&this.resize()}},methods:{resize(){const t=this.isHeightImportant?"important":"";return this.height=`auto${t?" !important":""}`,this.$nextTick(()=>{let e=this.$el.scrollHeight+1;this.minHeight&&(e=e<this.minHeight?this.minHeight:e),this.maxHeight&&(e>this.maxHeight?(e=this.maxHeight,this.maxHeightScroll=!0):this.maxHeightScroll=!1);const r=e+"px";this.height=`${r}${t?" !important":""}`}),this}},created(){this.val=this.modelValue},mounted(){this.resize()}};function c(t,e,r,g,n,i){return o((m(),u("textarea",{class:"aioseo-textarea-autosize",style:h(i.computedStyles),"onUpdate:modelValue":e[0]||(e[0]=s=>n.val=s),onFocus:e[1]||(e[1]=(...s)=>i.resize&&i.resize(...s))},null,36)),[[l,n.val]])}const d=a(p,[["render",c]]);export{d as B};
