1import{a as X,b as Z,c as $}from"./chunk-ONGCZBRZ.js";import"./chunk-ACZAVH2J.js";import"./chunk-QQIMN2JX.js";import"./chunk-A7RBIIUZ.js";import"./chunk-KWOQ4HMT.js";import"./chunk-XPT67DC2.js";import"./chunk-RDBFOA3X.js";import{a as te,b as ie}from"./chunk-DKOULGK6.js";import{a as ee}from"./chunk-OKFUWLWE.js";import{a as z,b as J}from"./chunk-2MDSVX3G.js";import{b as G,c as q}from"./chunk-46R3OALK.js";import"./chunk-G2RPGXWK.js";import"./chunk-BSMR5HIN.js";import{i as j,j as Y}from"./chunk-7D5TBQRE.js";import"./chunk-MUYF7UN3.js";import"./chunk-O2UZBAYN.js";import{m as K}from"./chunk-4HGNWMUF.js";import"./chunk-M45BUSZV.js";import{c as S,f as U,k as H,n as W,s as k,u as V}from"./chunk-OQWTGWQI.js";import"./chunk-JRIYDRTX.js";import{a as Q}from"./chunk-FCLK5JCQ.js";import"./chunk-AQGP2UH6.js";import{b as F,c as y}from"./chunk-5VDETJGG.js";import{Cb as M,Eb as p,Fb as m,Gb as h,Ja as T,Lc as b,Nb as I,Ob as x,Pb as v,Tb as L,Xa as E,Ya as w,aa as c,ac as o,bb as f,bc as n,cb as i,db as s,dd as N,eb as l,fa as C,ga as P,hd as O,id as B,kc as D,lb as R,na as _,nb as A,pb as u,za as t}from"./chunk-Q47N5KYY.js";import"./chunk-DE4CES4T.js";var ae=()=>({width:"3.125rem",height:"3.125rem"});function oe(r,g){r&1&&(i(0,"div",1),l(1,"app-logo",2),i(2,"p"),p(3),o(4,"translate"),s()(),i(5,"div",3),l(6,"p-progressSpinner",4),i(7,"p",5),p(8),o(9,"translate"),s()()),r&2&&(t(3),m(n(4,4,"AUTH.RESETTING_PASSWORD")),t(3),M(L(8,ae)),t(2),m(n(9,6,"AUTH.RESETTING_PASSWORD_WAIT")))}function ne(r,g){if(r&1&&(i(0,"div",1),l(1,"app-logo",2),i(2,"p"),p(3),o(4,"translate"),s()(),i(5,"p-message",6),p(6),s(),i(7,"div",7)(8,"div",8)(9,"a",9),l(10,"app-arrow-icon",10),p(11),o(12,"translate"),s()()()),r&2){let e=u();t(3),m(n(4,3,"AUTH.PASSWORD_RESET_SUCCESS")),t(3),m(e.successMessage()||""),t(5),h(" ",n(12,5,"AUTH.BACK_TO_SIGN_IN")," ")}}function se(r,g){if(r&1&&(i(0,"div",1),l(1,"app-logo",2),i(2,"p"),p(3),o(4,"translate"),s()(),i(5,"p-message",11),p(6),s(),i(7,"div",8)(8,"a",9),l(9,"app-arrow-icon",10),p(10),o(11,"translate"),s()()),r&2){let e=u();t(3),m(n(4,3,"AUTH.PASSWORD_RESET_FAILED")),t(3),m(e.errorMessage()||""),t(4),h(" ",n(11,5,"AUTH.BACK_TO_SIGN_IN")," ")}}function pe(r,g){if(r&1&&(i(0,"p-message",11),p(1),s()),r&2){u(2);let e=v(0);t(),h(" ",e.resetPasswordError," ")}}function le(r,g){if(r&1){let e=R();i(0,"div",1),l(1,"app-logo",2),i(2,"p"),p(3),o(4,"translate"),s(),i(5,"span",12),p(6),o(7,"translate"),s()(),E(8,pe,2,1,"p-message",11),i(9,"form",13),A("ngSubmit",function(){C(e);let d=u();return P(d.onSubmit())}),l(10,"app-password-fields",14),o(11,"translate"),o(12,"translate"),o(13,"translate"),o(14,"translate"),l(15,"p-button",15),o(16,"translate"),i(17,"div",8)(18,"a",9),l(19,"app-arrow-icon",10),p(20),o(21,"translate"),s()()()}if(r&2){let e=u(),a=v(0),d=v(1);t(3),m(n(4,14,"AUTH.RESET_YOUR_PASSWORD")),t(3),m(n(7,16,"AUTH.RESET_PASSWORD_SUBTITLE")),t(2),w(a.resetPasswordError?8:-1),t(),f("formGroup",e.resetForm),t(),f("form",e.resetForm)("passwordLabel",n(11,18,"AUTH.NEW_PASSWORD"))("confirmPasswordLabel",n(12,20,"AUTH.CONFIRM_NEW_PASSWORD"))("passwordPlaceholder",n(13,22,"AUTH.NEW_PASSWORD_PLACEHOLDER"))("confirmPasswordPlaceholder",n(14,24,"AUTH.CONFIRM_NEW_PASSWORD_PLACEHOLDER"))("showStrengthMeter",!0),t(5),f("label",n(16,26,"AUTH.RESET_PASSWORD"))("disabled",e.resetForm.invali
1d||d)("loading",d),t(5),h(" ",n(21,28,"AUTH.BACK_TO_SIGN_IN")," ")}}var Le=(()=>{class r{resetForm;isLoading=_(!1);errorMessage=_(null);successMessage=_(null);authStore=c(K);token;router=c(O);route=c(N);fb=c(k);recaptchaV3Service=c(G);translateService=c(F);constructor(){this.initForm(),D(()=>{let e=this.authStore.passwordResetData(),a=this.authStore.isLoading();this.isLoading.set(a),e.resetPasswordError&&this.handleError(e.resetPasswordError),e.message&&e.type==="success"&&this.handleSuccess(e.message)})}ngOnInit(){let e=this.route.snapshot.queryParamMap.get("token"),a=this.route.snapshot.queryParamMap.get("email");if(!e||!a){this.handleError(this.translateService.instant("AUTH.INVALID_RESET_LINK"));return}this.token=e,this.resetForm.patchValue({email:a})}onSubmit(){if(this.resetForm.invalid){this.resetForm.markAllAsTouched();return}if(!this.token){this.handleError(this.translateService.instant("AUTH.INVALID_RESET_TOKEN"));return}this.recaptchaV3Service.execute("reset_password").subscribe(e=>{let a=this.resetForm.value;this.authStore.resetPasswordWithToken({email:a.email,token:this.token,password:a.password,password_confirmation:a.confirmPassword,"g-recaptcha-response":e})})}initForm(){this.resetForm=this.fb.group({email:["",[S.required,S.email]],password:["",[S.required,S.minLength(8),Z()]],confirmPassword:["",[S.required]]},{validators:X})}handleError(e){this.errorMessage.set(e),this.successMessage.set(null)}handleSuccess(e){this.successMessage.set(e),this.errorMessage.set(null)}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=T({type:r,selectors:[["app-reset-password"]],decls:7,vars:3,consts:[[1,"auth-page"],[1,"auth-page-header"],[1,"auth-logo"],[1,"auth-loading-state"],["strokeWidth","4"],[1,"auth-loading-text"],["severity","success"],[1,"auth-page-form"],[1,"auth-page-footer"],["routerLink","/auth/login",1,"auth-footer-link"],["direction","left",1,"w-4","h-4"],["severity","error"],[1,"auth-header-subtitle"],[1,"auth-page-form",3,"ngSubmit","formGroup"],[3,"form","passwordLabel","confirmPasswordLabel","passwordPlaceholder","confirmPasswordPlaceholder","showStrengthMeter"],["type","submit","styleClass","auth-submit-btn",3,"label","disabled","loading"]],template:function(a,d){if(a&1&&(I(0)(1),i(2,"div",0),E(3,oe,10,9)(4,ne,13,7)(5,se,12,7)(6,le,22,30),s()),a&2){x(d.authStore.passwordResetData()),t();let re=x(d.authStore.isLoading());t(2),w(re&&!d.resetForm?3:d.successMessage()?4:d.errorMessage()?5:6)}},dependencies:[b,V,H,U,W,ie,te,J,z,Y,j,$,q,Q,B,ee,y],styles:["[_nghost-%COMP%]{display:block}.auth-loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 0}.auth-loading-text[_ngcontent-%COMP%]{margin-top:1rem;color:var(--text-color-secondary);text-align:center}"]})}return r})();export{Le as ResetPasswordComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.