1import{a as ie}from"./chunk-IGA5H5MI.js";import{b as J}from"./chunk-AHXOZD2I.js";import{a as X}from"./chunk-MUIXR6MJ.js";import"./chunk-DLUETWD6.js";import{a as z,b as ee}from"./chunk-4KFEKOMB.js";import{a as F,b as te}from"./chunk-7P55SE7J.js";import{b as G,h as H,j}from"./chunk-IATIYDOH.js";import{b as S}from"./chunk-IR3IXP4R.js";import{c as Z}from"./chunk-KKTVKEJB.js";import{a as Y}from"./chunk-OFPOYJTS.js";import"./chunk-DGVY3FNH.js";import{Ab as $,Db as C,Eb as q,Fb as u,Ib as T,Jb as m,Kb as f,Pb as E,Ra as o,Rb as a,S as p,Sb as _,X as y,Y as v,aa as B,ab as O,ba as N,da as L,ia as c,lb as b,mb as g,nb as h,ob as U,qb as K,rb as W,sb as M,tb as l,ua as Q,ub as d,wb as R,xb as k,zb as I}from"./chunk-IIXPTABD.js";import{a as A}from"./chunk-7CGTOI24.js";var ae=["digitInput"];function se(r,t){if(r&1){let e=I();R(0,"input",4,0),q("input",function(n){let s=y(e).$index,x=u();return v(x.onInput(s,n))})("keydown",function(n){let s=y(e).$index,x=u();return v(x.onKeydown(s,n))}),k()}if(r&2){let e=t.$implicit,i=t.$index,n=u();E("input-error",n.hasError),$("value",e),b("aria-label","Verification code digit "+(i+1)+" of 6")("aria-invalid",n.hasError)("aria-describedby",n.hasError?"code-error":null)}}var w=6,P=class r{hasError=!1;codeComplete=new L;digitInputs;digits=c(new Array(w).fill(""));alphanumericPattern=/^[A-Za-z0-9]$/;onInput(t,e){let i=e.target,n=i.value;if(n&&!this.alphanumericPattern.test(n)){i.value="";return}let s=[...this.digits()];s[t]=n.toUpperCase(),this.digits.set(s),n&&t<w-1&&this.focusInput(t+1),this.emitIfComplete(s)}onKeydown(t,e){e.key==="Backspace"&&!this.digits()[t]&&t>0&&this.focusInput(t-1)}onPaste(t){t.preventDefault();let e=(t.clipboardData?.getData("text")??"").replaceAll(/[^A-Za-z0-9]/g,"").toUpperCase();if(!e)return;let i=[...this.digits()],n=e.slice(0,w).split("");n.forEach((V,D)=>{i[D]=V}),this.digits.set(i),this.digitInputs.toArray().forEach((V,D)=>{V.nativeElement.value=i[D]});let x=Math.min(n.length,w-1);this.focusInput(x),this.emitIfComplete(i)}reset(){this.digits.set(new Array(w).fill("")),this.digitInputs.toArray().forEach(e=>{e.nativeElement.value=""}),this.focusInput(0)}focusInput(t){this.digitInputs?.toArray()?.[t]?.nativeElement.focus()}emitIfComplete(t){if(!t.every(Boolean)){this.codeComplete.emit("");return}this.codeComplete.emit(t.join(""))}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=O({type:r,selectors:[["app-verification-code-input"]],viewQuery:function(e,i){if(e&1&&T(ae,5),e&2){let n;m(n=f())&&(i.digitInputs=n)}},inputs:{hasError:"hasError"},outputs:{codeComplete:"codeComplete"},decls:5,vars:0,consts:[["digitInput",""],[1,"code-input-group",3,"paste"],[1,"sr-only"],["type","text","maxlength","1","inputmode","text","autocomplete","one-time-code",1,"code-digit",3,"input-error","value"],["type","text","maxlength","1","inputmode","text","autocomplete","one-time-code",1,"code-digit",3,"input","keydown","value"]],template:function(e,i){e&1&&(R(0,"fieldset",1),q("paste",function(s){return i.onPaste(s)}),R(1,"legend",2),a(2,"Verification code"),k(),K(3,se,2,6,"input",3,U),k()),e&2&&(o(3),W(i.digits()))},styles:["[_nghost-%COMP%]{display:block}.code-input-group[_ngcontent-%COMP%]{display:flex;gap:8px;justify-content:center;border:none;margin:0;padding:0;width:100%;min-width:0;box-sizing:border-box}.code-digit[_ngcontent-%COMP%]{flex:0 1 48px;min-width:0;aspect-ratio:1;text-align:center;text-transform:uppercase;font-family:var(--font-family);font-size:20px;font-weight:600;color:var(--color-text-dark);background-color:var(--color-card-bg);border:1px solid var(--color-input-border);border-radius:var(--radius-input);outline:none}.code-digit[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px var(--color-primary)}.code-digit.input-error[_ngcontent-%COMP%]{border-color:var(--color-error)}.code-digit.input-error[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px var(--color-error)}"]})};var ce=["resendButton"],le=["submitButton"];function de(r,t){if(r&1&&(a(0," We have sent a 6 character verification code to "),l(1,"strong"),a(2),d(),a(3,". Enter the 6 character code below to complete your registration: ")),r&2){let e=u();o(2),_(e.maskedEmail())}}function pe(r,t){r&1&&a(0," We have sent a 6 character verification code to your email. Enter the 6 character code below to complete your registration: ")}function ue(r,t){if(r&1&&(l(0,"p",7),a(1),d()),r&2){let e=u();o(),_(e.errorMessage())}}function me(r,t){r&1&&a(0," Sending... ")}function fe(r,t){r&1&&a(0," Resend it ")}function ge(r,t){if(r&1){let e=I();l(0,"app-turnstile-widget",17),C("tokenReceived",function(n){y(e);let s=u();return v(s.onTurnstileToken(n))})("tokenExpired",function(){y(e);let n=u();return v(n.onTurnstileExpired())}),d()}if(r&2){let e=u();M("siteKey",e.turnstileSiteKey())}}function he(r,t){if(r&1&&(l(0,"p",13),a(1),d()),r&2){let e=u();o(),_(e.captchaError())}}function ye(r,t){r&1&&a(0," Submitting... ")}function ve(r,t){r&1&&a(0," Submit ")}var ne=class r{static ERROR_MESSAGES={captcha:"Please complete the verification challenge.",generic:"Something went wrong. Please try again."};route=p(H);router=p(j);identityApi=p(ee);mfaState=p(ie);brandService=p(Z);returnUrlService=p(X);configService=p(Y);authService=p(J);destroyRef=p(N);elementRef=p(Q);titleService=p(G);document=p(B);codeInput;turnstileWidget;authLayout;resendButton;submitButton;maskedEmail=c("");verificationCode=c("");rememberDevice=c(!1);isSubmitting=c(!1);isResending=c(!1);errorMessage=c("");captchaError=c("");isCaptchaRequiredForVerify=c(!1);isCaptchaRequiredForResend=c(!1);resendSuccess=c(!1);resendStatus=c("");credential="";turnstileToken="";captchaEnabled(){return this.configService.isCaptchaEnabled()}turnstileSiteKey(){return this.configService.getCloudflareSiteKey()}showTurnstile(){return this.captchaEnabled()&&!!this.turnstileSiteKey()}ngOnInit(){if(te(this.titleService,this.brandService,"Verify Your Identity"),this.returnUrlService.captureFromRoute(this.route),this.credential=this.route.
1snapshot.queryParamMap.get("credential")??this.mfaState.credential()??"",this.maskedEmail.set(this.mfaState.maskedEmail()??""),!this.credential){this.router.navigate(["/signin"]);return}this.loadUserData()}ngAfterViewInit(){this.reveal(this.authLayout?.logoLink()??this.elementRef.nativeElement.querySelector("h1"))}onCodeComplete(t){this.verificationCode.set(t)}onTurnstileToken(t){this.turnstileToken=t,this.captchaError.set("")}onTurnstileExpired(){this.turnstileToken=""}onSubmit(){if(!this.verificationCode()||this.isSubmitting())return;if(this.showTurnstile()&&!this.turnstileToken){this.captchaError.set(r.ERROR_MESSAGES.captcha);return}this.isSubmitting.set(!0),this.errorMessage.set(""),this.captchaError.set(""),this.resendSuccess.set(!1);let t=A({credential:this.credential,verificationCode:this.verificationCode(),rememberDevice:this.rememberDevice()},this.showTurnstile()&&{cloudflareToken:this.turnstileToken});this.identityApi.verifyMfa(t).pipe(S(this.destroyRef)).subscribe({next:e=>{if(this.isSubmitting.set(!1),e.isCaptchaRequired){this.isCaptchaRequiredForVerify.set(!0),this.turnstileToken="",this.captchaError.set(e.errorMessage??"Verification failed. Please try again."),this.turnstileWidget?.reset(),this.restoreFocus(this.submitButton);return}if(e.success){this.mfaState.clear(),this.authService.validateSession().pipe(S(this.destroyRef)).subscribe({next:()=>{this.returnUrlService.redirect()},error:()=>this.returnUrlService.redirect()});return}this.errorMessage.set(e.errorMessage??"Verification failed. Please try again."),this.codeInput?.reset(),this.verificationCode.set("")},error:()=>{this.isSubmitting.set(!1),this.errorMessage.set(r.ERROR_MESSAGES.generic),this.restoreFocus(this.submitButton)}})}onResend(){if(this.isResending())return;if(this.showTurnstile()&&!this.turnstileToken){this.captchaError.set(r.ERROR_MESSAGES.captcha);return}this.isResending.set(!0),this.errorMessage.set(""),this.captchaError.set(""),this.resendSuccess.set(!1),this.resendStatus.set("");let t=A({credential:this.credential},this.showTurnstile()&&{cloudflareToken:this.turnstileToken});this.identityApi.resendMfaCode(t).pipe(S(this.destroyRef)).subscribe({next:e=>{if(this.isResending.set(!1),e.isCaptchaRequired){this.isCaptchaRequiredForResend.set(!0),this.turnstileToken="",this.captchaError.set(e.errorMessage??"Verification failed. Please try again."),this.turnstileWidget?.reset(),this.restoreFocus(this.resendButton);return}if(e.success){this.resendSuccess.set(!0),this.resendStatus.set("A new code has been sent to your email."),this.verificationCode.set(""),setTimeout(()=>this.codeInput?.reset(),0);return}this.errorMessage.set(e.errorMessage??"Failed to resend code. Please try again."),this.restoreFocus(this.resendButton)},error:()=>{this.isResending.set(!1),this.errorMessage.set(r.ERROR_MESSAGES.generic),this.restoreFocus(this.resendButton)}})}restoreFocus(t){let e=t?.nativeElement;!e||this.elementRef.nativeElement.contains(this.document.activeElement)||this.reveal(e)}reveal(t){t?.focus(),t?.scrollIntoView?.({block:"center"})}loadUserData(){this.identityApi.getMfaUserData(this.credential).pipe(S(this.destroyRef)).subscribe({next:t=>{t.maskedEmail&&this.maskedEmail.set(t.maskedEmail),this.isCaptchaRequiredForVerify.set(t.isCaptchaRequiredForVerify??!1),this.isCaptchaRequiredForResend.set(t.isCaptchaRequiredForResend??!1)},error:()=>{this.router.navigate(["/signin"])}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=O({type:r,selectors:[["app-verify-identity"]],viewQuery:function(e,i){if(e&1&&T(P,5)(z,5)(F,5)(ce,5)(le,5),e&2){let n;m(n=f())&&(i.codeInput=n.first),m(n=f())&&(i.turnstileWidget=n.first),m(n=f())&&(i.authLayout=n.first),m(n=f())&&(i.resendButton=n.first),m(n=f())&&(i.submitButton=n.first)}},decls:28,vars:19,consts:[["resendButton",""],["submitButton",""],[3,"backUrl","backText"],["tabindex","-1",1,"heading"],[1,"subtitle"],[1,"verify-form"],[3,"codeComplete","hasError"],["id","code-error",1,"error-message"],["aria-live","assertive","aria-atomic","true",1,"sr-only"],["aria-live","polite","aria-atomic","true",1,"success-message"],[1,"resend-text"],["type","button",1,"resend-link",3,"click"],[3,"siteKey"],["role","alert",1,"captcha-error"],["type","button",1,"btn-primary",3,"click"],[1,"remember-device"],["type","checkbox",3,"change","checked"],[3,"tokenReceived","tokenExpired","siteKey"]],template:function(e,i){e&1&&(l(0,"app-auth-layout",2)(1,"h1",3),a(2,"Verify Your Identity"),d(),l(3,"p",4),g(4,de,4,1)(5,pe,1,0),d(),l(6,"div",5)(7,"app-verification-code-input",6),C("codeComplete",function(s){return i.onCodeComplete(s)}),d(),g(8,ue,2,1,"p",7),l(9,"p",8),a(10),d(),l(11,"output",9),a(12),d(),l(13,"p",10),a(14," Didn't get the code? "),l(15,"button",11,0),C("click",function(){return i.onResend()}),g(17,me,1,0)(18,fe,1,0),d()(),g(19,ge,1,1,"app-turnstile-widget",12),g(20,he,2,1,"p",13),l(21,"button",14,1),C("click",function(){return i.onSubmit()}
1),g(23,ye,1,0)(24,ve,1,0),d(),l(25,"label",15)(26,"input",16),C("change",function(){return i.rememberDevice.set(!i.rememberDevice())}),d(),a(27," Remember this device "),d()()()),e&2&&(M("backUrl","/app/signin")("backText","Back to Sign in"),o(4),h(i.maskedEmail()?4:5),o(3),M("hasError",!!i.errorMessage()),o(),h(i.errorMessage()?8:-1),o(2),_(i.errorMessage()),o(2),_(i.resendStatus()),o(3),E("is-busy",i.isResending()),b("aria-disabled",i.isResending()),o(2),h(i.isResending()?17:18),o(2),h(i.showTurnstile()&&i.turnstileSiteKey()?19:-1),o(),h(i.captchaError()?20:-1),o(),E("is-busy",!i.verificationCode()||i.isSubmitting()),b("aria-disabled",!i.verificationCode()||i.isSubmitting())("aria-busy",i.isSubmitting()),o(2),h(i.isSubmitting()?23:24),o(3),M("checked",i.rememberDevice()))},dependencies:[F,P,z],styles:[".heading[_ngcontent-%COMP%]{font-family:var(--font-family);font-size:30px;font-weight:700;color:var(--color-text-dark);line-height:37.5px;text-align:center;margin:0 0 4px;letter-spacing:-.025em}.subtitle[_ngcontent-%COMP%]{font-size:14px;font-weight:400;color:var(--color-text-secondary);line-height:21px;text-align:center;margin:0 0 20px}.required-instruction[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-dark);margin-bottom:16px;text-align:left}.form-group[_ngcontent-%COMP%]{margin-bottom:16px}label[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:var(--color-text-dark);line-height:21px;margin-bottom:6px;font-family:var(--font-family)}label.error-label[_ngcontent-%COMP%], .required[_ngcontent-%COMP%]{color:var(--color-error)}input[type=email][_ngcontent-%COMP%], input[type=password][_ngcontent-%COMP%], input[type=text][_ngcontent-%COMP%]{display:flex;height:36px;width:100%;font-family:var(--font-family);font-size:14px;font-weight:400;color:var(--color-text);background-color:var(--color-card-bg);border:1px solid #737373;border-radius:var(--radius-input);padding:8px 12px;line-height:20px;outline:none}input[type=email][_ngcontent-%COMP%]:focus, input[type=password][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px var(--color-primary)}input[type=email].input-error[_ngcontent-%COMP%], input[type=password].input-error[_ngcontent-%COMP%], input[type=text].input-error[_ngcontent-%COMP%]{border-color:var(--color-error)}input[type=email].input-error[_ngcontent-%COMP%]:focus, input[type=password].input-error[_ngcontent-%COMP%]:focus, input[type=text].input-error[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px var(--color-error)}input[type=email][_ngcontent-%COMP%]::placeholder, input[type=password][_ngcontent-%COMP%]::placeholder, input[type=text][_ngcontent-%COMP%]::placeholder{color:#737373}input[type=email][_ngcontent-%COMP%]::-ms-reveal, input[type=email][_ngcontent-%COMP%]::-ms-clear, input[type=password][_ngcontent-%COMP%]::-ms-reveal, input[type=password][_ngcontent-%COMP%]::-ms-clear, input[type=text][_ngcontent-%COMP%]::-ms-reveal, input[type=text][_ngcontent-%COMP%]::-ms-clear{display:none}.password-wrapper[_ngcontent-%COMP%]{position:relative}.password-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-right:40px}.password-toggle[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:transparent;border:none;padding:4px;min-width:24px;min-height:24px;cursor:pointer;color:var(--color-toggle);display:flex;align-items:center;justify-content:center}.password-toggle[_ngcontent-%COMP%]:hover{color:var(--color-toggle-hover)}.password-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px;border-radius:2px}.legal-text[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);line-height:1.5;margin-top:16px;margin-bottom:0}.btn-primary[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;font-family:var(--font-family);font-size:16px;font-weight:700;color:#fff;background-color:var(--color-primary);border:1px solid var(--color-primary);border-radius:var(--radius-button);padding:8px 16px;min-height:36px;margin-top:16px;cursor:pointer;line-height:24px}.btn-primary[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover);border-color:var(--color-primary-hover)}.btn-primary[_ngcontent-%COMP%]:disabled{pointer-events:none;opacity:.5}.error-message[_ngcontent-%COMP%]{font-size:13px;color:var(--color-error);margin-top:4px;line-height:1.4}.footer-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);text-align:center;margin-top:24px;font-weight:500;font-size:16px}.footer-link[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);text-decoration:underline}.social-auth-error[_ngcontent-%COMP%]{font-size:13px;color:var(--color-error);text-align:center;margin-top:12px;line-height:1.5}.magic-link-error[_ngcontent-%COMP%]{font-size:13px;color:var(--color-error);text-align:center;margin:0 0 16px;line-height:1.5}.captcha-error[_ngcontent-%COMP%]{font-size:13px;color:var(--color-error);margin:4px 0 0;line-height:1.5}.heading[_ngcontent-%COMP%]{text-align:left;font-family:Georgia,Times New Roman,serif;font-size:32px;font-weight:700;line-height:1.3}.subtitle[_ngcontent-%COMP%]{text-align:left;font-size:14px;line-height:1.5;color:var(--color-text-dark)}.verify-form[_ngcontent-%COMP%]{text-align:left}.remember-device[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:16px 0 0;font-size:14px;font-weight:400;color:var(--color-text-dark);cursor:pointer}.remember-device[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:auto;height:auto;margin:0}.resend-text[_ngcontent-%COMP%]{font-size:14px;color:var(--color-text-dark);text-align:left;margin-top:16px}.resend-link[_ngcontent-%COMP%]{font-size:14px;font-weight:700;color:var(--color-primary);background:none;border:none;padding:0;cursor:pointer;text-decoration:underline}.resend-link[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px;border-radius:2px}.resend-link.is-busy[_ngcontent-%COMP%], .btn-primary.is-busy[_ngcontent-%COMP%]{opacity:.5;cursor:default}.success-message[_ngcontent-%COMP%]{font-size:13px;color:var(--color-success, #276700);margin-top:8px;line-height:1.4}.success-message[_ngcontent-%COMP%]:empty{margin-top:0}"]})};
1export{ne as VerifyIdentityComponent};
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.