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,GAAW,GAC7B9J,EAAWiB,eAOzB0J,gBACE3D,QAAQiB,IAAI,iBAWd2C,MACI5D,QAAQiB,IAAI,OAGhB4C,QAAQC,GACJ,OAAOhL,KAAK8B,UAAUmJ,wBAAwBD,iDA/UzC3J,GAAcD,sIAAdC,EAAc6J,2LAAdC,eAAe,QAADD,CAAC,6BAAfC,iBAAiB,QAAHD,CAAG,2BAAjBC,eAAe,qpJD1B5B/J,iCA4HAA,iCAkCAA,wCA9JaA,6BA4HAA,sCAkCAA,45HCpIAC,GAAb,wCCUO,IAAM+J,GAAb,MAAM,sDAAOA,4DAhBA,CACLC,KACAC,KACAC,KACAC,KACAC,IACAC,IACAC,cAAsB,CAAC,CAACnG,KAAM,GAAIoG,UAAWvK,MAC7CwK,KACAC,KACAC,KACAC,KACAC,KACAC,SAGKd,GAAb,EAAaA","names":["constructor","predicate","inclusive","this","call","subscriber","source","subscribe","TakeWhileSubscriber","Subscriber","destination","super","index","_next","value","result","err","error","nextOrComplete","predicateResult","Boolean","next","complete","i0","LoginComponent","elementRef","translate","router","route","formBuilder","authService","messageService","store","sanitizer","randomBytes","box","secretOrSharedKey","json","key","nonce","newNonce","messageUint8","decodeUTF8","JSON","stringify","encrypted","fullMessage","Uint8Array","length","set","encodeBase64","environment","currStep","loginForm","group","userName","Validators","password","emailForm","email","mfaCode","FormControl","warningMessage","displayq3","displayq4","displayloginHelp","displayELAR20","onClick","event","capslockOn","getModifierState","onKeyDown","onKeyUp","ngOnInit","window","history","pushState","location","href","onpopstate","go","getPortalMessages","val","portalMessage","data","otpRequestInProgress","queryParams","params","redirectApp","app","redirectURI","path","isRedirect","redirect","pipe","take","select","isLoggedIn","status","navigate","ngAfterViewInit","mouseover","mouseOverActiveElement","target","mouseout","login","clear","submit","invalid","busy","controls","getMFAProfile","res","emails","results","types","verifiedTargets","console","add","t","severity","detail","instant","message","requestOTP","emailSubmit","mfaCodeRef","setValue","preventDefault","requestMFACode1","otpWait","countdown","timer","display","log","i","statusText","submitOTP","verifyMFACode","catchError","EMPTY","throwError","switchMap","mfaResult","portalLogin","oidcToken","of","apps","eoeid","mfaToken","finalize","payload","userId","token","username","mfaEmail","espEmails","returnUrl","snapshot","uri","dispatch","StoreActions","reset","minutes","delay","Observable","map","v","lift","TakeWhileOperator","x","Math","floor","seconds","toString","slice","addToKeywords","eye","gethtml","msg","bypassSecurityTrustHtml","selectors","ctx","LoginModule","CommonModule","FormsModule","ReactiveFormsModule","ButtonModule","InputTextModule","ProgressSpinnerModule","RouterModule","component","RadioButtonModule","TranslateModule","NgOtpInputModule","DividerModule","DirectivesModule","TooltipModule"],"sources":["webpack:///node_modules/rxjs/_esm2015/internal/operators/takeWhile.js","webpack:///src/app/login/login.component.html","webpack:///src/app/login/login.component.ts","webpack:///src/app/login/login.module.ts"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nexport function takeWhile(predicate, inclusive = false) {\n return (source) => source.lift(new TakeWhileOperator(predicate, inclusive));\n}\nclass TakeWhileOperator {\n constructor(predicate, inclusive) {\n this.predicate = predicate;\n this.inclusive = inclusive;\n }\n call(subscriber, source) {\n return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));\n }\n}\nclass TakeWhileSubscriber extends Subscriber {\n constructor(destination, predicate, inclusive) {\n super(destination);\n this.predicate = predicate;\n this.inclusive = inclusive;\n this.index = 0;\n }\n _next(value) {\n const destination = this.destination;\n let result;\n try {\n result = this.predicate(value, this.index++);\n }\n catch (err) {\n destination.error(err);\n return;\n }\n this.nextOrComplete(value, result);\n }\n nextOrComplete(value, predicateResult) {\n const destination = this.destination;\n if (Boolean(predicateResult)) {\n destination.next(value);\n }\n else {\n if (this.inclusive) {\n destination.next(value);\n }\n destination.complete();\n }\n }\n}\n","\r\n
\r\n
\r\n
\r\n
\r\n {{'login.leftSubTitle'| translate}}:\r\n
\r\n
\r\n
\r\n

\r\n This page is under review and not intended for non-IT use at this time.\r\n

\r\n
\r\n
\r\n
\r\n \r\n
\r\n

Message Updated: {{messageData.updatedTime}}

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

{{'login.rightSubTitle'| translate}}

\r\n Getting Started\r\n
\r\n
\r\n
\r\n \r\n {{'login.error.requiredUserName'|translate}}\r\n
\r\n
\r\n \r\n {{'login.error.requiredPassword'|translate}}\r\n Caps lock is on.\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n OR\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n

ELAR (Online Licensure System)

\r\n
\r\n
\r\n
\r\n

NEW USERS will need to create an ELAR profile.

\r\n

EXISTING USERS who did not pre-register for ESP may need to reactivate account.

\r\n

Learn more about ELAR, and gain access to the new Education Security Portal.

\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n

{{'login.title2'| translate}}

\r\n
\r\n
\r\n
\r\n A code will be sent to you to verify your account. Please select where you would like this code to be sent.\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {{'login.error.requiredEmail'| translate}}\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n
\r\n\r\n
\r\n

Enter code

\r\n
\r\n
\r\n A Verification code has been sent to your email. This code will be valid for 15 minutes.\r\n
\r\n
\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import {AfterViewInit, Component, ElementRef, HostListener, OnInit, ViewChild, ViewChildren} from '@angular/core';\r\nimport {FormBuilder, FormControl, FormGroup, Validators} from \"@angular/forms\";\r\nimport {AuthService} from \"../services/AuthService\";\r\nimport {MessageService, PrimeNGConfig} from \"primeng/api\";\r\nimport {select, Store} from \"@ngrx/store\";\r\nimport {IAppState, isLoggedIn, StoreActions} from \"../store/app\";\r\nimport { box, randomBytes } from 'tweetnacl';\r\nimport {\r\n decodeUTF8,\r\n encodeUTF8,\r\n encodeBase64,\r\n decodeBase64\r\n} from 'tweetnacl-util';\r\nimport {catchError, combineAll, finalize, map, switchMap, take, takeUntil, takeWhile, tap} from \"rxjs/operators\";\r\nimport {EMPTY, Observable, of, throwError, timer} from \"rxjs\";\r\nimport {ActivatedRoute, Router} from \"@angular/router\";\r\nimport {TranslateService} from \"@ngx-translate/core\";\r\nimport {environment} from \"../../environments/environment\";\r\nimport jwt_decode from \"jwt-decode\";\r\nimport {DomSanitizer} from \"@angular/platform-browser\";\r\n\r\n@Component({\r\n selector: 'app-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: ['./login.component.scss']\r\n})\r\nexport class LoginComponent implements OnInit,AfterViewInit {\r\n loginForm: FormGroup;\r\n emailForm: FormGroup;\r\n submit: boolean;\r\n busy: boolean;\r\n currStep: number;\r\n newNonce = () => randomBytes(box.nonceLength);\r\n generateKeyPair = () => box.keyPair();\r\n timer: any;\r\n otpWait: boolean;\r\n emails: string[];\r\n oidcToken: string;\r\n eoeid: string;\r\n otpRequestInProgress: boolean;\r\n isRedirect:boolean;\r\n redirectApp: string;\r\n redirectURI: string;\r\n userName: string;\r\n password: string;\r\n mfaCode: FormControl;\r\n emailSubmit:boolean;\r\n capslockOn: boolean;\r\n warningMessage: string;\r\n displayq3: boolean;\r\n displayq4: boolean;\r\n displayloginHelp: boolean;\r\n displayELAR20:boolean;\r\n\r\n @ViewChild('mfaCodeRef') mfaCodeRef:any;\r\n\r\n mouseOverActiveElement: any;\r\n portalMessage:any;\r\n\r\n @HostListener('window:click', ['$event']) onClick(event){\r\n if (event.getModifierState && event.getModifierState('CapsLock')) {\r\n this.capslockOn = true;\r\n } else {\r\n this.capslockOn = false;\r\n }\r\n }\r\n\r\n @HostListener('window:keydown', ['$event'])\r\n onKeyDown(event){\r\n if (event.getModifierState && event.getModifierState('CapsLock')) {\r\n this.capslockOn = true;\r\n } else {\r\n this.capslockOn = false;\r\n }\r\n }\r\n\r\n @HostListener('window:keyup', ['$event'])\r\n onKeyUp(event){\r\n if (event.getModifierState && event.getModifierState('CapsLock')) {\r\n this.capslockOn = true;\r\n } else {\r\n this.capslockOn = false;\r\n }\r\n }\r\n\r\n constructor(private elementRef:ElementRef,private translate: TranslateService,private router: Router,\r\n private route: ActivatedRoute, private formBuilder: FormBuilder,\r\n private authService: AuthService, private messageService: MessageService,\r\n private store: Store,private sanitizer: DomSanitizer) {\r\n this.currStep=1;\r\n\r\n this.loginForm = this.formBuilder.group({\r\n userName: ['', Validators.required],\r\n password: ['', Validators.required]\r\n });\r\n\r\n this.emailForm = this.formBuilder.group({\r\n email: ['', Validators.required]\r\n });\r\n\r\n this.mfaCode = new FormControl('', [Validators.required, Validators.maxLength(6)]);\r\n\r\n this.warningMessage= environment[\"warning.message.q2\"];\r\n this.displayq3= environment[\"display.q3\"];\r\n this.displayq4= environment[\"display.q4\"];\r\n this.displayloginHelp= environment[\"display.loginHelp\"];\r\n this.displayELAR20=!!environment[\"elar2.0_create_profile\"];\r\n }\r\n\r\n ngOnInit(): void {\r\n window.history.pushState(null, null, window.location.href);\r\n window.onpopstate = function () {\r\n window.history.go(1);\r\n };\r\n this.authService.getPortalMessages('01')\r\n .subscribe(val=>{\r\n this.portalMessage=val.data;\r\n }, error => {\r\n\r\n });\r\n this.otpRequestInProgress=false;\r\n this.route.queryParams\r\n .subscribe(params => {\r\n this.redirectApp = params.app;\r\n this.redirectURI = params.path;\r\n this.isRedirect = params.redirect;\r\n }\r\n );\r\n\r\n\r\n this.store\r\n .pipe(take(1))\r\n .pipe(select(isLoggedIn()))\r\n .subscribe(status =>{\r\n if(status){\r\n this.router.navigate(['home']);\r\n }\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n\r\n mouseover(event) {\r\n this.mouseOverActiveElement=event.target;\r\n }\r\n mouseout(event) {\r\n this.mouseOverActiveElement=null;\r\n }\r\n\r\n login() {\r\n this.messageService.clear();\r\n\r\n this.submit = true;\r\n if (this.loginForm.invalid) {\r\n return;\r\n }\r\n this.busy = true;\r\n\r\n this.userName=this.loginForm.controls.userName.value;\r\n this.password=this.loginForm.controls.password.value;\r\n\r\n this.authService.getMFAProfile(this.userName,this.password)\r\n .subscribe(res => {\r\n this.busy = false;\r\n this.submit = false;\r\n this.currStep=2;\r\n this.emails = res.results.types[0].verifiedTargets;\r\n }, err => {\r\n console.error(err);\r\n this.busy = false;\r\n this.submit = false;\r\n if(err.status === 0){\r\n this.messageService.add({severity:'error', detail:' Unable to Connect to the Server'});\r\n } else if(err.status === 404 || err.status === 401) {\r\n this.messageService.add({severity:'error', detail:this.translate.instant('login.error.invalidLogin')});\r\n }else {\r\n this.messageService.add({severity:'error', detail:err.error.message});\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n requestOTP (event) {\r\n\r\n this.emailSubmit=true;\r\n if(this.mfaCodeRef){\r\n this.mfaCodeRef.setValue('');\r\n }\r\n event.preventDefault();\r\n this.messageService.clear();\r\n\r\n if (this.emailForm.invalid) {\r\n return;\r\n }\r\n this.busy = true;\r\n this.otpRequestInProgress=true;\r\n this.authService.requestMFACode1(this.loginForm.controls.userName.value,this.emailForm.controls.email.value)\r\n .subscribe(res => {\r\n this.busy = false;\r\n this.submit = false;\r\n this.currStep=3;\r\n this.otpWait=true;\r\n this.otpRequestInProgress=false;\r\n this.countdown(2, 1)\r\n .subscribe(val => {\r\n this.timer = val.display;\r\n },\r\n error => console.log(error), () => {\r\n this.otpWait = false;\r\n });\r\n }, res => {\r\n this.busy = false;\r\n this.submit = false;\r\n this.otpRequestInProgress=false;\r\n if(res.status === 0){\r\n this.messageService.add({severity:'error', detail:' Unable to Connect to the Server'});\r\n } else if(res.error === null) {\r\n this.messageService.add({severity:'error', detail:res.statusText});\r\n }else {\r\n this.messageService.add({severity:'error', detail:res.error.message});\r\n }\r\n })\r\n\r\n }\r\n\r\n submitOTP () {\r\n this.messageService.clear();\r\n this.submit = true;\r\n if (this.mfaCode.invalid) {\r\n return;\r\n }\r\n this.busy = true;\r\n\r\n this.authService.verifyMFACode(this.userName\r\n ,this.password, this.mfaCode.value)\r\n .pipe(catchError(err => {\r\n if(err.status === 401){\r\n this.messageService.add({severity:'error', detail:'The verification code you entered has either expired or is incorrect. Please click \"Resend Code\" and try again.'});\r\n return EMPTY;\r\n } else {\r\n return throwError(err);\r\n }\r\n\r\n }))\r\n .pipe(switchMap(mfaResult => {\r\n return this.authService.portalLogin(mfaResult.oidcToken)\r\n .pipe(switchMap(result => {\r\n return of({apps:result.data.apps, eoeid: result.data.eoeid,\r\n mfaToken: mfaResult.mfaToken,oidcToken: mfaResult.oidcToken});\r\n }))\r\n }))/*.pipe(switchMap( loginInfo => {\r\n return this.authService.initThirtyMinuteCookie(true).pipe(switchMap(_=> {\r\n console.log(_);\r\n return of(loginInfo)}));\r\n }))*/\r\n .pipe(finalize(() => {\r\n this.busy = false;\r\n }))\r\n .subscribe(res => {\r\n this.busy = false;\r\n this.currStep=0;\r\n\r\n const payload: any ={userId: res.eoeid, token: res.oidcToken,\r\n mfaToken: res.mfaToken, username: this.userName, apps:res.apps,mfaEmail: this.emailForm.controls.email.value,\r\n espEmails: this.emails\r\n }\r\n\r\n const returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';\r\n\r\n if(returnUrl){\r\n payload.redirect = {app: this.redirectApp, uri: this.redirectURI, returnUrl};\r\n }\r\n\r\n if(this.isRedirect) {\r\n payload.redirect = {app: this.redirectApp, uri: this.redirectURI};\r\n }\r\n\r\n this.store\r\n .dispatch(new StoreActions.LoginSuccess(payload));\r\n this.mfaCode.reset();\r\n this.emailForm.reset();\r\n this.loginForm.reset();\r\n }, res => {\r\n this.busy = false;\r\n console.log(res);\r\n if(res.status === 0){\r\n this.messageService.add({severity:'error', detail:'Unable to Connect to the Server.'});\r\n } else if(res.error === null) {\r\n this.messageService.add({severity:'error', detail:res.statusText});\r\n }else {\r\n this.messageService.add({severity:'error', detail:res.error.message});\r\n }\r\n });\r\n\r\n }\r\n\r\n encrypt = (\r\n secretOrSharedKey: Uint8Array,\r\n json: any,\r\n key?: Uint8Array\r\n ) => {\r\n const nonce = this.newNonce();\r\n const messageUint8 = decodeUTF8(JSON.stringify(json));\r\n const encrypted = key\r\n ? box(messageUint8, nonce, key, secretOrSharedKey)\r\n : box.after(messageUint8, nonce, secretOrSharedKey);\r\n\r\n const fullMessage = new Uint8Array(nonce.length + encrypted.length);\r\n fullMessage.set(nonce);\r\n fullMessage.set(encrypted, nonce.length);\r\n\r\n const base64FullMessage = encodeBase64(fullMessage);\r\n return base64FullMessage;\r\n };\r\n\r\n countdown(minutes: number, delay: number = 0) {\r\n return new Observable<{ display: string; minutes: number; seconds: number }>(\r\n subscriber => {\r\n timer(delay, 1000)\r\n .pipe(take(minutes * 60))\r\n .pipe(map(v => minutes * 60 - 1 - v))\r\n .pipe(takeWhile(x => x >= 0))\r\n .subscribe(countdown => { // countdown => seconds\r\n // tslint:disable-next-line:no-shadowed-variable\r\n const minutes = Math.floor(countdown / 60);\r\n const seconds = countdown - minutes * 60;\r\n\r\n subscriber.next({\r\n display: `${('0' + minutes.toString()).slice(-2)}:${('0' + seconds.toString()).slice(-2)}`,\r\n minutes,\r\n seconds\r\n });\r\n\r\n if (seconds <= 0 && minutes <= 0) {\r\n subscriber.complete();\r\n }\r\n });\r\n });\r\n }\r\n\r\n\r\n addToKeywords() {\r\n console.log('addToKeywords');\r\n }\r\n\r\n /* @HostListener('document:keypress', ['$event'])\r\n keyEvent(event: KeyboardEvent) {\r\n if (event.keyCode === 13 && this.mouseOverActiveElement && this.mouseOverActiveElement.tagName ==='A') {\r\n event.preventDefault();\r\n this.mouseOverActiveElement?.click();;\r\n }\r\n }*/\r\n\r\n eye() {\r\n console.log('eye');\r\n }\r\n\r\n gethtml(msg){\r\n return this.sanitizer.bypassSecurityTrustHtml(msg);\r\n }\r\n\r\n protected readonly environment = environment;\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport {LoginComponent} from \"./login.component\";\r\nimport {RouterModule} from \"@angular/router\";\r\nimport {FormsModule, ReactiveFormsModule} from \"@angular/forms\";\r\nimport {ButtonModule} from \"primeng/button\";\r\nimport {InputTextModule} from \"primeng/inputtext\";\r\nimport {ProgressSpinnerModule} from \"primeng/progressspinner\";\r\nimport {RadioButtonModule} from \"primeng/radiobutton\";\r\nimport {TranslateModule} from \"@ngx-translate/core\";\r\nimport {NgOtpInputModule} from \"ng-otp-input\";\r\nimport {PasswordModule} from \"primeng/password\";\r\nimport {DividerModule} from \"primeng/divider\";\r\nimport {DirectivesModule} from \"../directives/directives.module\";\r\nimport {TooltipModule} from \"primeng/tooltip\";\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [LoginComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n ButtonModule,\r\n InputTextModule,\r\n ProgressSpinnerModule,\r\n RouterModule.forChild([{path: '', component: LoginComponent}]),\r\n RadioButtonModule,\r\n TranslateModule,\r\n NgOtpInputModule,\r\n DividerModule,\r\n DirectivesModule,\r\n TooltipModule\r\n ]\r\n})\r\nexport class LoginModule { }\r\n"]}