1import{c as ke,d as Be,e as We,f as De}from"./chunk-KVP3H224.js";import{Nc as be,Qc as Ae,ye as Ge}from"./chunk-6QDVQ5WV.js";import{$a as d,Ac as ce,Ba as Y,Ec as me,Fc as Ee,Ha as f,Hc as ue,Ia as A,Ib as w,In as Fe,Ja as N,Jb as g,K as q,Ln as Le,Mc as de,Mm as Me,N as b,O as C,Oa as F,Pa as r,Pc as Se,Qa as a,Qc as Ce,Ra as u,Sc as Te,Sl as ge,Vg as Ne,Vq as Pe,W as J,Wb as re,Ya as L,Z as p,Za as Z,_a as ee,ac as ae,am as ve,c as x,ca as T,da as I,db as te,eb as h,ec as se,fb as l,fc as $,gl as we,i as z,jb as ie,jn as Ve,k as y,kb as oe,kq as $e,l as E,lb as ne,m as V,md as R,mh as he,pm as Re,pu as xe,rc as S,sa as c,sw as ye,tb as G,tc as le,ub as k,uc as _e,um as Oe,v as H,vc as pe,wg as Ie,xg as fe,y as j,ya as K,yc as v,za as Q}from"./chunk-6VDOBKBI.js";import"./chunk-UNNH6OJB.js";import{h as P}from"./chunk-HE2D45TV.js";var ze=i=>i?.confirmPassword?i.confirmPassword:null,Ue={provide:Ie,useValue:ze,multi:!0};var Je=["reCaptchaComponent"];function Ke(i,_){if(i&1){let e=L();r(0,"div",12)(1,"p"),d(2,3),a(),r(3,"button",14),h("click",function(){T(e);let o=l();return I(o.firebaseAuth.signOut())}),d(4,4),a()()}}function Qe(i,_){if(i&1&&(r(0,"span",15),G(1),a()),i&2){let e=l();c(),k(e.error)}}function Ye(i,_){if(i&1){let e=L();r(0,"re-captcha",30,0),h("resolved",function(o){T(e);let n=l(4);return I(n.v2recaptchaResolved(o))}),a()}}function Ze(i,_){if(i&1){let e=L();r(0,"h2",16),G(1),a(),r(2,"div",17)(3,"form",18),u(4,"ww-input",19)(5,"ww-input",20)(6,"ww-password",21)(7,"ww-password",22),f(8,Ye,2,0,"re-captcha"),w(9,"async"),r(10,"button",23),w(11,"async"),h("click",function(){T(e);let o=l(),n=l(2);return I(n.resolveWithPassword(o.inviteId))}),d(12,5),a()(),r(13,"a",24),d(14,6),a(),u(15,"ww-section-divider",25),r(16,"ww-login-button-google",26),h("signInResult",function(o){T(e);let n=l(),m=l(2);return I(m.onGoogleSignIn(o,n.inviteId,n.invitedEmail,n.inviteName))}),a(),r(17,"p",27),Z(18,7),u(19,"a",28)(20,"a",29),ee(),a()()}if(i&2){let e=l(),t=l(2);c(),k(e.title),c(2),F("formGroup",t.formGroup),c(2),F("readonly",!0),c(3),N(g(9,5,t.showRecaptchaPrompt$)?8:-1),c(2),F("disabled",t.formGroup.invalid||g(11,7,t.missingRecaptchaToken$))}}function et(i,_){i&1&&f(0,Qe,2,1,"span",15)(1,Ze,21,9),i&2&&N(_.error?0:1)}function tt(i,_){i&1&&(r(0,"div",13),u(1,"mat-spinner"),a())}function it(i,_){if(i&1&&(f(0,et,2,1),w(1,"async"),A(2,tt,2,0,"div",13)),i&2){let e,t=l();N((e=g(1,1,t.vm$))?0:2,e)}}function ot(i,_){i&1&&(r(0,"div",13),u(1,"mat-spinner"),a())}var Xe=(()=>{class i extends we{confirmPasswordValidator(e){return this.passwordFormControl.value===e.value?null:{confirmPassword:$localize`Passwords do not match`}}constructor(){super(),this.firebaseAuth=p(he),this.inviteRx=p(xe),this.recaptchaV3Service=p(We),this.resolveInviteWrite=p(ye),this.route=p(de),this.router=p(Se),this.snackBar=p(Ve),this.passwordFormControl=new v("",{validators:[S.required,S.minLength(8),S.maxLength(100),fe.password],nonNullable:!0}),this.confirmPasswordFormControl=new v("",{validators:[S.required,e=>this.confirmPasswordValidator(e)],nonNullable:!0}),this.formGroup=new pe({name:new v("",{validators:[S.required],nonNullable:!0}),email:new v("",{nonNullable:!0}),password:this.passwordFormControl,confirmPassword:this.confirmPasswordFormControl}),this.inviteId$=this.route.params.pipe(E(e=>e.inviteId),H(e=>!!e&&typeof e=="string")),this.invite$=this.inviteId$.pipe(b(e=>this.inviteRx.getResolvedInvite(e)),j(()=>z(null)),q({refCount:!0,bufferSize:1})),this.recaptchaVersionSub=new x("v3"),this.recaptchaV2TokenSub=new x(null),this.recaptchaToken$=this.recaptchaVersionSub.pipe(b(e=>e==="v2"?this.recaptchaV2TokenSub.pipe(E(t=>({token:t,version:e}))):this.recaptchaV3Service.execute(Pe.inviteResolve).pipe(E(t=>({token:t,version:e}))))),this.showRecaptchaPrompt$=this.recaptchaVersionSub.pipe(E(e=>e==="v2")),this.vm$=V([this.inviteId$,this.invite$]).pipe(E(([e,t])=>t?{title:$localize`You've been invited to join ${t.businessName}`,inviteId:e,invitedEmail:t.email,inviteName:t.name}:{error:$localize`Invite was not found or has been removed.`})),this.missingRecaptchaToken$=V([this.recaptchaVersionSub,this.recaptchaV2TokenSub]).pipe(E(([e,t])=>e==="v2"&&!t)),this.subscribeToError(),this.subscribeToResponse(),this.subscribeToUpdateForm()}v2recaptchaResolved(e){this.recaptchaV2TokenSub.next(e)}resolveWithPassword(e){return P(this,null,function*(){if(R(e)||this.formGroup.invalid||!this.formGroup.value.name||!this.formGroup.value.password)return;let{token:t,version:o}=yield y(this.recaptchaToken$);t&&this.resolveInviteWrite.payload.next({inviteId:e,payload:{name:this.formGroup.value.name,password:this.formGroup.value.password,recaptcha:`${o}:${t}`}})})}onGoogleSignIn(e,t,o,n){return P(this,null,function*(){if(!e||R(t)||R(o)||R(n))return;if(e.user.email!==o){this.snackBar.open({message:$localize`You are attempting to use an email address that does not match the invite. Please sign in using the invited email.`}),this.firebaseAuth.signOut();return}let{token:m,version:O}=yield y(this.recaptchaToken$);m&&this.resolveInviteWrite.payload.next({inviteId:t,payload:{name:n,userId:e.user.uid,recaptcha:`${O}:${m}`}})})}subscribeToError(){this.resolveInviteWrite.error$.pipe(C(this.ngOnDestroy$)).subscribe(e=>{if(!(e instanceof se)||!Ne(e.error))return;this.recaptchaVersionSub.value==="v3"&&e.error.statusCode===$.Forbidden?(this.snackBar.open({message:$localize`Additional verification is required. Please complete the recaptcha flow below and re-submit the form.`}),this.recaptchaVersionSub.next("v2")):e.error.statusCode!==$.Ok&&(this.snackBar.open({message:$localize`The recaptcha verification failed. Please try again.`}),this.recaptchaV2TokenSub.value&&this.recaptchaV2TokenSub.next(null),this.reCaptchaComponent&&this.reCaptchaComponent.reset())})}subscribeToResponse(){V([this.resolveInviteWrite.response$,this.resolveInviteWrite.payload$,this.invite$]).pipe(C(this.ngOnDestroy$)).subscribe(([e,t,o])=>{e.statusCode===$.Ok&&o?.email&&t.payload.password&&this.firebaseAuth.signInWithEmailAndPassword(o?.email,t.payload.password).then(()=>{this.router.navigateByUrl("")})})}subscribeToUpdateForm(){this.invite$.pipe(C(this.ngOnDestroy$)).subscribe(e=>{this.formGroup.patchValue({email:e?.email??"",name:e?.name??""},{emitEvent:!1})}),this.passwordFormControl.valueChanges.pipe(C(this.ngOnDestroy$)).subscribe(()=>{this.confirmPasswordFormControl.updateValueAndValidity()})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=K({type:i,selectors:[["ww-resolve-invite"]],viewQuery:function(t,o){if(t&1&&ie(Je,5),t&2){let n;oe(n=ne())&&(o.reCaptchaComponent=n.first)}},hostAttrs:[1,"ww-resolve-invite"],standalone:!1,features:[Y],decls:12,vars:3,consts:()=>{let e;e=$localize`Have an account?`;let t;t=$localize` Log in`;let o;o=$localize`Sign out`;let n;n=$localize` You can not resolve an invite while logged in as an existing user. `;let m;m=$localize` Sign out `;let O;O=$localize`Full name`;let B;B=$localize`Email`;let W;W=$localize`Password`;let D;D=$localize`Confirm password`;let U;U=$localize` Join `;let X;X=$localize` Join with SSO `;let M;return M=$localize` By signing up, you agree to our ${"\uFFFD#19\uFFFD"}:START_LINK: Terms of use ${"[\uFFFD/#19\uFFFD|\uFFFD/#20\uFFFD]"}:CLOSE_LINK: and ${"\uFFFD#20\uFFFD"}:START_LINK_1: Privacy Policy ${"[\uFFFD/#19\uFFFD|\uFFFD/#20\uFFFD]"}:CLOSE_LINK:. `,M=te(M),[["reCaptchaComponent",""],e,t,n,m,U,X,M,[1,"flex","justify-between","w-full","p-6"],["href","https://waitwhile.com",1,"inline-flex"],["width","112","src","./assets/logos/waitwhile-logo.svg"],["routerLink","/login","wwColor","primary"],[1,"flex","flex-col","gap-6","max-w-sm"],[1,"flex","justify-center","p-4"],["wwButton","","aria-label",o,3,"click"],["wwColor","warning",1,"mt-8"],[1,"text-center"],[1,"ww-resolve-invite-wrapper"],["wwForm","",1,"flex","flex-col","gap-4","items-stretch",3,"formGroup"],["label",O,"formControlName","name"],["label",B,"formControlName","email",3,"readonly"],["label",W,"formControlName","password","type","new-password"],["label",D,"formControlName","confirmPassword","type","new-password"],["wwButton","","type","submit",3,"click","disabled"],["routerLink","/login/sso","wwColor","primary",1,"text-center"],[1,"mt-2","mb-2"],[3,"signInResult"],[1,"ww-typography-body2","text-center"],["wwColor","primary","href","https://waitwhile.com/terms/","target","_blank"],["wwColor","primary","href","https://waitwhile.com/privacy/","target","_blank"],[3,"resolved"]]},template:function(t,o){if(t&1&&(r(0,"div",8)(1,"a",9),u(2,"img",10),a(),r(3,"span")(4,"span"),d(5,1),a(),r(6,"a",11),d(7,2),a()()(),f(8,Ke,5,0,"div",12),w(9,"async"),A(10,it,3,3)(11,ot,2,0,"div",13)),t&2){let n;c(8),N((n=g(9,1,o.firebaseAuth.authStateName$))==="loggedIn"?8:n==="loggedOut"?10:11)}},dependencies:[Me,ge,Re,ve,Oe,Fe,Le,ce,le,_e,Ee,me,be,Ce,ke,re],styles:[`.ww-resolve-invite{background:var(--ww-color-white);min-height:100%;display:flex;flex-direction:column;align-items:center}.ww-resolve-invite .ww-resolve-invite-wrapper{margin-top:40px;margin-bottom:80px;width:330px;
1display:flex;flex-direction:column;align-items:stretch;gap:1em}.ww-resolve-invite re-captcha div{margin:0 auto} 2/*noopresolve-invite.component-ONMGWBB7.css.map */ 3`],encapsulation:2,changeDetection:0})}}return i})();var Jt=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=Q({type:i})}static{this.\u0275inj=J({providers:[Ue],imports:[ae,Ge,$e,ue,Ae,Te.forChild([{path:":inviteId",component:Xe}]),Be,De]})}}return i})();export{Ue as ERROR_PIPE_HANDLER_PROVIDER,Jt as WwInvitesModule,Xe as WwResolveInviteComponent,ze as errorPipeHandler}; 4//noopchunk-GALXYXIV.js.map
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.