import{w as s,B as l,t as a,q as n,s as c}from"./index-BeCeuELg.js";import{I as p}from"./controller-icon-1d76e1bd-tKWyvUbA.js";import{d,v as m}from"./debounce-e75fb516-zDu1bAY2.js";const i=["default","visibility-toggle"],u=(o,t)=>{s(o,"_variant",e=>typeof e=="string"&&i.includes(e),new Set(i),t)};class C extends p{constructor(t,e,r){super(t,e,r),this.afterSyncCharCounter=()=>{typeof this.component._value=="string"&&(this.component.state._currentLength=this.component._value.length,this.component.state._currentLengthDebounced=this.component._value.length)},this.updateCurrentLengthDebounced=d(h=>{c(this.component,"_currentLengthDebounced",h)},500),this.component=t}validateAutoComplete(t){s(this.component,"_autoComplete",e=>typeof e=="string"&&(e==="on"||e==="off"),new Set(["on | off"]),t)}validateHasCounter(t){m(this.component,t,{hooks:{afterPatch:this.afterSyncCharCounter}})}validateVariant(t){u(this.component,t)}validateMaxLength(t){l(this.component,"_maxLength",t,{hooks:{afterPatch:this.afterSyncCharCounter},min:0})}validatePattern(t){a(this.component,"_pattern",t)}validatePlaceholder(t){a(this.component,"_placeholder",t)}validateReadOnly(t){n(this.component,"_readOnly",t)}validateRequired(t){n(this.component,"_required",t)}validateValue(t){a(this.component,"_value",t,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component.state._value)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateHasCounter(this.component._hasCounter),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validateVariant(this.component._variant)}}export{C as I};
//# sourceMappingURL=controller-8674d885-CP4TGFng.js.map
