/*!
 * KoliBri - The accessible HTML-Standard
 */
import{e as watchString,w as watchValidator}from"./common-Dd0zJQbD.js";import{v as validateAutoComplete}from"./auto-complete-mCkUnxg2.js";import{a as validateHasCounter,v as validateMaxLengthBehavior,b as validateMaxLength}from"./max-length-behavior-nTw1Zuyf.js";import{v as validatePlaceholder}from"./placeholder-BVhy3BzI.js";import{v as validateReadOnly}from"./read-only-BetTuumR.js";import{v as validateRequired}from"./required-CnTTpFCN.js";import{I as InputIconController}from"./controller-icon-DWR7m7FI.js";const validatePattern=(t,a,e={})=>{watchString(t,"_pattern",a,e)},PasswordVariantPropTypeOptions=["default","visibility-toggle"],validatePasswordVariant=(t,a)=>{watchValidator(t,"_variant",t=>"string"==typeof t&&PasswordVariantPropTypeOptions.includes(t),new Set(PasswordVariantPropTypeOptions),a)};class InputPasswordController extends InputIconController{constructor(t,a,e){super(t,a,e),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=t}validateAutoComplete(t){validateAutoComplete(this.component,t)}validateHasCounter(t){validateHasCounter(this.component,t)}validateMaxLengthBehavior(t){validateMaxLengthBehavior(this.component,t)}validateVariant(t){validatePasswordVariant(this.component,t)}validateMaxLength(t){validateMaxLength(this.component,t,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePattern(t){validatePattern(this.component,t)}validatePlaceholder(t){validatePlaceholder(this.component,t)}validateReadOnly(t){validateReadOnly(this.component,t)}validateRequired(t){validateRequired(this.component,t)}validateValue(t){watchString(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.validateMaxLengthBehavior(this.component._maxLengthBehavior),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{InputPasswordController as I};