"use strict";(self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[3196],{63196:(A,u,t)=>{t.r(u),t.d(u,{ResetPasswordModule:()=>c});var R=t(15504),P=t(67029),d=t(31007),i=t(31777);const f={VALIDATORS:[i.kI.required],MESSAGES:{required:"Potwierdzenie has\u0142a jest wymagane."}};var m=t(44560),e=t(51109),E=t(10047),p=t(8003);const T=[{path:"",component:(()=>{class o extends R.OI{constructor(s,r,S,_,l){super(),this.formReactiveService=s,this.userService=r,this.notifier=S,this.router=_,this.route=l}ngOnInit(){this.buildForm({password:m.$T,"password-confirm":f}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("Nie mo\u017Cna znale\u017A\u0107 ID u\u017Cytkownika lub kodu weryfikuj\u0105cego."),this.router.navigate(["/"]))}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Pomy\u015Blnie zresetowano has\u0142o!"),this.router.navigate(["/login"])},error:s=>this.notifier.error(s.message)})}isConfirmedPasswordValid(){const s=this.form.value;return s.password===s["password-confirm"]}}return o.\u0275fac=function(s){return new(s||o)(e.Y36(R.RL),e.Y36(E.KD),e.Y36(E.d4),e.Y36(d.F0),e.Y36(d.gz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["my-login"]],features:[e.qOj],decls:13,vars:4,consts:function(){let n,s,r,S,_,l;return n="Resetuj moje has\u0142o",s="Has\u0142o",r="Has\u0142o",S="Potwierd\u017A has\u0142o",_="Potwierdzone has\u0142o",l="Resetuj moje has\u0142o",[[1,"margin-content"],[1,"title-page"],n,["role","form",3,"formGroup","ngSubmit"],[1,"form-group"],["for","password"],s,["formControlName","password","inputId","password","placeholder",r,"autocomplete","new-password",3,"formError"],["for","password-confirm"],S,["formControlName","password-confirm","inputId","password-confirm","placeholder",_,"autocomplete","new-password",3,"formError"],["type","submit","value",l,1,"peertube-button","orange-button",3,"disabled"]]},template:function(s,r){1&s&&(e.TgZ(0,"div",0)(1,"h1",1),e.SDv(2,2),e.qZA(),e.TgZ(3,"form",3),e.NdJ("ngSubmit",function(){return r.resetPassword()}),e.TgZ(4,"div",4)(5,"label",5),e.SDv(6,6),e.qZA(),e._UZ(7,"my-input-text",7),e.qZA(),e.TgZ(8,"div",4)(9,"label",8),e.SDv(10,9),e.qZA(),e._UZ(11,"my-input-text",10),e.qZA(),e._UZ(12,"input",11),e.qZA()()),2&s&&(e.xp6(3),e.Q6J("formGroup",r.form),e.xp6(4),e.Q6J("formError",r.formErrors.password),e.xp6(4),e.Q6J("formError",r.formErrors["password-confirm"]),e.xp6(1),e.Q6J("disabled",!r.form.valid||!r.isConfirmedPasswordValid()))},dependencies:[i._Y,i.JJ,i.JL,i.sg,i.u,p.m],styles:["my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}"]}),o})(),data:{meta:{title:"Zresetuj has\u0142o"}}}];let g=(()=>{class o{}return o.\u0275fac=function(s){return new(s||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[d.Bz.forChild(T),d.Bz]}),o})(),c=(()=>{class o{}return o.\u0275fac=function(s){return new(s||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[g,P.nC,R.hA]}),o})()}}]);
//# sourceMappingURL=3196.024798a6a0106a52.js.map