1import{g as b,i as R}from"./chunk-EWPP756Y.js";import"./chunk-I5EQON52.js";import{a as S}from"./chunk-WJYI5X5F.js";import{c as H,d as M}from"./chunk-G6PWMA7J.js";import{Jd as U,Qb as u,Qc as c,Rb as o,Rc as l,Sb as a,Tb as h,ac as f,cc as I,db as r,ec as d,fd as O,mb as g,oa as C,pa as A,qa as T,ra as v,sb as y,sc as s,tc as _,uc as w,xd as N,yb as V}from"./chunk-IQ6SK2BU.js";import{T as x,r as k}from"./chunk-FSMGGXIA.js";import"./chunk-K7BHMZHH.js";import"./chunk-OXDKANHF.js";import"./chunk-XUHYVR5R.js";function L(n,E){if(n&1&&(o(0,"div",9),h(1,"div",10),o(2,"p",11),s(3),c(4,"translate"),a()()),n&2){let t=d();r(3),_(l(4,1,t.messageKey))}}function P(n,E){if(n&1){let t=f();o(0,"div",2)(1,"p",11),s(2),c(3,"translate"),a(),o(4,"button",12),I("click",function(){C(t);let e=d();return A(e.onConfirmAction())}),s(5),c(6,"translate"),a()()}if(n&2){let t=d();r(2),_(l(3,2,t.messageKey)),r(3),w(" ",l(6,4,t.ctaKey)," ")}}function D(n,E){if(n&1){let t=f();o(0,"div",2)(1,"div",13),T(),o(2,"svg",14),h(3,"path",15),a()(),v(),o(4,"p",11),s(5),c(6,"translate"),a(),o(7,"button",12),I("click",function(){C(t);let e=d();return A(e.onContinue())}),s(8),c(9,"translate"),a()()}if(n&2){let t=d();r(5),_(l(6,2,t.messageKey)),r(3),w(" ",l(9,4,"V2.AUTH_ACTION.CONTINUE")," ")}}function G(n,E){if(n&1){let t=f();o(0,"div",2)(1,"div",16),T(),o(2,"svg",17),h(3,"path",18),a()(),v(),o(4,"p",11),s(5),c(6,"translate"),a(),o(7,"button",12),I("click",function(){C(t);let e=d();return A(e.onContinue())}),s(8),c(9,"translate"),a()()}if(n&2){let t=d();r(5),_(l(6,2,t.messageKey)),r(3),w(" ",l(9,4,"V2.AUTH_ACTION.GO_TO_LOGIN")," ")}}var K={verifyEmail:{heading:"V2.AUTH_ACTION.HEADING_VERIFY_EMAIL",confirm:"V2.AUTH_ACTION.CONFIRM_VERIFY_EMAIL",cta:"V2.AUTH_ACTION.CTA_VERIFY_EMAIL",pending:"V2.AUTH_ACTION.PENDING_VERIFY_EMAIL",success:"V2.AUTH_ACTION.SUCCESS_VERIFY_EMAIL",continueToHome:!0},recoverEmail:{heading:"V2.AUTH_ACTION.HEADING_RECOVER_EMAIL",confirm:"V2.AUTH_ACTION.CONFIRM_RECOVER_EMAIL",cta:"V2.AUTH_ACTION.CTA_RECOVER_EMAIL",pending:"V2.AUTH_ACTION.PENDING_RECOVER_EMAIL",success:"V2.AUTH_ACTION.SUCCESS_RECOVER_EMAIL"},verifyAndChangeEmail:{heading:"V2.AUTH_ACTION.HEADING_CHANGE_EMAIL",confirm:"V2.AUTH_ACTION.CONFIRM_CHANGE_EMAIL",cta:"V2.AUTH_ACTION.CTA_CHANGE_EMAIL",pending:"V2.AUTH_ACTION.PENDING_CHANGE_EMAIL",success:"V2.AUTH_ACTION.SUCCESS_CHANGE_EMAIL"}},Q=(()=>{class n{constructor(t,i,e){this.route=t,this.router=i,this.cdr=e,this.status="pending",this.headingKey="V2.AUTH_ACTION.HEADING_DEFAULT",this.messageKey="V2.AUTH_ACTION.PENDING_DEFAULT",this.ctaKey="V2.AUTH_ACTION.CTA_VERIFY_EMAIL",this.continueUrl=null,this.oobCode="",this.applyConfig=null,this.signedInVerified=!1}ngOnInit(){let t=this.route.snapshot.queryParamMap,i=t.get("mode"),e=t.get("oobCode")??"";if(this.continueUrl=t.get("continueUrl"),!e||!i){this.setError("V2.AUTH_ACTION.HEADING_ERROR","V2.AUTH_ACTION.ERROR_INVALID_LINK");return}if(i==="resetPassword"){let m={oobCode:e};this.continueUrl&&(m.continueUrl=this.continueUrl),this.router.navigate(["/v2/reset-password"],{queryParams:m,replaceUrl:!0});return}let p=K[i];if(!p){this.setError("V2.AUTH_ACTION.HEADING_ERROR","V2.AUTH_ACTION.ERROR_UNSUPPORTED");return}this.oobCode=e,this.applyConfig=p,this.headingKey=p.heading,this.messageKey=p.confirm,this.ctaKey=p.cta,this.status="confirm"}onConfirmAction(){this.status!=="confirm"||!this.applyConfig||(this.status="pending",this.messageKey=this.applyConfig.pending,this.applyCode(this.oobCode,this.applyConfig.success,this.applyConfig.continueToHome===!0))}onContinue(){if(this.continueUrl&&this.isSafeContinueUrl(this.continueUrl)){window.location.assign(this.continueUrl);return}this.router.navigate([this.signedInVerified?"/v2/home":"/v2/login"])}async applyCode(t,i,e=!1){try{if(await k(x(),t),this.status="success",this.messageKey=i,e){try{await x().currentUser?.reload()}catch{}this.signedInVerified=x().currentUser?.emailVerified===!0}}catch(p){let m=p?.code??"";m==="auth/expired-action-code"||m==="auth/invalid-action-code"?this.setError("V2.AUTH_ACTION.HEADING_ERROR","V2.AUTH_ACTION.ERROR_LINK_EXPIRED"):this.setError("V2.AUTH_ACTION.HEADING_ERROR","V2.AUTH_ACTION.ERROR_GENERIC")}finally{this.cdr.markForCheck()}}setError(t,i){this.status="error",this.headingKey=t,this.messageKey=i,this.cdr.markForCheck()}isSafeContinueUrl(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}static{this.\u0275fac=function(i){return new(i||n)(g(b),g(R),g(O))}}static{this.\u0275cmp=y({type:n,selectors:[["app-v2-auth-action"]],decls:13,vars:7,consts:[[1,"login-page","tw-min-h-[100dvh]","tw-bg-mech-bg","tw-flex","tw-items-center","tw-justify-center","tw-p-4"],[1,"login-card","tw-bg-mech-surface","tw-rounded-[40px]","tw-p-8","md:tw-p-12","tw-max-w-md","tw-w-full","tw-shadow-2xl","tw-shadow-blue-500/5","tw-space-y-8","tw-border","t
1w-border-mech-border"],[1,"tw-text-center","tw-space-y-4"],[1,"tw-flex","tw-justify-center"],[1,"tw-w-16","tw-h-16","tw-rounded-2xl","tw-bg-mech-primary","tw-flex","tw-items-center","tw-justify-center","tw-shadow-lg","tw-shadow-blue-500/20"],["cssClass","tw-w-10 tw-h-10 tw-text-white"],[1,"tw-text-3xl","tw-font-[900]","tw-text-mech-text","tw-tracking-tight"],["class","tw-text-center tw-space-y-3 tw-py-4",4,"ngIf"],["class","tw-text-center tw-space-y-4",4,"ngIf"],[1,"tw-text-center","tw-space-y-3","tw-py-4"],["aria-hidden","true",1,"tw-w-8","tw-h-8","tw-mx-auto","tw-rounded-full","tw-border-2","tw-border-mech-border","tw-border-t-mech-primary","tw-animate-spin"],[1,"tw-text-sm","tw-text-mech-text-muted"],["type","button",1,"mech-btn-primary","tw-w-full","tw-py-4","tw-text-sm",3,"click"],[1,"tw-w-16","tw-h-16","tw-rounded-full","tw-bg-green-50","tw-flex","tw-items-center","tw-justify-center","tw-mx-auto"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","stroke-width","2","aria-hidden","true",1,"tw-w-8","tw-h-8","tw-text-green-500"],["stroke-linecap","round","stroke-linejoin","round","d","M5 13l4 4L19 7"],[1,"tw-w-16","tw-h-16","tw-rounded-full","tw-bg-red-900/20","tw-flex","tw-items-center","tw-justify-center","tw-mx-auto"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","stroke-width","2","aria-hidden","true",1,"tw-w-8","tw-h-8","tw-text-red-400"],["stroke-linecap","round","stroke-linejoin","round","d","M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"]],template:function(i,e){i&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5,"app-mech-logo",5),a()(),o(6,"h1",6),s(7),c(8,"translate"),a()(),V(9,L,5,3,"div",7)(10,P,7,6,"div",8)(11,D,10,6,"div",8)(12,G,10,6,"div",8),a()()),i&2&&(r(7),w(" ",l(8,5,e.headingKey)," "),r(2),u("ngIf",e.status==="pending"),r(),u("ngIf",e.status==="confirm"),r(),u("ngIf",e.status==="success"),r(),u("ngIf",e.status==="error"))},dependencies:[U,N,S,M,H],styles:["[_nghost-%COMP%]{display:block}.login-page[_ngcontent-%COMP%]{box-sizing:border-box;height:100dvh;min-height:100dvh;align-items:flex-start;padding-block:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior-y:contain;font-family:Inter,ui-sans-serif,system-ui,sans-serif;color:var(--color-text)}.login-card[_ngcontent-%COMP%]{flex:0 0 auto;margin-block:auto;animation:_ngcontent-%COMP%_login-card-enter .4s cubic-bezier(.16,1,.3,1) both}.auth-back-row[_ngcontent-%COMP%]{position:sticky;top:max(0px,env(safe-area-inset-top));z-index:2;width:calc(100% + 16px);margin-block:-8px;margin-inline:-8px;border-radius:12px;background:color-mix(in srgb,var(--color-surface) 92%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}@media(max-width:399px){.login-page[_ngcontent-%COMP%]{padding-inline:12px}.login-card[_ngcontent-%COMP%]{min-width:0;padding:24px;border-radius:32px}.login-card[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{overflow-wrap:anywhere}.auth-input-leading[_ngcontent-%COMP%]{display:none}.auth-input-control[_ngcontent-%COMP%]{padding-left:16px}}@keyframes _ngcontent-%COMP%_login-card-enter{0%{opacity:0;transform:scale(.95) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}"],changeDetection:0})}}return n})();export{Q as V2AuthActionComponent};
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.