(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{qdsz:function(e,s,t){"use strict";t.r(s),t.d(s,"ResetPasswordModule",function(){return v});var r=t("ofXK"),a=t("3Pt+"),c=t("PCNd"),o=t("tyNb"),i=t("cxbk"),n=t("fXoL"),d=t("jhN1"),u=t("o0su"),h=t("t34c"),l=t("Iw+v");function m(e,s){1&e&&(n.dc(0,"span",26),n.dc(1,"i",27),n.Rc(2,"error_outline"),n.cc(),n.dc(3,"span"),n.Rc(4,"Enter your new password."),n.cc(),n.cc())}function p(e,s){1&e&&(n.dc(0,"span",26),n.dc(1,"i",27),n.Rc(2,"error_outline"),n.cc(),n.dc(3,"span"),n.Rc(4,"Password does not meet criteria."),n.cc(),n.cc())}const w=function(e){return{"background-image":e}},b=[{path:"",component:(()=>{class e{constructor(e,s,t,r,a){var c,o;this.titleService=e,this.router=s,this.activatedRoute=t,this.commonService=r,this.userService=a,this.submitStatus=!1,this.hasLowerCase=!1,this.hasCapital=!1,this.hasNumber=!1,this.hasMinChar=!1,this.hasMaxChar=!1,this.resetPasswordToken="",this.role_id=i.a.LOGIN_ROLE.CUSTOMER,this.roleName="customer",this.userType="",this.activatedRoute.params.subscribe(e=>{e&&e.id&&(this.resetPasswordToken=e.id),e&&e.type&&(this.userType=e.type)}),(null===(c=this.commonService)||void 0===c?void 0:c.zoneName)?this.titleService.setTitle("Reset password | "+(null===(o=this.commonService)||void 0===o?void 0:o.zoneName)):this.titleService.setTitle("Reset password")}ngOnInit(){this.createUserFormObject()}ngAfterViewInit(){this.loadJs()}createUserFormObject(){this.resetPasswordForm=new a.f({password:new a.c(null,a.z.required),password_reset_token:new a.c(this.resetPasswordToken,a.z.required)})}resetPassword(){const e=this;e.submitStatus=!0,"VALID"==e.resetPasswordForm.status&&this.hasLowerCase&&this.hasCapital&&this.hasNumber&&this.hasMinChar&&this.hasMaxChar&&e.userService.resetPassword({new_password:this.resetPasswordForm.value.password,password_reset_token:this.resetPasswordForm.value.password_reset_token}).subscribe(s=>{200==s.status?(e.submitStatus=!1,e.manageNavigation("/login"),e.commonService.showToaster("success",s.message)):e.commonService.showToaster("error",s.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}manageNavigation(e){this.router.navigate("/login"==e?this.userType==i.a.LOGIN_ROLE.AGENT?[e,"agent"]:this.userType==i.a.LOGIN_ROLE.CONSULTANT1?[e,"consultant1"]:this.userType==i.a.LOGIN_ROLE.CONSULTANT2?[e,"consultant2"]:[e]:[e])}onPasswordChange(){this.hasCapital=!(!this.resetPasswordForm.value.password||!/[A-Z]/.test(this.resetPasswordForm.value.password)),this.hasLowerCase=!(!this.resetPasswordForm.value.password||!/[a-z]/.test(this.resetPasswordForm.value.password)),this.hasNumber=!(!this.resetPasswordForm.value.password||!/[0-9]/.test(this.resetPasswordForm.value.password)),this.hasMinChar=!!(this.resetPasswordForm.value.password&&this.resetPasswordForm.value.password.length>=8),this.hasMaxChar=!!(this.resetPasswordForm.value.password&&this.resetPasswordForm.value.password.length<=16)}loadJs(){this.commonService.loadDefaultInputAnimation();const e=$(window).outerHeight(!0),s=$(".pre-login-footer").outerHeight(!0);$(".pre-login").css("min-height",e-s+"px")}}return e.\u0275fac=function(s){return new(s||e)(n.Xb(d.c),n.Xb(o.d),n.Xb(o.a),n.Xb(u.b),n.Xb(u.l))},e.\u0275cmp=n.Rb({type:e,selectors:[["app-reset-password"]],decls:46,vars:17,consts:[[1,"pre-login",3,"ngStyle"],[1,"container","pre-login-container"],[1,"row"],[1,"col-lg-5","col-md-6","col-sm-7"],[1,"shadow-card-wrapper","thumbnail"],[1,"card-header"],[1,"language-select","clearfix"],["href","","onclick","return false;",1,"pull-right"],[1,"zone-logo","text-center"],["alt","Logo","title","Logo",3,"src"],[1,"form-name","text-center"],[1,"card-main"],[1,"login-form",3,"formGroup","submit"],[1,"input_with_desc"],[1,"form-group"],[1,"material_input_block"],["formControlName","password","type","password","maxlength","16",1,"form-control","material_input",3,"keyup"],["href","#","onclick","return false;","aria-hidden","true","title","show password",1,"fa","fa-eye-slash"],["class","input-required",4,"ngIf"],[1,"input_desc"],["type","submit",1,"btn","btn-primary","full-width","btn-block","text-uppercase"],[1,"button-text"],[1,"card-footer"],[1,"btn","btn-block","create-acc-link","text-center"],["href","#","onclick","return false;",3,"click"],["hasStickyFooter","true"],[1,"input-required"],[1,"material-icons"]],template:function(e,s){1&e&&(n.dc(0,"section",0),n.dc(1,"div",1),n.dc(2,"div",2),n.dc(3,"div",3),n.dc(4,"div",4),n.dc(5,"header",5),n.dc(6,"div",6),n.dc(7,"a",7),n.Rc(8,"\u0639\u0631\u0628\u0649"),n.cc(),n.cc(),n.dc(9,"div",8),n.Yb(10,"img",9),n.cc(),n.dc(11,"h1",10),n.Rc(12,"New password"),n.cc(),n.cc(),n.dc(13,"main",11),n.dc(14,"form",12),n.kc("submit",function(){return s.resetPassword()}),n.dc(15,"div",13),n.dc(16,"div",14),n.dc(17,"div",15),n.dc(18,"input",16),n.kc("keyup",function(){return s.onPasswordChange()}),n.cc(),n.dc(19,"label"),n.Rc(20,"Password"),n.cc(),n.Yb(21,"a",17),n.cc(),n.Pc(22,m,5,0,"span",18),n.Pc(23,p,5,0,"span",18),n.cc(),n.dc(24,"ul",19),n.dc(25,"label"),n.Rc(26,"Password must contain"),n.cc(),n.dc(27,"li"),n.Rc(28,"A lowercase letter"),n.cc(),n.dc(29,"li"),n.Rc(30,"A capital (uppercase letter)"),n.cc(),n.dc(31,"li"),n.Rc(32,"A number"),n.cc(),n.dc(33,"li"),n.Rc(34,"Minimum 8 characters"),n.cc(),n.dc(35,"li"),n.Rc(36,"Maximum 16 characters"),n.cc(),n.cc(),n.cc(),n.dc(37,"button",20),n.dc(38,"span",21),n.Rc(39,"Submit"),n.cc(),n.cc(),n.cc(),n.cc(),n.dc(40,"footer",22),n.dc(41,"div",23),n.Rc(42," Already have account? "),n.dc(43,"a",24),n.kc("click",function(){return s.manageNavigation("/login")}),n.Rc(44,"Log in"),n.cc(),n.cc(),n.cc(),n.cc(),n.cc(),n.cc(),n.cc(),n.cc(),n.Yb(45,"app-footer",25)),2&e&&(n.uc("ngStyle",n.zc(15,w,"url("+s.commonService.selectedThemeImages+"/bg-beam.svg), url("+s.commonService.selectedThemeImages+"/login-bg-image.jpg)")),n.Lb(10),n.uc("src",s.commonService.selectedThemeImages+"/zone-logo.svg",n.Jc),n.Lb(4),n.uc("formGroup",s.resetPasswordForm),n.Lb(8),n.uc("ngIf","INVALID"===s.resetPasswordForm.controls.password.status&&s.submitStatus),n.Lb(1),n.uc("ngIf","VALID"===s.resetPasswordForm.controls.password.status&&s.submitStatus&&(!s.hasLowerCase||!s.hasCapital||!s.hasNumber||!s.hasMinChar||!s.hasMaxChar)),n.Lb(4),n.Nb(s.hasLowerCase?"active":""),n.Lb(2),n.Nb(s.hasCapital?"active":""),n.Lb(2),n.Nb(s.hasNumber?"active":""),n.Lb(2),n.Nb(s.hasMinChar?"active":""),n.Lb(2),n.Nb(s.hasMaxChar?"active":""))},directives:[r.o,a.A,a.o,a.g,a.b,a.n,a.e,h.a,a.i,r.n,l.a],styles:[""]}),e})()}];let g=(()=>{class e{}return e.\u0275fac=function(s){return new(s||e)},e.\u0275mod=n.Vb({type:e}),e.\u0275inj=n.Ub({imports:[[o.f.forChild(b)],o.f]}),e})(),v=(()=>{class e{}return e.\u0275fac=function(s){return new(s||e)},e.\u0275mod=n.Vb({type:e}),e.\u0275inj=n.Ub({imports:[[a.h,a.w,r.c,c.a,g]]}),e})()}}]);