import{a as G}from"./chunk-7WRF56BE.js";import{b as L}from"./chunk-ZTV3BAJC.js";import{h as b}from"./chunk-VIQ4DEV6.js";import{b as h}from"./chunk-767JKDCJ.js";import{E as $,F as D,d as A,g as O,h as M,p as N,w,x as v}from"./chunk-OPKDC23H.js";import"./chunk-CR4K7T5L.js";import{Da as _,Db as m,Gd as g,Hb as T,Kd as C,Na as P,Qh as W,Ta as c,Tg as y,ba as i,mb as a,nb as S,ob as s,pb as d,sa as u,vh as I}from"./chunk-ZSQR4KTU.js";import{i as p}from"./chunk-IQVXR75E.js";var F={VALIDATORS:[A.required],MESSAGES:{required:"\u064A\u062C\u0628 \u062A\u0623\u0643\u064A\u062F \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651."}};var X=(()=>{let t=class t extends G{formReactiveService=i(h);userService=i(W);serverService=i(I);notifier=i(y);router=i(C);route=i(g);userId;verificationString;ngOnInit(){let{minLength:e,maxLength:r}=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({password:b(e,r),"password-confirm":F}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("\u062A\u0639\u0630\u0631 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u0645\u0639\u0631\u0641 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645 \u0623\u0648 \u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u062A\u062D\u0642\u0642."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0623\u064F\u0639\u064A\u062F\u064E \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651 \u0628\u0646\u062C\u0627\u062D!"),this.router.navigate(["/login"]);},error:e=>this.notifier.handleError(e)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};p(t,"\u0275fac",(()=>{let e;return function(o){return(e||(e=u(t)))(o||t);};})()),p(t,"\u0275cmp",P({type:t,selectors:[["ng-component"]],features:[c],decls:13,vars:4,consts:()=>{let e;e="\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let r;r="\u0623\u064F\u0643\u0651\u0650\u062F \u0627\u0644\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let o;o="\u0623\u0639\u0650\u062F \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0633\u0631\u064A";let E;E="\u0623\u0639\u0650\u062F \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0633\u0631\u064A";let R;R="\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let f;return f="\u0623\u0643\u062F \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651",[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",r,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(r,o){r&1&&(S(0,"div",3)(1,"h1",4),m(2,0),s(),S(3,"form",5),T("ngSubmit",function(){return o.resetPassword();}),S(4,"div",6)(5,"label",7),m(6,1),s(),d(7,"my-input-text",8),s(),S(8,"div",6)(9,"label",9),m(10,2),s(),d(11,"my-input-text",10),s(),d(12,"input",11),s()()),r&2&&(_(3),a("formGroup",o.form),_(4),a("formError",o.formErrors.password),_(4),a("formError",o.formErrors["password-confirm"]),_(),a("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[$,N,O,M,D,v,w,L],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-ZMNUSJ3U.css.map */`]}));let l=t;return l;})();var te=[{path:"",component:X,data:{meta:{title:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651"}}}];export{te as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-2RK6NJBT.js.map