import{b as G}from"./chunk-EN3GHNYR.js";import{h as L}from"./chunk-O4NWZCXV.js";import{b as $,c as y}from"./chunk-BNV6WX3E.js";import{A as D,B as I,d as O,g as C,h as M,m as N,p as v,s as w}from"./chunk-7VHQBARM.js";import"./chunk-ZJ7WKAH3.js";import{Da as S,Ea as n,Eg as W,La as c,Lb as T,Wa as d,Wf as h,ad as g,ba as f,db as m,dd as A,eb as t,fb as E,nb as p,rb as P}from"./chunk-QXV2GR6R.js";import{i as r}from"./chunk-JJ4RDTEF.js";var b={VALIDATORS:[O.required],MESSAGES:{required:"\u0E15\u0E49\u0E2D\u0E07\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19"}};var F=(()=>{let s=class s extends y{constructor(e,i,o,_,l){super();r(this,"formReactiveService");r(this,"userService");r(this,"notifier");r(this,"router");r(this,"route");r(this,"userId");r(this,"verificationString");this.formReactiveService=e,this.userService=i,this.notifier=o,this.router=_,this.route=l;}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("\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E44\u0E2D\u0E14\u0E35\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E23\u0E2B\u0E31\u0E2A\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19"),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19\u0E40\u0E23\u0E35\u0E22\u0E1A\u0E23\u0E49\u0E2D\u0E22"),this.router.navigate(["/login"]);},error:e=>this.notifier.error(e.message)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};r(s,"\u0275fac",function(i){return new(i||s)(n($),n(W),n(h),n(A),n(g));}),r(s,"\u0275cmp",f({type:s,selectors:[["ng-component"]],standalone:!0,features:[c,T],decls:13,vars:4,consts:()=>{let e;e="\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let i;i="\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19\u0E41\u0E25\u0E49\u0E27";let o;o="\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let _;_="\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let l;l="\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let u;return u="\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",[_,l,u,[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&&(m(0,"div",3)(1,"h1",4),p(2,0),t(),m(3,"form",5),P("ngSubmit",function(){return o.resetPassword();}),m(4,"div",6)(5,"label",7),p(6,1),t(),E(7,"my-input-text",8),t(),m(8,"div",6)(9,"label",9),p(10,2),t(),E(11,"my-input-text",10),t(),E(12,"input",11),t()()),i&2&&(S(3),d("formGroup",o.form),S(4),d("formError",o.formErrors.password),S(4),d("formError",o.formErrors["password-confirm"]),S(),d("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[D,N,C,M,I,v,w,G],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6CW2LNIG.css.map */`]}));let R=s;return R;})();var oe=[{path:"",component:F,data:{meta:{title:"Reset password"}}}];export{oe as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-HPYCZBEY.js.map