1import{b as F}from"./chunk-CV4OKJDT.js";import{M as _,Pa as R,R as V,Xa as k,ea as G,q as L,sa as M}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import{J as j,e as u,h as I,i as A,p as E,s as N,t as P,w as x}from"./chunk-76O7YCWW.js";import{c as f,e as T}from"./chunk-YYIIKC2W.js";import{d as C,e as S}from"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import"./chunk-PO2RDVKE.js";import{Ic as y,Pb as g,Rb as b,Wb as l,Xb as i,Yb as o,Zb as r,_a as h,db as s,lc as w,pb as a,ub as v,zc as p}from"./chunk-3URBZWPM.js";import"./chunk-ODN5LVDJ.js";function W(m,d){if(m&1&&(i(0,"div"),r(1,"fab-notification",12),o()),m&2){let q=w();s(),l("isNotificationOpen",!0)("notification",q.notification)}}var te=(()=>{let d=class d{constructor(n,t,e,B,D,O,U,z,H){this.authService=n,this.fb=t,this.activatedRoute=e,this.router=B,this.route=D,this.layoutSetupService=O,this.titleService=U,this.meta=z,this.s3GetterService=H,this.newTitle="MyAAT: create a password | AAT",this.enabled=!1,this.isUserAuth=!1,this.submitButton={text:"Reset password",action:{type:"callback",callback:this.submit.bind(this)},type:"primary",aria:"Reset password"},this.oldPasswordInterface={id:"oldPassword",label:"<strong>Password</strong>",required:!0,codeType:"Password"},this.passwordInterface={id:"password",label:"<strong>Password</strong>",required:!0,codeType:"PasswordChoice"},this.passwordConfrimationInterface={id:"passwordConfirmation",label:"<strong>Confirm password</strong>",required:!0,codeType:"Password"},this.notification={type:"warning",message:"",glyph:"warning"},this.layoutSetupService.setLayoutConfig({showHeader:!1,showFooter:!1,showLeftNav:!1}),this.meta.updateTag({name:"description",content:"We can help you reset your password using the email address linked to your MyAAT account."}),this.setTitle(this.newTitle),this.activatedRoute.params.subscribe(c=>{this.username=c.username}),this.form=this.fb.group({password:[""],passwordConfirmation:["",u.required],username:[this.username,u.required],old_password:[""]}),this.form.valueChanges.subscribe(c=>{this.checkConfirmationValidator(this.form.controls.password,this.form.controls.passwordConfirmation,"Passwords"),this.enabled=!this.form.invalid,this.submitButton.disabled=!this.form.valid}),this.sub=n.authenticationChanged$.subscribe(c=>{this.isUserAuth=c,c&&this.completeLogin()})}ngOnInit(){this.homeLogo=this.s3GetterService.getUrl({objName:_.aatLogo})}setTitle(n){this.titleService.setTitle(n)}submit(){this.authService.changePassword(this.form.value.password,this.form.value.username,this.form.value.old_password).subscribe(()=>{},n=>{this.enabled=!0,this.notification.isOpened=!0,this.notification.type="warning",this.notification.glyph="warning",this.notification.message=n.error.message})}checkConfirmationValidator(n,t,e){n.value!=t.value?t.errors||t.setErrors({formControlValidationErrors:{value:e+" don't match"}}):(t.setErrors(null),t.updateValueAndValidity({onlySelf:!0}))}completeLogin(){this.sub&&this.sub.unsubscribe(),this.router.navigate(["./../../../dashboards"],{relativeTo:this.route})}};d.\u0275fac=function(t){return new(t||d)(a(L),a(j),a(f),a(T),a(f),a(G),a(S),a(C),a(V))},d.\u0275cmp=v({type:d,selectors:[["change-pass-page"]],decls:26,vars:12,consts:[[1,"container","container-fixed","col-md-5","col-sm-10","col-xs-10"],[1,"logo"],["href",""],["alt","AAT logo",3,"src"],[1,"col-md-8","col-sm-10","col-xs-10"],["novalidate","",3,"formGroup"],[1,"form__fieldgroup"],["formControlName","old_password",3,"content","formControl"],["formControlName","password",3,"content","formControl"],["formControlName","passwordConfirmation",3,"content","formControl"],[1,"button_right","col-md-8","col-sm-10","col-xs-10"],[3,"enabled","button"],[3,"isNotificationOpen","notification"]],template:function(t,e){t&1&&(i(0,"div",0),r(1,"br")(2,"br"),i(3,"div",1)(4,"a",2),r(5,"img",3),o()(),r(6,"br"),i(7,"h3"),p(8,"MyAAT: Create a password"),o(),r(9,"br"),i(10,"div",4),g(11,W,2,2,"div"),o(),i(12,"form",5)(13,"p"),p(14,"Type the temporary password we sent you in the email"),o(),i(15,"div",6),r(16,"fab-input-text-2",7),o(),i(17,"p"),p(18,"Choose a new password"),o(),i(19,"div",6),r(20,"fab-input-text-2",8),o(),i(21,"div",6),r(22,"fab-input-text-2",9),o(),r(23,"br"),i(24,"div",10),r(25,"fab-button",11),o()()()),t&2&&(s(5),l("src",y(e.homeLogo),h),s(6),b(e.notification.message&&e.notification.message!==""?11:-1),s(),l("formGroup",e.form),s(4),l("content",e.oldPasswordInterface)("formControl",e.form.controls.old_password),s(4),l("content",e.passwordInterface)("formControl",e.form.controls.password),s(2),l("content",e.passwordConfrimationInterface)("formControl",e.form.controls.passwordConfirmation),s(3),l("enabled",e.enabled)("button",e.submitButton))},dependencies:[F,k,E,I,A,N,P,x,R,M],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.container{margin:0 auto;font-size:14px}.container hr{background-color:#dce6f0;color:#dce6f0;border:none;height:1px}form .form-control{width:100%}.logo{width:95px;margin-bottom:15px;margin-left:-10px} 2`],encapsulation:2});let m=d;return m})();export{te as ChangePassPageComponent};
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.