PageSourceSearch

https://www.aat.org.uk/csr/chunk-I63Z5R4N.js

js aat.org.uk collected 2026-10-03 21:39:12 UTC 16,617 bytes, 2 lines download raw bytes

1import{a as b}from"./chunk-JEL6HJ7P.js";import{a as de,b as me}from"./chunk-CV4OKJDT.js";import{$ as oe,M as ee,Pa as re,R as ie,U as te,Xa as ce,aa as ne,e as y,ea as ae,gb as le,q as Z,sa as se}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import{J as X,e as B,h as q,i as Y,n as $,p as z,s as K,t as J,w as Q}from"./chunk-76O7YCWW.js";import{c as E,e as j,f as G,k as W}from"./chunk-YYIIKC2W.js";import{d as H,e as V}from"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import"./chunk-PO2RDVKE.js";import{Ic as F,J as _,Nc as A,Pb as m,Rb as f,Tb as I,Ub as O,Vb as D,Wb as l,Xb as c,Yb as s,Za as R,Zb as d,_a as U,db as n,ec as L,ha as P,jc as T,lc as u,oa as S,pa as w,pb as h,ua as N,ub as M,zc as v}from"./chunk-3URBZWPM.js";import"./chunk-ODN5LVDJ.js";var ue=()=>["/myaat/login/password"];function _e(t,r){if(t&1&&(c(0,"div")(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),d(5,"fab-loader"),s()()()()()),t&2){let e=u();n(),l("fab-gtm",e.gtmId)}}function Se(t,r){t&1&&(c(0,"h3",8),v(1,"Log in"),s())}function we(t,r){if(t&1&&(c(0,"div",9),d(1,"fab-notification",12),s()),t&2){let e=r.$implicit;n(),l("isNotificationOpen",!0)("notification",e)}}function xe(t,r){if(t&1&&(c(0,"div",9),d(1,"fab-notification",12),s()),t&2){let e=u(2);n(),l("isNotificationOpen",!0)("notification",e.sharedMachineWarning)}}function Le(t,r){if(t&1&&(c(0,"div",9),d(1,"fab-notification",12),s()),t&2){let e=u(2);n(),l("isNotificationOpen",!0)("notification",e.logoutNotification)}}function Te(t,r){t&1&&(c(0,"h3",8),v(1,"Verify your email"),s())}function Ae(t,r){if(t&1&&(c(0,"div",10),d(1,"fab-notification",12),s()),t&2){let e=u(2);n(),l("isNotificationOpen",e.showNotification)("notification",e.notification)}}function Ee(t,r){if(t&1){let e=L();c(0,"form",13),T("keydown",function(o){S(e);let a=u(2);return w(a.keyDownFunction(o))}),d(1,"br")(2,"fab-input-text-2",14)(3,"br")(4,"fab-input-text-2",15)(5,"br"),c(6,"div",16),d(7,"fab-button",17),s(),d(8,"br"),s()}if(t&2){let e=u(2);l("formGroup",e.form),n(2),l("content",e.usernameField)("formControl",e.form.controls.username),n(2),l("content",e.passwordField)("formControl",e.form.controls.password),n(3),l("button",e.loginButton)("enabled",e.enabled)}}function ke(t,r){if(t&1){let e=L();c(0,"div")(1,"app-mfa",18),T("mfaSubmit",function(o){S(e);let a=u(2);return w(a.mfaSubmit(o))})("disabledNotifications",function(o){S(e);let a=u(2);return w(a.disabledNotifications(o))}),s(),d(2,"br")(3,"br"),s()}if(t&2){let e=u(2);n(),l("secretCode",e.mfaSetCode)("stage",e.stage)}}function Pe(t,r){if(t&1&&(c(0,"div")(1,"div",10),d(2,"div",19),s(),d(3,"br"),c(4,"div",20),d(5,"fab-button",17),s(),d(6,"br"),s()),t&2){let e=u(2);n(2),l("innerHTML",e.message,R),n(3),l("button",e.resendVerificationButton)("enabled",e.enabled)}}function Ne(t,r){t&1&&(c(0,"p")(1,"a",21),v(2,"Reset your password."),s()(),c(3,"p")(4,"a",22),v(5,"Contact us if you've forgotten your details."),s()()),t&2&&(n(),l("routerLink",A(1,ue)))}function Re(t,r){if(t&1&&(c(0,"div"),m(1,Ne,6,2),s()),t&2){let e=u(2);n(),f(e.stage<3?1:-1)}}function Ue(t,r){t&1&&(c(0,"p")(1,"a",21),v(2,"Reset your password."),s()(),c(3,"p")(4,"a",22),v(5,"Contact us if you've forgotten your details."),s()()),t&2&&(n(),l("routerLink",A(1,ue)))}function Me(t,r){if(t&1&&m(0,Ue,6,2),t&2){let e=u(2);f(e.stage<3?0:-1)}}function Ie(t,r){t&1&&(c(0,"p")(1,"a",23),v(2,"Register with AAT."),s()())}function Oe(t,r){if(t&1&&(c(0,"div",0),d(1,"br")(2,"br"),c(3,"div",5)(4,"a",6),d(5,"img",7),s()(),m(6,Se,2,0,"h3",8),O(7,we,2,2,"div",9,I),m(9,xe,2,2,"div",9),m(10,Le,2,2,"div",9),m(11,Te,2,0,"h3",8),m(12,Ae,2,2,"div",10),m(13,Ee,9,7,"form",11),m(14,ke,4,2,"div"),m(15,Pe,7,3,"div"),c(16,"div",10),d(17,"hr"),s(),m(18,Re,2,1,"div")(19,Me,1,1),m(20,Ie,3,0,"p"),s()),t&2){let e=u();l("fab-gtm",e.gtmId),n(5),l("src",F(e.homeLogo),U),n(),f(e.stage==1?6:-1),n(),D(e.additionalNotifications),n(2),f(e.notification.message===""&&!e.loggedOut&&e.stage<2?9:-1),n(),f(e.notification.message===""&&e.loggedOut?10:-1),n(),f(e.stage==2?11:-1),n(),f(e.notification.message&&e.notification.message!==""?12:-1),n(),f(e.form&&e.stage==1?13:-1),n(),f(e.stage==3||e.stage==4?14:-1),n(),f(e.stage==2?15:-1),n(3),f(e.form.controls.verificationcode?19:18),n(2),f(e.stage==1?20:-1)}}var De=1,Fe=2,He=3,fe=4,ti=(()=>
1{let r=class r{constructor(i,o,a,g,x,he,ge,pe,ve,Ce,ye,be){this.authService=i,this.fb=o,this.activatedRoute=a,this.router=g,this.route=x,this.layoutSetupService=he,this.titleService=ge,this.meta=pe,this.gtmService=ve,this.cmsContentService=Ce,this.contactService=ye,this.s3GetterService=be,this.destroyRef=P(N),this.stage=De,this.newTitle="MyAAT login | AAT",this.homeLogo=this.s3GetterService.getUrl({objName:ee.aatLogo}),this.internalRedirection=!1,this.isUserAuth=!1,this.showNotification=!1,this.isLoading=!1,this.enabled=!1,this.usernameField={id:"username",label:"<strong>Email</strong>",required:!0,codeType:"Email"},this.passwordField={id:"password",label:"<strong>Password</strong>",required:!0,codeType:"NoValidation",validationMessage:"Enter your password"},this.loginButton={text:"Log in to MyAAT",action:{type:"callback",callback:this.submit.bind(this)},type:"primary",aria:"Log in to MyAAT"},this.resendVerificationButton={text:"Resend verification email",action:{type:"callback",callback:this.resendVerificationEmail.bind(this)},type:"primary",aria:"Resend verification email"},this.logoutNotification={type:"success",message:"You are now logged out",glyph:"success"},this.sharedMachineWarning={type:"ghost",message:"Using a shared computer? Remember to log off and close your browser window when you've finished.",glyph:"warning"},this.notification={type:"warning",message:"",glyph:"warning"},this.additionalNotifications=[],this.mfaSubmit=p=>{this.isLoading=!0,this.mfaSetCode?this.authService.verifySoftwareToken(p).subscribe(C=>{this.authService.refresh().subscribe(k=>{this.completeLogin()},k=>{console.log(k)})},C=>{this.stage=fe,console.log(C)}):this.authService.respondToAuthChallenge(p,this.authService.authChallenge).subscribe(C=>{this.completeLogin()},C=>{console.log(C)})},this.layoutSetupService.setLayoutConfig({showHeader:!1,showFooter:!1,showLeftNav:!1}),this.gtmId=this.layoutSetupService.layoutProperties.GTM_ID,this.meta.updateTag({name:"description",content:"Enter your email and password to log in to your MyAAT account."}),this.setTitle(this.newTitle),this.checkAccess(),this.form=this.fb.group({username:[this.authService.userEmail||"",B.required],password:""}),this.form.valueChanges.pipe(y(this.destroyRef)).subscribe(p=>{this.enabled=this.form.valid,this.loginButton.disabled=!this.form.valid}),i.authenticationChanged$.pipe(y(this.destroyRef)).subscribe(p=>{this.isUserAuth=p}),this.activatedRoute.queryParams.pipe(y(this.destroyRef)).subscribe(p=>{this.getUrlParams(p)}),i.authenticationErrored$.pipe(y(this.destroyRef)).subscribe(p=>{this.loginErrorHandler(p),this.isLoading=!1})}checkAccess(){this.isLoading=!0,this.authService.authenticationChanged$.pipe(_(1)).subscribe(i=>{this.router.url==="/myaat/logout"?(this.loggedOut=!0,i&&this.authService.logout().subscribe(),this.isLoading=!1):this.router.url.split(/[/?]+/)[3]==="mfa"?i?this.authService.requiresMfaSetup()?this.authService.associateSoftwareToken().subscribe(o=>{this.isLoading=!1,this.stage=He,this.mfaSetCode=o.SecretCode},o=>{}):this.completeLogin():this.authService.authChallenge?(this.stage=fe,this.isLoading=!1):this.router.navigate(["myaat/login"]):i?this.authService.requiresMfaSetup()?this.redirectUrl?this.router.navigate(["myaat/login/mfa"],{queryParams:{destination:this.paramDestination}}):this.router.navigate(["myaat/login/mfa"]):this.completeLogin():this.isLoading=!1})}ngOnInit(){this.redirectUrl&&this.meta.addTag({name:"robots",content:"noindex, nofollow"}),this.cmsContentService.getNotifications("login",{fullWidth:!1,leftAlign:!1}).subscribe(i=>{this.additionalNotifications=i},i=>{i.status!==404&&console.error(i)}),this.authService.isPasswordReset&&this.notificationHandler("You have successfully changed your password. Log in to your MyAAT account.","success","success",!1)}isAuthChallenge(i){return Object.prototype.hasOwnProperty.call(i,"Session")&&Object.prototype.hasOwnProperty.call(i,"ChallengeParameters")&&Object.prototype.hasOwnProperty.call(i,"ChallengeName")}submit(){let i=this.form.value;this.enabled=!1,this.showNotification=!1,this.isLoading=!0,this.authService.login(i.username,i.password,i.verificationcode).subscribe(o=>{this.isAuthChallenge(o)?(this.authService.authChallenge=o,this.redirectUrl?this.router.navigate(["myaat/login/mfa"],{queryParams:{destination:this.paramDestination}}):this.router.navigate(["myaat/login/mfa"])):o["cognito:groups"]?.some(a=>b.MFA_GROUPS.includes(a))&&!this.contactService.contactPreferredMFASetting()?this.redirectUrl?this.router.navigate(["myaat/login/mfa"],{queryParams:{destination:this.paramDestination}}):this.router.navigate(["myaat/login/mfa"]):this.completeLogin()}),this.gtmService.push({event:"userLogin"}),this.authService.isPasswordReset&&this.notificationHandler("You have successfully changed your password. Log in to your MyAAT account.","success","success",!1)}completeLogin(){this.authService.getCurrentUser().pipe(_(1)).subscribe({next:i=>{let o=i,a=o["custom:membership_type"]?JSON.parse(o["custom:membership_type"]):[];this.gtmService.push({event:"customFormSubmit",formName:"login",userRoles:o["cognito:groups"],membershipNumber:o["custom:member_id"],membershipType:a,isLapsed:o["custom:is_lapsed"]}),this.redirectAfterLogin()}})}resendVerificationEmail(){this.enabled=!1,this.showNotification=!1,this.authService.verifyCodeSendEmail(this.form.value.username,this.form.value.password).subscribe(i=>{this.notificationHandler(`New verification email sent. <a href="/about/help-and-support">Contact us if you don't receive an email.</a>`,"status","success")},i=>{this.notificationHandler(i.error.message,"warning","warning")})}resendConfirmationEmail(){this.enabled=!1,this.showNotification=!1,this.authService.confirmationCodeSendEmail(this.form.value.username).subscribe(i=>{this.notificationHandler(`New verification email sent. <a href="/about/help-and-support">Contact us if you don't receive an email.</a>`,"status","success")},i=>{this.notificationHandler(i.error.message,"warning","warning")})}loginErrorHandler(i){let o=i.error;this.isLoading=!1,o.message==="Email not verified"||o.message==="User not confirmed"||o.message==="Invalid verification code provided, please try again."?(this.stage=Fe,this.meta.updateTag({name:"description",content:"You'll need to verify your email address before you can access your MyAAT account."}),this.setTitle("MyAAT: verify your email"),this.notificationHandler(o.message,"warning","warning"),this.message=o.message==="Email not verified"||o.message==="User not confirmed"?"<p>We need to verify your email address before you can access your MyAAT account.</p><p>We've sent you an email with a verification link. If it doesn't arrive within a few minutes check your spam folder to make sure it's not in there, or send it again.</p>":"<p>Your verification code is no longer valid. Please check your inbox for lastest emails or click below to receive a new one.<p>",o.message==="User not confirmed"&&(this.resendVerificationButton.action.callback=this.resendConfirmationEmail.bind(this))):o.message==="Password reset required for the user"?(this.authService.userResetPassRequired=!0,this.router.navigate(["./password"],{relativeTo:this.route})):o.message==="invalid code"?this.notificationHandler("The code you\u2019ve entered is incorrect. Please checked you\u2019ve typed it in correctly, or use the \u201DGo back\u201D button to try the account set up again.","warning","warning"):(this.notificationHandler("The details you've entered don't match our records. Please check you've typed them correctly, or use the links below to get help.","warning","warning"),o.message==="Incorrect username or password."&&this.verificationCode&&(this.authService.userEmail=this.form.value.username,this.router.navigate(["./.."],{relativeTo:this.route})))}notificationHandler(i,o,a,g=null){this.enabled=g||!0,this.showNotification=!0,this.notification.message=i,this.notification.type=o,this.notification.glyph=a}keyDownFunction(i){i.keyCode==13&&this.form.valid&&this.submit()}getUrlParams(i){let o=document.location.origin;if(Object.keys(i).length>0){this.paramDestination=i.destination??"";let a;
1for(let g in i)switch(g){case"user":{a=i.user;break}case"userConfirmationCode":case"emailConfirmationCode":{this.verificationCode=i[g],this.verificationCodeType=g.startsWith("user")?"user":"email",this.form.addControl("verificationcode",new $(`${this.verificationCodeType}:${this.verificationCode}`));break}case"destination":{this.paramDestination==="/lms"&&i.iframeSrc?this.redirectUrl=o+this.paramDestination+"?iframeSrc="+i.iframeSrc:this.paramDestination.startsWith("/")?(this.internalRedirection=!0,this.redirectUrl=o+this.paramDestination):b.ALLOWED_CALLBACK_URLS.some(x=>this.paramDestination.startsWith(x))&&(this.internalRedirection=!1,this.redirectUrl=this.paramDestination);break}default:break}this.verificationCode&&this.verificationCodeType==="user"&&a?this.authService.verifySignUp(a,this.verificationCode).subscribe(g=>{this.form.removeControl("verificationcode"),this.notificationHandler("You've successfully verified your account. Please log in below to continue.","success","success",!1)},g=>{this.notificationHandler("Please log in to complete your account verification.","status","warning",!1)}):this.verificationCode&&this.notificationHandler("Please log in to complete your account verification.","status","warning",!1)}}redirectAfterLogin(){this.authService.getCurrentUser().pipe(_(1)).subscribe(i=>{if(this.redirectUrl)window.location.href=this.redirectUrl;else if(i.callbackURL&&i.callbackURL.length>0){let o=i,a=decodeURIComponent(o.callbackURL);this.contactService.patchContact(o["custom:contact_id"],{contactId:o["custom:contact_id"],callbackURL:null}).subscribe(()=>{a.startsWith("/")?this.router.navigate([a]):b.ALLOWED_CALLBACK_URLS&&b.ALLOWED_CALLBACK_URLS.some(g=>a.startsWith(g))&&(window.location.href=a)})}else this.layoutSetupService.setLayoutConfig({showHeader:!0,showFooter:!0,showLeftNav:!0}),this.router.navigate(["/myaat/dashboards"])})}disabledNotifications(i){this.notification.message=""}setTitle(i){this.titleService.setTitle(i)}};r.\u0275fac=function(o){return new(o||r)(h(Z),h(X),h(E),h(j),h(E),h(ae),h(V),h(H),h(te),h(oe),h(ne),h(ie))},r.\u0275cmp=M({type:r,selectors:[["login-page"]],decls:2,vars:1,consts:[[1,"container","container-fixed","col-md-5","col-sm-11","col-xs-11",3,"fab-gtm"],[1,"container","container-fixed",3,"fab-gtm"],[1,"row"],[1,"col-md-12","col-sm-12","col-xs-12"],[1,"login-loader"],[1,"logo"],["href",""],["alt","AAT logo",3,"src"],[1,"title"],[1,"col-md-8","col-sm-11","col-xs-11","notification--stacked"],[1,"col-md-8","col-sm-11","col-xs-11"],["action","/myaat/dashboards","novalidate","",3,"formGroup"],[3,"isNotificationOpen","notification"],["action","/myaat/dashboards","novalidate","",3,"keydown","formGroup"],["formControlName","username",3,"content","formControl"],["formControlName","password",3,"content","formControl"],[1,"button_right","col-md-8","col-sm-8","col-xs-11"],[3,"button","enabled"],[3,"mfaSubmit","disabledNotifications","secretCode","stage"],[3,"innerHTML"],[1,"col-md-8","col-sm-8","col-xs-11"],["title","Forgotten your password?",3,"routerLink"],["href","/about/help-and-support","title","Contact us"],["href","/registration/register-with-aat","title","Register with AAT"]],template:function(o,a){o&1&&m(0,_e,6,1,"div")(1,Oe,21,13,"div",0),o&2&&f(a.isLoading?0:1)},dependencies:[me,ce,z,q,Y,K,J,Q,re,le,de,se,W,G],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}.login-loader{margin-top:25%}@media (min-width: 992px){.button_right{display:flex;justify-content:flex-end}}.button_right.buttom-back{justify-content:space-between}.button_right.buttom-back a{padding-top:20px}.logo{width:95px;margin-bottom:15px;margin-left:-10px}.title{margin-bottom:15px}.notification__message .icon-success,.notification__message .icon-error{color:#fff}.notification--stacked{padding-bottom:5px}.auto-list{padding-left:15px}.auto-list li{list-style:decimal}.disc-list{padding-left:15px}.disc-list li{list-style:disc}
2`],encapsulation:2});let t=r;return t})();export{ti as LoginPageComponent};

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.