1import{b as ht,m as ct,o as pt,p as N}from"./chunk-SQXH55RY.js";import{D as nt,N as lt,O as j,t as V,x as A}from"./chunk-2RZNBXEW.js";import{b as at,c as ot}from"./chunk-WUS6VI32.js";import{A as rt,ca as it,d as E,e as tt,ea as st,h as et,k as y,ra as k,sa as D}from"./chunk-LKIBVTZY.js";import{b as O}from"./chunk-IXSVJUWF.js";import{e as v,j as h,s as Z}from"./chunk-LZGEQQYD.js";import{R as X,Sa as z,X as J,_b as b,ka as T,ra as _}from"./chunk-BW2TMJN6.js";import{j as x}from"./chunk-RNQ7BUHW.js";var mt=(()=>{let l=class l{transform(t){return t||(t=0),t.toString().replace(/[,]+/g,"")}};l.\u0275fac=function(e){return new(e||l)},l.\u0275pipe=Z({name:"reverseFormat",type:l,pure:!0,standalone:!0});let p=l;return p})();var dt=(()=>{let l=class l{constructor(t,e,s,a,i,r){this.globalData=t,this.langService=e,this.gameListCacheService=s,this.appConfigService=a,this.translate=i,this.swalDialog=r,this.isTopExist=!1,this.nowFilter="",this.nowFilterDisplay="",this.resourceInfoSharedPrefix=this.appConfigService.getConfig("resourceInfoSharedPrefix"),this.resourceAssetSharedPrefix=this.appConfigService.getConfig("resourceAssetSharedPrefix")}getGameListData(t,e,s){this.globalData.loading=!0;let a="".concat(this.resourceInfoSharedPrefix,"/").concat(at,"/EGAME-").concat(t,".json");this.gameListCacheService.getJsonData({name:t,url:a}).subscribe(i=>{if(i){this.gameListData=i,this.gameListData.game.forEach(o=>{o.loadImgStatus=null}),this.gameListData.game=this.convertGameFormat(this.gameListData.game),this.originArry=this.gameListData.game,this.gameListData.game&&(this.isTopExist=typeof this.gameListData.game.find(o=>o.isTop===1)<"u"),this.gameListData.game.sort((o,c)=>c.gameIndex-o.gameIndex);let r=[],n=[];this.gameListData.category.forEach(o=>{n.filter(c=>c.category===o.category).length==0&&n.push({category:o.category})}),n.forEach(o=>{let c=this.gameListData.category.filter(m=>m.category===o.category&&m.language===this.langService.language.toUpperCase());if(c.length>0)r.push({category:c[0].category,displayValue:c[0].displayValue,language:c[0].language,orderIndex:c[0].orderIndex});else{let m=this.gameListData.category.filter(u=>u.category===o.category&&u.language==="EN-US");m.length>0&&r.push({category:m[0].category,displayValue:m[0].displayValue,language:m[0].language,orderIndex:m[0].orderIndex})}}),this.gameListData.category=r,this.gameListData.category=this.gameListData.category.filter(o=>this.gameListData.game.filter(c=>c.category===o.category).length>0)}if(e.indexOf("Fishing")>-1?this.nowFilter="FISHING":e.indexOf("Crash")>-1?this.nowFilter="CRASH":this.isTopExist?this.nowFilter="topGames":this.gameListData&&this.gameListData.game&&(this.gameListData.category.length?this.nowFilter=this.gameListData.category[0].category:this.nowFilter="allGames"),this.nowFilter!=""&&this.nowFilter!="topGames"&&this.nowFilter!="allGames"&&this.gameListData.category.length){let r=this.gameListData.category.filter(n=>n.category==this.nowFilter);r.length?this.nowFilterDisplay=r[0].displayValue:this.nowFilterDisplay=this.gameListData.category[0].displayValue}if(this.globalData.loading=!1,s){let r=this.getGameNameByCode(s);this.swalDialog.popMessage(this.translate.instant("codeMessage.51051").replace("{0}",r),0,()=>window.close())}},i=>{this.gameListData={category:[],game:[]},this.originArry=[],this.globalData.loading=!1,this.isTopExist=!1})}convertGameFormat(t){let e=this.langService.language.toUpperCase(),s="".concat(this.resourceAssetSharedPrefix,"/").concat(ot);return t.reduce((i,r)=>{if(this.globalData.handleCurrencyIsShow(r.supportCurrency)&&this.globalData.handlePlatformIsShow(r.supportClient)){let o=null,c=r.language.filter(m=>m.language===e);if(c.length>0?o=c[0]:o=r.language.filter(m=>m.language==="EN-US")[0],o===void 0)return i;r.nameByLang=this.globalData.convertCharacterRefference(o.name),r.imgIdByLang="".concat(s,"/").concat(o.imgId),i.push(r)}return i},[])}getGameNameByCode(t){let e=this.langService.language.toUpperCase(),s,a=this.gameListData.game.filter(i=>i.gameCode===t);return a&&a.length>0?(s=a[0].language.filter(i=>i.language===e),(!s||s.length===0)&&(s=a[0].language.filter(i=>i.language==="EN-US")),s[0].name):""}};l.\u0275fac=function(e){return new(e||l)(h(D),h(y),h(nt),h(O),h(et),h(k))},l.\u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"});let p=l;return p})();var ut=(()=>{let l=class l{constructor(t,e,s){this.userDetectService=t,this.globalData=e,this.http=s}traceGameClick(t,e,s,a,i){if(!this.globalData.isLogin)return;
1let r={ProviderId:t,GameCode:e,GameName:s,DisplayIndex:a,LocationType:i};r.SiteMode=this.userDetectService.isApp?"A":this.globalData.isMobileStyle?"M":"W",r.ClientDevice=this.userDetectService.getSiteMode(),this.http.traceGameClick(r).subscribe()}};l.\u0275fac=function(e){return new(e||l)(h(E),h(D),h(A))},l.\u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"});let p=l;return p})();var P="game";var Bt="SportsBook",Mt="LiveCasino",U="EGAME",R="FishHunter",W="CrashGame",Ct="Lottery",Y="Poker",wt="Racing";var Rt={[Bt]:P,[Mt]:P,[U]:P,[R]:P,[W]:P,[Ct]:P,[Y]:P,[wt]:P};var vt=(()=>{let l=class l{constructor(){this.userAgent=navigator.userAgent||""}isIOS(){return/iPhone|iPad|iPod/.test(this.userAgent)}isGoogleApp(){return/GSA/.test(this.userAgent)}isIOSGoogleApp(){return this.isIOS()&&this.isGoogleApp()}isInAppBrowser(){return/FBAN|FBAV|Instagram|Line/.test(this.userAgent)}};l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"});let p=l;return p})();var St=(()=>{let l=class l{constructor(t,e,s,a,i,r,n){this.globalData=t,this.httpService=e,this.cmsService=s,this.accountInfoService=a,this.storageService=i,this.langService=r,this.menuService=n,this.providerBalanceList=[],this.totalWalletBalance=0,this.totalWalletBalanceHasChecked=!1,this.totalWalletBalanceLoading=!1,this.isOpenAll=!1,this.isComponentAlive=!0}loadIndex(t){var e;((e=this.menuService.providerMenuList)==null?void 0:e.length)>0?(this.accountInfoService.getBalance(),t&&this.checkBalanceByTotal()):this.menuService.getProviderMenu("report").then(()=>{this.accountInfoService.getBalance(),t&&this.checkBalanceByTotal()})}checkMainWalletBalance(){this.globalData.walletLoading=!0;let t={providerId:""};this.httpService.getBalance(t).subscribe(e=>{e.code===0&&(this.globalData.acctInfo&&(this.globalData.acctInfo.balance=e.data.balance),this.storageService.setCookie("acctInfo",JSON.stringify(this.globalData.acctInfo)),this.sumTotal("-",parseFloat(e.data.balance).toFixed(2)),T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.globalData.walletLoading=!1}))})}checkBalanceByTotal(){this.totalWalletBalanceLoading=!0,this.httpService.getMemTransferProvider({}).subscribe(t=>{if(t.code===0){let e=t.data.providerList;this.menuService.fetchProviderData();for(let s=0;s<this.menuService.providerMenuList.length;s++){this.menuService.providerMenuList[s].hasChecked=!0;for(let a=0;a<this.menuService.providerMenuList[s].subMenu.length;a++){let i=this.menuService.providerMenuList[s].subMenu[a];i.hasChecked=!1;let r=this.menuService.providerStatus.find(o=>o.providerId===i.providerId);r&&(i.transferActive=r.transferActive===1,i.sourceActive=r.sourceActive===1,i.gameActive=r.gameActive===1);let n=!(i!=null&&i.transferActive)&&!(i!=null&&i.sourceActive)&&!(i!=null&&i.gameActive)||e.indexOf(i.providerId)===-1;this.checkBalanceByProvider(i.providerId,!0,n)}}}})}checkBalanceByProduct(t){let e=this.menuService.providerMenuList.find(s=>s.product===t);if(!e||e.hasChecked||!e.subMenu||e.subMenu.length===0){e.hasChecked=!0;return}this.httpService.getMemTransferProvider({}).subscribe(s=>{if(s.code===0){let a=s.data.providerList;this.menuService.fetchProviderData();for(let i=0;i<e.subMenu.length;i++){let r=e.subMenu[i],n=this.menuService.providerStatus.find(c=>c.providerId===r.providerId);n&&(r.transferActive=n.transferActive===1,r.sourceActive=n.sourceActive===1,r.gameActive=n.gameActive===1);let o=!(r!=null&&r.transferActive)&&!(r!=null&&r.sourceActive)&&!(r!=null&&r.gameActive)||a.indexOf(r.providerId)===-1;this.checkBalanceByProvider(r.providerId,!0,o,t),e.hasChecked=!0}}})}checkBalanceByProvider(t,e,s,a){let i=[];if(a?this.menuService.providerMenuList.map(r=>{if(r.product===a){let n=r.subMenu.find(o=>o.providerId===t);n&&i.push(n)}}):this.menuService.providerMenuList.map(r=>{let n=r.subMenu.find(o=>o.providerId===t);n&&i.push(n)}),!(i.length<0||i[0].hasChecked||i[0].walletLoading)){if(s==null){this.menuService.fetchProviderData();let r=this.menuService.providerStatus.find(n=>n.providerId===t);s=(r==null?void 0:r.transferActive)!==1&&(r==null?void 0:r.sourceActive)!==1&&(r==null?void 0:r.gameActive)!==1}if(!s&&!e)this.httpService.getMemTransferProvider({}).subscribe(r=>{if(r.code===0)if(r.data.providerList.indexOf(t)>-1){this.updateProvider(i,!0,null,null);let o={providerId:t};this.httpService.getBalance(o).subscribe(c=>{c.code===0?(this.updateProvider(i,null,!0,c.data.balance),this.sumTotal(t,parseFloat(c.data.balance).toFixed(2)),T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.updateProvider(i,!1,null,null)})):this.updateProvider(i,!1,null,null)})}else this.updateProvider(i,null,!0,0),T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.totalWalletBalanceLoading=!1,this.totalWalletBalanceHasChecked=!0,this.accountInfoService.isProviderListOpen=!0})});else if(!s&&e){this.updateProvider(i,!0,null,null);let r={providerId:t};this.httpService.getBalance(r).subscribe(n=>{n.code===0?(this.updateProvider(i,null,!0,n.data.balance),this.sumTotal(t,parseFloat(n.data.balance).toFixed(2)),T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.updateProvider(i,!1,null,null)})):this.updateProvider(i,!1,null,null)})}else s&&(this.updateProvider(i,null,!0,0),T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.totalWalletBalanceLoading=!1,this.totalWalletBalanceHasChecked=!0,this.accountInfoService.isProviderListOpen=!0}))}}updateProvider(t,e,s,a){t.forEach(i=>
1{e!=null&&(i.walletLoading=e),s!=null&&(i.hasChecked=s),a!=null&&(i.balance=a)})}sumTotal(t,e){var s,a;if(this.providerBalanceList[t]=e,this.menuService.providerMenuList.some(i=>i.subMenu.some(r=>r.hasChecked))){this.totalWalletBalance=parseFloat(((s=this.globalData.acctInfo)==null?void 0:s.balance)||"0")+parseFloat(((a=this.globalData.acctInfo)==null?void 0:a.bonus)||"0");for(let i in this.providerBalanceList)this.totalWalletBalance=parseFloat(this.totalWalletBalance)+parseFloat(this.providerBalanceList[i]);T(1e3).pipe(b(()=>!!this.isComponentAlive)).subscribe(()=>{this.totalWalletBalanceLoading=!1,this.totalWalletBalanceHasChecked=!0,this.accountInfoService.isProviderListOpen=!0})}}ngOnDestroy(){this.accountInfoService.isProviderListOpen=!1,this.isComponentAlive=!1}};l.\u0275fac=function(e){return new(e||l)(h(D),h(A),h(j),h(ht),h(tt),h(y),h(N))},l.\u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"});let p=l;return p})();var zt=(()=>{let l=class l{constructor(t,e,s,a,i,r,n,o,c,m,u,g,S,f,d,C,Dt,Pt,Ft){this.httpService=t,this.globalData=e,this.deviceService=s,this.reverseFormatPipe=a,this.swalDialog=i,this.cmsService=r,this.menuService=n,this.accountWalletService=o,this.router=c,this.userDetectService=m,this.loginService=u,this.uppercase=g,this.langService=S,this.bannerService=f,this.appConfigService=d,this.gamesService=C,this.route=Dt,this.recordGameService=Pt,this.providerService=Ft,this.providerList=[],this.isProviderListOpen="",this.isPromotionListOpen=!1,this.chooseGame="-",this.provider=null,this.transferForm={from:"-",to:"-",lastFrom:"",lastTo:"",amount:"",promoteId:0,setShowPromotionList:!1},this.fromBalance=0,this.toBalance=0,this.previewBonus=0,this.isFastOpen=!1,this.fastTransferGame=null,this.fastTransferData={from:"",to:"",toProvider:"",game:null,gameUrl:"",index:""},this.promoteTitle="",this.nextTimeDontShowPromotion=!1,this.gameWaiting=null,this.isPortable=!0,this.upcomingQueries="",this.preStates={preChooseGame:"",preChooseProvider:"",preProvider:null,preProviderFromDisplay:null,preProviderToDisplay:null,preFrom:null,preLastFrom:null,preTo:null,preLastTo:null,preLastTransferTo:"",preLastTransferFrom:""},this.prePromoteStates={prePreviewBonus:"",prePromoteId:"",prePromoteTitle:"",prePromotion:"",preAmount:0},this.providerDisplayNameChanged=!1,this.resourceInfoPrefix=this.appConfigService.getConfig("resourceInfoPrefix"),this.prePage="",this.initPromotionTransfer=()=>{var w;this.transferForm.amount=Math.floor((w=this.globalData.acctInfo)==null?void 0:w.balance),this.providerList.providerMenu=this.menuService.providerMenuList,this.httpService.getLastTransfer({}).subscribe(F=>{var I,L,q;if(F.code===0){if(this.lastTransferData=F.data,this.lastTransferData.to===null)this.lastTransferData.to="-",this.preStates.preLastTransferTo=this.lastTransferData.to;else{let[K,H]=this.getIdStr(this.lastTransferData.to),G=(q=(L=(I=this.providerList.providerMenu)==null?void 0:I.find(B=>B.product==K))==null?void 0:L.subMenu)==null?void 0:q.find(B=>B.providerId==H);G&&(G==null?void 0:G.transferActive)==!1&&(this.lastTransferData.to="-",this.preStates.preLastTransferTo=this.lastTransferData.to),this.providerList.providerMenu.map(B=>{B.subMenu.map($=>{$.providerLast==this.lastTransferData.to&&(this.providerToDisplay=$.providerDisplayName,this.preStates.preProviderToDisplay=this.providerToDisplay,this.transferForm.lastTo=$.providerLast,this.preStates.preLastTo=this.transferForm.lastTo,this.providerDisplayNameChanged=!0)})}),(!this.transferForm.lastTo||this.transferForm.lastTo==="-")&&(this.lastTransferData.to="-",this.preStates.preLastTransferTo=this.lastTransferData.to),[K,H]=this.getIdStr(this.lastTransferData.to),this.transferForm.to=H,this.preStates.preTo=this.transferForm.to,this.transferForm.to!=="-"&&this.providerDisplayNameChanged&&this.getPromtion(this.transferForm.to)}this.isProviderListOpen==="to"&&this.openProviderList("to"),this.isPromotionListOpen===!0&&this.openPromotionList(),this.globalData.loading=!1}else this.globalData.loading=!1})},this.openProviderList=w=>{this.isProviderListOpen=w,this.preStates.preProvider=this.provider;let F=this.isProviderListOpen=="from"?this.transferForm.lastFrom:this.transferForm.lastTo;if(F===""||F==="-"||F===null)this.chooseGame="-",this.preStates.preChooseGame=this.chooseGame,this.chooseProvider=null,this.preStates.preChooseProvider=this.chooseProvider,this.tempData=null;else{let I=F.split("-");this.chooseGame=I[0],this.preStates.preChooseGame=this.chooseGame,this.chooseProvider=I[1],this.preStates.preChooseProvider=this.chooseProvider,this.tempData=this.providerList.providerMenu.find(L=>
1L.product===this.chooseGame),this.provider=this.tempData.subMenu.find(L=>L.providerId===this.chooseProvider),this.preStates.preProvider=this.provider}}}initfastTransfer(t,e){this.transferForm.from=e.from,this.preStates.preFrom=this.transferForm.from,this.fromBalance=t,this.transferForm.to=e.to,this.preStates.preTo=this.transferForm.to,this.getProviderBalance(this.transferForm.to).then(a=>{this.toBalance=a.balance});let s="";switch(e.toProvider){case"Slot-Games":s="EGAME";break;default:s=e.toProvider}this.providerToDisplay=this.providerList.providerMenu.find(a=>a.product===s).subMenu.find(a=>a.providerId===this.transferForm.to).providerDisplayName,this.preStates.preProviderToDisplay=this.providerToDisplay,this.transferForm.lastTo=this.providerList.providerMenu.find(a=>a.product===s).subMenu.find(a=>a.providerId===this.transferForm.to).providerLast,this.preStates.preLastTo=this.transferForm.lastTo,this.setDefaultAmount(),this.getPromtion(this.transferForm.to)}getLastTransfer(){this.httpService.getLastTransfer({}).subscribe(t=>{var e,s,a,i,r,n;if(t.code===0){this.lastTransferData=t.data,this.lastTransferData.from===null&&(this.lastTransferData.from="-",this.preStates.preLastTransferFrom=this.lastTransferData.from),this.lastTransferData.to===null&&(this.lastTransferData.to="-",this.preStates.preLastTransferTo=this.lastTransferData.to);let[o,c]=this.getIdStr(this.lastTransferData.from),[m,u]=this.getIdStr(this.lastTransferData.to),g=(a=(s=(e=this.providerList.providerMenu)==null?void 0:e.find(f=>f.product==o))==null?void 0:s.subMenu)==null?void 0:a.find(f=>f.providerId==c);g&&(g==null?void 0:g.transferActive)==0&&(this.lastTransferData.from="-",this.preStates.preLastTransferFrom=this.lastTransferData.from);let S=(n=(r=(i=this.providerList.providerMenu)==null?void 0:i.find(f=>f.product==m))==null?void 0:r.subMenu)==null?void 0:n.find(f=>f.providerId==u);S&&(S==null?void 0:S.transferActive)==0&&(this.lastTransferData.to="-",this.preStates.preLastTransferTo=this.lastTransferData.to),this.providerList.providerMenu.map(f=>{f.subMenu.map(d=>{d.providerLast==this.lastTransferData.from&&(this.providerFromDisplay=d.providerDisplayName,this.preStates.preProviderFromDisplay=this.providerFromDisplay,this.transferForm.lastFrom=d.providerLast,this.preStates.preLastFrom=this.transferForm.lastFrom),d.providerLast==this.lastTransferData.to&&(this.providerToDisplay=d.providerDisplayName,this.preStates.preProviderToDisplay=this.providerToDisplay,this.transferForm.lastTo=d.providerLast,this.preStates.preLastTo=this.transferForm.lastTo)})}),this.lastTransferData.from=this.providerFromDisplay?this.lastTransferData.from:"-",this.preStates.preLastTransferFrom=this.lastTransferData.from,this.lastTransferData.to=this.providerToDisplay?this.lastTransferData.to:"-",this.preStates.preLastTransferTo=this.lastTransferData.to,this.transferForm.lastFrom=this.lastTransferData.from,this.preStates.preLastFrom=this.transferForm.lastFrom,[o,c]=this.getIdStr(this.lastTransferData.from),this.transferForm.from=c,this.preStates.preFrom=this.transferForm.from,this.getProviderBalance(this.transferForm.from).then(f=>{this.fromBalance=f.balance,this.setDefaultAmount()}),this.transferForm.lastTo=this.lastTransferData.to,this.preStates.preLastTo=this.transferForm.lastTo,[m,u]=this.getIdStr(this.lastTransferData.to),this.transferForm.to=u,this.preStates.preTo=this.transferForm.to,this.getProviderBalance(this.transferForm.to).then(f=>{this.toBalance=f.balance}),this.lastTransferData.to!="-"&&this.getPromtion(this.transferForm.to)}})}getIdStr(t){if(t!=="-"){let e=t.split("-");if(e.length>0)return[e[0],e[1]]}return["",t]}getPromtion(t){this.changePromotion();let e={providerId:t};this.globalData.loading=!0,this.httpService.getTransferPromotions(e).subscribe(s=>{s.code===0&&s.data!==null&&(this.promotionList=s.data.promotionList),this.globalData.loading=!1})}changePromotion(t){t?(this.promotion=t,this.transferForm.promoteId=t.promoteId,this.promoteTitle=t.promoteTitle,this.setAmount(this.transferForm.amount)):(this.previewBonus=0,this.transferForm.promoteId=0,this.promoteTitle=""),this.globalData.isMobileStyle&&!this.providerDisplayNameChanged&&this.closePopUp(),this.providerDisplayNameChanged=!1}openPromotionList(){this.setPrePromotion(),this.isPromotionListOpen=!0}onCancelSelectPromotion(){this.resetPrePromotion(),this.isPromotionListOpen=!1}selectPromotionDone(){this.isPromotionListOpen=!1}setPrePromotion(){this.prePromoteStates.prePreviewBonus=this.previewBonus,this.prePromoteStates.prePromoteId=this.transferForm.promoteId,this.prePromoteStates.prePromoteTitle=this.promoteTitle,this.prePromoteStates.prePromotion=this.promotion,this.prePromoteStates.preAmount=this.transferForm.amount}resetPrePromotion(){this.previewBonus=this.prePromoteStates.prePreviewBonus,this.transferForm.promoteId=this.prePromoteStates.prePromoteId,this.promoteTitle=this.prePromoteStates.prePromoteTitle,this.promotion=this.prePromoteStates.prePromotion,this.transferForm.amount=this.prePromoteStates.preAmount,this.setAmount(this.transferForm.amount)}changeGame(t){t?(this.chooseGame=t.product,this.chooseProvider=null,this.provider=null,this.tempData=t):(this.chooseGame="-",this.chooseProvider=null,this.provider=null,this.tempData=null,this.globalData.isMobileStyle&&this.onSubmit())}changeProvider(t){this.chooseProvider=t.providerId,this.provider=t,this.globalData.isMobileStyle&&this.onSubmit()}isDoneDisabled(){return!(this.chooseGame==="-"&&!this.provider||this.chooseGame&&this.provider)}onSubmit(){this.chooseGame==="-"?(this.isProviderListOpen==="from"&&(this.transferForm.from="-",this.transferForm.lastFrom="-",this.getProviderBalance(this.transferForm.from).then(t=>{this.fromBalance=t.balance,this.setDefaultAmount(),this.preStates.preFrom=this.transferForm.from,this.preStates.preLastFrom=this.transferForm.lastFrom})),this.isProviderListOpen==="to"&&(this.transferForm.to="-",this.transferForm.lastTo="-",this.promotionList=null,this.getProviderBalance(this.transferForm.to).then(t=>{this.toBalance=t.balance,this.preStates.preTo=this.transferForm.to,this.preStates.preLastTo=this.transferForm.lastTo})),this.closePopUp()):(this.isProviderListOpen==="from"&&(this.transferForm.from=this.chooseProvider,this.providerFromDisplay=this.provider.providerDisplayName,this.transferForm.lastFrom=this.provider.providerLast,this.getProviderBalance(this.transferForm.from).then(t=>{this.fromBalance=t.balance,this.setDefaultAmount(),this.preStates.preFrom=this.transferForm.from,this.preStates.preProviderFromDisplay=this.providerFromDisplay,this.preStates.preLastFrom=this.transferForm.lastFrom})),this.isProviderListOpen==="to"&&(this.transferForm.to=this.chooseProvider,this.providerToDisplay=this.provider.providerDisplayName,this.transferForm.lastTo=this.provider.providerLast,this.getProviderBalance(this.transferForm.to).then(t=>{this.toBalance=t.balance,this.getPromtion(this.transferForm.to),this.preStates.preTo=this.transferForm.to,this.preStates.preProviderToDisplay=this.providerToDisplay,this.preStates.preLastTo=this.transferForm.lastTo})),this.closePopUp())}updateFromAndToBalance(){this.getProviderBalance(this.transferForm.from).then(t=>{this.fromBalance=t.balance,this.setDefaultAmount()}),this.getProviderBalance(this.transferForm.to).then(t=>{this.toBalance=t.balance,this.getPromtion(this.transferForm.to)})}
1closePopUp(){this.isProviderListOpen=null,this.isPromotionListOpen=!1}resetPreStates(){this.chooseGame=this.preStates.preChooseGame,this.chooseProvider=this.preStates.preChooseProvider,this.provider=this.preStates.preProvider,this.providerFromDisplay=this.preStates.preProviderFromDisplay,this.preStates.preProviderToDisplay&&(this.providerToDisplay=this.preStates.preProviderToDisplay),this.preStates.preTo&&(this.transferForm.to=this.preStates.preTo),this.transferForm.lastTo=this.preStates.preLastTo,this.transferForm.from=this.preStates.preFrom,this.transferForm.lastFrom=this.preStates.preLastFrom,this.preStates.preLastTransferTo&&(this.lastTransferData.to=this.preStates.preLastTransferTo),this.preStates.preLastTransferFrom&&(this.lastTransferData.from=this.preStates.preLastTransferFrom)}getProviderBalance(t){return new Promise((e,s)=>{let a={providerId:t};this.globalData.loading=!0,this.httpService.getBalance(a).subscribe(i=>{var r;i.code===0?(t=="-"&&(this.mainBalance=(r=this.globalData.acctInfo)==null?void 0:r.balance,this.mainBalance=parseFloat(i.data.balance).toFixed(2),this.globalData.acctInfo.balance=parseFloat(i.data.balance).toFixed(2)),this.globalData.loading=!1,e(i.data)):(this.resetPreStates(),this.globalData.loading=!1)})})}changeArrow(){if(this.transferForm.from===this.transferForm.to)return;this.globalData.loading=!0;let t=this.transferForm.from,e=this.transferForm.lastFrom,s=this.transferForm.to,a=this.transferForm.lastTo,i=this.providerFromDisplay,r=this.providerToDisplay;this.transferForm.from=s,this.preStates.preFrom=this.transferForm.from,this.transferForm.lastFrom=a,this.preStates.preLastFrom=this.transferForm.lastFrom,this.transferForm.to=t,this.preStates.preTo=this.transferForm.to,this.transferForm.lastTo=e,this.preStates.preLastTo=this.transferForm.lastTo,this.providerFromDisplay=r,this.preStates.preProviderFromDisplay=this.providerFromDisplay,this.providerToDisplay=i,this.preStates.preProviderToDisplay=this.providerToDisplay,this.provider=null;let n=this.fromBalance,o=this.toBalance;this.fromBalance=o,this.toBalance=n,this.setDefaultAmount(),this.getPromtion(this.transferForm.to)}transfer(t,e){let s={from:this.transferForm.from,to:this.transferForm.to,lastFrom:this.transferForm.lastFrom,lastTo:this.transferForm.lastTo,amount:this.reverseFormatPipe.transform(this.transferForm.amount),promoteId:this.transferForm.promoteId==0?"":this.transferForm.promoteId,setShowPromotionList:!1,gameCode:e||null};this.globalData.loading=!0,this.httpService.transferSubmit(s).subscribe(a=>{if(a.code===0)this.getLastTransfer(),this.cmsService.cmsSetting.isShowPromoteList=!1,this.fastTransferData&&this.isFastOpen?this.getGameSite(this.fastTransferData.game,t,a.code).then(i=>{if(this.fastTransferData.gameUrl=i.gameInfo?i.gameInfo.gameUrl:"",this.fastTransferData.gameUrl===""){this.router.navigate(["/"]);return}this.upcomingQueries&&(this.fastTransferData.gameUrl=this.fastTransferData.gameUrl+this.upcomingQueries),this.openGameWindow(t,i.gameCode)}).catch(i=>{console.error("getGameSite error : ",i)}):(this.globalData.showDirectAlert("codeMessage.0",1),this.globalData.loading=!1);else{this.globalData.loading=!1;let i=a.code,r=a.code.toString().substring(2);r==="40408"||r==="40411"||r==="5"||r==="70020"?this.fastTransferData&&this.isFastOpen?this.getGameSite(this.fastTransferData.game,t).then(n=>{if(this.fastTransferData.gameUrl=n.gameInfo?n.gameInfo.gameUrl:"",this.fastTransferData.gameUrl===""){this.router.navigate(["/"]);return}this.upcomingQueries&&(this.fastTransferData.gameUrl=this.fastTransferData.gameUrl+this.upcomingQueries),this.globalData.showDirectAlert("codeMessage.".concat(r),0,()=>{this.fastTransferData&&this.fastTransferData.gameUrl!=""&&this.openGameWindow(t,n.gameCode)},i)}).catch(()=>{}):this.globalData.showDirectAlert("codeMessage.".concat(r),0,()=>{},i):V(a.code)===19&&this.globalData.showDirectAlert("codeMessage.800003",0,()=>{},a.code)}this.globalData.loading=!1})}openGameWindow(t,e){this.isFastOpen=!1,this.fastTransferGame=null,this.globalData.openGameMethod(this.fastTransferData.gameUrl,t,e,this.fastTransferData.to),this.fastTransferData={from:"",to:"",toProvider:"",game:null,gameUrl:"",index:""}}checkTransfer(t,e){var r;if(this.toBalance==-1||this.fromBalance==-1){this.globalData.showDirectAlert("codeMessage.41001");return}if(this.transferForm.from===""){this.globalData.showDirectAlert("transferPage.fromProviderBlank",2);return}if(this.transferForm.to===""){this.globalData.showDirectAlert("transferPage.toProviderBlank",2);return}if(this.transferForm.from===this.transferForm.to){this.globalData.showDirectAlert("transferPage.differProvider",2);return}let s=this.reverseFormatPipe.transform(this.transferForm.amount);if(!new RegExp("^[1-9][0-9]*$").test(s)){this.globalData.showDirectAlert("codeMessage.40418",2);return}if(s=parseFloat(s),isNaN(s)||s<0){this.globalData.showDirectAlert("codeMessage.40419",2);return}if(parseFloat(this.fromBalance)<s){this.globalData.showDirectAlert("codeMessage.30034",2);return}this.transferForm.from!=="-"&&this.transferForm.to!=="-"?(this.mainBalance=(r=this.globalData.acctInfo)==null?void 0:r.balance,parseFloat(this.mainBalance)<0?this.swalDialog.popConfirm(this.globalData.translateString("transferPage.mainWalletMinus"),n=>{n&&this.transfer(t,e)}):this.transfer(t,e)):this.transfer(t,e)}setAmount(t,e){(!t||t<1)&&(t=0),t=this.reverseFormatPipe.transform(t).toString();var s=t.split(".");t=s[0],/\b(0+)/gi.test(t)&&(t=t.replace(/\b(0+)/gi,""));var a=/^(([1-9]{1}\d*)|(0{1}))?$/;
1if(!a.test(t)&&t.length!=0&&(t=t.slice(0,-1)),t=="")e&&(e.value=0),this.transferForm.amount=0;else{var i=/(\d{1,3})(?=(\d{3})+$)/g;e&&(e.value=t.replace(i,"$1,")),this.transferForm.amount=t.replace(i,"$1,")}if(this.promotion){var r=t*this.promotion.rate;this.promotion.maxAmt!=null?r<=this.promotion.maxAmt&&r>=this.promotion.minAmt?r=r:r>this.promotion.maxAmt?r=this.promotion.maxAmt:r=0:r=0,this.previewBonus=r;var n;n=parseFloat(this.previewBonus).toFixed(2);var s=n.split("."),o=this.previewBonus.toString().split(".");this.previewBonus=o[0].replace(i,"$1,")+"."+s[1],this.previewBonus<=0&&(this.previewBonus=0)}}setDefaultAmount(){var t,e;this.fastTransferData.from&&this.fastTransferData.to?this.fromBalance<1?this.setAmount(0):this.setAmount(this.fromBalance):this.fromBalance<((t=this.lastTransferData)==null?void 0:t.amount)?this.fromBalance<1?this.setAmount(0):this.setAmount(this.fromBalance):this.setAmount((e=this.lastTransferData)==null?void 0:e.amount)}popupFastTransfer(t,e,s,a,i,r,n,o,c,m){this.prePage=this.globalData.history[this.globalData.history.length-1];let u=this.cmsService.providerStatus.find(d=>d.providerId==s),g={product:o?"Slot-Games":a,providerId:s,gameCode:t==null?void 0:t.gameCode,gameType:t==null?void 0:t.gameType,gameName:t!=null&&t.gameName?t==null?void 0:t.gameName:"",position:a,checkPlayPoker:i,checkDeposit:r,type:n,index:e,upcomingQueries:c,RealMoney:this.globalData.isRealMoney,PrePage:this.prePage,transferActive:u.transferActive};m||(this.fastTransferGame=g);let S=new URLSearchParams;for(let d in g)S.set(d,g[d]);let f=m?"GameNotLogin?":"AutoTransfer?";if(this.globalData.isApp){let d=f.replace("?","");this.router.navigate(["/".concat(d)],{queryParams:g})}else{let d=this.langService.getRedirectUrl(f+S.toString());if(this.deviceService.isIOSGoogleApp())window.location.href=d;else{let C=window.open("","gamepage");C.location.href=d,C.focus()}}}loadProviderStatus(t){return x(this,null,function*(){try{let e=yield X(this.providerService.provider$.pipe(_(s=>s.length>0),z(1),J(s=>s.find(a=>a.providerId===t))));return e?{gameActive:e.gameActive,transferActive:e.transferActive}:{gameActive:1}}catch(e){return console.error("loadProviderStatus error:",e),{gameActive:1}}})}getGameSite(t,e,s){return x(this,null,function*(){return(yield this.loadProviderStatus(t.providerId)).gameActive==0?(this.route.queryParams.subscribe(i=>{this.gameMaintenance(t.providerId,i.PrePage,s)}),Promise.reject()):(this.globalData.isApp&&(e=!0),new Promise((i,r)=>{let n={providerId:t.providerId,gameCode:t.gameCode,gameName:t.gameName,gameType:t.gameType,language:this.langService.language,RealMoney:String(e),position:t.position};this.httpService.getGameUrl(n).subscribe(o=>{if(o.code===0)o.data.gameCode=t.gameCode,i(o.data);else if(o.code===90001)this.globalData.showDirectAlert("codeMessage.90001",0,()=>{r()});else if(o.code.toString().substring(2)=="51051"){let c=o.data.gameInfo.unfinishedGameCode;this.gamesService.getGameListData(t.providerId,"",c)}else o.code===51060?this.globalData.showDirectAlert("codeMessage.51060",0,()=>{this.globalData.isApp?this.globalData.goBack():window.close()}):o.code===41001?this.globalData.showDirectAlert("codeMessage.41001",0,()=>{this.globalData.isApp?this.globalData.goBack():window.close()}):(V(o.code)===19&&this.route.queryParams.subscribe(c=>{this.gameMaintenance(t.providerId,c.PrePage,o.code)}),r())})}))})}getGameMenuLink(t,e,s){return x(this,null,function*(){this.traceGameClick(t),this.globalData.isRealMoney=!0,s&&s.preventDefault(),this.upcomingQueries=e;let a="";if(t.position===U||t.position===R||t.position===W){let i="EGAME-"+this.uppercase.transform(t.providerId);a=this.cmsService.getPageUrl(i)}switch(t.position){case U:this.bannerService.providerBannerId=t.providerId,this.router.navigate([a]);break;case R:this.bannerService.providerBannerId=t.providerId,this.router.navigate([a+"/Fishing"]);break;case W:this.bannerService.providerBannerId=t.providerId,this.router.navigate([a+"/Crash"]);break;default:let i=t.providerId;if(i==="RYC"&&(this.userDetectService.detectDevice(),this.isPortable=this.userDetectService.getChannel()!=="W"),!this.isPortable)this.globalData.showDirectAlert("DeviceNotSupport",2);else{let r=new Set(["CDL","ICL","BTL"]).has(i),n=t.position==Y,o=this.globalData.isLogin;!r&&!this.globalData.isLogin?this.loginService.isOpenLogin=!0:this.popupFastTransfer(t.gameInfo,"",t.providerId,t.position,n,o,t.positionProviderType,!1,this.upcomingQueries,r&&!this.globalData.isLogin)}break}})}gameMaintenance(t,e,s){this.fastTransferGame=null;let a=e||"/",i=this.langService.getRedirectUrl("MaintenanceProvider?Provider="+encodeURIComponent(t)+"&PrePage="+a);this.globalData.showDirectAlert("codeMessage.800003",0,()=>window.location.replace(i),s)}traceGameClick(t){var s;if(["LiveCasino","Lottery","SportsBook","Poker"].includes(t.position)){let a=t.gameInfo;this.recordGameService.traceGameClick(a==null?void 0:a.providerId,a==null?void 0:a.gameCode,(s=t.displayName[0])==null?void 0:s.name,0,"M")}}};l.\u0275fac=function(e){return new(e||l)(h(A),h(D),h(vt),h(mt),h(k),h(j),h(N),h(St),h(st),h(E),h(ct),h(rt),h(y),h(pt),h(O),h(dt),h(it),h(ut),h(lt))},l.\u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"});let p=l;return p})();export{mt as a,St as b,dt as c,ut as d,zt as e};
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.