"use strict";(self.webpackChunkdotcms_ui=self.webpackChunkdotcms_ui||[]).push([[5597],{65597:(p,g,s)=>{s.r(g),s.d(g,{ForgotPasswordModule:()=>T});var a=s(36895),c=s(87904),e=s(24006),u=s(72986),d=s(22868),v=s(2094),h=s(95190),M=s(42816),o=s(86353),m=s(35593),f=s(51740),P=s(94632),w=s(43740);function F(n,i){if(1&n){const t=o.EpF();o.TgZ(0,"div",1)(1,"h3",2),o._uU(2),o.qZA(),o._UZ(3,"p",3),o.TgZ(4,"form",4)(5,"div",5)(6,"label",6),o._uU(7),o.qZA(),o._UZ(8,"input",7)(9,"dot-field-validation-message",8),o.qZA(),o.TgZ(10,"div",9)(11,"button",10),o.NdJ("click",function(){o.CHM(t);const l=o.oxw();return o.KtG(l.goToLogin())}),o.qZA(),o.TgZ(12,"button",11),o.NdJ("click",function(){o.CHM(t);const l=o.oxw();return o.KtG(l.submit())}),o.qZA()()()()}if(2&n){const t=i.ngIf,r=o.oxw();o.xp6(2),o.Oqu(t.i18nMessagesMap["forgot-password"]),o.xp6(1),o.Q6J("innerHTML",r.message,o.oJD),o.xp6(1),o.Q6J("formGroup",r.forgotPasswordForm),o.xp6(3),o.Oqu(t.i18nMessagesMap.emailAddressLabel),o.xp6(2),o.Q6J("message",null==t?null:t.i18nMessagesMap["error.form.mandatory"].replace("{0}",t.i18nMessagesMap.emailAddressLabel))("field",r.forgotPasswordForm.get("login")),o.xp6(2),o.Q6J("label",t.i18nMessagesMap.cancel),o.xp6(1),o.Q6J("disabled",!r.forgotPasswordForm.valid)("label",t.i18nMessagesMap["get-new-password"])}}let C=(()=>{class n{constructor(t,r,l,y){this.fb=t,this.loginPageStateService=r,this.dotRouterService=l,this.loginService=y,this.message="",this.forgotPasswordConfirmationMessage=""}ngOnInit(){this.loginInfo$=this.loginPageStateService.get().pipe((0,u.q)(1),(0,d.b)(t=>{this.forgotPasswordConfirmationMessage=t.i18nMessagesMap["an-email-with-instructions-will-be-sent"]})),this.forgotPasswordForm=this.fb.group({login:["",[e.kI.required]]})}submit(){confirm(this.forgotPasswordConfirmationMessage)&&(this.message="",this.loginService.recoverPassword(this.forgotPasswordForm.get("login").value).pipe((0,u.q)(1)).subscribe(()=>{this.goToLogin({queryParams:{resetEmailSent:!0,resetEmail:this.forgotPasswordForm.get("login").value}})},t=>{this.message=t.error?.errors[0]?.message}))}goToLogin(t){this.dotRouterService.goToLogin(t)}}return n.\u0275fac=function(t){return new(t||n)(o.Y36(e.QS),o.Y36(v.O),o.Y36(M.W),o.Y36(h.r6))},n.\u0275cmp=o.Xpm({type:n,selectors:[["dot-forgot-password-component"]],decls:2,vars:3,consts:[["class","forgot-password__container",4,"ngIf"],[1,"forgot-password__container"],["data-testId","header"],["data-testId","errorMessage",1,"p-invalid",3,"innerHTML"],[1,"p-fluid",3,"formGroup"],[1,"field","form__group--validation"],["data-testId","usernameLabel","for","username"],["id","username","pInputText","","type","text","dotAutofocus","","formControlName","login","autocomplete","username","data-testId","input"],[3,"message","field"],[1,"field"],["pButton","","data-testId","cancelButton","type","button",1,"p-button-secondary",3,"label","click"],["pButton","","type","submit","data-testId","submitButton",3,"disabled","label","click"]],template:function(t,r){1&t&&(o.YNc(0,F,13,9,"div",0),o.ALo(1,"async")),2&t&&o.Q6J("ngIf",o.lcZ(1,1,r.loginInfo$))},dependencies:[a.O5,e._Y,e.Fj,e.JJ,e.JL,m.Hq,f.o,e.sg,e.u,P.g,w.h,a.Ov],styles:["[_nghost-%COMP%]{max-width:360px;width:80%}h3[_ngcontent-%COMP%]{margin:0}button[type=submit][_ngcontent-%COMP%]{margin-left:.5rem}"]}),n})();var x=s(44189),b=s(95978);const I=[{component:C,path:""}];let T=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=o.oAB({type:n}),n.\u0275inj=o.cJS({imports:[a.ez,e.u5,m.hJ,f.j,e.UX,x.v,b.x,c.Bz.forChild(I)]}),n})()},43740:(p,g,s)=>{s.d(g,{h:()=>c});var a=s(86353);let c=(()=>{class e{constructor(d){this.el=d}ngOnInit(){this.el.nativeElement.disabled||setTimeout(()=>{this.el.nativeElement.focus()},100)}}return e.\u0275fac=function(d){return new(d||e)(a.Y36(a.SBq))},e.\u0275dir=a.lG2({type:e,selectors:[["","dotAutofocus",""]]}),e})()}}]);