import{r as t,c as e,h as s,H as a,g as i}from"./p-CV0Pyo1O.js";import{F as r}from"./p-Ce_W43gc.js";import{a3 as o,q as h,v as l,u as n,w as d,x as f}from"./p-CPKMvyV_.js";const c=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.errorText="",this.inputHandler=()=>{},this.disabled=!1}render(){return s(a,{key:"52fee4080e9475313f4043c1a1e116d07881fd72",exportparts:"label,input,input-invalid"},s("div",{key:"efe6ee7fae0693fad8086e7849fdc03a01525368",class:"form-group d-flex flex-column"},s("div",{key:"dd224535e329aa82cc86be2f32f40b4a8904e1bc",class:"d-flex align-items-start gap-2"},s("label",{key:"6cee04c50d6eaba123d00ee5ffdad036e46bbf7d",part:"label",class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"30e545c71fa6a5e4eac985ea6073dc5b2ab78629",helpText:this.helpText})),s("input",{key:"3ba7425da1d80314acdd0050c90aa8a795473584",type:"file",name:this.name,part:`input ${this.errorText?"input-invalid ":""}${this.disabled?"input-disabled":""}`,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onBlur:()=>this.formControlBlur.emit(),onChange:()=>this.errorText=""}),s(r,{key:"9ad4526e2937d98d555b325e60d20dc7305ee786",errorText:this.errorText,name:this.name})))}get el(){return i(this)}},m=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.helpText="",this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit({name:s,value:e.value})},this.updateInput=t=>{const e=this.el.querySelector("textarea");e&&(e.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?o:this.errorText?h:this.isFocused?l:this.disabled?n:d}render(){return s(a,{key:"f6c4833f4a582e5b310b89356716acce6ef24f8f"},s("div",{key:"dc576c3df86ede178fef9dd2975ea2307fd1bd5f",class:"form-group d-flex flex-column"},s("label",{key:"4217d6bbe9fb6331c2ab5e9d043659079a7af1dc",part:f,class:"form-label",htmlFor:this.name},this.label),s("textarea",{key:"42ab7f076431ee0a1e744eb648de1590e39554f7",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",disabled:this.disabled}),s("form-control-help-text",{key:"a1d8a2b674e5faf81c778a07ca270094f77e7281",helpText:this.helpText,name:this.name}),s("form-control-error-text",{key:"a47839b4edc4007b6c9dfc1b6689dd1e1750cc60",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{c as form_control_file_v2,m as form_control_textarea}