import{b as G}from"./chunk-36KDLFTD.js";import{h as L}from"./chunk-26IAXPPW.js";import{b as I,c as W}from"./chunk-67RJ5AZW.js";import{A as D,B as $,d as O,g as C,h as M,m as N,p as w,s as v}from"./chunk-ZIVZTBTN.js";import"./chunk-A62DV3ZS.js";import{Db as T,Ha as _,Mg as h,Sa as P,Uf as y,Wa as c,ba as s,gb as S,la as u,ld as g,od as A,pb as a,qb as t,rb as d,zb as m}from"./chunk-OX24XL2F.js";import{i as p}from"./chunk-FQ4ILEWG.js";var b={VALIDATORS:[O.required],MESSAGES:{required:"La confirmation du mot de passe est requise."}};var F=(()=>{let r=class r extends W{formReactiveService=s(I);userService=s(h);notifier=s(y);router=s(A);route=s(g);userId;verificationString;ngOnInit(){this.buildForm({password:L,"password-confirm":b}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("Impossible de trouver l'identifiant utilisateur\xB7ice ou le texte de v\xE9rification."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Votre mot de passe a \xE9t\xE9 r\xE9initialis\xE9 avec succ\xE8s !"),this.router.navigate(["/login"]);},error:e=>this.notifier.error(e.message)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};p(r,"\u0275fac",(()=>{let e;return function(o){return(e||(e=u(r)))(o||r);};})()),p(r,"\u0275cmp",P({type:r,selectors:[["ng-component"]],features:[c],decls:13,vars:4,consts:()=>{let e;e="Mot de passe";let i;i="Mot de passe confirm\xE9";let o;o="R\xE9initialiser mon mot de passe";let E;E="R\xE9initialiser mon mot de passe";let R;R="Mot de passe";let f;return f="Confirmer le mot de passe",[E,R,f,[1,"margin-content"],[1,"title-page"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","password"],["formControlName","password","inputId","password","placeholder",e,"autocomplete","new-password",3,"formError"],["for","password-confirm"],["formControlName","password-confirm","inputId","password-confirm","placeholder",i,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(i,o){i&1&&(a(0,"div",3)(1,"h1",4),m(2,0),t(),a(3,"form",5),T("ngSubmit",function(){return o.resetPassword();}),a(4,"div",6)(5,"label",7),m(6,1),t(),d(7,"my-input-text",8),t(),a(8,"div",6)(9,"label",9),m(10,2),t(),d(11,"my-input-text",10),t(),d(12,"input",11),t()()),i&2&&(_(3),S("formGroup",o.form),_(4),S("formError",o.formErrors.password),_(4),S("formError",o.formErrors["password-confirm"]),_(),S("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[D,N,C,M,$,w,v,G],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6CW2LNIG.css.map */`]}));let l=r;return l;})();var re=[{path:"",component:F,data:{meta:{title:"R\xE9initialiser le mot de passe"}}}];export{re as default};/**i18n:93ef1b86561141301263c1f349fa8abb749523958c3a6dfaf46ed36d22b0a506*///# sourceMappingURL=chunk-Q62XW3WI.js.map