import{a as J}from"./chunk-BXXEY6EK.js";import{e as k,f as M}from"./chunk-XZELSHJP.js";import{c as q,h as D,i as L,k as A,m as U,n as z,t as G,w as O,y as Z}from"./chunk-AUG6ZMIQ.js";import{c as H}from"./chunk-JQJV7TYV.js";import{c as $}from"./chunk-YM543BQE.js";import{m as V,o as j,p as N}from"./chunk-STBSUBIU.js";import{Ac as R,Ba as C,Ca as w,Cb as v,Fd as T,Hb as h,Jb as F,Jc as l,Kc as d,Ob as f,Tb as o,Ub as a,Vb as _,Zb as y,_ as b,ac as E,cc as I,kb as t,lb as u,oc as g,qa as S,qc as p,rc as c,sc as B,xb as P}from"./chunk-NW2U37DI.js";import"./chunk-TWZW5B45.js";function Q(e,x){e&1&&(o(0,"small",21),p(1),l(2,"translate"),a()),e&2&&(t(),c(d(2,1,"Email address is required")))}function W(e,x){e&1&&(o(0,"small",21),p(1),l(2,"translate"),a()),e&2&&(t(),c(d(2,1,"Please check Email Format")))}function X(e,x){if(e&1&&(o(0,"div"),v(1,Q,3,3,"small",21)(2,W,3,3,"small",21),a()),e&2){I();let i=g(20);t(),f(i.errors!=null&&i.errors.required?1:-1),t(),f(i.errors!=null&&i.errors.pattern?2:-1)}}function Y(e,x){e&1&&_(0,"i",17)}var ue=(()=>{class e extends N{constructor(i,r,m,n,s){super(s),this.customerService=i,this.toastr=r,this.translate=m,this.router=n,this.sendingResponse={}}ngOnInit(){}forgotPassword(i,r){if(i.valid){this.sendingResponse[r]=!0;let m={email:i.value.email};this.customerService.forgotPassword(m).pipe(b(this.unSubscribe$)).subscribe({next:n=>{this.sendingResponse[r]=!1,n?.success&&(this.toastr.success(this.translate.transform(n.success)),n?.redirect&&this.router.navigate(["/"]),this.router.navigate(["/customer/login"])),n?.error&&this.toastr.error(this.translate.transform(n.error))},error:()=>{this.sendingResponse[r]=!1}})}}static{this.\u0275fac=function(r){return new(r||e)(u(J),u(V),u($),u(k),u(j))}}static{this.\u0275cmp=S({type:e,selectors:[["app-forgot-password"]],standalone:!0,features:[P,R],decls:33,vars:25,consts:[["forgotPsw","ngForm"],["emailField","ngModel"],[1,"page","login-bg1"],[1,"page-single"],[1,"container"],[1,"row","justify-content-center","py-4"],[1,"col-sm-12"],[1,"card","authentication-card","px-3","py-5","mx-auto"],[1,"pb-0","px-5","pt-0","text-center"],[1,"mb-2"],[1,"text-muted","fs-13","mb-1"],["id","forgot",1,"card-body","pt-3","pb-0",3,"ngSubmit"],[1,"form-group"],[1,"form-label"],["required","","name","email","type","email","ngModel","","pattern","[^@\\s]+@[^@\\s]+\\.[a-zA-Z]{2,}",1,"form-control",3,"placeholder"],[1,"submit"],["type","submit",1,"btn","btn-secondary","btn-block",3,"disabled"],[1,"fa","fa-spinner","fa-spin","mx-1"],[1,"text-center","mt-4"],[1,"text-dark","mb-0"],["routerLink","/",1,"text-primary","ms-1"],[1,"text-danger"]],template:function(r,m){if(r&1){let n=y();o(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8)(7,"h3",9),p(8),l(9,"translate"),a(),o(10,"p",10),p(11),l(12,"translate"),a()(),o(13,"form",11,0),E("ngSubmit",function(){C(n);let K=g(14);return w(m.forgotPassword(K,"forgot"))}),o(15,"div",12)(16,"label",13),p(17),l(18,"translate"),a(),_(19,"input",14,1),l(21,"translate"),v(22,X,3,2,"div"),a(),o(23,"div",15)(24,"button",16),p(25),l(26,"translate"),v(27,Y,1,0,"i",17),a()(),o(28,"div",18)(29,"p",19)(30,"a",20),p(31),l(32,"translate"),a()()()()()()()()()()}if(r&2){let n=g(14),s=g(20);t(8),c(d(9,13,"Forgot Password?")),t(3),c(d(12,15,"Enter the email address that is linked to your account.")),t(6),c(d(18,17,"Email")),t(2),F("is-invalid",s.invalid&&s.touched)("is-valid",s.valid),h("placeholder",d(21,19,"Email")),t(3),f(s.invalid&&s.touched||s.dirty?22:-1),t(2),h("disabled",n.invalid||m.sendingResponse.forgot),t(),B(" ",d(26,21,"Submit")," "),t(2),f(m.sendingResponse.forgot?27:-1),t(4),c(d(32,23,"Send me Back"))}},dependencies:[T,H,M,Z,z,q,D,L,G,O,U,A]})}}return e})();export{ue as ForgotPasswordComponent};
