export const __webpack_id__="2704";export const __webpack_ids__=["2704"];export const __webpack_modules__={81507:function(e,t,s){s.r(t),s.d(t,{HaFormString:()=>n});var i=s(69868),a=s(84922),o=s(11991),r=s(44017);s(64054),s(80287);const d=["password","secret","token"];class n extends a.WF{focus(){this._input&&this._input.focus()}render(){return a.qy` <ha-textfield .type="${this.isPassword?this.unmaskedPassword?"text":"password":this.stringType}" .label="${this.label}" .value="${this.data||""}" .helper="${this.helper}" helperPersistent .disabled="${this.disabled}" .required="${this.schema.required}" .autoValidate="${this.schema.required}" .name="${this.schema.name}" .autocomplete="${this.schema.autocomplete}" .suffix="${this.isPassword?a.qy`<div style="width:24px"></div>`:this.schema.description?.suffix}" .validationMessage="${this.schema.required?this.localize?.("ui.common.error_required"):void 0}" @input="${this._valueChanged}" @change="${this._valueChanged}"></ha-textfield> ${this.renderIcon()} `}renderIcon(){return this.isPassword?a.qy` <ha-icon-button .label="${this.localize?.(`${this.localizeBaseKey}.${this.unmaskedPassword?"hide_password":"show_password"}`)}" @click="${this.toggleUnmaskedPassword}" .path="${this.unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}"></ha-icon-button> `:a.s6}updated(e){e.has("schema")&&this.toggleAttribute("own-margin",!!this.schema.required)}toggleUnmaskedPassword(){this.unmaskedPassword=!this.unmaskedPassword}_valueChanged(e){let t=e.target.value;this.data!==t&&(""!==t||this.schema.required||(t=void 0),(0,r.r)(this,"value-changed",{value:t}))}get stringType(){if(this.schema.format){if(["email","url"].includes(this.schema.format))return this.schema.format;if("fqdnurl"===this.schema.format)return"url"}return"text"}get isPassword(){return d.some(e=>this.schema.name.includes(e))}constructor(...e){super(...e),this.localizeBaseKey="ui.components.selectors.text",this.disabled=!1,this.unmaskedPassword=!1}}n.styles=a.AH`:host{display:block;position:relative}:host([own-margin]){margin-bottom:5px}ha-textfield{display:block}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`,(0,i.__decorate)([(0,o.MZ)({attribute:!1})],n.prototype,"localize",void 0),(0,i.__decorate)([(0,o.MZ)({attribute:!1})],n.prototype,"localizeBaseKey",void 0),(0,i.__decorate)([(0,o.MZ)({attribute:!1})],n.prototype,"schema",void 0),(0,i.__decorate)([(0,o.MZ)()],n.prototype,"data",void 0),(0,i.__decorate)([(0,o.MZ)()],n.prototype,"label",void 0),(0,i.__decorate)([(0,o.MZ)()],n.prototype,"helper",void 0),(0,i.__decorate)([(0,o.MZ)({type:Boolean})],n.prototype,"disabled",void 0),(0,i.__decorate)([(0,o.wk)()],n.prototype,"unmaskedPassword",void 0),(0,i.__decorate)([(0,o.P)("ha-textfield")],n.prototype,"_input",void 0),n=(0,i.__decorate)([(0,o.EM)("ha-form-string")],n)}};
//# sourceMappingURL=2704.3cbc3bed498c9074.js.map