export const __rspack_esm_id=47405;export const __rspack_esm_ids=[47405];export const __webpack_modules__={35535(t,s,e){e.a(t,async function(t,a){try{e.r(s);var r=e(15697),o=e(57527),i=e(79224),n=e(148),l=e(61615),d=e(88457),h=(e(75041),e(57406)),c=e(24396),p=e(28308),u=e(76730),g=t([l,d,h]);[l,d,h]=g.then?(await g)():g;class y extends o.WF{render(){return this.cardLess?this._renderContent():o.qy` <ha-card outlined .header=${this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`)}> ${this._renderContent()} </ha-card> `}_renderContent(){return o.qy` <div class="card-content"> <p> ${this.localize(`ui.panel.${this.translationKeyPanel}.instructions`)} </p> ${this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.s6} <ha-input autofocus id="email" label=${this.localize(`ui.panel.${this.translationKeyPanel}.email`)} .value=${this.email??""} type="email" required .disabled=${this._inProgress} @keydown=${this._keyDown} .validationMessage=${this.localize(`ui.panel.${this.translationKeyPanel}.email_error_msg`)}></ha-input> </div> <div class="card-actions"> <ha-progress-button @click=${this._handleEmailPasswordReset} .progress=${this._inProgress}> ${this.localize(`ui.panel.${this.translationKeyPanel}.send_reset_email`)} </ha-progress-button> </div> `}_keyDown(t){"Enter"===t.key&&this._handleEmailPasswordReset()}async _handleEmailPasswordReset(){const t=this.emailField,s=t.value??"";t.reportValidity()?(this._inProgress=!0,this._resetPassword(s)):t.focus()}static get styles(){return[u.RF,o.AH`ha-card{max-width:600px;margin:24px auto 0}h1{margin:0}ha-input{width:100%}.card-actions{justify-content:flex-end;align-items:center;display:flex}`]}constructor(...t){super(...t),this.translationKeyPanel="config.cloud.forgot_password",this.cardLess=!1,this._inProgress=!1,this._resetPassword=async t=>{this._inProgress=!0;try{this.hass?await(0,c.Ut)(this.hass,t):await(0,p.zN)(t),(0,n.r)(this,"cloud-email-changed",{value:t}),this._inProgress=!1,(0,n.r)(this,"cloud-done",{flashMessage:this.localize(`ui.panel.${this.translationKeyPanel}.check_your_email`)})}catch(s){this._inProgress=!1;"usernotfound"===(s&&s.body&&s.body.code)&&t!==t.toLowerCase()?await this._resetPassword(t.toLowerCase()):this._error=s&&s.body&&s.body.message?s.body.message:"Unknown error"}}}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"localize",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"translation-key-panel"})],y.prototype,"translationKeyPanel",void 0),(0,r.Cg)([(0,i.MZ)()],y.prototype,"email",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean,attribute:"card-less"})],y.prototype,"cardLess",void 0),(0,r.Cg)([(0,i.wk)()],y.prototype,"_inProgress",void 0),(0,r.Cg)([(0,i.wk)()],y.prototype,"_error",void 0),(0,r.Cg)([(0,i.P)("#email",!0)],y.prototype,"emailField",void 0),y=(0,r.Cg)([(0,i.EM)("cloud-forgot-password-card")],y),e.d(s,{CloudForgotPasswordCard:()=>y}),a()}catch(t){a(t)}})},90268(t,s,e){e.a(t,async function(t,a){try{e.r(s);var r=e(15697),o=e(57527),i=e(79224),n=e(35535),l=e(6643),d=e(76730),h=t([n,l]);[n,l]=h.then?(await h)():h;class c extends o.WF{render(){return o.qy` <hass-subpage .hass=${this.hass} .narrow=${this.narrow} .header=${this.hass.localize("ui.panel.config.cloud.forgot_password.title")}> <div class="content"> <cloud-forgot-password-card .hass=${this.hass} .localize=${this.hass.localize} .email=${this.email}></cloud-forgot-password-card> </div> </hass-subpage> `}static get styles(){return[d.RF,o.AH`.content{padding-bottom:24px}`]}constructor(...t){super(...t),this.narrow=!1,this._requestInProgress=!1}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],c.prototype,"narrow",void 0),(0,r.Cg)([(0,i.MZ)()],c.prototype,"email",void 0),(0,r.Cg)([(0,i.wk)()],c.prototype,"_requestInProgress",void 0),c=(0,r.Cg)([(0,i.EM)("cloud-forgot-password")],c),e.d(s,{CloudForgotPassword:()=>c}),a()}catch(t){a(t)}})}};
//# sourceMappingURL=47405.f7434b33cbd804e7.js.map