1try{let d=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},g=(new d.Error).stack;g&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[g]="6e358ed0-8eca-41a1-a168-26ee17bab433",d._sentryDebugIdIdentifier="sentry-dbid-6e358ed0-8eca-41a1-a168-26ee17bab433")}catch{}(typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{}).SENTRY_RELEASE={id:"161606c08ea687253482a1b6b02c8cd05b8d0512"},(self.webpackChunkSIMPro=self.webpackChunkSIMPro||[]).push([["src_app_views_login_login_module_ts"],{95712(d,g,i){i.d(g,{LoginModule:()=>z});var f=i(99457),s=i(34456),h=i(65915),u=i(90852),v=i(89204),C=i(8127),_=i(63855),e=i(20203),c=i(72237),p=i(45312),S=i(23127),x=i(89023),I=i(66992),y=i(41834),L=i(83273),A=i(75809),b=i(62139),w=i(54285),E=i(51567),T=i(50819),U=i(91687),D=i(45609),B=i(22179);function O(n,r){1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,"UserBundle.login.login_in_progress")))}function M(n,r){if(1&n&&(e.\u0275\u0275elementStart(0,"option",5),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=r.$implicit;e.\u0275\u0275property("value",e.\u0275\u0275interpolate(t.id)),e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate(t.text)}}function P(n,r){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",1)(1,"label")(2,"p",3),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(5,"select",4),e.\u0275\u0275twoWayListener("ngModelChange",function(o){e.\u0275\u0275restoreView(t);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275twoWayBindingSet(l.locale,o)||(l.locale=o),e.\u0275\u0275resetView(o)}),e.\u0275\u0275repeaterCreate(6,M,2,3,"option",5,e.\u0275\u0275repeaterTrackByIdentity),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,2,"UserBundle.login.choose_language")),e.\u0275\u0275advance(2),e.\u0275\u0275twoWayProperty("ngModel",t.locale),e.\u0275\u0275advance(),e.\u0275\u0275repeater(t.locales)}}function W(n,r){1&n&&(e.\u0275\u0275elementStart(0,"span",13),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,"UserBundle.login.login_failure_message_disabled_user")))}function N(n,r){1&n&&(e.\u0275\u0275elementStart(0,"span",13),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,"UserBundle.login.login_failure_message")))}function F(n,r){1&n&&(e.\u0275\u0275elementStart(0,"span",13),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,"UserBundle.login.login_failure_message_openid")))}function j(n,r){1&n&&(e.\u0275\u0275elementStart(0,"div",8)(1,"div",9)(2,"p"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()()()),2&n&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,1,"GUIBundle.generic.bookmark_site")))}function k(n,r){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"div",1)(2,"input",6),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275twoWayListener("ngModelChange",function(o){e.\u0275\u0275restoreView(t);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275twoWayBindingSet(l.loginData.username,o)||(l.loginData.username=o),e.\u0275\u0275resetView(o)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",1)(5,"input",7),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275twoWayListener("ngModelChange",function(o){e.\u0275\u0275restoreView(t);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275twoWayBindingSet(l.loginData.password,o)||(l.loginData.password=o),e.\u0275\u0275resetVie
1w(o)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"div",8)(8,"div",9)(9,"a",10)(10,"p",11),e.\u0275\u0275text(11),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(13,"button",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.login())}),e.\u0275\u0275elementStart(14,"span"),e.\u0275\u0275text(15),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275conditionalCreate(17,W,3,3,"span",13),e.\u0275\u0275conditionalCreate(18,N,3,3,"span",13),e.\u0275\u0275conditionalCreate(19,F,3,3,"span",13),e.\u0275\u0275elementEnd()(),e.\u0275\u0275conditionalCreate(20,j,5,3,"div",8),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder",e.\u0275\u0275interpolate(e.\u0275\u0275pipeBind1(3,13,"FOSUserBundle.form.username"))),e.\u0275\u0275twoWayProperty("ngModel",t.loginData.username),e.\u0275\u0275advance(3),e.\u0275\u0275property("placeholder",e.\u0275\u0275interpolate(e.\u0275\u0275pipeBind1(6,15,"FOSUserBundle.form.password"))),e.\u0275\u0275twoWayProperty("ngModel",t.loginData.password),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(12,17,"CoreBundle.views.login_page.trouble_accessing_your_account")),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",t.loginInProgress),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(16,19,"FOSUserBundle.layout.login")),e.\u0275\u0275advance(2),e.\u0275\u0275conditional(t.badLoginPermanentDisable?17:-1),e.\u0275\u0275advance(),e.\u0275\u0275conditional(t.badLogin?18:-1),e.\u0275\u0275advance(),e.\u0275\u0275conditional(t.badLoginOpenId?19:-1),e.\u0275\u0275advance(),e.\u0275\u0275conditional(t.bookmarkMessage?20:-1)}}function V(n,r){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",1)(1,"label"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.loginAuthZero())}),e.\u0275\u0275elementStart(5,"span"),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,3,"UserBundle.login.or_sign_in_with")),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",t.loginInProgress),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(7,5,"UserBundle.login.login_in_with_openid"))}}let m=(()=>{class n{translate=(0,e.inject)(u.c$);sfUser=(0,e.inject)(L.D);oauthService=(0,e.inject)(I.T);router=(0,e.inject)(c.Router);route=(0,e.inject)(c.ActivatedRoute);userService=(0,e.inject)(A.K);store=(0,e.inject)(S.Store);toastr=(0,e.inject)(w.tw);sfTrans=(0,e.inject)(y.P);localeService=(0,e.inject)(x.i);modalService=(0,e.inject)(h.Bq);loginService=(0,e.inject)(B.H);ssoEnabled=["prod","uat"].includes(p.c.name);restrictedSso={"okta-just-eat":"Okta"};auth0;interval;legacyUrl;tokenInfo;_locale;badLogin=null;badLoginOpenId=null;badLoginPermanentDisable;loginData={username:"",password:""};loginInProgress=!1;isAuthenticated=!1;bookmarkMessage=!1;locales=[{id:"en",text:"English"},{id:"fr",text:"Fran\xe7ais"},{id:"de",text:"Deutsch"},{id:"es",text:"Espa\xf1ol"},{id:"zh",text:"\u4e2d\u6587"}];get locale(){return this._locale}set locale(t){this._locale=t,this.changeLocale()}constructor(){this.legacyUrl=p.c.legacyUrl,this.auth0=this.ssoEnabled?this.loginService.getAuth0Client(p.c.openIdDomain,p.c.openIdClientId):null}ngOnInit(){this.locale=this.sfUser.locale,this.isAuthenticated=this.oauthService.isAuthenticated(),this.loginData.username="",this.loginData.password="",this.isAuthenticated&&this.getUserInfo(),this.route.queryParams.subscribe(t=>{t?.msg&&(this.toastr.warning(t.msg),this.isAuthenticated=!1,this.router.navigateByUrl("/login"))}),this.router.events.pipe((0,E.p)(t=>t instanceof c.RoutesRecognized),function R(){return(0,T.N)((n,r)=>{let t,a=!1;n.subscribe((0,U._)(r,o=>{const l=t;t=o,a&&r.next([l,o]),a=!0}))})}()).subscribe(t=>{const a=!!localStorage.getItem("auth");t[0].urlAfterRedirects.includes("change-password")&&a&&this.toastr.success(this.sfTrans.trans("UserBundle.login.password_changed_login"))}
1),this.bookmarkMessage=this.route.snapshot.queryParams.bookmarkMessage}ngOnDestroy(){clearInterval(this.interval)}processSuccessLogin(t){return this.loginInProgress=!1,this.isAuthenticated=this.oauthService.isAuthenticated(),this.tokenInfo=t,this.checkIfCredentialsExpired(t),this.getUserInfo(),t}login(){this.loginInProgress=!0,this.initNewLoginAttempt(),this.oauthService.fetchAccessToken(this.loginData.username,this.loginData.password).subscribe(t=>{this.processSuccessLogin(t)},t=>{t instanceof _.yz&&(this.loginInProgress=!1,403===t.status?this.badLoginPermanentDisable=!0:423===t.status?this.handleLockOutUser():this.handleBadLogin(t))})}loginAuthZero(){var t=this;return(0,v.A)(function*(){t.loginInProgress=!0,yield t.auth0.loginWithPopup();const o=(yield t.auth0.getIdTokenClaims()).__raw;t.oauthService.loginOauthWithJWT(o).subscribe(l=>{t.processSuccessLogin(l)},()=>{t.isAuthenticated=t.oauthService.isAuthenticated(),t.loginInProgress=!1,t.badLogin=!0,setTimeout(()=>{t.initNewLoginAttempt()},1e4)})})()}logout(){window.walkMeVars.user=null,this.oauthService.removeTokens(),this.isAuthenticated=this.oauthService.isAuthenticated()}changeLocale(){this.localeService.changeLocale(this.locale)}get isWaitingFor2FACode(){return this.sfUser.hasRole("ROLE_AWAITING_CURRENT_SESSION_2FA_VALIDATION")}get isWaitingFor2FASetupValidation(){return this.sfUser.hasRole("ROLE_AWAITING_2FA_SETUP_VALIDATION")}get isWaitingForPasswordChangeOnExpiredCredentials(){return this.sfUser.hasRole("ROLE_AWAITING_PASSWORD_CHANGE_ON_EXPIRED_CREDENTIALS")}get hasFrontendRole(){return this.sfUser.hasRole("ROLE_FRONTEND")}get isWaitingForTermsAcceptance(){return this.sfUser.hasRole("ROLE_AWAITING_TERMS_OF_USAGE_ACCEPTANCE")}get isAdmin(){return this.sfUser.hasRole("ROLE_ADMIN")}redirectOnLogin(){if(this.isWaitingForPasswordChangeOnExpiredCredentials)return;let t=this.route.snapshot.queryParams.returnUrl;if(["login","auth/two-factor-validation"].forEach(o=>{t&&(t.startsWith(o)||t.startsWith("/"+o))&&(t=null)}),this.isWaitingFor2FACode)this.router.navigate(["/auth/two-factor-validation"],{queryParams:{returnUrl:t}});else if(this.isWaitingForTermsAcceptance)this.router.navigate(["/standalone/terms-of-use"],{queryParams:{returnUrl:t}});else if(this.isWaitingFor2FASetupValidation)this.router.navigate(["/auth/two-factor-setup"],{queryParams:{returnUrl:t}});else{if(!this.hasFrontendRole)return this.logout(),void(window.location.href=this.legacyUrl);if(this.isAdmin)this.modalService.open(b.e,{size:"lg",backdrop:"static"}).componentInstance.accepted.pipe().subscribe(()=>{this.logout(),window.location.href=this.legacyUrl});else{this.store.dispatch(new C.l);const o=t||this.sfUser.getHomeRoute();this.router.navigateByUrl(o)}}}getUserInfo(){this.userService.getUserInfo().subscribe(t=>{this.sfUser.loadData(t),this.handleSsoRestrictions()&&this.redirectOnLogin()},t=>{t.error instanceof Error?console.error("LoginComponent failed to get user info, client-side error occurred"):(console.error("LoginComponent failed to get user info, server-side error occurred"),console.error("LoginComponent - Has your login password expired?"))})}handleSsoRestrictions(){const t=this.sfUser.user.ssoType;if(this.isAuthenticated&&t in this.restrictedSso){const a=this.sfTrans.transInterpolate("UserBundle.login.sso_restriction",{sso_type:this.restrictedSso[t]});return this.toastr.error(a),this.logout(),!1}return!0}initNewLoginAttempt(){this.badLogin=!1,this.badLoginOpenId=!1}handleLockOutUser(){this.router.navigateByUrl("/auth/locked-out",{state:{username:this.loginData.username}})}handleBadLogin(t){"Wireless Logic OpenID"===t.error?.message?this.badLoginOpenId=!0:this.badLogin=!0,setTimeout(()=>{this.initNewLoginAttempt()},1e4)}checkIfCredentialsExpired(t){"ROLE_AWAITING_PASSWORD_CHANGE_ON_EXPIRED_CREDENTIALS"===(0,D.A)(t.access_token)?.scopes?.profile?.roles.toString()&&this.router.navigate(["/auth/change-password"]).then()}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-login"]],decls:7,vars:4,consts:[[1,"ibox-content"],[1,"form-group"],[1,"m-t"],[1,"mat-caption"],[1,"form-control","choose-language",3,"ngModelChange","ngModel"],[3,"value"],["name","username","autocomplete","username","required","",1,"form-control",3,"ngModelChange","placeholder","ngModel"],["type","password","name","password","autocomplete","current-password","required","",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"row"],[1,"col-lg-12","text-left"],["routerLink","/auth/forgot-password",1,"pull-right"],[1,"text-overline"],[1,"btn","btn-success","btn-sm","block","m-b",3,"click","disabled"],[1,"help-block"]],template:function(a,o){1&a&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275conditionalCreate(1,O,3,3,"p"),e.\u0275\u0275conditionalCreate(2,P,8,4,"div",1),e.\u0275\u0275elementStart(3,"form",2),e.\u0275\u0275conditionalCreate(4,k,21,21,"div"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(5,"hr"),e.\u0275\u0275conditionalCreate(6,V,8,7,"div",1),e.\u0275\u0275elementEnd()),2&a&&(e.\u0275\u0275advance(),e.\u0275\u0275conditional(o.isAuthenticated?1:-1),e.\u0275\u0275advance(),e.\u0275\u0275conditional(o.isAuthenticated?-1:2),e.\u0275\u0275advance(2),e.\u0275\u0275conditional(o.isAuthenticated?-1:4),e.\u0275\u0275advance(2),e.\u0275\u0275conditional(!o.isAuthenticated&&o.ssoEnabled?6:-1))},dependencies:[s.YN,s.qT,s.xH,s.y7,s.me,s.wz,s.BC,s.cb,s.YS,s.vS,s.cV,c.RouterLink,u.h,u.D9],styles:[".help-block[_ngcontent-%COMP%]{color:#ff8c8c}"]})}return n})();const G=[{path:"",component:m}];let H=(()=>{class n{static \u0275fac=function(a){return new(a||n)};static \u0275mod=e.\u0275\u0275defineNgModule({type:n});static \u0275inj=e.\u0275\u0275defineInjector({imports:[c.RouterModule.forChild(G),c.RouterModule]})}return n})(),z=(()=>{class n{static \u0275fac=function(a){return new(a||n)};static \u0275mod=e.\u0275\u0275defineNgModule({type:n});static \u0275inj=e.\u0275\u0275defineInjector({imports:[f.CommonModule,H,u.h,s.YN,h.XZ,m]})}return n})()}}]);
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.