1import{a as B}from"./chunk-XSBQJWFC.js";import{a as z}from"./chunk-TUKJRVTR.js";import{c as K,e as O}from"./chunk-NRNLTANT.js";import"./chunk-YBEOIROC.js";import"./chunk-745BQPOS.js";import"./chunk-EHD4YHFX.js";import{b as j}from"./chunk-E3H4BJ7I.js";import"./chunk-PFLDZXT3.js";import{a as N}from"./chunk-ASTXUBF3.js";import{H as q,Ja as X,Ka as J,W as G,i as h,n as U,ya as H}from"./chunk-XNTCN5LM.js";import{Da as r,G as y,I as x,Kb as R,Kc as A,Ma as w,Nb as c,Pb as M,Sb as g,Tb as u,Ub as C,aa as a,ca as E,da as b,db as l,eb as m,gd as I,ha as V,jb as D,jd as P,kb as o,kc as F,la as p,lb as s,mb as _,qa as L,r as S,tb as T,wb as k,yb as d}from"./chunk-5LGYDGR4.js";import"./chunk-HIUAR4UN.js";function W(t,f){t&1&&(o(0,"div",0)(1,"h3",1),c(2,"Please wait while we verify your email address."),s(),o(3,"div",2),_(4,"fx-icon",3),s()())}function Y(t,f){t&1&&(o(0,"fx-button",6),c(1,"Deposit"),s())}function Z(t,f){if(t&1&&(o(0,"span",9),c(1),s()),t&2){let e=d(3);r(),M("Resend available in ",e.remainingSeconds(),"s")}}function $(t,f){if(t&1){let e=T();o(0,"fx-button",8),k("click",function(){E(e);let i=d(2);return b(i.triggerEmail())}),c(1," Resend verification email "),s(),l(2,Z,2,1,"span",9)}if(t&2){d();let e=C(0);R("disabled",e),r(2),m(e?2:-1)}}function ee(t,f){if(t&1&&(g(0),o(1,"div",0)(2,"h3"),c(3,"Email verification"),s(),o(4,"fx-card")(5,"fx-card-body"),_(6,"fx-cms-article",4),o(7,"div",5),l(8,Y,2,0,"fx-button",6)(9,$,3,3),o(10,"fx-button",7),c(11,"Go to lobby"),s()()()()()),t&2){let e=d(),n=C(0),i=C(1);u(e.coolDown());let v=e.verificationStatus();r(6),D("article",n)("isLoading",i),r(2),m(v?8:9)}}var ue=(()=>{class t{triggerEmail(){this.emailVerifyService.sendVerificationEmail(({title:e,message:n,type:i})=>{this.toasts.show({title:e,message:n},{type:i})})}constructor(){this.route=a(I),this.accountService=a(j),this.auth=a(N),this.destroyRef=a(V),this.cmsService=a(K),this.toasts=a(H),this.emailVerifyService=a(B),this.player=a(z).player,this.coolDown=this.emailVerifyService.cooldownService.isCooldown,this.remainingSeconds=this.emailVerifyService.cooldownService.remainingSeconds,this.isLoading=p(!0),this.verificationStatus=p(!1),this.cmsContent=p(null),L(()=>{let e=this.player();e&&F(()=>{if(e.emailVerified){this.verificationStatus.set(!0),this.fetchCmsContent(!0),this.isLoading.set(!1);return}this.route.queryParamMap.pipe(y(1),h(this.destroyRef)).subscribe(n=>{let i=n.get("token")??"";if(!i){this.fetchCmsContent(!1);return}this.confirmEmailVerification(i)})})})}fetchCmsContent(e){let n=e?"activation-success":"activation-unsuccess";this.isLoading.set(!0),this.cmsService.getCmsContent(n).pipe(h(this.destroyRef),S(i=>i),x(()=>this.isLoading.set(!1))).subscribe({next:i=>this.cmsContent.set(i),error:i=>console.error(i.error)})}confirmEmailVerification(e){this.accountService.confirmEmailVerification(e).pipe(x(()=>this.isLoading.set(!1)),h(this.destroyRef)).subscribe({next:()=>{this.verificationStatus.set(!0),this.auth.signInSilent().then(()=>this.fetchCmsContent(!0))},error:()=>{this.verificationStatus.set(!1),this.fetchCmsContent(!1)}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=w({type:t,selectors:[["fx-activate"]],decls:4,vars:4,consts:[[1,"container-slim"],[1,"text-center"],[1,"d-flex","justify-content-center","my-5"],["icon","warning","size","large"],[1,"mt-0",3,"article","isLoading"],[1,"d-flex","flex-column","gap-4","text-center"],["btnType","brand","routerLink","/cashier/deposit"],["btnType","secondary","routerLink","/"],["btnType","brand",3,"click"],[1,"cooldown-msg"]],template:function(n,i){if(n&1&&(g(0)(1),l(2,W,5,0,"div",0),l(3,ee,12,4,"div",0)),n&2){let v=u(i.cmsContent());r();let Q=u(i.isLoading());r(),m(Q?2:-1),r(),m(v?3:-1)}},dependencies:[A,q,U,O,X,J,G,P],styles:["fx-cms-article .container{padding:0}"],changeDetection:1})}}return t})();export{ue as EmailVerificationComponent};
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.