@truelab/truelogic 3.14.0 → 3.15.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/170.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_truelab_truelogic=self.webpackChunk_truelab_truelogic||[]).push([[170],{1316:(e,t,a)=>{a.d(t,{Dy:()=>r.Dy,ti:()=>r.ti});var r=a(2405)},2405:(e,t,a)=>{var r,n;a.d(t,{Dy:()=>r,ti:()=>n}),function(e){e.CASH="cash",e.TRUE="true",e.STAKING="staking",e.CONVERT="convert"}(r||(r={})),function(e){e.ACTIVE="active",e.REDEEMED="redeemed"}(n||(n={}))},5715:(e,t,a)=>{a.r(t),a.d(t,{PromoLobbyModule:()=>qs,init:()=>Qs});var r=a(4848),n=a(8521);const s=a.p+"assets/coming-soon.378973f1d8788623bbe9.webp",i=a.p+"assets/true-coin.1428441fe478e319cb4e.webp",l=a.p+"assets/gradient-bg.ec5b14ea3eb84ebb40c2.jpg",o=a.p+"assets/prize-drop-item.2bf1291207de774584ad.webp",d=a.p+"assets/reward-icon.098bebd610501e5d7344.webp",c=a.p+"assets/bg-wallet.76604959187a933cb30d.jpg",u=a.p+"assets/safe.851b5630bbec8de3e5b1.webp",p=a.p+"assets/cash-prize.4ef22f77cafcace9ef38.webp",m=a.p+"assets/prize-drop-bg-event-landscape.62d513476fec0a205481.webp",v=a.p+"assets/prize-drop-bg-event-portrait.3d627778db401fff49c0.webp",h=a.p+"assets/prize-drop-logo.b4d8a5270f8092b9f573.webp";var g=a(6540),f=a(1468);const x=(0,g.createContext)(null),w=(0,f.iI)(x).withTypes(),b=(0,f.jO)(x).withTypes();var y=a(4644),j=a(38),C=a(1370),N=a(6901),D=a(3588);const E=(e,t)=>{e.screenHistory.push(t)},R=(e,t)=>"wallet-convert"===e.topBarScreen&&"wallet-convert-confirm"===t.topBarScreen,z=(0,D.Kr)({name:"promoLobby",initialState:{activeScreen:"true-world",topBarScreen:null,screenHistory:[],uiBlockers:[],lang:null},reducers:e=>({setPromoLobbyActiveScreen:e.reducer((e,t)=>{if(e.uiBlockers.length>0)return;const a=t.payload;e.activeScreen===a&&null===e.topBarScreen||("true-world"===a?e.screenHistory=[]:E(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen})),e.topBarScreen=null,e.activeScreen=a}),setPromoLobbyLang:e.reducer((e,t)=>{e.lang=t.payload}),setPromoLobbyTopBarScreen:e.reducer((e,t)=>{if(e.uiBlockers.length>0)return;const a=t.payload;e.topBarScreen===a||E(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen}),e.topBarScreen=a}),navigateBack:e.reducer(e=>{if(e.uiBlockers.length>0)return;let t=e.screenHistory.pop();for(;t&&R(e,t);)t=e.screenHistory.pop();t&&(e.activeScreen=t.activeScreen,e.topBarScreen=t.topBarScreen,"true-world"===t.activeScreen&&null===t.topBarScreen&&(e.screenHistory=[]))}),resetPromoLobbyScreen:e.reducer(e=>{e.uiBlockers.length>0||(e.activeScreen="true-world",e.topBarScreen=null,e.screenHistory=[])}),blockPromoLobbyUI:e.reducer((e,t)=>{e.uiBlockers.includes(t.payload)||e.uiBlockers.push(t.payload)}),unblockPromoLobbyUI:e.reducer((e,t)=>{e.uiBlockers=e.uiBlockers.filter(e=>e!==t.payload)})}),selectors:{getActiveScreen:e=>e.activeScreen,getPromoLobbyUIBlocked:e=>e.uiBlockers.length>0}}),{blockPromoLobbyUI:k,setPromoLobbyActiveScreen:S,setPromoLobbyLang:B,setPromoLobbyTopBarScreen:P,navigateBack:O,resetPromoLobbyScreen:L,unblockPromoLobbyUI:I}=z.actions,{getActiveScreen:T,getPromoLobbyUIBlocked:_}=z.selectors,A=z.reducer;var M=a(874),F=a(7542),U=a(3178),$=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const Y={ERR_UNKNOWN:{message:"General error: unknow error occured",languageKey:"LOBBY.100"},ERR_UNAUTHORIZED:{message:"General error: operation is forbidden",languageKey:"LOBBY.101"},ERR_VALIDATION:{message:"Invalid request",languageKey:"LOBBY.100"},ERR_TRUE_WALLET_API:{message:"Error occured while claiming reward (on Wallet side)",languageKey:"LOBBY.102"},ERR_REWARD_NOT_FOUND:{message:"Reward was not found, is not claimable, or is not active",languageKey:"LOBBY.117"},ERR_REWARD_EXPIRED:{message:"Reward claim period expired",languageKey:"LOBBY.104"},ERR_REWARD_CLAIM_FAILED:{message:"Error occured while claiming reward (on PM side)",languageKey:"LOBBY.106"},ERR_CAMPAIGN_NOT_FOUND:{message:"Campaign not found (it was cancelled or expired)",languageKey:"LOBBY.107"},ERR_CAMPAIGN_NOT_AVAILABLE:{message:"Campaign is not available for the user (possible reasons: not valid operator, brand, game, currency or country, or campaign has specific allowed players list)",languageKey:"LOBBY.108"},ERR_CAMPAIGN_ALREADY_JOINED:{message:"User has already joined this campaign",languageKey:"LOBBY.109"},ERR_CAMPAIGN_JOIN_ONCE:{message:"User has already joined to another RUNNING campaign",languageKey:"LOBBY.110"},ERR_TRUE_WALLET_UNAVAILABLE:{message:"Reward claim is temporarily unavailable due to a technical issue. Please try again later.",languageKey:"LOBBY.111"},ERR_REWARD_CLAIM_COOLDOWN:{message:"Too many requests. Please wait before sending another claim request.",languageKey:"LOBBY.112"},ERR_CONVERT_WITHDRAWAL_FAILED:{message:"Convert withdrawal failed.",languageKey:"LOBBY.114"},ERR_CONVERT_VALIDATION:{message:"Invalid convert amount.",languageKey:"LOBBY.115"},ERR_CONVERT_COOLDOWN:{message:"Too many requests. Please wait before sending another convert request.",languageKey:"LOBBY.119"},ERR_CONVERT_ACTIVE_REWARD_LIMIT:{message:"The player already has an active convert reward.",languageKey:"LOBBY.118"}},V=(e,t,a,...r)=>$(void 0,[e,t,a,...r],void 0,function*(e,t,a,r=null,n={}){const s=new Headers;s.append("Content-Type","application/json"),s.append("Authorization",`Bearer ${a}`);const i={method:e,headers:s};r&&(i.body=JSON.stringify(r));const l=new URL(t);l.search=new URLSearchParams(n).toString();const o=l.toString(),d="There were problems with connection, please restart the game",{data:c,error:u}=yield(0,M.TX)((0,M.L5)(()=>$(void 0,void 0,void 0,function*(){var e,t;const{data:a,error:r}=yield(0,M.TX)(fetch(o,i));if(r)throw new Error(d);if(!a.ok){const r={message:`HTTP error: ${a.status}`,languageKey:null},{data:n}=yield(0,M.TX)(a.json());throw(null===(e=null==n?void 0:n.error)||void 0===e?void 0:e.message)&&(r.message=n.error.message),(null===(t=null==n?void 0:n.error)||void 0===t?void 0:t.code)&&Object.assign(r,(e=>{var t,a;return{code:e,message:(null===(t=Y[e])||void 0===t?void 0:t.message)||"Something went wrong",languageKey:(null===(a=Y[e])||void 0===a?void 0:a.languageKey)||null}})(n.error.code)),new Error(r.message,{cause:r})}const{data:n,error:s}=yield(0,M.TX)(a.json());if(s)throw new Error("Something went wrong");return n})));if(u)throw u instanceof Error&&u.message===d&&(0,U.Xm)(u),u;return c});const W=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),G=e=>{if(!W(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},J=(0,D.Kr)({name:"convert",initialState:{amount:"",lastResultEur:null,apiConvert:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setConvertAmount:e.reducer((e,t)=>{e.amount=t.payload}),setConvertLastResultEur:e.reducer((e,t)=>{e.lastResultEur=t.payload}),clearConvertForm:e.reducer(e=>{e.amount="",e.lastResultEur=null,e.apiConvert.data=null,e.apiConvert.error=null,e.apiConvert.isPending=!1}),setApiWalletConvertFake:e.reducer((e,t)=>{e.apiConvert.fake=t.payload}),clearApiWalletConvertError:e.reducer(e=>{e.apiConvert.error=null}),fetchApiWalletConvert:e.asyncThunk((e,t)=>{return a=void 0,r=[e,t],s=function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.convert.apiConvert.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.convert.apiConvert;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("POST",`${u}/wallet/convert`,c,e)}catch(e){const a=(p=e)instanceof Error&&W(p.cause)?G(p.cause):null;if(a)return t(a);throw e}var p},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s},{pending:e=>{e.apiConvert.isPending=!0,e.apiConvert.error=null,e.apiConvert.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=G(t.payload);e.apiConvert.isPending=!1,e.apiConvert.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiConvert.isPending=!1,e.apiConvert.data=t.payload}})}),selectors:{getConvertAmount:e=>e.amount,getConvertLastResultEur:e=>e.lastResultEur,getConvertApiIsPending:e=>e.apiConvert.isPending,getConvertApiError:e=>e.apiConvert.error}}),{setConvertAmount:K,setConvertLastResultEur:H,clearConvertForm:Q,setApiWalletConvertFake:q,clearApiWalletConvertError:X,fetchApiWalletConvert:Z}=J.actions,{getConvertAmount:ee,getConvertLastResultEur:te,getConvertApiIsPending:ae,getConvertApiError:re}=J.selectors,ne=J.reducer,se={viewedRewardDropIds:[],viewedCampaignIds:[]},ie=(0,C.l1)(e=>{var t,a;return Object.assign(Object.assign({},se),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},e=>{var t,a;return Object.assign(Object.assign({},se),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},{whitelist:["notification"]}),le=(0,D.Kr)({name:"notification",initialState:se,reducers:e=>({markNotificationRewardViewed:e.reducer((e,t)=>{e.viewedRewardDropIds.includes(t.payload)||e.viewedRewardDropIds.push(t.payload)}),markNotificationRewardsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedRewardDropIds.includes(t)||e.viewedRewardDropIds.push(t)})}),clearNotificationViewedReward:e.reducer((e,t)=>{e.viewedRewardDropIds=e.viewedRewardDropIds.filter(e=>e!==t.payload)}),markNotificationCampaignViewed:e.reducer((e,t)=>{e.viewedCampaignIds.includes(t.payload)||e.viewedCampaignIds.push(t.payload)}),markNotificationCampaignsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedCampaignIds.includes(t)||e.viewedCampaignIds.push(t)})}),clearNotificationViewedCampaign:e.reducer((e,t)=>{e.viewedCampaignIds=e.viewedCampaignIds.filter(e=>e!==t.payload)})})}),{markNotificationRewardViewed:oe,markNotificationRewardsViewed:de,clearNotificationViewedReward:ce,markNotificationCampaignViewed:ue,markNotificationCampaignsViewed:pe,clearNotificationViewedCampaign:me}=le.actions,ve=le.reducer;var he=a(748);const ge=(0,D.Kr)({name:"wallet",initialState:{isWalletAvailable:!0,trueDecimal:2,trueSessionRate:null,wallets:[],convertParams:{penalty:{amount:"50"},commission:{amount:"1"}},minConvertAmount:5},reducers:e=>({setWallets:e.reducer((e,t)=>{e.wallets=t.payload}),setWalletAvailability:e.reducer((e,t)=>{e.isWalletAvailable=t.payload}),setTrueSessionRate:e.reducer((e,t)=>{e.trueSessionRate=t.payload}),setConvertParams:e.reducer((e,t)=>{t.payload&&(e.convertParams=t.payload)}),incrementWalletBalance:e.reducer((e,t)=>{const a=e.wallets[0];if(a){const e=parseFloat(a.balance)||0;a.balance=String(e+t.payload)}}),markActiveWalletSeen:e.reducer(e=>{const t=e.wallets[0];t&&(t.isNew=!1)}),setMinConvertAmount:e.reducer((e,t)=>{e.minConvertAmount=t.payload})}),selectors:{getActiveWallet:e=>e.wallets[0],getIsWalletAvailable:e=>e.isWalletAvailable,getTrueSessionRate:e=>{var t,a,r;return null!==(a=null===(t=e.wallets[0])||void 0===t?void 0:t.sessionRate)&&void 0!==a?a:null===(r=e.trueSessionRate)||void 0===r?void 0:r.rate},getIsActiveWalletNew:e=>{var t;return!0===(null===(t=e.wallets[0])||void 0===t?void 0:t.isNew)},getConvertParams:e=>e.convertParams,getMinConvertAmount:e=>e.minConvertAmount}}),{incrementWalletBalance:fe,markActiveWalletSeen:xe,setTrueSessionRate:we,setWalletAvailability:be,setWallets:ye,setConvertParams:je,setMinConvertAmount:Ce}=ge.actions,{getActiveWallet:Ne,getIsActiveWalletNew:De,getIsWalletAvailable:Ee,getTrueSessionRate:Re,getConvertParams:ze,getMinConvertAmount:ke}=ge.selectors,Se=ge.reducer;var Be=a(5478),Pe=a(4218),Oe=a(9617);const Le=["promoLobby","prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired","prizeDropSuccess","prizeDropResultFinished","prizeDropResultCancelled","prizeDropLive","prizeDropJoinError","walletConvertSuccess"],Ie=e=>Le.includes(e),Te=(0,j.Z0)({name:"modals",initialState:{hasOpened:!1,current:[],isModalReady:!0},reducers:{setIsModalReady(e,t){e.isModalReady=t.payload},setHasOpened(e,t){e.hasOpened=t.payload},addCurrent(e,t){e.current.push(t.payload)},focusModal(e,t){e.current=e.current.filter(e=>e!==t.payload),e.current.push(t.payload)},closeModalSlice(e,t){(null==t?void 0:t.payload)?e.current=e.current.filter(e=>e!==t.payload):e.current=[],e.hasOpened=!!e.current.length},setModalReady(e){e.isModalReady=!0}},selectors:{getModalsIsModalMode:e=>e.isModalReady&&e.hasOpened,getCurrentModal:e=>e.current.at(-1)||null}}),{closeModalSlice:_e,setModalReady:Ae,setIsModalReady:Me,setHasOpened:Fe,addCurrent:Ue,focusModal:$e}=Te.actions,{getModalsIsModalMode:Ye,getCurrentModal:Ve}=Te.selectors,We=Te.reducer,Ge=e=>(t,a,r)=>{const{current:n}=a().modals;r.mainDispatch((0,Pe.Xm)(!0)),Ie(e)&&(r.mainDispatch((0,he.M5)()),r.mainDispatch((0,Pe.lX)(!0))),n.includes(e)?t($e(e)):(Be.h$.emit("modal:opened",e),t(Fe(!0)),t(Ue(e)))},Je=e=>(t,a,r)=>{if("promoLobby"===e){if(a().promoLobby.uiBlockers.length>0)return;t(L()),r.mainDispatch((0,Oe.Pp)(!1))}t(_e(e));const n=a().modals.current,s=n.length<1,i=n.some(Ie);r.mainDispatch((0,Pe.lX)(i)),s&&r.mainDispatch((0,Pe.Xm)(!1))};var Ke,He=a(1128);!function(e){e.CAMPAIGN_UPDATED="campaignUpdated",e.REWARD="reward",e.WALLET_STATUS="walletStatus"}(Ke||(Ke={}));const Qe=e=>{try{const t=new URL(e);return t.searchParams.delete("token"),t.searchParams.delete("authorization"),t.toString()}catch(t){return e}},qe=e=>{var t;if(!e||"object"!=typeof e)return e;const a=e;return{constructorName:null===(t=e.constructor)||void 0===t?void 0:t.name,type:a.type,message:a.message,status:a.status,statusText:a.statusText,readyState:a.readyState,responseText:a.responseText}},Xe=({error:e,socket:t,url:a,transports:r})=>{var n,s,i,l,o;const d=e;return{url:Qe(a),transports:null!=r?r:"default",currentTransport:null!==(i=null===(s=null===(n=null==t?void 0:t.io.engine)||void 0===n?void 0:n.transport)||void 0===s?void 0:s.name)&&void 0!==i?i:null,connected:null!==(l=null==t?void 0:t.connected)&&void 0!==l&&l,active:null!==(o=null==t?void 0:t.active)&&void 0!==o&&o,error:d?{name:d.name,message:d.message,description:d.description,type:d.type,context:qe(d.context)}:null}},Ze=new class{constructor(){this.socket=null,this.callbacks=new Map}connect({url:e,token:t,transports:a}){if(!e||!t)return Promise.reject(new Error("Url or token not provided"));this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect());const r=Qe(e);return new Promise((n,s)=>{const i={auth:{token:t}};a&&(i.transports=a),Be.vF.socketEvent("Socket.io connecting",{url:r,transports:null!=a?a:"default",hasAuthToken:!0}),this.socket=(0,He.io)(e,i),this.socket.once("connect",()=>{var e,t,a;const s=null===(e=this.socket)||void 0===e?void 0:e.io.engine;Be.vF.socketEvent("Socket.io connected",{url:r,transport:null!==(a=null===(t=null==s?void 0:s.transport)||void 0===t?void 0:t.name)&&void 0!==a?a:null}),null==s||s.once("upgrade",()=>{Be.vF.socketEvent("Socket.io transport upgraded",{url:r,transport:s.transport.name})}),null==s||s.once("close",e=>{Be.vF.socketEvent("Socket.io engine closed",{url:r,reason:e,transport:s.transport.name})}),n()}),this.socket.once("connect_error",t=>{Be.vF.socketEvent("Socket.io connection error",Xe({error:t,socket:this.socket,url:e,transports:a})),s(t)}),this.socket.once("error",t=>{Be.vF.socketEvent("Socket.io error",Xe({error:t,socket:this.socket,url:e,transports:a})),s(t)}),this.socket.io.on("reconnect_attempt",e=>{var t,a,n,s;return Be.vF.socketEvent("Socket.io trying to reconnect",{url:r,attempt:e,transport:null!==(s=null===(n=null===(a=null===(t=this.socket)||void 0===t?void 0:t.io.engine)||void 0===a?void 0:a.transport)||void 0===n?void 0:n.name)&&void 0!==s?s:null})}),this.socket.io.on("reconnect_error",t=>Be.vF.socketEvent("Socket.io retry failed",Xe({error:t,socket:this.socket,url:e,transports:a}))),this.socket.io.on("reconnect_failed",()=>Be.vF.socketEvent("Socket.io all retries exhausted",{url:r,transports:null!=a?a:"default"})),this.socket.onAny((e,t)=>{const a={type:e,payload:t,timestamp:Date.now()};this.emit(e,a)}),this.socket.on("disconnect",e=>{var t,a;Be.vF.socketEvent("Socket.io disconnected",{url:r,reason:e,active:null!==(a=null===(t=this.socket)||void 0===t?void 0:t.active)&&void 0!==a&&a})})})}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}send(e){this.socket&&this.socket.connected?this.socket.emit(e.type,e.payload):Be.vF.socketEvent("Socket.io not connected. Unable to send:",e)}on(e,t){this.callbacks.has(e)||this.callbacks.set(e,new Set),this.callbacks.get(e).add(t)}off(e,t){var a;null===(a=this.callbacks.get(e))||void 0===a||a.delete(t)}emit(e,t){var a;Be.vF.socketEvent(e,t.payload),null===(a=this.callbacks.get(e))||void 0===a||a.forEach(e=>e(t))}};var et=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const tt=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),at=e=>{if(!tt(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},rt=e=>e instanceof Error&&tt(e.cause)?at(e.cause):null,nt={campaigns:[],activeCampaign:null,displayedCampaign:null,campaignsQueue:[],prizeDropLiveShownCampaignIds:[],apiLobbyInit:{data:null,isPending:!1,error:null,fake:null},apiJoinCampaign:{data:null,isPending:!1,error:null,fake:null},socketConnection:{data:null,isSuccess:!1,isPending:!1,error:null,fake:null}},st=(0,C.l1)(e=>{var t;return Object.assign(Object.assign({},nt),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},e=>{var t;return Object.assign(Object.assign({},nt),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},{whitelist:["prizeDrop"]}),it=(0,D.Kr)({name:"prizeDrop",initialState:nt,reducers:e=>({setPrizeDropRestData:e.reducer((e,t)=>{e.restData=t.payload}),setPrizeDropCampaigns:e.reducer((e,t)=>{e.campaigns=t.payload}),setPrizeDropActiveCampaign:e.reducer((e,t)=>{e.activeCampaign=t.payload}),setPrizeDropDisplayedCampaign:e.reducer((e,t)=>{e.displayedCampaign=t.payload}),setPrizeDropSocketEventCampaignUpdated:e.reducer((e,t)=>{var a,r;const n=t.payload,s=e.campaigns.map(e=>{var t,a;return e.campaignId===n.campaignId?Object.assign(Object.assign({},e),{status:n.status,prizesLeftCount:null!==(t=n.prizesLeftCount)&&void 0!==t?t:e.prizesLeftCount,winnersCount:null!==(a=n.winnersCount)&&void 0!==a?a:e.winnersCount,prizes:n.prizes.length>0?e.prizes.map(e=>{const t=n.prizes.find(t=>t.prizeId===e.prizeId);return t?Object.assign(Object.assign({},e),t):e}):e.prizes}):e});e.campaigns=s;const i=e.campaigns.find(e=>e.campaignId===n.campaignId);(null===(a=e.displayedCampaign)||void 0===a?void 0:a.campaignId)===n.campaignId&&i&&(e.displayedCampaign=i),(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)===n.campaignId&&("finished"===n.status||"cancelled"===n.status?e.activeCampaign=null:e.activeCampaign=i)}),setApiPrizeDropLobbyInitFake:e.reducer((e,t)=>{e.apiLobbyInit.fake=t.payload}),setApiPrizeDropJoinCampaignFake:e.reducer((e,t)=>{e.apiJoinCampaign.fake=t.payload}),setPrizeDropSocketFake:e.reducer((e,t)=>{e.socketConnection.fake=t.payload}),joinPrizeDropCampaign:e.reducer((e,t)=>{t.payload.campaignId===e.displayedCampaign.campaignId&&(e.activeCampaign=e.displayedCampaign,e.activeCampaign.joined=!0,e.campaigns=e.campaigns.map(e=>e.campaignId===t.payload.campaignId?Object.assign(Object.assign({},e),{joined:!0}):e))}),clearPrizeDropJoinCampaignError:e.reducer(e=>{e.apiJoinCampaign.error=null}),clearPrizeDropJoinCampaignData:e.reducer(e=>{e.apiJoinCampaign.data=null,e.apiJoinCampaign.error=null,e.apiJoinCampaign.isPending=!1}),setPrizeDropDefferedCampaign:e.reducer((e,t)=>{e.defferedCampaign=t.payload}),clearPrizeDropDefferedCampaign:e.reducer(e=>{e.defferedCampaign=null}),setPrizeDropCampaignsQueue:e.reducer((e,t)=>{e.campaignsQueue=t.payload}),shiftPrizeDropFromCampaignsQueue:e.reducer(e=>{e.campaignsQueue=e.campaignsQueue.slice(1)}),clearPrizeDropCampaignsQueue:e.reducer(e=>{e.campaignsQueue=[]}),addPrizeDropLiveShownCampaignId:e.reducer((e,t)=>{e.prizeDropLiveShownCampaignIds.includes(t.payload)||e.prizeDropLiveShownCampaignIds.push(t.payload)}),fetchApiPrizeDropLobbyInit:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.prizeDrop.apiLobbyInit.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url,p=o.promoLobby.lang;if(d){const e=o.prizeDrop.apiLobbyInit.fake;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("GET",`${u}/lobby/init`,c,e,{lang:p})}catch(e){const a=rt(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiLobbyInit.isPending=!0,e.apiLobbyInit.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=at(t.payload);e.apiLobbyInit.isPending=!1,e.apiLobbyInit.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiLobbyInit.isPending=!1,e.apiLobbyInit.data=t.payload}}),fetchApiPrizeDropJoinCampaign:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.prizeDrop.apiJoinCampaign.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.url,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.token;if(d){const e=o.prizeDrop.apiJoinCampaign.fake;return yield(0,M.yy)(e.delay),e.hasError&&e.countRetries?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!u)throw Error("Endpoint or token not provided");try{return yield V("POST",`${c}/campaign/join`,u,e)}catch(e){const a=rt(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiJoinCampaign.isPending=!0,e.apiJoinCampaign.error=null,e.apiJoinCampaign.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=at(t.payload);e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.error={name:a,message:r,code:a,languageKey:n},e.apiJoinCampaign.data=null;const s=e.apiJoinCampaign.fake;(null==s?void 0:s.enabled)&&(null==s?void 0:s.countRetries)>0&&(s.countRetries-=1,e.apiJoinCampaign.fake=s)},fulfilled:(e,t)=>{e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.data=t.payload}}),connectPrizeDropSocketService:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n;const s=a(),i=null===(r=s.prizeDrop.apiLobbyInit.data)||void 0===r?void 0:r.credentials;if(!i)throw Error("Socket credentials not provided (lobby init response)");const{url:l,token:o,transports:d}=i;if(null===(n=s.prizeDrop.apiLobbyInit.fake)||void 0===n?void 0:n.enabled){const e=s.prizeDrop.socketConnection.fake;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):void 0}yield Ze.connect({url:l,token:o,transports:d})}),{pending:e=>{e.socketConnection.isPending=!0,e.socketConnection.isSuccess=!1,e.socketConnection.error=null},rejected:(e,t)=>{var a,r;e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!1,e.socketConnection.error={name:(null===(a=t.error)||void 0===a?void 0:a.name)||"Oops",message:(null===(r=t.error)||void 0===r?void 0:r.message)||"Something went wrong"}},fulfilled:e=>{e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!0,e.socketConnection.error=null}})}),selectors:{isPrizeDropActive:e=>e.activeCampaign&&"cancelled"!==e.activeCampaign.status,getPrizeDropMode:(e,t)=>{const a=e.campaigns.find(e=>e.campaignId===t);if(a){if("scheduled"===a.status)return"upcoming";if("running"===a.status)return"live"}return"ended"},isPrizeDropJoined:e=>{var t;return null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined},getPrizeDropMaxPrize:e=>{const{prizes:t}=e.displayedCampaign,a=t.find(e=>null==e?void 0:e.topPrize);return!a&&t.length>0?t[0]:a},hasPrizeDropActiveCampaign:e=>{var t,a,r;return(null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined)&&(null===(a=null==e?void 0:e.activeCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.displayedCampaign)||void 0===r?void 0:r.campaignId)},displayPrizeDropJoinButton:e=>{var t,a,r,n;return"running"===(null===(t=null==e?void 0:e.displayedCampaign)||void 0===t?void 0:t.status)&&((null===(a=null==e?void 0:e.displayedCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)||!(null===(n=null==e?void 0:e.activeCampaign)||void 0===n?void 0:n.joined))}}}),{setPrizeDropActiveCampaign:lt,setPrizeDropDisplayedCampaign:ot,setPrizeDropSocketEventCampaignUpdated:dt,setApiPrizeDropLobbyInitFake:ct,setApiPrizeDropJoinCampaignFake:ut,setPrizeDropRestData:pt,fetchApiPrizeDropLobbyInit:mt,fetchApiPrizeDropJoinCampaign:vt,connectPrizeDropSocketService:ht,setPrizeDropSocketFake:gt,joinPrizeDropCampaign:ft,setPrizeDropDefferedCampaign:xt,clearPrizeDropDefferedCampaign:wt,setPrizeDropCampaignsQueue:bt,shiftPrizeDropFromCampaignsQueue:yt,clearPrizeDropCampaignsQueue:jt,addPrizeDropLiveShownCampaignId:Ct,clearPrizeDropJoinCampaignError:Nt,clearPrizeDropJoinCampaignData:Dt,setPrizeDropCampaigns:Et}=it.actions,{isPrizeDropActive:Rt,getPrizeDropMode:zt,isPrizeDropJoined:kt,getPrizeDropMaxPrize:St,hasPrizeDropActiveCampaign:Bt,displayPrizeDropJoinButton:Pt}=it.selectors,Ot=it.reducer,Lt=e=>(t,a,r)=>{const{displayedCampaign:n}=a().prizeDrop;(null==n?void 0:n.campaignId)&&"prizeDropJoinError"!==e&&t(Ct(n.campaignId)),t(Je(e)),t(yt());const{campaignsQueue:s}=a().prizeDrop,i=s[0];i&&(t(ot(i)),r.mainDispatch((0,he.M5)()),t(Ge("prizeDropLive")))};var It=a(1316),Tt=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const _t=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired"],At=e=>{if(e.reward.type!==It.Dy.TRUE)return"prizeDropCongratulation";switch(e.claimUiStatus){case"pending":default:return"prizeDropClaimed";case"success":return"prizeDropClaimedSuccess";case"error":return"prizeDropClaimedFailed";case"expired":return"prizeDropClaimedExpired"}},Mt=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),Ft=e=>{if(!Mt(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},Ut=(0,D.Kr)({name:"rewards",initialState:{rewards:[],rewardsQueue:[],winReward:null,hasDefferedRewardModal:!1,apiRewardsList:{data:null,isPending:!1,error:null,fake:null},apiClaim:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setRewards:e.reducer((e,t)=>{e.rewards=t.payload}),upsertReward:e.reducer((e,t)=>{const a=e.rewards.findIndex(e=>e.rewardId===t.payload.rewardId);a>=0?e.rewards[a]=t.payload:e.rewards.push(t.payload)}),removeRewardById:e.reducer((e,t)=>{e.rewards=e.rewards.filter(e=>e.rewardId!==t.payload)}),setWinReward:e.reducer((e,t)=>{e.winReward=t.payload}),clearWinReward:e.reducer(e=>{e.winReward=null}),setHasDefferedRewardModal:e.reducer((e,t)=>{e.hasDefferedRewardModal=t.payload}),addRewardsToQueue:e.reducer((e,t)=>{t.payload.forEach(t=>{const a=e.rewardsQueue.findIndex(e=>e.reward.rewardId===t.rewardId);let r;if(a>=0){const n=e.rewardsQueue[a];let s="pending";"success"===n.claimUiStatus||"error"===n.claimUiStatus?s=n.claimUiStatus:"expired"===n.claimUiStatus&&(s="expired"),r={reward:t,claimUiStatus:s},e.rewardsQueue.splice(a,1)}else r={reward:t,claimUiStatus:"pending"};e.rewardsQueue.unshift(r)})}),removeRewardFromQueueById:e.reducer((e,t)=>{e.rewardsQueue=e.rewardsQueue.filter(e=>e.reward.rewardId!==t.payload)}),updateRewardQueueEntryClaimUiStatus:e.reducer((e,t)=>{const a=e.rewardsQueue.find(e=>e.reward.rewardId===t.payload.rewardId);a&&(a.claimUiStatus=t.payload.claimUiStatus)}),clearApiRewardsClaimData:e.reducer(e=>{e.apiClaim.data=null,e.apiClaim.error=null,e.apiClaim.isPending=!1}),setApiRewardsListFake:e.reducer((e,t)=>{e.apiRewardsList.fake=t.payload}),setApiRewardsClaimFake:e.reducer((e,t)=>{e.apiClaim.fake=t.payload}),fetchApiRewardsList:e.asyncThunk((e,t)=>Tt(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.rewards.apiRewardsList.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.rewards.apiRewardsList;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");return V("GET",`${u}/rewards`,c)}),{pending:e=>{e.apiRewardsList.isPending=!0,e.apiRewardsList.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=Ft(t.payload);e.apiRewardsList.isPending=!1,e.apiRewardsList.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiRewardsList.isPending=!1,e.apiRewardsList.data=t.payload,e.rewards=t.payload.data.filter(e=>e.status===It.ti.ACTIVE)}}),fetchApiRewardsClaim:e.asyncThunk((e,t)=>Tt(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.rewards.apiClaim.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.rewards.apiClaim;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("POST",`${u}/rewards/${e.rewardId}/claim`,c,{})}catch(e){const a=(p=e)instanceof Error&&Mt(p.cause)?Ft(p.cause):null;if(a)return t(a);throw e}var p}),{pending:e=>{e.apiClaim.isPending=!0,e.apiClaim.error=null,e.apiClaim.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=Ft(t.payload);e.apiClaim.isPending=!1,e.apiClaim.error={name:a,message:r,code:a,languageKey:n},e.apiClaim.data=null;const s=e.apiClaim.fake;(null==s?void 0:s.enabled)&&(null==s?void 0:s.countRetries)>0&&(s.countRetries-=1,e.apiClaim.fake=s)},fulfilled:(e,t)=>{e.apiClaim.isPending=!1,e.apiClaim.data=t.payload}})})}),{setRewards:$t,upsertReward:Yt,removeRewardById:Vt,setWinReward:Wt,clearWinReward:Gt,setHasDefferedRewardModal:Jt,addRewardsToQueue:Kt,removeRewardFromQueueById:Ht,updateRewardQueueEntryClaimUiStatus:Qt,clearApiRewardsClaimData:qt,setApiRewardsListFake:Xt,setApiRewardsClaimFake:Zt,fetchApiRewardsList:ea,fetchApiRewardsClaim:ta}=Ut.actions,aa=Ut.reducer;var ra=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const na=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),sa=e=>{if(!na(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},ia=(0,D.Kr)({name:"transaction",initialState:{transactions:[],hasMore:!1,currentPage:1,apiTransactions:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setApiTransactionsFake:e.reducer((e,t)=>{var a;e.apiTransactions.fake=null!==(a=t.payload)&&void 0!==a?a:null}),clearTransactions:e.reducer(e=>{e.transactions=[],e.hasMore=!1,e.currentPage=1,e.apiTransactions.error=null,e.apiTransactions.isPending=!1}),addTransaction:e.reducer((e,t)=>{const{amount:a,rewardId:r}=t.payload,n={transactionId:`optimistic-${r}`,createdAt:(new Date).toISOString(),status:"completed",type:"top-up",subType:"prizedrop",amount:a};e.transactions=[n,...e.transactions]}),fetchApiTransactions:e.asyncThunk((e,t)=>ra(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l,o,d;const c=a(),u=null===(r=c.transaction.apiTransactions.fake)||void 0===r?void 0:r.enabled,p=null===(s=null===(n=c.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,m=null===(l=null===(i=c.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(u){const{fake:a}=c.transaction.apiTransactions,r=e&&"object"==typeof e&&"page"in e&&null!==(o=e.page)&&void 0!==o?o:1,{data:n,error:s}=yield(0,M.TX)((0,M.L5)(()=>ra(void 0,void 0,void 0,function*(){const t=a.hasError||a.errorWhenScroll&&r>1;if(Be.vF.fakeApiEvent("/wallet/transactions",e,t?JSON.parse(a.error):JSON.parse(a.response),t),yield(0,M.yy)(a.delay),t)throw new Error(a.error);return JSON.parse(a.response)})));return s?t(JSON.parse(a.error)):n}if(!m||!p)throw Error("Endpoint or token not provided");const v=e&&"object"==typeof e&&"page"in e&&null!==(d=e.page)&&void 0!==d?d:1,h={};v>1&&(h.page=String(v));try{return yield V("GET",`${m}/wallet/transactions`,p,null,h)}catch(e){const a=(g=e)instanceof Error&&na(g.cause)?sa(g.cause):null;if(a)return t(a);throw e}var g}),{pending:e=>{e.apiTransactions.isPending=!0,e.apiTransactions.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=sa(t.payload);e.apiTransactions.isPending=!1,e.apiTransactions.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{var a;e.apiTransactions.isPending=!1;const{payload:r}=t;e.apiTransactions.data=r;const n=r.transactions.map(e=>{return t=e,Object.assign(Object.assign({},t),{amount:parseFloat(t.amount)||0});var t}),{arg:s}=t.meta,i=s&&"object"==typeof s&&"page"in s&&null!==(a=s.page)&&void 0!==a?a:1;1===i?(e.transactions=n,e.currentPage=1):e.transactions=[...e.transactions,...n],e.currentPage=i,e.hasMore=r.hasMore}})})}),{addTransaction:la,clearTransactions:oa,fetchApiTransactions:da,setApiTransactionsFake:ca}=ia.actions,ua=ia.reducer;var pa,ma;const va=(0,y.HY)({convert:ne,modals:We,notification:ve,prizeDrop:Ot,promoLobby:A,rewards:aa,transaction:ua,wallet:Se}),ha=(0,M.P3)("token"),ga={key:`${null!==(ma=null===(pa=(0,F.p)(ha))||void 0===pa?void 0:pa.gameId)&&void 0!==ma?ma:"sandbox"}:promoLobby`,storage:N.A,whitelist:["notification","prizeDrop"],transforms:[ie,st]},fa=(0,C.rL)(ga,va),xa={mainDispatch:(...e)=>{throw new Error("PromoLobby mainDispatch is not set. Ensure PromoLobbyProvider mounted inside main Provider.")},mainGetState:()=>{throw new Error("PromoLobby mainGetState is not set. Ensure PromoLobbyProvider mounted inside main Provider.")}},wa=(0,j.U1)({reducer:fa,middleware:e=>e({serializableCheck:{ignoredActions:[C.ZM,C.r2,C.Hz,C.DY,C.Cq,C.eY]},thunk:{extraArgument:xa}}),devTools:!1}),ba=(0,C.GM)(wa);var ya=a(8131);const ja=({children:e})=>{const t=(0,f.Pj)();return(0,g.useEffect)(()=>{var e;e={mainDispatch:t.dispatch,mainGetState:()=>t.getState()},xa.mainDispatch=e.mainDispatch,xa.mainGetState=e.mainGetState},[t]),(0,r.jsx)(ya.Q,{loading:null,persistor:ba,children:(0,r.jsx)(f.Kq,{store:wa,context:x,children:e})})},Ca=({children:e})=>(0,r.jsx)(ja,{children:e});var Na,Da=a(9286),Ea=a(6942),Ra=a.n(Ea);function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},za.apply(null,arguments)}const ka=e=>g.createElement("svg",za({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 8 10"},e),Na||(Na=g.createElement("path",{fill:"#fff",d:"M1.083 0v3l1.944 2-1.944 2v3h5.833V7L4.972 5l1.944-2V0z"})));var Sa=a(2192);const Ba=({prizeDropMode:e,className:t})=>{const a=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:Ra()("flex items-center gap-4 rounded-20 px-10 py-4","ended"===e&&"bg-add-gradient","live"===e&&"bg-green","upcoming"===e&&"bg-add-violet backdrop-blur-[20px]",t),children:["live"===e&&(0,r.jsx)("div",{className:"h-6 w-6 rounded-full bg-white"}),"upcoming"===e&&(0,r.jsx)(ka,{className:"h-10 w-8"}),(0,r.jsxs)("span",{className:"text-xs-bold",children:["ended"===e&&a("LOBBY.014","Ended").toUpperCase(),"live"===e&&a("LOBBY.012","Live").toUpperCase(),"upcoming"===e&&a("LOBBY.013","Upcoming").toUpperCase()]})]})};var Pa=a(6098),Oa=a(7052);const La=({onClick:e,isLoading:t,className:a="",text:n,loadingText:s,disabled:i=!1,size:l="middle"})=>(0,r.jsx)(Pa.$,{className:Ra()("mx-auto w-full mp:max-w-530 ml:max-w-560",a),onClick:a=>!t&&e(a),disabled:i||t,size:l,children:t?(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[(0,r.jsx)(Oa.k,{}),s]}):n}),Ia=({onClick:e,isLoading:t,className:a="",disabled:n=!1})=>{const s=(0,Sa.Bd)();return(0,r.jsx)(La,{onClick:e,text:s("DROP.010","Join now"),loadingText:s("DROP.011","Joining..."),isLoading:t,className:a,disabled:n})};var Ta,_a,Aa,Ma,Fa,Ua,$a,Ya,Va,Wa;function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ga.apply(null,arguments)}const Ja=e=>g.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 32 32"},e),Ta||(Ta=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__a)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m-5.548 15.999L16 21.547l5.548-5.548L16 10.45z",clipRule:"evenodd"})),_a||(_a=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__b)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),Aa||(Aa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__c)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),Ma||(Ma=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__d)",d:"M16 2.857C23.26 2.857 29.143 8.74 29.143 16c0 7.258-5.884 13.143-13.143 13.143-7.258 0-13.143-5.885-13.143-13.143S8.742 2.857 16 2.857m0 .571C9.057 3.428 3.43 9.057 3.43 16S9.057 28.57 16 28.57 28.572 22.943 28.572 16 22.943 3.428 16 3.428"})),Fa||(Fa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__e)",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 .571C7.479.571.571 7.48.571 16S7.48 31.429 16 31.429 31.429 24.52 31.429 16 24.52.571 16 .571"})),Ua||(Ua=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__f)",d:"M22.457 15.292a1 1 0 0 1 0 1.414l-5.75 5.75a1 1 0 0 1-1.414 0l-5.75-5.75a1 1 0 0 1 0-1.414l5.75-5.75a1 1 0 0 1 1.414 0zm-12.005.707L16 21.547l5.548-5.548L16 10.45z"})),$a||($a=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__g)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),Ya||(Ya=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__h)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),Va||(Va=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__i)",d:"M21.548 15.999 16 21.547l-5.548-5.548L16 10.45zm-10.288 0 4.74 4.74 4.74-4.74-4.74-4.74z"})),Wa||(Wa=g.createElement("defs",null,g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__d",x1:2.857,x2:29.143,y1:2.857,y2:29.143,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.153,stopColor:"#491B04"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#FFF7D2"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__e",x1:0,x2:32,y1:0,y2:32,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.15,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#734D26"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__g",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.215,stopColor:"#0DF2C1"}),g.createElement("stop",{offset:.5,stopColor:"#F2E70D"}),g.createElement("stop",{offset:.872,stopColor:"#04493A"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__h",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#FFF7D2"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.75,stopColor:"#491B04"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__i",x1:10.452,x2:21.548,y1:10.451,y2:21.547,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#491B04"}),g.createElement("stop",{offset:.748,stopColor:"#FFF7D2"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__a",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.202,stopColor:"#E3C28E"}),g.createElement("stop",{offset:.721,stopColor:"#B37F42"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__b",cx:0,cy:0,r:1,gradientTransform:"matrix(31.98739 31.98739 -45.67082 45.67082 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#19925E"}),g.createElement("stop",{offset:.502,stopColor:"#4BB866",stopOpacity:.8}),g.createElement("stop",{offset:.968,stopColor:"#EBE713"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__c",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__f",cx:0,cy:0,r:1,gradientTransform:"rotate(44.527 -6.37 15.216)scale(21.999 31.4097)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"}))))),Ka={title:{fontSize:36,fontWeight:800,height:42,baseline:32},promo:{fontSize:30,fontWeight:700,height:35,baseline:28},currency:{fontSize:18,fontWeight:700,height:21,baseline:16},text:{fontSize:20,fontWeight:700,height:24,baseline:19}},Ha=({children:e,variant:t="title",className:a="",maxWidth:n})=>{const s=(0,g.useId)().replace(/:/g,"-"),i=`gold-gradient-${s}`,l=`gold-shadow-${s}`,o=(0,g.useRef)(null),[d,c]=(0,g.useState)(200),u=Ka[t],[p,m]=(0,g.useState)(u.fontSize),v=void 0!==n?u.height/2:u.baseline;return(0,g.useLayoutEffect)(()=>{m(u.fontSize)},[e,n,u.fontSize]),(0,g.useLayoutEffect)(()=>{if(o.current){const e=o.current.getBBox(),t=Math.ceil(e.width),a=void 0!==n?Math.min(t,n)+4:t+4;if(void 0!==n&&t>n){const e=Math.max(Math.floor(p*(n/t)),1);p!==e&&m(e)}d!==a&&c(a)}},[e,p,n,u.fontSize,d]),(0,r.jsxs)("svg",{className:a,width:d,height:u.height,viewBox:`0 0 ${d} ${u.height}`,style:{display:"inline-block",overflow:"visible"},children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("radialGradient",{id:i,gradientUnits:"userSpaceOnUse",cx:"0",cy:"0",r:"10",gradientTransform:"matrix(12.479 4.522 17.525 -6.564 0.044977 0.0000027894)",children:[(0,r.jsx)("stop",{stopColor:"#E3C28E",offset:"20.23%"}),(0,r.jsx)("stop",{stopColor:"#CB9A68",offset:"46.16%"}),(0,r.jsx)("stop",{stopColor:"#B37F42",offset:"72.08%"})]}),(0,r.jsx)("filter",{id:l,x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,r.jsx)("feDropShadow",{dx:"0",dy:"1",stdDeviation:"0",floodColor:"black",floodOpacity:"0.3"})})]}),(0,r.jsx)("text",{ref:o,x:"0",y:v,fill:`url(#${i})`,filter:`url(#${l})`,fontFamily:"Roboto, sans-serif",fontSize:p,fontWeight:u.fontWeight,dominantBaseline:void 0!==n?"middle":void 0,children:e})]})};var Qa;function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qa.apply(null,arguments)}const Xa=e=>g.createElement("svg",qa({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Qa||(Qa=g.createElement("path",{fill:"currentColor",d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.418 8 8 11.582 11.582 8 8 4.418z"})));var Za=a(4554),er=a(7031);const tr=({classes:e})=>(0,r.jsxs)("div",{className:"loader",children:[(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot})]});var ar=a(9494),rr=a(7997);const nr=()=>{var e;const t=(0,Sa.Bd)(),a=w(),n=b(Ne),s=null!==(e=b(Re))&&void 0!==e?e:0,i=b(Ee),l=b(e=>e.wallet.trueDecimal),o=b(ze),{isPending:d,error:p}=b(e=>e.prizeDrop.apiLobbyInit),m=b(e=>e.rewards.rewards.some(e=>e.type===It.Dy.CONVERT&&e.status===It.ti.ACTIVE)),v=(0,Da.GV)(rr.ge),[h,f]=(0,g.useState)(""),x=n?Number(n.balance):0,y=d||!!p||!i,j=Number.isFinite(s)&&s>0,C=!!o&&x>0&&j&&!y,N=m;return(0,g.useEffect)(()=>{f(Be.bp.formatCash(x,{showCurrency:!1,customDecimals:l,roundUp:!0}))},[x,l,s]),(0,r.jsx)("div",{className:"h-200 rounded-30",style:{backgroundImage:`url(${er.f.get(c)})`,backgroundSize:"cover",backgroundPosition:"top right"},children:(0,r.jsxs)("div",{className:"relative flex h-full flex-col justify-between gap-16 rounded-30 border-[3px] border-white-10 p-17",children:[(0,r.jsx)("img",{src:er.f.get(u),alt:"safe",className:"absolute -right-3 bottom-16 w-190"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)(Xa,{className:"h-28 w-28 shrink-0 text-white"}),(0,r.jsx)("div",{className:"title-h3-bold",children:"$TRUE Token"})]}),(0,r.jsxs)("div",{children:[y?(0,r.jsx)("div",{className:"flex h-38 items-center",children:(0,r.jsx)(tr,{classes:{dot:"w-7 h-7"}})}):(0,r.jsx)(ar.$,{className:"m-0 font-extrabold leading-[38px] text-white",text:h,initialFontSize:32,maxWidth:v?240:170}),!y&&x>0&&j&&(0,r.jsxs)("div",{className:"text-medium-reg -mt-3 opacity-60",children:["~",Be.bp.formatCash(x/s,{roundUp:!0})]})]})]}),C?(0,r.jsx)(Pa.$,{className:"!w-fit !min-w-167 !bg-brand-gradient",onClick:()=>{Be.h$.emit("walletConvert:openClicked",(0,Za.p)({exchangeRate:s,penaltyPercent:null==o?void 0:o.penalty.amount,feeTrue:null==o?void 0:o.commission.amount})),a(P("wallet-convert"))},disabled:N,children:o.penalty.amount?t("LOBBY.051",`Convert now (-${Math.round(parseFloat(o.penalty.amount))}%)`,{"@value@":String(Math.round(parseFloat(o.penalty.amount)))}):t("","Convert now")}):(0,r.jsx)("div",{className:"text-medium-reg -mt-3 opacity-60",children:t("","The Power Behind TRUE World")})]})})},sr=()=>{var e,t;const a=(0,Sa.Bd)(),n=b(e=>e.prizeDrop.displayedCampaign.cashPrizePool),s=b(e=>e.prizeDrop.displayedCampaign),i=b(Re),l=b(e=>e.wallet.trueDecimal),o=s.prizes.some(e=>"true"===e.type),d="number"==typeof i&&i>0;return n?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"title-h3-bold text-cente flex items-center justify-center gap-8 text-center",children:[(0,r.jsxs)("div",{children:["🏆 ",a("DROP.003","Prize pool:")," "]}),o?(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-20 w-20"}),(0,r.jsxs)(Ha,{variant:"text",children:[Be.bp.formatCash(null!==(e=null==n?void 0:n.value)&&void 0!==e?e:0,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}):(0,r.jsx)(Ha,{variant:"text",children:Be.bp.formatCash(null==n?void 0:n.value,{customCurrency:null==n?void 0:n.currency,customDecimals:null==n?void 0:n.decimals,roundUp:!0})})]}),o&&d&&(0,r.jsxs)("div",{className:"text-medium-reg text-center opacity-60",children:["~"," ",Be.bp.formatCash((null!==(t=null==n?void 0:n.value)&&void 0!==t?t:0)/i,{roundUp:!0})]})]}):null};a(494),a(2796),a(7317),a(9964),a(813),a(5811),a(9423),a(7205),a(2369),a(5616),a(1340),a(7081),a(4895),a(6007);var ir,lr=a(4353),or=a.n(lr);function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},dr.apply(null,arguments)}const cr=e=>g.createElement("svg",dr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 20"},e),ir||(ir=g.createElement("path",{fill:"#fff",d:"M8 8.333V10H6.333V8.333zm3.333 0V10H9.667V8.333zm3.334 0V10H13V8.333zM16.333 2.5A1.666 1.666 0 0 1 18 4.166v11.667a1.666 1.666 0 0 1-1.667 1.667H4.667A1.667 1.667 0 0 1 3 15.833V4.166A1.667 1.667 0 0 1 4.667 2.5H5.5V.833h1.667V2.5h6.666V.833H15.5V2.5zm0 13.333V6.666H4.667v9.167zM8 11.666v1.667H6.333v-1.667zm3.333 0v1.667H9.667v-1.667zm3.334 0v1.667H13v-1.667z"}))),ur=({dateStart:e,dateEnd:t,className:a=""})=>{const n=(0,Da.GV)(e=>e.localization.lang);return(0,r.jsxs)("div",{className:Ra()(a||"text-small-med mt-12"),children:[(0,r.jsx)(cr,{className:"mr-6 inline-block h-20 w-20"}),or()(e).locale("no"===n?"nb":n).format("MMM D, YYYY")," ","–"," ",or()(t).locale("no"===n?"nb":n).format("MMM D, YYYY")]})},pr=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),n=Math.floor(a/36e5%24),s=Math.floor(a/6e4%60),i=Math.floor(a/1e3%60),l=e=>String(e).padStart(2,"0");return{days:l(r),hours:l(n),mins:l(s),secs:l(i)}},mr=({prizeDropMode:e,className:t=""})=>{const a=(0,Sa.Bd)(),{dateStart:n,dateEnd:s}=b(e=>e.prizeDrop.displayedCampaign),i="upcoming"===e?n:s,l="ended"===e,[o,d]=(0,g.useState)(()=>pr(i));(0,g.useEffect)(()=>{const e=setInterval(()=>{d(pr(i))},1e3);return()=>clearInterval(e)},[i]);const c=[{value:o.days,text:a("DROP.036","Days")},{value:o.hours,text:a("DROP.037","Hrs")},{value:o.mins,text:a("DROP.038","Mins")},{value:o.secs,text:a("DROP.039","Secs")}],u=e=>!!(l||Number(e)<0);return(0,r.jsxs)("div",{className:Ra()("flex flex-col items-center rounded-16 bg-white-6 pb-20 pt-16",t),children:[(0,r.jsxs)("span",{className:"title-h3-bold",children:["live"===e&&a("DROP.035","Ends in"),"ended"===e&&a("DROP.045","Ended"),"upcoming"===e&&a("DROP.068","Starts in")]}),(0,r.jsx)("div",{className:"mt-6 flex gap-4",children:c.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex flex-col rounded-10 bg-white-6 px-14 py-12",children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:u(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))}),(0,r.jsx)(ur,{dateStart:n,dateEnd:s})]})};var vr,hr,gr,fr=a(1601);function xr(){return xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xr.apply(null,arguments)}const wr=e=>g.createElement("svg",xr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 18 18"},e),vr||(vr=g.createElement("path",{fill:"url(#qualified-icon_svg__a)",d:"M8.222.962a1 1 0 0 1 1.556 0l.899 1.112a1 1 0 0 0 1.037.337l1.381-.371a1 1 0 0 1 1.259.914l.073 1.429a1 1 0 0 0 .642.882l1.335.512a1 1 0 0 1 .48 1.479l-.78 1.199a1 1 0 0 0 0 1.09l.78 1.2a1 1 0 0 1-.48 1.479l-1.335.51a1 1 0 0 0-.642.883l-.073 1.429a1 1 0 0 1-1.259.914l-1.38-.371a1 1 0 0 0-1.038.337l-.9 1.112a1 1 0 0 1-1.555 0l-.899-1.112a1 1 0 0 0-1.037-.337l-1.381.37a1 1 0 0 1-1.259-.913l-.073-1.429a1 1 0 0 0-.641-.882l-1.336-.511a1 1 0 0 1-.48-1.48l.78-1.199a1 1 0 0 0 0-1.09l-.78-1.2a1 1 0 0 1 .48-1.478l1.336-.512a1 1 0 0 0 .64-.882l.074-1.429a1 1 0 0 1 1.259-.914l1.38.371a1 1 0 0 0 1.038-.337z"})),hr||(hr=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2,d:"m6 9 2 2 4-4"})),gr||(gr=g.createElement("defs",null,g.createElement("linearGradient",{id:"qualified-icon_svg__a",x1:0,x2:18,y1:6.818,y2:6.818,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#41FF8D"}),g.createElement("stop",{offset:1,stopColor:"#2FA5E8"})))));var br=a(6966);const yr=({betStatus:e})=>{const t=(0,Sa.Bd)(),a=b(e=>e.prizeDrop.displayedCampaign),n=b(e=>e.prizeDrop.activeCampaign),s=(null==a?void 0:a.campaignId)===(null==n?void 0:n.campaignId);if(null===e)return null;const{bgClass:i,icon:l,title:o}=((e,t,a)=>t?e?{bgClass:"bg-green opacity-20",icon:(0,r.jsx)(wr,{className:"z-1"}),title:a("DROP.041","Your current bet meets the requirements")}:{bgClass:"bg-[rgba(255,71,102,0.2)]",icon:(0,r.jsx)("span",{className:"z-1 leading-[18px]",children:"😴"}),title:a("DROP.044","Your current bet does not meet the requirements")}:{bgClass:"bg-[rgba(255,96,71,0.2)]",icon:(0,r.jsx)("div",{className:"bg-add-gradient z-1 flex min-h-18 min-w-18 items-center justify-center rounded-full",children:(0,r.jsx)(br.A,{className:"h-full w-full"})}),title:a("LOBBY.040","You have already joined an active event.")})(e,s,t);return(0,r.jsxs)("div",{className:"relative -mb-10 mt-10 flex items-center gap-6 py-6 pl-6 pr-10",children:[(0,r.jsx)("div",{className:Ra()("absolute inset-0 rounded-20",i)}),l,(0,r.jsx)("span",{className:"text-small-reg z-1",children:o})]})},jr=({prizeDropMode:e,betStatus:t,isJoined:a})=>{const n=(0,Da.GV)(fr.uB),s=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"relative flex flex-col items-center rounded-tl-16 rounded-tr-16 bg-gradient-to-b from-white-6 to-transparent text-center",children:[(0,r.jsx)("img",{src:er.f.get(n?v:m),alt:"bg",className:"absolute left-1/2 top-0 w-full max-w-full -translate-x-1/2 ml:max-w-448"}),(0,r.jsx)(Ba,{prizeDropMode:e,className:"absolute right-10 top-10"}),(0,r.jsx)("img",{src:er.f.get(h),alt:"logo",className:"contain mt-20 h-74 w-140"}),(0,r.jsxs)("span",{className:"title-h3-bold mt-10 px-6",children:["ended"!==e&&s("DROP.002","Spin and win amazing prizes instantly!"),"ended"===e&&`${s("DROP.046","All winners have received their prizes!")} 🥳`]}),"ended"===e&&(0,r.jsxs)("span",{className:"text-medium-reg px-6 leading-[25px]",children:[s("DROP.047","Stay tuned for new events")," 🚀"]}),a&&(0,r.jsx)(yr,{betStatus:t})]})},Cr=({minimumBet:e,className:t=""})=>{const a=(0,Sa.Bd)();return(0,r.jsx)("div",{className:Ra()("rounded-16 bg-white-6 py-14",t),children:(0,r.jsxs)("div",{className:"text-medium-reg text-center",children:[a("DROP.034","Minimum bet to participate:")," ",(0,r.jsx)("span",{className:"font-bold",children:Be.bp.formatCash(e)})]})})},Nr=({className:e=""})=>{const t=b(e=>{var t;return zt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),a=b(e=>e.prizeDrop.displayedCampaign.prizes),n=b(Re),s=b(e=>e.wallet.trueDecimal),i="number"==typeof n&&n>0,l=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:Ra()("flex flex-col gap-1",e),children:[(0,r.jsxs)("div",{className:Ra()("text-small-reg grid rounded-tl-12 rounded-tr-12 bg-white-6 px-20 py-6","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsx)("div",{className:"opacity-60",children:l("DROP.031","Prize")}),(0,r.jsx)("div",{className:"text-right opacity-60",children:l("DROP.032","Count")}),"upcoming"!==t&&(0,r.jsx)("div",{className:"text-right opacity-60",children:l("DROP.033","Left")})]}),a.map(({prizeId:e,leftCount:a,totalCount:l,configCash:o,configTrue:c})=>{var u,p,m,v,h,g,f;return(0,r.jsxs)("div",{className:Ra()("text-medium-reg grid items-center bg-white-10 py-8 pl-16 pr-20 last-of-type:rounded-bl-12 last-of-type:rounded-br-12","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("img",{src:er.f.get(d),alt:"Cash prize",className:"contain h-36 w-36"}),"TRUE"===(null===(u=null==c?void 0:c.amount)||void 0===u?void 0:u.currency)?(0,r.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16"}),Be.bp.formatCash(null===(p=null==c?void 0:c.amount)||void 0===p?void 0:p.value,{showCurrency:!1,customDecimals:s,roundUp:!0})," "]}),i&&(0,r.jsxs)("span",{className:"text-xs-reg opacity-60",children:["~",Be.bp.formatCash((null!==(v=null===(m=null==c?void 0:c.amount)||void 0===m?void 0:m.value)&&void 0!==v?v:0)/n,{roundUp:!0})," "]})]}):(0,r.jsxs)("span",{className:"title-h3-bold",children:[Be.bp.formatCash(null===(h=null==o?void 0:o.amount)||void 0===h?void 0:h.value,{showCurrency:!1,customDecimals:null===(g=null==o?void 0:o.amount)||void 0===g?void 0:g.decimals,roundUp:!0})," ",(0,r.jsx)("span",{className:"text-small-bold",children:null===(f=null==o?void 0:o.amount)||void 0===f?void 0:f.currency})]})]}),(0,r.jsx)("span",{className:"text-right",children:l}),"upcoming"!==t&&(0,r.jsx)("span",{className:"text-right",children:a})]},e)})]})},Dr=({prizesLeftCount:e,winnersCount:t})=>{const a=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"mt-18 flex gap-10",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:e}),(0,r.jsxs)("span",{className:"text-small-med",children:["🎁 ",a("DROP.029","Prizes left")]})]}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:t}),(0,r.jsxs)("span",{className:"text-small-med",children:["⭐️ ",a("DROP.030","Winners")]})]})]})},Er=()=>{const e=(0,Da.GV)(e=>e.stake.current.amount),{prizesLeftCount:t,winnersCount:a,betAmount:n}=b(e=>e.prizeDrop.displayedCampaign),s=b(e=>{var t;return zt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),i=b(kt),l="live"===s?e>=n:null;return(0,g.useEffect)(()=>{Be.h$.emit("pdModal:eventsView")},[]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)(jr,{betStatus:l,prizeDropMode:s,isJoined:i}),"upcoming"===s&&(0,r.jsx)(mr,{prizeDropMode:s,className:"mt-6"}),(0,r.jsxs)("div",{className:Ra()("rounded-16 bg-white-6 px-14 pb-14 pt-16","live"===s&&"mt-6","live"===s&&i&&"!mt-16","ended"===s&&"mt-4"),children:["upcoming"!==s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sr,{}),(0,r.jsx)(Dr,{prizesLeftCount:t,winnersCount:a})]}),"upcoming"===s&&(0,r.jsx)(sr,{}),(0,r.jsx)(Nr,{className:Ra()("upcoming"===s?"mt-18":"mt-10")})]}),(0,r.jsx)(Cr,{minimumBet:n,className:"upcoming"===s&&"mb-13"}),"upcoming"!==s&&(0,r.jsx)(mr,{prizeDropMode:s,className:"mb-10"})]})};var Rr=a(9701);const zr=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),n=Math.floor(a/36e5%24),s=Math.floor(a/6e4%60),i=Math.floor(a/1e3%60),l=e=>String(e).padStart(2,"0");return{days:l(r),hours:l(n),mins:l(s),secs:l(i)}},kr=({dateStart:e,className:t=""})=>{const a=(0,Sa.Bd)(),[n,s]=(0,g.useState)(()=>zr(e));(0,g.useEffect)(()=>{const t=setInterval(()=>{s(zr(e))},1e3);return()=>clearInterval(t)},[e]);const i=[{value:n.days,text:a("DROP.036","Days")},{value:n.hours,text:a("DROP.037","Hrs")},{value:n.mins,text:a("DROP.038","Mins")},{value:n.secs,text:a("DROP.039","Secs")}],l=e=>Number(e)<0;return(0,r.jsxs)("div",{className:Ra()("flex flex-col gap-5",t),children:[(0,r.jsx)("span",{className:"text-small-reg text-left opacity-60",children:a("DROP.068","Starts in")}),(0,r.jsx)("div",{className:"flex gap-4",children:i.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex min-w-40 flex-col rounded-10 bg-white-20 p-8",style:{boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.20) inset"},children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:l(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))})]})},Sr=({campaign:e})=>{var t,a,n,s,i,l,d,c;const u=b(t=>zt(t,e.campaignId)),p="ended"===u,m="upcoming"===u,v="live"===u,h=b(Re),g=b(e=>e.wallet.trueDecimal),f="number"==typeof h&&h>0,x=(0,Da.GV)(fr.ge),y=(0,Sa.Bd)(),j=w(),C=e.prizes.some(e=>"true"===e.type);return(0,r.jsxs)("button",{type:"button",className:"relative flex h-170 w-full cursor-pointer flex-col justify-between overflow-hidden rounded-16 bg-[linear-gradient(79deg,#D1003F_0%,#D1003F_50%,#FF844F_100%)] p-20 drop-shadow-[0_1px_2px_rgba(0,0,0,0.2)]",onClick:()=>(j(ot(e)),void j(S("campaign"))),children:[(0,r.jsxs)("svg",{style:{transform:"rotate(65.125deg) translate(-115%, -36%)",position:"absolute",right:"-160px",top:"0",mixBlendMode:"plus-lighter",width:"268.556px",height:"583.547px"},width:"305",height:"170",viewBox:"0 0 305 170",fill:"none",children:[(0,r.jsxs)("g",{style:{mixBlendMode:"plus-lighter"},children:[(0,r.jsx)("g",{filter:"url(#filter0_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"167.639",cy:"115.844",rx:"167.639",ry:"115.844",transform:"matrix(-0.612432 0.790523 -0.999061 -0.0433308 508.881 -146.403)",fill:"#FF4D00"})}),(0,r.jsx)("g",{filter:"url(#filter1_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"135.464",cy:"72.9381",rx:"135.464",ry:"72.9381",transform:"matrix(0.938677 -0.344798 0.823647 0.567102 188.028 -5.93066)",fill:"#FF4D00"})})]}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("filter",{id:"filter0_f_5002_5141",x:"0.000213623",y:"-287.287",width:"580.958",height:"536.773",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"67.8837",result:"effect1_foregroundBlur_5002_5141"})]}),(0,r.jsxs)("filter",{id:"filter1_f_5002_5141",x:"183.68",y:"-124.579",width:"383.16",height:"226.608",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"25.4564",result:"effect1_foregroundBlur_5002_5141"})]})]})]}),(0,r.jsx)("img",{className:"absolute right-0 top-1/2 h-170 w-190 -translate-y-1/2",src:er.f.get(o),alt:""}),(0,r.jsx)(Ba,{prizeDropMode:u,className:"absolute right-16 top-16 z-[30]"}),(0,r.jsx)(Rr.Y,{className:"title-h1-bold relative z-10 max-w-[50%] text-left uppercase",text:""===(null===(t=e.texts)||void 0===t?void 0:t.title)||null===(null===(a=e.texts)||void 0===a?void 0:a.title)?y("LOBBY.005","Spin and Win"):e.texts.title,initialFontSize:20,initialLineHeight:23,maxHeight:46}),m&&(0,r.jsx)("div",{children:(0,r.jsx)(kr,{dateStart:e.dateStart})}),(v||p)&&(0,r.jsxs)("div",{className:"relative z-10 -mb-3 text-left",children:[(0,r.jsx)("div",{className:"text-small-bold mb-2",children:y("LOBBY.006","Prize pool")}),(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[C&&(0,r.jsx)(Ja,{className:"h-32 w-32"}),(0,r.jsx)(Ha,{variant:"title",className:"-mb-3",maxWidth:x?400:133,children:Be.bp.formatCash(null!==(s=null===(n=e.cashPrizePool)||void 0===n?void 0:n.value)&&void 0!==s?s:0,{showCurrency:!1,customDecimals:C?g:null===(i=e.cashPrizePool)||void 0===i?void 0:i.decimals,roundUp:!0})})]}),(0,r.jsxs)("div",{className:"h-21",children:[C&&f&&(0,r.jsxs)("div",{className:"title-h2-bold",children:["~",Be.bp.formatCash((null!==(d=null===(l=e.cashPrizePool)||void 0===l?void 0:l.value)&&void 0!==d?d:0)/h,{showCurrency:!0,roundUp:!0})]}),!C&&(0,r.jsx)(Ha,{variant:"currency",children:null===(c=e.cashPrizePool)||void 0===c?void 0:c.currency})]})]}),p&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[20] rounded-16 bg-[#000101] opacity-100",style:{mixBlendMode:"color"},"aria-hidden":!0})]},e.campaignId)},Br={running:0,scheduled:1,finished:2},Pr=e=>new Date(e).getTime(),Or=()=>{var e;const t=b(e=>e.prizeDrop.campaigns),a=(0,Sa.Bd)(),n=null!==(e=null==t?void 0:t.filter(e=>"cancelled"!==e.status).sort((e,t)=>{const a=Br[e.status]-Br[t.status];if(0!==a)return a;const r=Pr(e.dateStart),n=Pr(t.dateStart);return"running"===e.status?n-r:r-n}))&&void 0!==e?e:[],s=0===n.filter(e=>!("finished"===e.status)).length;return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-12",children:[(0,r.jsx)("div",{className:"title-h2-bold pl-16",children:a("LOBBY.004","Events")}),(0,r.jsxs)("div",{className:"flex flex-col gap-12",children:[n.map(e=>(0,r.jsx)(Sr,{campaign:e},e.campaignId)),s&&(0,r.jsxs)("div",{className:"text-medium-reg rounded-12 bg-white-10 p-14 text-center opacity-80",children:[a("LOBBY.011","New thrilling events are coming soon — stay tuned 🚀 ")," 🚀"]})]})]})},Lr=({htmlString:e})=>(0,r.jsx)("div",{className:Ra()("[&_h3]:text-medium-bold [&_h3:first-child]:mt-0 [&_h3]:mt-19","[&_p]:text-small-reg [&_p>strong]:text-small-bold [&_p]:mt-4 [&_p]:opacity-80 [&_p]:ml:mt-5","[&_ul]:mt-4 [&_ul]:flex [&_ul]:flex-col [&_ul]:gap-3","[&_li]:text-small-reg [&_li]:relative [&_li]:pl-22 [&_li]:opacity-80 [&_li]:before:absolute [&_li]:before:left-10 [&_li]:before:top-7 [&_li]:before:h-4 [&_li]:before:w-4 [&_li]:before:rounded-full [&_li]:before:bg-additional","[&_table]:mt-4 [&_table]:w-full","[&_thead]:text-small-bold [&_thead>tr>th:first-child]:rounded-tl-10 [&_thead>tr>th:last-child]:rounded-tr-10 [&_thead>tr>th]:h-30 [&_thead>tr>th]:w-1/2 [&_thead>tr>th]:bg-white-10 [&_thead>tr>th]:pl-12 [&_thead>tr>th]:text-left","[&_tbody>tr>td]:text-small-reg [&_tbody>tr>td]:relative [&_tbody>tr>td]:h-30 [&_tbody>tr>td]:pl-12","[&_tbody>tr:last-child>td:first-child]:before:rounded-bl-10 [&_tbody>tr:last-child>td:last-child]:before:rounded-br-10 [&_tbody>tr>td:last-child]:before:border-r [&_tbody>tr>td]:before:absolute [&_tbody>tr>td]:before:left-0 [&_tbody>tr>td]:before:top-0 [&_tbody>tr>td]:before:h-full [&_tbody>tr>td]:before:w-full [&_tbody>tr>td]:before:border-b [&_tbody>tr>td]:before:border-l [&_tbody>tr>td]:before:border-solid [&_tbody>tr>td]:before:border-white-10"),dangerouslySetInnerHTML:{__html:e}}),Ir=()=>{const e=b(e=>e.prizeDrop.displayedCampaign.texts.rules);return(0,g.useEffect)(()=>{Be.h$.emit("pdModal:rulesView")},[]),(0,r.jsx)("div",{className:"mb-19 rounded-16 bg-white-6 p-20 text-white",children:(0,r.jsx)(Lr,{htmlString:e})})},Tr=({config:e,activeTab:t,setActiveTab:a})=>e.length?(0,r.jsx)("div",{className:"flex h-44 w-384",children:e.map(e=>(0,r.jsx)("button",{className:Ra()(["first-of-type:border-l-solid first-of-type:rounded-l-12 first-of-type:border-l-2 first-of-type:border-l-white-20"],["last-of-type:border-r-solid last-of-type:rounded-r-12 last-of-type:border-r-2 last-of-type:border-r-white-20"],"border-y-solid group flex-1 border-y-2 border-y-white-20 ",e.id===t&&"pointer-events-none !border-transparent bg-white-20"),type:"button",onClick:r=>((e,r)=>{e.preventDefault(),r!==t&&a(r)})(r,e.id),children:(0,r.jsx)("span",{className:Ra()("text-medium-bold",e.id===t?"opacity-100":"opacity-40 group-hover:opacity-80 group-hover:transition-opacity"),children:e.title})},e.id))}):null;const _r=({campaignId:e})=>(t,a)=>{return r=void 0,n=void 0,i=function*(){t(vt({campaignId:e})).unwrap().then(a=>{a.joined&&(t(ft({campaignId:e})),t(ht()))}).catch(e=>{Be.vF.error(e)})},new((s=void 0)||(s=Promise))(function(e,t){function a(e){try{o(i.next(e))}catch(e){t(e)}}function l(e){try{o(i.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s(function(e){e(r)})).then(a,l)}o((i=i.apply(r,n||[])).next())});var r,n,s,i};var Ar=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const Mr=(e={})=>(t,a,r)=>Ar(void 0,void 0,void 0,function*(){var n;const s=null!==(n=e.shouldFreezeUi)&&void 0!==n&&n;s&&r.mainDispatch((0,Pe.zE)()),t(mt()).unwrap().then(e=>Ar(void 0,void 0,void 0,function*(){var n,i,l,o,d,c,u;s&&r.mainDispatch((0,Pe.GP)());const p=null===(n=null==e?void 0:e.campaigns)||void 0===n?void 0:n.find(e=>e.joined&&"running"===e.status);if(t(Et(null!==(i=null==e?void 0:e.campaigns)&&void 0!==i?i:[])),t(be(null===(l=null==e?void 0:e.isWalletAvailable)||void 0===l||l)),t(we(null!==(o=null==e?void 0:e.trueSessionRate)&&void 0!==o?o:null)),t(ye(null!==(d=null==e?void 0:e.wallets)&&void 0!==d?d:[])),t(je(null!==(c=null==e?void 0:e.convertParams)&&void 0!==c?c:null)),t(ht()),t(ea()),null==p?void 0:p.joined)t(lt(p)),Be.h$.emit("campaignId:set",p.campaignId);else{const r=a().prizeDrop.prizeDropLiveShownCampaignIds,n=null===(u=null==e?void 0:e.campaigns)||void 0===u?void 0:u.filter(e=>"running"===e.status&&!e.joined&&!r.includes(e.campaignId));t(bt(null!=n?n:[])),(null==n?void 0:n.length)>0&&t(ot(null==n?void 0:n[0]))}})).catch(e=>{s&&r.mainDispatch((0,Pe.GP)()),Be.vF.error(e)})}),Fr=()=>(e,t,a)=>Ar(void 0,void 0,void 0,function*(){e(mt()).unwrap().then(a=>Ar(void 0,void 0,void 0,function*(){var r,n,s,i,l;const o=a.campaigns.find(e=>e.joined&&"running"===e.status);e(Et(a.campaigns)),e(be(null===(r=a.isWalletAvailable)||void 0===r||r)),e(we(null!==(n=a.trueSessionRate)&&void 0!==n?n:null)),e(ye(null!==(s=a.wallets)&&void 0!==s?s:[])),e(je(null!==(i=a.convertParams)&&void 0!==i?i:null)),(null===(l=t().prizeDrop.socketConnection)||void 0===l?void 0:l.isSuccess)||e(ht()),e(lt(o))})).catch(e=>{a.mainDispatch((0,Pe.GP)()),Be.vF.error(e)})}),Ur=[..._t,"prizeDropResultFinished","prizeDropResultCancelled"],$r=e=>(t,a,r)=>{const n=r.mainGetState().play.isActive,{activeCampaign:s,campaigns:i}=a().prizeDrop;i.find(t=>t.campaignId===e.campaignId)?"finished"===e.status||"cancelled"===e.status?n&&(null==s?void 0:s.campaignId)===e.campaignId?(t(Dt()),t(xt(e))):(t(dt(e)),(null==s?void 0:s.campaignId)===e.campaignId&&(t(Dt()),"finished"===e.status?t(Ge("prizeDropResultFinished")):"cancelled"===e.status&&t(Ge("prizeDropResultCancelled")))):t(n?xt(e):dt(e)):(a().modals.current.includes("promoLobby")&&t(ue(e.campaignId)),t(Mr()))};var Yr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Vr.apply(null,arguments)}const Wr=e=>g.createElement("svg",Vr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 22 22"},e),Yr||(Yr=g.createElement("path",{fill:"#fff",d:"M13.024 13.024a.75.75 0 0 0 .474-1.423l-.237.711zm-1.732-1.368h-.75c0 .323.207.61.513.712zm.75-2.744a.75.75 0 0 0-1.5 0h1.5m1.219 3.4.237-.711-1.969-.656-.237.711-.237.712 1.969.656zm-1.969-.656h.75V8.912h-1.5v2.744zm5.25-.656h-.75a4.5 4.5 0 0 1-4.5 4.5V17a6 6 0 0 0 6-6zm-5.25 5.25v-.75a4.5 4.5 0 0 1-4.5-4.5h-1.5a6 6 0 0 0 6 6zM6.042 11h.75a4.5 4.5 0 0 1 4.5-4.5V5a6 6 0 0 0-6 6zm5.25-5.25v.75a4.5 4.5 0 0 1 4.5 4.5h1.5a6 6 0 0 0-6-6z"})));var Gr=a(6861),Jr=a(454);const Kr=({text:e,className:t=""})=>(0,r.jsxs)("div",{className:Ra()("relative flex min-w-290 items-center justify-center gap-12 rounded-8 bg-main-ui px-16 py-12 shadow-notify-modals",t),children:[(0,r.jsx)("div",{className:"absolute h-full w-full rounded-8 bg-white-10"}),(0,r.jsx)("div",{className:"bg-add-gradient flex min-h-22 min-w-22 shrink-0 items-center justify-center overflow-hidden rounded-full",children:(0,r.jsx)(Wr,{className:"h-full w-full"})}),(0,r.jsx)("div",{className:"text-medium-med",children:e})]}),Hr=(0,g.createContext)(null),Qr=({children:e})=>{const[t,a]=(0,g.useState)(null),n=(0,g.useRef)(null),s=(0,g.useCallback)((e,t)=>{clearTimeout(n.current),a({type:e,text:t}),n.current=setTimeout(()=>{a(null)},1500)},[]),i=(0,g.useCallback)((e="Reward claimed")=>{s("success",e)},[s]),l=(0,g.useCallback)((e="Something went wrong")=>{s("failed",e)},[s]),o=(0,g.useCallback)((e="Unfortunately, the reward expiration time has ended.")=>{s("expired",e)},[s]),d=(0,g.useMemo)(()=>({showSuccessToast:i,showFailedToast:l,showExpiredToast:o}),[i,l,o]);return(0,r.jsxs)(Hr.Provider,{value:d,children:[e,t&&(0,r.jsxs)("div",{className:"pointer-events-none fixed left-1/2 top-28 z-[71] min-w-290 -translate-x-1/2 text-wrap px-16",children:["success"===t.type&&(0,r.jsx)(Jr.r,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"expired"===t.type&&(0,r.jsx)(Kr,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"failed"===t.type&&(0,r.jsx)(Gr.v,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"})]})]})},qr=()=>{const e=(0,g.useContext)(Hr);if(!e)throw new Error("usePromoLobbyToast must be used within PromoLobbyToastProvider");return e};var Xr;function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Zr.apply(null,arguments)}const en=e=>g.createElement("svg",Zr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Xr||(Xr=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 14h8M8 2v8.333m0 0L11.333 7M8 10.333 4.667 7"}))),tn={deposit:{label:"Received",key:"LOBBY.020"},prizedrop:{label:"Prizedrop Reward",key:"LOBBY.007"},airdrop:{label:"Airdrop Reward",key:"LOBBY.010"},sent:{label:"Sent",key:"LOBBY.019"},conversion:{label:"Conversion",key:"LOBBY.071"}},an=({transaction:e})=>{const t="top-up"===e.type,a=(0,Sa.Bd)(),n=b(e=>e.wallet.trueDecimal);return(0,r.jsxs)("div",{className:"flex items-center gap-10 rounded-16 bg-white-10 py-5 pl-5 pr-15",children:[(0,r.jsx)("div",{className:"flex h-34 w-34 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(en,{className:Ra()("h-16 w-16 opacity-60",!t&&"rotate-180")})}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("span",{className:"text-medium-med",children:a(tn[e.subType].key,tn[e.subType].label)})}),(0,r.jsxs)("div",{className:Ra()("text-medium-bold flex shrink-0 items-center gap-6",t?"text-[#77DA29]":"text-white opacity-60"),children:[t&&(0,r.jsx)("span",{children:"+"}),!t&&(0,r.jsx)("span",{children:"-"}),(0,r.jsx)(Xa,{className:Ra()("h-16 w-16",t?"text-[#77DA29]":"text-white")}),Be.bp.formatCash(Math.abs(e.amount),{showCurrency:!1,customDecimals:n,roundUp:!0})]})]})},rn=()=>{const e=(0,Sa.Bd)(),t=w(),a=b(e=>e.transaction.transactions),n=b(e=>e.transaction.apiTransactions.isPending),s=b(Ee),i=b(e=>e.transaction.hasMore),l=b(e=>e.transaction.currentPage),o=b(e=>e.transaction.apiTransactions.error),{showFailedToast:d}=qr(),c=(0,g.useRef)(null),u=(0,g.useRef)(n),p=n||!s;return(0,g.useEffect)(()=>{const t=u.current;u.current=n,t&&!n&&o&&d(e("LOBBY.037","Something went wrong. Please try again."))},[n,o,d,e]),(0,g.useEffect)(()=>{if(!i||p||o)return;const e=c.current;if(!e)return;const a=new IntersectionObserver(e=>{e[0].isIntersecting&&s&&t(da({page:l+1}))},{threshold:0});return a.observe(e),()=>a.disconnect()},[i,p,l,o]),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-white",children:e("LOBBY.015","History")}),!p&&0===a.length&&(0,r.jsx)("div",{className:"flex h-56 flex-col items-center justify-center rounded-12 bg-white-6 p-12 text-center",children:(0,r.jsx)("div",{className:"text-medium-reg opacity-60",children:e("LOBBY.016","There are no transactions yet")})}),a.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[a.filter(e=>"completed"===e.status).map(e=>(0,r.jsx)(an,{transaction:e},e.transactionId)),i&&(0,r.jsx)("div",{ref:c,className:"h-1"})]}),p&&(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(Oa.k,{className:"!mb-20 !mt-5 !h-17 !w-17 !p-2"})})]})};const nn=({rewardId:e,fromHub:t=!1})=>(a,r)=>{return n=void 0,s=void 0,l=function*(){var n,s,i,l;const o=r().rewards.rewards.find(t=>t.rewardId===e),d=null!==(l=null===(i=null===(s=null===(n=null==o?void 0:o.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0;a(ta({rewardId:e})).unwrap().then(()=>{a(oe(e)),a(ce(e)),d>0&&(a(fe(d)),a(la({amount:d,rewardId:e}))),a(Vt(e)),t&&(a(Ht(e)),a(qt())),r().wallet.isWalletAvailable&&a(da({page:1}))}).catch(e=>{Be.vF.error(e)})},new((i=void 0)||(i=Promise))(function(e,t){function a(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(a,r)}o((l=l.apply(n,s||[])).next())});var n,s,i,l},sn=e=>(t,a,r)=>{var n;const s=null===(n=a().rewards.winReward)||void 0===n?void 0:n.rewardId;t(Je(e)),s&&t(Ht(s)),t(Gt()),t(qt());const{rewardsQueue:i}=a().rewards,l=i[0];l&&(t(Wt(l.reward)),t(Ge(At(l)))),r.mainDispatch((0,he.M5)())},ln=e=>(t,a,r)=>{var n,s,i,l,o,d,c,u;const p=a(),m=r.mainGetState().play.isActive;if(e.status===It.ti.REDEEMED&&e.type===It.Dy.CONVERT){Be.h$.emit("rewardConvert:pendingCleared",(0,Za.i6)(e,"claimed")),t(Vt(e.rewardId)),t(Ht(e.rewardId));const r=a(),s=r.modals.current.filter(e=>_t.includes(e));if((null===(n=r.rewards.winReward)||void 0===n?void 0:n.rewardId)===e.rewardId&&s.length>0){if(r.rewards.apiClaim.data)return;s.forEach(e=>{t(Je(e))}),t(Gt()),t(qt())}return}const v=!a().rewards.apiClaim.isPending;if(e.status===It.ti.REDEEMED&&v)return t(ce(e.rewardId)),t(Vt(e.rewardId)),t(Ht(e.rewardId)),t(Je("prizeDropClaimed")),void t(Je("prizeDropCongratulation"));if(t(Yt(e)),(e.type===It.Dy.TRUE||e.type===It.Dy.CASH)&&e.status===It.ti.ACTIVE){if(e.type===It.Dy.TRUE&&Be.h$.emit("prizeDrop:won",(0,Za.ym)(e)),e.type===It.Dy.CASH){const a=null!==(o=null===(l=null===(i=null===(s=e.rewardCash)||void 0===s?void 0:s.configCash)||void 0===i?void 0:i.amount)||void 0===l?void 0:l.value)&&void 0!==o?o:0;a>0&&(t(fe(a)),t(la({amount:a,rewardId:e.rewardId})))}t(Kt([e]));const r=a().rewards.rewardsQueue[0];if(!r)return;return m?(t(Wt(r.reward)),void t(Jt(!0))):p.modals.current.some(e=>_t.includes(e))?(a().modals.current.filter(e=>_t.includes(e)).forEach(e=>{t(Je(e))}),t(qt()),t(Wt(r.reward)),void t(Ge(At(r)))):(t(Wt(r.reward)),void t(Ge(At(r))))}if(e.type===It.Dy.CONVERT)return;const h=null!==(u=null===(c=null===(d=e.rewardStaking)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.value)&&void 0!==u?u:0;h>0&&(t(fe(h)),t(la({amount:h,rewardId:e.rewardId}))),a().wallet.isWalletAvailable&&t(da({page:1}))};var on=a(8682),dn=a(4354),cn=a(8578),un=a(8608),pn=a(8351),mn=a.n(pn);const vn=e=>""===e?new(mn())(0):new(mn())(e),hn=(e,t)=>vn(e).toDecimalPlaces(t,mn().ROUND_CEIL).toNumber(),gn=(e,t)=>{const a=vn(e).toDecimalPlaces(2,mn().ROUND_FLOOR);if(100===t)return a.toString();const r=vn(e).mul(t).div(100).toDecimalPlaces(2,mn().ROUND_CEIL);return(r.greaterThan(a)?a:r).toString()},fn=({amount:e,commissionAmount:t,currencyDecimals:a,exchangeRate:r,penaltyPercent:n})=>{const s=vn(e).toNumber(),i=vn(1).minus(vn(n).div(100)),l=vn(s).minus(t),o=l.isNegative()?vn(0):l,d=Number.isFinite(r)&&r>0,c=d?vn(1).div(r):vn(0),u=c.mul(i),p=d?hn(c,a):0,m=d?hn(u,a):0,v=d?(h=o.mul(u),g=a,vn(h).toDecimalPlaces(g,mn().ROUND_HALF_UP).toNumber()):0;var h,g;return{inputAmountTrue:s,convertAmountTrue:o.toNumber(),resultEur:v,regularExchangeRate:p,penaltyExchangeRate:m}};var xn=a(5894),wn=a(3372),bn=a(3654),yn=a(7263);const jn=({children:e,onClose:t=null,fullScreen:a=!1,background:n=null,modalName:s="promoLobby"})=>{const i=b(e=>e.modals.current.at(-1)||null),l=(0,Da.GV)(e=>!!e.modals.current.length),o=(0,Da.GV)(e=>e.viewPort.userAgent.browser.isSafari),d=(0,g.useRef)(null),c=o?{isolation:"isolate",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"}:void 0,u=()=>{i===s&&t&&(Be.VH.emit("button:clicked",{name:"modalClose",value:s}),t())};return(0,bn.Ls)([d],u,!l),(0,bn.dD)("Escape",u,!l),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ra()("fixed inset-0 -right-1 bottom-39 bg-brand-black opacity-75",xn.T.modal),style:c}),(0,r.jsx)("div",{className:Ra()("fixed -left-1 -right-1 bottom-0 h-40 bg-brand-black",xn.T.modal),style:c}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:d,"data-testid":(0,wn.j)(`${s}-modal`),className:Ra()("promo-lobby-modal-gradient-border bg-brand-black-95 fixed bottom-40 left-0 right-0 flex w-full flex-col items-center overflow-hidden rounded-t-20",a&&["top-40 bg-white-6-gradient ml:top-20"],!a&&["max-h-[calc(100%-40px-20px)]"],xn.T.modal),style:c,children:[e,n&&(0,r.jsx)(yn.o,{src:er.f.get(n),from:"from-main-ui-bleached-06",className:"!absolute left-1/2 top-1/2 z-[-1] size-1000 min-w-1000 -translate-x-1/2 -translate-y-1/2 opacity-20"})]})})]})},Cn=({children:e,hasShadow:t=!1,className:a="",scrollbarInsetTop:n=0,scrollbarInsetBottom:s=0})=>{const i=b(e=>e.promoLobby.activeScreen),l=b(e=>e.promoLobby.topBarScreen),o=(0,Da.GV)(e=>e.viewPort.style.scale),d=(0,g.useRef)(null),c=(0,g.useRef)(null),u=(0,g.useRef)(null),[p,m]=(0,g.useState)(0),[v,h]=(0,g.useState)(0),[f,x]=(0,g.useState)(0),[w,y]=(0,g.useState)(!1),j=(0,g.useRef)(0),C=v-p<1;function N(){if(c.current&&d.current){const e=c.current.clientHeight,t=d.current.clientHeight;if(e>t){const a=Math.max(0,n),r=Math.max(0,s),i=Math.max(0,t-a-r);h(e-t);const l=i>0?i*t/e:0;x(Math.min(i,l)),y(i>0)}else y(!1),m(0)}}const D=`${i}-${null!=l?l:"null"}`,E=(0,g.useRef)(D);(0,g.useEffect)(()=>{w&&E.current!==D&&(m(0),E.current=D),E.current=D},[w,D]),(0,g.useEffect)(()=>{if(w){const e=e=>{e.preventDefault(),e.stopPropagation()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}}},[w]),(0,fr.st)(N,0,c),(0,g.useEffect)(()=>{w&&p>=c.current.scrollHeight-d.current.clientHeight&&m(c.current.clientHeight-d.current.clientHeight)},[f,w,p]);const R=e=>{const t=d.current;if(!t)return;const a=t.getBoundingClientRect(),r=Math.max(0,n),i=Math.max(0,s),l=Math.max(0,t.clientHeight-r-i),c=Math.max(0,l-f);if(0===c)return;let u=(e.clientY-a.top)/o-r-j.current;u=Math.max(0,Math.min(u,c)),m(u/c*v)},z=()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",z)};return(0,r.jsxs)("div",{ref:d,className:Ra()("relative h-full w-full touch-none overflow-hidden scroll-smooth",a),onWheel:e=>{if(N(),w){const t=p+e.deltaY;m(Math.max(0,Math.min(t,v)))}},onTouchStart:e=>{if(N(),w){const t=e.touches[0].clientY;d.current.dataset.touchStartY=(t/o).toString()}},onTouchMove:e=>{if(N(),w){const t=d.current,a=parseFloat(t.dataset.touchStartY||"0"),r=e.touches[0].clientY,n=p+(a-r/o);m(Math.max(0,Math.min(n,v))),t.dataset.touchStartY=(r/o).toString()}},children:[(0,r.jsx)("div",{ref:c,className:"custom-scroll-content relative scroll-smooth will-change-transform",style:{transform:`translateY(-${p}px)`,transition:"none"},children:e}),t&&(0,r.jsx)("div",{className:Ra()("bg-surface-gradient pointer-events-none absolute -bottom-10 left-0 z-2 h-104 w-full",C?"transition-opacity duration-300":"transition-none"),style:{opacity:C?0:1}}),w&&(0,r.jsx)("div",{ref:u,className:"absolute right-6 top-0 w-3 cursor-pointer rounded-3 bg-white-20 md:right-11",style:{height:`${f}px`,transform:(()=>{var e;const t=(null===(e=d.current)||void 0===e?void 0:e.clientHeight)||0,a=Math.max(0,n),r=Math.max(0,s),i=Math.max(0,t-a-r),l=Math.max(0,i-f);return`translateY(${a+(l>0?l*p/v:0)}px)`})()},onMouseDown:e=>{e.preventDefault();const t=d.current,a=u.current;if(!t||!a)return;const r=a.getBoundingClientRect();j.current=(e.clientY-r.top)/o,document.addEventListener("mousemove",R),document.addEventListener("mouseup",z)}})]})},Nn=({children:e,className:t="",contentClassName:a="",scrollbarInsetTop:n=null,scrollbarInsetBottom:s=null})=>(0,r.jsx)(Cn,{scrollbarInsetTop:n,scrollbarInsetBottom:s,className:Ra()("w-full flex-1",t),children:(0,r.jsx)("div",{className:Ra()("mx-auto max-w-560 px-15 ml:px-0",a),children:e})}),Dn=({children:e,className:t=""})=>(0,r.jsx)("div",{className:Ra()("bg-brand-black-95 w-full px-16 pb-14 ml:pb-6",t),children:e});var En=a(6629),Rn=a(5529),zn=a(3277),kn=a(2306);const Sn=({children:e,onReturn:t=null,onClose:a=null,returnType:n="back",modalName:s="promoLobby",classes:i={closeButton:"",returnButton:""}})=>{const l=!!(0,Da.GV)(e=>e.session.urls.lobby),o=(0,Da.GV)(e=>e.app.urlParams.isHomeButtonDisabled),d=t&&("back"===n||"home"===n&&l&&!o);return(0,r.jsxs)("div",{className:"relative w-full px-60",children:[d&&(0,r.jsx)(kn.K,{"data-testid":"return-button",icon:"home"===n?zn.A:En.A,className:Ra()("absolute left-8 top-8 z-1",null==i?void 0:i.returnButton),onClick:e=>{"home"!==n&&Be.VH.emit("button:clicked",{name:"return"}),t(e)}}),e,a&&(0,r.jsx)(kn.K,{"data-testid":"close-button",icon:Rn.A,className:Ra()("absolute right-8 top-8 z-1",null==i?void 0:i.closeButton),onClick:e=>{e.stopPropagation(),Be.VH.emit("button:clicked",{name:"modalClose",value:s}),a()}})]})},Bn=({children:e,onClose:t=null,background:a=null,modalName:n="promoLobby"})=>{const s=b(e=>e.modals.current.at(-1)||null),i=(0,Da.GV)(e=>!!e.modals.current.length),l=(0,g.useRef)(null),o=()=>{s===n&&t&&!i&&(Be.VH.emit("button:clicked",{name:"modalClose",value:n}),t())};return(0,bn.Ls)([l],o,!i),(0,bn.dD)("Escape",o,!i),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ra()("fixed inset-0 -right-1 bottom-0",xn.T.modal),style:{background:"radial-gradient(107.99% 100% at 50% 0%, rgba(13, 242, 193, 0.1) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(8, 8, 8, 0.00) 100%), var(--colors-brand-black)"}}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:l,"data-testid":(0,wn.j)(`${n}-modal`),className:Ra()("fixed bottom-0 left-0 right-0 top-0 flex w-full flex-col items-center overflow-hidden rounded-t-0",xn.T.modal),children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-0 h-full w-full",children:(0,r.jsx)("img",{className:"h-full w-full object-cover object-center ml:scale-[1.5]",src:er.f.get(a),alt:""})}),e,(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:o,onKeyDown:o,className:"fixed bottom-0 left-0 right-0 h-40 w-full cursor-default"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:o,onKeyDown:o,className:"fixed left-0 right-0 top-0 h-20 w-full cursor-default"})]})})]})},Pn=e=>!!e&&new Date(e).getTime()<=Date.now(),On=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.rewards.apiClaim),u=b(e=>e.modals.current.includes("promoLobby")),p=b(e=>e.promoLobby.activeScreen),f=b(e=>e.promoLobby.topBarScreen),{isPending:x,data:y,error:j}=c,C=b(e=>e.wallet.trueDecimal),N=b(Re),D="number"==typeof N&&N>0,[E,R]=(0,g.useState)(!1),z=(0,Sa.Bd)(),k=w(),S=()=>{Be.h$.emit("reward:expired",(0,Za.rx)(d,"expired")),k(Qt({rewardId:d.rewardId,claimUiStatus:"expired"})),k(ce(d.rewardId)),k(Vt(d.rewardId)),k(qt()),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedExpired"))};(0,g.useEffect)(()=>{Be.h$.emit("pdModalWinTrue:opened",(0,Za.ym)(d))},[d]),(0,g.useEffect)(()=>{R(!1)},[d.rewardId]),(0,g.useEffect)(()=>{if(y&&E&&(Be.h$.emit("reward:claimSuccess",(0,Za.rx)(d,"claimed")),k(Qt({rewardId:d.rewardId,claimUiStatus:"success"})),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedSuccess")),k(qt())),j&&!x&&E){if(Pn(d.expiresAt))return void S();Be.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,Za.rx)(d,"new")),{error_code:j.name})),k(Qt({rewardId:d.rewardId,claimUiStatus:"error"})),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedFailed"))}},[E,y,j,x]);const B=()=>{x||(Be.h$.emit("pdModalWinDrop:closed",(0,Za.ym)(d)),u&&"true-world"===p&&null===f&&k(oe(d.rewardId)),k(sn("prizeDropClaimed")))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimed",onClose:B,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimed",onClose:B,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:z("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:z("DROP.072","You've won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:C,roundUp:!0})," "]})]}),D&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/N,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:z("DROP.070","Claim your prize to have it credited to your account")})]}),(0,r.jsx)(La,{text:z("LOBBY.008","Claim"),loadingText:z("LOBBY.036","Pending"),isLoading:x,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{if(R(!0),Pn(d.expiresAt))return(0,M.yy)(300),void S();k(nn({rewardId:d.rewardId}))},disabled:x})]})})]})},Ln=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.wallet.trueDecimal),u=b(Re),p="number"==typeof u&&u>0,h=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimExpired:opened")},[]),(0,g.useEffect)(()=>{},[]);const x=()=>{Be.h$.emit("pdModalClaimExpired:closed"),f(sn("prizeDropClaimedExpired"))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedExpired",onClose:x,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedExpired",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Wr,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:h("DROP.077","Reward expired")}),(0,r.jsx)("div",{className:"title-h3-bold",children:h("DROP.078","Time is up")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:c,roundUp:!0})," "]})]}),p&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/u,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:h("DROP.079","Unfortunately, the reward expiration time has ended.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:x,children:h("GEN.220","Close")})]})})]})},In=({t:e,error:t,fallbackKey:a,fallbackMessage:r})=>{var n,s;return(null==t?void 0:t.code)?e(null!==(n=t.languageKey)&&void 0!==n?n:"",null!==(s=t.message)&&void 0!==s?s:r):e(a,r)},Tn=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.rewards.apiClaim),{isPending:u,data:p,error:h}=c,f=b(e=>e.wallet.trueDecimal),x=b(Re),y="number"==typeof x&&x>0,j=(0,Sa.Bd)(),C=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimFailed:opened")},[]),(0,g.useEffect)(()=>{p&&d&&(C(Qt({rewardId:d.rewardId,claimUiStatus:"success"})),C(Je("prizeDropClaimedFailed")),C(Ge("prizeDropClaimedSuccess")),C(qt()))},[p,C,d]);const N=()=>{u||(Be.h$.emit("pdModalClaimFailed:closed"),C(sn("prizeDropClaimedFailed")))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedFailed",onClose:N,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedFailed",onClose:N,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(br.A,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:j("DROP.074","Claim failed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:j("DROP.075","Something went wrong")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:f,roundUp:!0})," "]})]}),y&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/x,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:In({t:j,error:h,fallbackKey:"DROP.076",fallbackMessage:"We couldn't process your request. Please try again later."})})]}),(0,r.jsx)(La,{text:j("DROP.017","Try Again"),loadingText:j("LOBBY.036","Pending"),isLoading:u,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{u||C(nn({rewardId:d.rewardId}))},disabled:u})]})})]})};var _n=a(598);const An=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.wallet.trueDecimal),u=b(Re),p="number"==typeof u&&u>0,h=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimSuccess:opened")},[]);const x=()=>{Be.h$.emit("pdModalClaimSuccess:closed"),f(sn("prizeDropClaimedSuccess"))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedSuccess",onClose:x,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedSuccess",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(_n.A,{className:"h-74 w-74 rounded-full bg-green ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:h("DROP.071","Reward claimed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:h("DROP.072","You’ve won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:c,roundUp:!0})," "]})]}),p&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/u,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:h("DROP.073","The reward has been successfully credited to your balance.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:x,children:h("GEN.220","OK")})]})})]})},Mn=()=>{var e,t,a,n,s,i,l,o,d;const c=(0,Da.GV)(fr.uB),u=b(e=>e.rewards.winReward),p=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalWinDrop:opened",(0,Za.ym)(u))},[u]);const x=()=>{Be.h$.emit("pdModalWinDrop:closed",(0,Za.ym)(u)),f(sn("prizeDropCongratulation"))};return(0,r.jsxs)(jn,{modalName:"prizeDropCongratulation",onClose:x,children:[c&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!c&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropCongratulation",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.019","You’ve won a cash prize")})]}),(0,r.jsx)("div",{className:"text-prize-drop",children:(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=null==u?void 0:u.rewardCash)||void 0===e?void 0:e.configCash)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:null===(i=null===(s=null===(n=null==u?void 0:u.rewardCash)||void 0===n?void 0:n.configCash)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.decimals,roundUp:!0})," ",null===(d=null===(o=null===(l=null==u?void 0:u.rewardCash)||void 0===l?void 0:l.configCash)||void 0===o?void 0:o.amount)||void 0===d?void 0:d.currency]})}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.020","Instantly credited to your account.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),x()},children:p("DROP.021","Great news!")})]})})]})},Fn=()=>{const{apiJoinCampaign:e}=b(e=>e.prizeDrop),{campaignId:t}=b(e=>e.prizeDrop.displayedCampaign),a=w(),n=(0,Sa.Bd)();(0,g.useEffect)(()=>{Be.h$.emit("pdModalJoinError:opened")},[]),((t,r)=>{const n=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(n.current)return e.data&&(e.data.joined?(Be.h$.emit("pdModalJoinError:successRetry"),a(Ge("prizeDropSuccess")),a(Je("prizeDropJoinError")),a(Dt()),a(ht())):(Be.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(Ge("prizeDropJoinError")))),void(e.error&&(Be.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(Ge("prizeDropJoinError"))))},r),(0,g.useEffect)(()=>{n.current=!0},[])})(0,[e]);const s=()=>{e.isPending||(Be.h$.emit("pdModalJoinError:closed"),a(Lt("prizeDropJoinError")),a(Nt()))};return(0,r.jsxs)(jn,{onClose:s,modalName:"prizeDropJoinError",children:[(0,r.jsx)(Sn,{onClose:s,returnType:"home",modalName:"prizeDropJoinError",children:(0,r.jsx)("div",{className:"title-h1-bold pb-18 pt-25 text-center uppercase ml:pt-19",children:n("DROP.015","Oops")})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-604 select-text flex-col items-center gap-18 px-14 pb-30 ml:px-0 ml:pb-31",children:[(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-medium-reg mb-2",children:In({t:n,error:e.error,fallbackKey:"DROP.016",fallbackMessage:"Something's wrong... Please try again."})})}),(0,r.jsx)(La,{text:n("DROP.017","Try Again"),loadingText:n("DROP.011","Joining..."),className:"w-full max-w-354 !bg-brand-gradient",isLoading:e.isPending,onClick:e=>{e.stopPropagation(),Be.VH.emit("button:clicked",{name:"service"}),a(_r({campaignId:t})),Be.h$.emit("pdModalJoinError:startRetry")}})]})})]})};var Un;function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},$n.apply(null,arguments)}const Yn=e=>g.createElement("svg",$n({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 9 8"},e),Un||(Un=g.createElement("path",{fill:"#FC0",d:"m4.5 0 1.08 2.92L8.5 4 5.58 5.08 4.5 8 3.42 5.08.5 4l2.92-1.08z"}))),Vn=()=>{var e,t,a,n,s,i,l,o,d,c;const u=(0,Da.GV)(fr.uB),{dateStart:p,dateEnd:f,betAmount:x,prizesTotalCount:y,campaignId:j,texts:C}=b(e=>e.prizeDrop.displayedCampaign),{apiJoinCampaign:N}=b(e=>e.prizeDrop),D=b(St),E=b(e=>e.wallet.trueDecimal),R=(0,Sa.Bd)(),z=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalLive:opened")},[]),(0,g.useEffect)(()=>{N.data&&(N.data.joined?(Be.h$.emit("pdModalLive:joinSuccess"),z(jt()),z(Dt()),z(Ge("prizeDropSuccess")),z(Lt("prizeDropLive")),z(ht())):(Be.h$.emit("pdModalLive:joinError"),z(Ge("prizeDropJoinError")),z(Je("prizeDropLive")))),N.error&&(Be.h$.emit("pdModalLive:joinError"),z(Ge("prizeDropJoinError")),z(Je("prizeDropLive")))},[N]);const k=()=>{N.isPending||(Be.h$.emit("pdModalLive:later"),z(Lt("prizeDropLive")))};return(0,r.jsxs)(jn,{modalName:"prizeDropLive",onClose:k,children:[(0,r.jsx)(Sn,{modalName:"prizeDropLive",onClose:k,children:(0,r.jsx)("div",{})}),(0,r.jsxs)(Nn,{scrollbarInsetTop:56,children:[u&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!u&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)("div",{className:"mx-auto max-w-604 pt-30 ml:pt-25",children:(0,r.jsxs)("div",{className:"flex flex-col gap-16 px-15 pb-22 text-center ml:px-0 ml:pb-18",children:[(0,r.jsxs)("div",{className:"relative flex w-full flex-col items-center gap-11 text-center ml:gap-10",children:[(0,r.jsx)(Ba,{prizeDropMode:"live",className:"absolute -top-5 left-1/2 translate-x-22"}),(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:(null==C?void 0:C.title)||R("DROP.001","Prize drop event is live!")}),(0,r.jsx)("div",{className:"text-medium-reg",children:(null==C?void 0:C.description)||R("DROP.002","Spin and win amazing prizes instantly!")})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-11 rounded-14 bg-white-6 px-20 pb-22 pt-20 ml:gap-10",children:[(0,r.jsx)(sr,{}),(0,r.jsxs)("div",{className:"text-medium-reg flex flex-col gap-2 pl-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.004","Total prize count:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:y})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[R("DROP.005","Top prize:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:"true"===(null==D?void 0:D.type)?(0,r.jsxs)("div",{children:[Be.bp.formatCash(null!==(a=null===(t=null===(e=null==D?void 0:D.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value)&&void 0!==a?a:0,{showCurrency:!1,customDecimals:E,roundUp:!0})," $TRUE"]}):(0,r.jsx)("div",{children:Be.bp.formatCash(null!==(i=null===(s=null===(n=null==D?void 0:D.configCash)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value)&&void 0!==i?i:0,{customCurrency:null===(o=null===(l=null==D?void 0:D.configCash)||void 0===l?void 0:l.amount)||void 0===o?void 0:o.currency,customDecimals:null===(c=null===(d=null==D?void 0:D.configCash)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.decimals,roundUp:!0})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.006","Min. bet to participate:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:Be.bp.formatCash(x)})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.007","Every qualified bet can win")," 🚀"]})]})]})]}),(0,r.jsx)(ur,{dateStart:p,dateEnd:f,className:"text-medium-bold mt-0 flex items-center justify-center"})]})})]}),(0,r.jsx)(Dn,{className:"!pb-30 ml:!pb-10",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-560 gap-14 px-14 ml:gap-10 ml:px-0",children:[(0,r.jsx)(Pa.$,{className:"!min-w-170 flex-1",onClick:e=>{e.stopPropagation(),k()},variant:"secondary",children:R("DROP.009","Later")}),(0,r.jsx)(La,{text:R("DROP.010","Join now"),loadingText:R("DROP.011","Joining..."),isLoading:N.isPending,onClick:()=>{Be.h$.emit("pdModalLive:startJoin"),z(_r({campaignId:j}))},className:"text-medium-bold !min-w-170 flex-1 !bg-brand-gradient"})]})})]})},Wn=()=>{const e=(0,Da.GV)(fr.uB),t=(0,Sa.Bd)(),a=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalEventCancelled:opened")},[]);const n=()=>{Be.h$.emit("pdModalEventCancelled:closed"),a(Je("prizeDropResultCancelled"))};return(0,r.jsxs)(jn,{modalName:"prizeDropResultCancelled",onClose:n,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropResultCancelled",onClose:n,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.022","Event cancelled")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.023","The current event has been cancelled. Stay tuned for new events ")} 🚀`})]})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),n()},children:t("DROP.014","OK")})]})})]})},Gn=()=>{const e=(0,Da.GV)(fr.uB),t=(0,Sa.Bd)(),a=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalEventEnded:opened")},[]);const n=()=>{Be.h$.emit("pdModalEventEnded:closed"),a(Je("prizeDropResultFinished"))};return(0,r.jsxs)(jn,{modalName:"prizeDropResultFinished",onClose:n,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropResultFinished",onClose:n,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.024","Event ended")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.025","The current event is over. Stay tuned for new events")} 🚀`})]})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),n()},children:t("DROP.014","OK")})]})})]})},Jn=()=>{const e=w(),t=(0,Sa.Bd)();(0,g.useEffect)(()=>{Be.h$.emit("pdModalSuccess:opened")},[]);const a=()=>{Be.h$.emit("pdModalSuccess:closed"),e(Je("prizeDropSuccess"))};return(0,r.jsxs)(jn,{onClose:a,modalName:"prizeDropSuccess",children:[(0,r.jsx)(Sn,{onClose:a,returnType:"home",modalName:"prizeDropSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(_n.A,{className:"",width:46,height:46})})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold",children:t("DROP.012","Success").toUpperCase()}),(0,r.jsx)("span",{className:"text-medium-reg",children:t("DROP.013","You have successfully joined the event!")}),(0,r.jsx)(Pa.$,{className:"w-full max-w-354 !bg-brand-gradient uppercase",onClick:e=>{e.stopPropagation(),a()},children:t("DROP.014","OK")})]})})]})},Kn=()=>{const e=w(),t=(0,Sa.Bd)(),a=b(te),n=()=>{e(Je("walletConvertSuccess")),e(Q())};return(0,g.useEffect)(()=>{Be.h$.emit("walletConvertSuccess:opened",{})},[]),(0,r.jsxs)(jn,{onClose:n,modalName:"walletConvertSuccess",children:[(0,r.jsx)(Sn,{onClose:n,returnType:"home",modalName:"walletConvertSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(_n.A,{width:46,height:46})})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-12 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold uppercase",children:t("LOBBY.091","CONVERSION COMPLETED")}),a&&(0,r.jsx)("div",{className:"flex flex-col items-center",children:(0,r.jsx)(Ha,{variant:"promo",children:a})}),(0,r.jsx)("p",{className:"text-medium-reg max-w-314 text-center ml:max-w-560",children:t("LOBBY.092","Funds will be credited to your casino balance after 1 spin")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),Be.h$.emit("walletConvertSuccess:continuePlayingClicked",{}),n()},children:t("LOBBY.093","Continue playing")})]})})]})},Hn=()=>{const e=b(Pt),t=(0,Sa.Bd)(),a=[{id:"events",title:t("DROP.027","Event")},{id:"rules",title:t("DROP.028","Rules")}],[n,s]=(0,g.useState)("events");return(0,r.jsxs)("div",{className:Ra()(e&&"!pb-64"),children:[(0,r.jsx)("div",{className:"mb-16 flex flex-col items-center",children:(0,r.jsx)(Tr,{activeTab:n,setActiveTab:s,config:a})}),(0,r.jsx)("div",{className:"mx-auto",children:"events"===n?(0,r.jsx)(Er,{}):(0,r.jsx)(Ir,{})})]})},Qn=()=>{const e=(0,Sa.Bd)(),t=e=>e.split(/(\$TRUE)/g).map((e,t)=>(0,r.jsx)("span",{className:"$TRUE"===e?"text-medium-bold text-white opacity-100":"opacity-60",children:e},`${e}-${t}`));return(0,r.jsxs)("div",{className:"mx-auto flex w-full flex-col items-center pb-28",children:[(0,r.jsx)("h2",{className:"w-340 text-28 font-black leading-[1.3] text-white",children:e("LOBBY.041","Welcome to TRUE World. Play. Earn. Unlock more.")}),(0,r.jsx)("div",{className:"h-322",children:(0,r.jsx)("img",{src:er.f.get(i),alt:"true coin",className:"h-full object-cover object-center"})}),(0,r.jsxs)("div",{className:"text-medium-reg mx-auto max-w-340 text-white",children:[(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.042","TRUE World is your gateway to the next generation of rewards inside TRUE LABS games."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.043","As you play, you automatically earn $TRUE tokens through Prize Drops, leaderboard tournaments, and exclusive airdrops. No extra steps - just enjoy your favorite games and collect rewards."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.044","Your $TRUE tokens open the door to a growing universe of opportunities: trade collectibles on the Marketplace, stake tokens for added benefits, or explore new features across the TRUE World portal."))}),(0,r.jsx)("p",{children:t(e("LOBBY.045","Ownership of $TRUE is more than a bonus - it's your entry ticket to special events and tournaments, unique in-game content, and future perks across the entire TRUE ecosystem. You can even spend $TRUE on exclusive TRUE LABS merchandise and other real-world items."))})]})]})},qn=()=>{const e=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-16 pb-28",children:[(0,r.jsx)("img",{src:er.f.get(s),alt:"coming soon",className:"h-310 w-414 max-w-none object-cover object-center"}),(0,r.jsxs)("div",{className:"flex w-340 flex-col items-center gap-6 text-center",children:[(0,r.jsx)("h2",{className:"title-h1-bold text-white",children:e("LOBBY.029","Your character's progress")}),(0,r.jsxs)("p",{className:"text-medium-reg text-white opacity-60",children:[e("LOBBY.030","Let your hero grow with every spin!"),(0,r.jsx)("br",{}),e("LOBBY.031","Tease your luck, uncover in-game secrets, and unlock real-world rewards.")]}),(0,r.jsx)("p",{className:"text-medium-bold text-white",children:e("LOBBY.032","Coming soon. Stay tuned!")})]})]})},Xn=e=>{if(!e)return"expired";const t=new Date(e).getTime()-Date.now();if(t<=0)return"expired";const a=Math.floor(t/36e5);return a<1?"lessThanHour":a},Zn=({reward:e,onClaimRequested:t=()=>!0})=>{var a,n,s;const i=(0,Sa.Bd)(),l=w(),{showExpiredToast:o}=qr(),[c,u]=(0,g.useState)(()=>Xn(e.expiresAt)),p=b(e=>e.rewards.apiClaim),{error:m}=p,[v,h]=(0,g.useState)(!1),f=b(e=>e.wallet.trueDecimal),x=b(Re),y=!!(j=e.expiresAt)&&new Date(j).getTime()<=Date.now();var j;const C="number"==typeof x&&x>0;(0,g.useEffect)(()=>{if(!e.expiresAt)return;const t=()=>u(Xn(e.expiresAt)),a=setInterval(t,6e4);return t(),()=>clearInterval(a)},[e.expiresAt]),(0,g.useEffect)(()=>{m&&v&&h(!1)},[m,v]);const N=(0,g.useMemo)(()=>"expired"===c?i("LOBBY.035","Unfortunately, the reward expiration time has ended."):"lessThanHour"===c?i("LOBBY.038","expires in <1 hour"):1===c?i("LOBBY.038","expires in <1 hour").replace("<1","1"):i("LOBBY.009","expires in <HOURS> hours",{"<HOURS>":String(c)}),[c,i]),D=(0,g.useRef)(!1);if((0,g.useEffect)(()=>{y&&!D.current&&(D.current=!0,Be.h$.emit("reward:expired",(0,Za.rx)(e,"expired")),o(i("LOBBY.035","Unfortunately, the reward expiration time has ended.")),l(ce(e.rewardId)),l(Vt(e.rewardId)))},[l,e,e.rewardId,y,o,i]),y)return null;const E=null===(s=null===(n=null===(a=e.rewardTrue)||void 0===a?void 0:a.configTrue)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value;return(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:d,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:i("LOBBY.007","Prizedrop reward")}),(0,r.jsxs)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16"}),Be.bp.formatCash(E,{showCurrency:!1,customDecimals:f,roundUp:!0})]}),C&&(0,r.jsxs)("div",{className:"text-xs-reg mt-1 opacity-70",children:["~",Be.bp.formatCash((null!=E?E:0)/x,{roundUp:!0})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(La,{size:"small",text:i("LOBBY.008","Claim"),loadingText:i("LOBBY.036","Pending"),isLoading:v,className:"!min-w-120 !bg-brand-gradient",onClick:()=>{t(e)&&(Be.h$.emit("reward:claimClicked",(0,Za.rx)(e,"new")),h(!0),l(nn({rewardId:e.rewardId,fromHub:!0})))},disabled:y||v}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:N})]})]})},es=a.p+"assets/reward-convert-icon.00d13d6b7d747ea756ec.webp",ts=({reward:e})=>{var t,a,n,s,i,l,o,d,c;const u=(0,Sa.Bd)(),p=w(),m=(0,Da.jL)();return(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:es,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:u("LOBBY.094","Pending reward")}),(0,r.jsx)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:Be.bp.formatCash(null!==(n=null===(a=null===(t=null==e?void 0:e.rewardConvert)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value)&&void 0!==n?n:0,{roundUp:!0,customCurrency:null!==(l=null===(i=null===(s=e.rewardConvert)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.currency)&&void 0!==l?l:"FUN",customDecimals:null!==(c=null===(d=null===(o=e.rewardConvert)||void 0===o?void 0:o.amount)||void 0===d?void 0:d.decimals)&&void 0!==c?c:2})})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(Pa.$,{size:"small",className:"!min-w-120 !bg-brand-gradient",onClick:()=>{Be.h$.emit("rewardConvert:playClicked",(0,Za.i6)(e,"new")),p(Je("promoLobby")),m((0,Oe.Pp)(!1))},children:u("LOBBY.096","Play")}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:u("LOBBY.095","Unlocks after 1 spin")})]})]})},as=()=>{const e=b(e=>e.rewards.rewards.filter(e=>(e.type===It.Dy.TRUE||e.type===It.Dy.CONVERT)&&e.status===It.ti.ACTIVE)),t=b(e=>e.rewards.apiClaim),{data:a,error:n}=t,s=(0,Sa.Bd)(),i=(0,g.useRef)(!1),l=(0,g.useRef)(null),o=(0,g.useRef)(new Set),{showSuccessToast:d,showFailedToast:c,showExpiredToast:u}=qr();(0,g.useEffect)(()=>{e.forEach(e=>{e.type!==It.Dy.CONVERT||o.current.has(e.rewardId)||(o.current.add(e.rewardId),Be.h$.emit("rewardConvert:pendingShown",(0,Za.i6)(e,"new")))})},[e]),(0,g.useEffect)(()=>{a&&i.current&&l.current&&(d(s("LOBBY.034","The reward has been successfully credited to your balance.")),Be.h$.emit("reward:claimSuccess",(0,Za.rx)(l.current,"claimed")),i.current=!1,l.current=null)},[a,d,s]),(0,g.useEffect)(()=>{n&&i.current&&l.current&&(c(In({t:s,error:n,fallbackKey:"LOBBY.037",fallbackMessage:"Something went wrong. Please try again later."})),Be.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,Za.rx)(l.current,"new")),{error_code:n.name})),i.current=!1,l.current=null)},[n,c,u,s]);const p=e=>{return(t=e.expiresAt)&&new Date(t).getTime()<=Date.now()?(Be.h$.emit("reward:expired",(0,Za.rx)(e,"expired")),u(s("LOBBY.035","Unfortunately, the reward expiration time has ended.")),!1):(i.current=!0,l.current=e,!0);var t};return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex w-full flex-col rounded-12 bg-white-10 p-16",children:[(0,r.jsx)("h2",{className:"title-h2-bold",children:s("LOBBY.002","Rewards Hub")}),e.map(e=>(0,r.jsxs)(r.Fragment,{children:[e.type===It.Dy.TRUE&&(0,r.jsx)(Zn,{reward:e,onClaimRequested:p},e.rewardId),e.type===It.Dy.CONVERT&&(0,r.jsx)(ts,{reward:e},e.rewardId)]})),0===e.length&&(0,r.jsxs)("div",{className:"text-medium-reg mt-6 opacity-60",children:[s("LOBBY.003","Just play TRUE LABS games and unlock extra rewards")," 🎁"]})]})})},rs=()=>{const e=w();return(0,g.useEffect)(()=>{e(Fr())},[e]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-16 pb-12",children:[(0,r.jsx)(as,{}),(0,r.jsx)(Or,{})]})};var ns,ss;function is(){return is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},is.apply(null,arguments)}const ls=e=>g.createElement("svg",is({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 36 36"},e),ns||(ns=g.createElement("rect",{width:36,height:36,fill:"#fff",fillOpacity:.1,rx:8})),ss||(ss=g.createElement("path",{stroke:"#DA8A29",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 18.9v-4.485m0 7.81v.04M23.67 26H12.33a3.4 3.4 0 0 1-3.267-2.424c-.176-.598.04-1.22.37-1.751l5.67-10.224c1.328-2.135 4.466-2.135 5.794 0l5.67 10.224c.33.53.546 1.153.37 1.75A3.4 3.4 0 0 1 23.67 26"}))),os=()=>{var e,t;const a=(0,Sa.Bd)(),n=w(),s=b(ee),i=b(ze),l=b(ae),o=b(re),d=b(ke),c=b(e=>e.wallet.trueDecimal),{showFailedToast:u}=qr(),p=(0,g.useRef)(!1),m=null!==(e=b(Re))&&void 0!==e?e:0,v=i?parseFloat(i.penalty.amount):50,h=null!==(t=null==i?void 0:i.commission.amount)&&void 0!==t?t:"0",f=parseFloat(h)||0,{inputAmountTrue:x,convertAmountTrue:y,penaltyExchangeRate:j,regularExchangeRate:C,resultEur:N}=fn({amount:s,commissionAmount:f,currencyDecimals:Be.bp.currencyDecimals,exchangeRate:m,penaltyPercent:v}),D=m>0,E=D&&""!==s&&y>=d,R=(0,g.useMemo)(()=>(0,Za.p)({inputAmountTrue:x,convertAmountTrue:y,feeTrue:f,penaltyPercent:v,exchangeRate:m}),[f,y,m,x,v]),z=e=>Be.bp.formatCash(e,{roundUp:!0}),S=e=>e>0?`~${z(e)}`:"—";return(0,g.useEffect)(()=>{D||(n(Q()),n(P("wallet-convert")))},[n,D]),(0,g.useEffect)(()=>{o&&p.current&&(u(In({t:a,error:o,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),p.current=!1,n(X()))},[o,n,u,a]),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-12",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-center",children:a("LOBBY.088","Confirm conversion")}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)("div",{className:"flex w-full items-center justify-center rounded-16 bg-white-10 px-20 py-14",children:(0,r.jsxs)("div",{className:"flex w-full items-center gap-10",children:[(0,r.jsx)("div",{className:"flex h-36 w-36 shrink-0 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(ls,{width:36,height:36})}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsx)("span",{className:"text-medium-bold",children:a("LOBBY.089","Unlock condition")}),(0,r.jsx)("span",{className:"text-small-reg opacity-60",children:a("LOBBY.090","Make 1 bet to credit the amount to your casino balance.")})]})]})}),(0,r.jsx)("div",{className:"flex w-full flex-col rounded-16 bg-white-10 p-16",children:(0,r.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,r.jsxs)("div",{className:"flex w-full items-start justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.082","Exchange rate"),":"]}),(0,r.jsxs)("span",{className:"text-xs-reg opacity-40",children:[a("LOBBY.083","Regular rate"),":"," ",S(C)," "]})]}),(0,r.jsx)("span",{className:"text-medium-bold",children:S(j)})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.085","You convert"),":"]}),(0,r.jsxs)("span",{className:"text-medium-bold",children:[(B=y,Be.bp.formatCash(B,{showCurrency:!1,customDecimals:c,roundUp:!0}))," ",a("","$TRUE")]})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.084","Transfer fee"),":"]}),(0,r.jsxs)("span",{className:"text-medium-bold",children:[f," ",a("","$TRUE")]})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.059","You get"),":"]}),(0,r.jsx)("span",{className:"text-medium-bold",children:z(N)})]})]})}),(0,r.jsxs)("div",{className:"flex w-full gap-8",children:[(0,r.jsx)(Pa.$,{variant:"secondary",className:"flex-1",onClick:()=>{Be.h$.emit("walletConvertConfirm:cancelled",R),n(Q()),n(P("wallet"))},disabled:l,children:a("LOBBY.065","Cancel")}),(0,r.jsx)(La,{text:a("LOBBY.066","Confirm"),loadingText:a("LOBBY.036","Pending"),onClick:()=>{var e;E&&(p.current=!0,n(H(z(N))),n((e={amount:String(y),commission:{amount:h},penalty:{amount:String(v)}},t=>{return a=void 0,r=void 0,s=function*(){t(k("walletConvert"));const a=(0,Za.p)({convertAmountTrue:e.amount,feeTrue:e.commission.amount,penaltyPercent:e.penalty.amount});try{const r=yield t(Z(e)).unwrap();t(I("walletConvert")),r.success?(Be.h$.emit("walletConvert:success",(0,Za.ST)(a,["amount_true"])),window.sessionStorage.setItem("promoLobby.walletReturnedAfterConvert","true"),t(ea()),t(Je("promoLobby")),t(Ge("walletConvertSuccess"))):Be.h$.emit("walletConvert:failed",a)}catch(e){t(I("walletConvert"));const r=e;Be.h$.emit("walletConvert:failed",Object.assign(Object.assign({},a),{error_code:r.code,error_message:r.message})),Be.vF.error(e)}},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s})))},isLoading:l,disabled:!E,className:"flex-1 !bg-brand-gradient"})]})]})]});var B},ds=[25,50,75,100],cs=()=>{var e;const t=(0,Sa.Bd)(),a=w(),n=b(ee),s=b(Ne),i=b(ze),l=b(ke),o=(0,g.useRef)(null),d=s&&parseFloat(s.balance)||0,c=null!==(e=b(Re))&&void 0!==e?e:0,u=i?parseFloat(i.penalty.amount):50,p=i?parseFloat(i.commission.amount):0;(0,g.useEffect)(()=>{a(Fr())},[a]),(0,g.useEffect)(()=>{c<=0&&""!==n&&a(K(""))},[n,a,c]);const{inputAmountTrue:m,convertAmountTrue:v,penaltyExchangeRate:h,regularExchangeRate:f,resultEur:x}=fn({amount:n,commissionAmount:p,currencyDecimals:Be.bp.currencyDecimals,exchangeRate:c,penaltyPercent:u}),y=c>0,j=!y,C=""!==n&&v<l,N=y&&""!==n&&v>=l,D=C?"text-[#DA2929]":"";let E="border-white-20";C?E="border-[#DA2929]":""!==n&&(E="border-white-30");const R=(0,g.useMemo)(()=>(0,Za.p)({inputAmountTrue:m,convertAmountTrue:v,feeTrue:p,penaltyPercent:u,exchangeRate:c}),[p,v,c,m,u]),z=e=>Be.bp.formatCash(e,{roundUp:!0}),k=e=>e>0?`~${z(e)}`:"—";return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-12",children:[(0,r.jsxs)("p",{className:"text-medium-reg text-center opacity-60",children:[t("LOBBY.081a","You can convert your $TRUE tokens into ")," ",(0,r.jsx)("span",{className:"font-bold text-white opacity-100",children:t("LOBBY.081b","real cash on casino balance")})," ",t("LOBBY.081c",`right now with ${Math.round(u)}% penalty`)]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-20 rounded-16 bg-white-10 p-16",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsx)("span",{className:"text-medium-med text-white",children:t("LOBBY.086","Conversion amount")}),(0,r.jsxs)("div",{className:["flex h-48 items-center justify-between rounded-12 border px-16 py-4","bg-black-20",E,j?"pointer-events-none opacity-40":""].join(" "),onClick:()=>{var e;return!j&&(null===(e=o.current)||void 0===e?void 0:e.focus())},role:"button",tabIndex:-1,onKeyDown:()=>{},children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16 shrink-0 text-white"}),(0,r.jsx)("input",{ref:o,type:"text",inputMode:"decimal",value:n,onChange:e=>(e=>{a(K(((e,t)=>{const[a="",...r]=e.replace(/[^0-9.]/g,"").split("."),n=r.join("").slice(0,2),s=r.length>0?`${a}.${n}`:a;if(!a)return"";const i=new(mn())(s||0),l=vn(t).toDecimalPlaces(2,mn().ROUND_FLOOR);return i.greaterThanOrEqualTo(l)?l.toString():s})(e,d)))})(e.target.value),placeholder:"0",disabled:j,className:"text-medium-bold w-full min-w-0 bg-transparent text-white outline-none"})]}),m>0&&y&&(0,r.jsx)("span",{className:"text-xs-reg ml-8 shrink-0 opacity-60",children:k(m*f)})]}),C&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-small-reg",style:{color:"#DA2929"},children:t("LOBBY.063","Minimum conversion amount is 5 $TRUE")})}),(0,r.jsx)("div",{className:"mt-4 flex gap-4",children:ds.map(e=>{return(0,r.jsxs)(Pa.$,{onClick:()=>(e=>{var t;j||(a(K(gn(d,e))),null===(t=o.current)||void 0===t||t.focus())})(e),variant:"secondary",disabled:j,className:["!h-44 !min-w-0 flex-1",(t=e,""!==n&&d>0&&n===gn(d,t)?"ring-1 ring-white":"")].join(" "),children:[e,"%"]},e);var t})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-0",children:[(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.082","Exchange rate"),":"]}),(0,r.jsxs)("span",{className:"text-small-med",children:["1 $TRUE ",(S=h,S>0?`≈ ${z(S)}`:"—")," "]})]}),(0,r.jsxs)("span",{className:"text-xs-reg opacity-40",children:[t("LOBBY.083","Regular rate"),": ",k(f)]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.084","Transfer fee"),":"]}),(0,r.jsxs)("span",{className:"text-small-med",children:[p," ",t("","$TRUE")]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.085","You convert"),":"]}),m>0&&(0,r.jsxs)("span",{className:["text-small-med",D].join(" "),children:[(e=>Be.bp.formatCash(e,{showCurrency:!1,customDecimals:2,roundUp:!0}))(v)," ",t("","$TRUE")]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("span",{className:"text-medium-med",children:[t("LOBBY.059","You get"),":"]}),m>0&&y&&(0,r.jsx)("span",{className:"text-medium-med",children:z(x)})]})]}),(0,r.jsx)(Pa.$,{className:["w-full !bg-brand-gradient",N?"":"pointer-events-none opacity-40"].join(" "),onClick:()=>{N&&(Be.h$.emit("walletConvert:proceedClicked",(0,Za.ST)(R,["amount_true"])),a(P("wallet-convert-confirm")))},disabled:!N,children:t("LOBBY.052","Convert now")})]}),(0,r.jsx)("div",{className:"flex w-full flex-col items-center rounded-16 bg-white-10 px-20 py-14 text-center",children:(0,r.jsxs)("p",{className:"text-small-reg",children:[(0,r.jsx)("span",{className:"opacity-60",children:t("LOBBY.087a","You will need to make at least")})," ",(0,r.jsx)("span",{className:"font-bold",children:t("LOBBY.087b","1 bet")})," ",(0,r.jsx)("span",{className:"opacity-60",children:t("LOBBY.087c","to receive your conversion reward on the casino balance.")})]})})]});var S};const us=()=>{const e=w(),t=!!b(e=>e.prizeDrop.restData),a=!!b(e=>{var t;return null===(t=e.transaction.apiTransactions.fake)||void 0===t?void 0:t.enabled}),r=b(Ee),n=t||a;(0,g.useEffect)(()=>{n&&(e(oa()),r&&e((e,t)=>{return a=void 0,r=void 0,s=function*(){t().wallet.isWalletAvailable&&e(da(void 0)).unwrap().catch(e=>{Be.vF.error(e)})},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s}),e(Fr()))},[e,n,r])},ps=()=>(us(),(0,g.useEffect)(()=>{Be.h$.emit("wallet:opened"),(0,Za.Xg)()&&Be.h$.emit("wallet:returnedAfterAction")},[]),(0,r.jsxs)("div",{className:"flex flex-col gap-24",children:[(0,r.jsx)(nr,{}),(0,r.jsx)(rn,{})]})),ms=()=>{const e=b(e=>e.promoLobby.activeScreen),t=b(e=>e.promoLobby.topBarScreen);return(0,r.jsxs)(r.Fragment,{children:["info"===t&&(0,r.jsx)(Qn,{}),"profile"===t&&(0,r.jsx)(qn,{}),"wallet"===t&&(0,r.jsx)(ps,{}),"wallet-convert"===t&&(0,r.jsx)(cs,{}),"wallet-convert-confirm"===t&&(0,r.jsx)(os,{}),null===t&&(0,r.jsxs)(r.Fragment,{children:["true-world"===e&&(0,r.jsx)(rs,{}),"campaign"===e&&(0,r.jsx)(Hn,{})]})]})};var vs,hs,gs,fs,xs;function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ws.apply(null,arguments)}function bs(){return bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bs.apply(null,arguments)}function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ys.apply(null,arguments)}function js(){return js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},js.apply(null,arguments)}function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Cs.apply(null,arguments)}const Ns={trueWorld:{title:"True World",icon:e=>g.createElement("svg",Cs({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),xs||(xs=g.createElement("path",{fill:"#fff",d:"m27.844 15-9.866 9.88L8.11 15l9.867-9.879zM11.3 21.686l-2.466 2.47-2.467-2.47 2.467-2.47zM9.133 9.038l-3.488 3.493-3.489-3.493 3.489-3.493z"}))),screens:["true-world","campaign"],comingSoon:!1},trueGames:{title:"True Games",icon:e=>g.createElement("svg",js({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),fs||(fs=g.createElement("path",{fill:"#fff",d:"M5.294 15a1.08 1.08 0 0 0 1.078 1.078h6.471A1.08 1.08 0 0 0 13.921 15V6.372a1.08 1.08 0 0 0-1.078-1.078h-6.47a1.08 1.08 0 0 0-1.08 1.078zm0 8.627a1.08 1.08 0 0 0 1.078 1.079h6.471a1.08 1.08 0 0 0 1.078-1.079v-4.313a1.08 1.08 0 0 0-1.078-1.079h-6.47a1.08 1.08 0 0 0-1.08 1.079zm10.784 0a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V15a1.08 1.08 0 0 0-1.079-1.079h-6.47A1.08 1.08 0 0 0 16.078 15zm1.079-18.333a1.08 1.08 0 0 0-1.079 1.078v4.314a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V6.372a1.08 1.08 0 0 0-1.079-1.078z"}))),screens:["true-games"],comingSoon:!0},tournaments:{title:"Tournaments",icon:e=>g.createElement("svg",ys({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),gs||(gs=g.createElement("path",{fill:"#fff",d:"M21.353 4.412v3.176h4.236q-.044 3.834-1.205 5.407l-.119.152q-.933 1.12-3.187 1.592a6.36 6.36 0 0 1-5.017 4.408l-.002.088a4.235 4.235 0 0 0 4.235 4.236v2.117H9.707v-2.117a4.235 4.235 0 0 0 4.236-4.236l-.003-.088a6.36 6.36 0 0 1-5.016-4.408q-2.254-.471-3.187-1.592-1.279-1.534-1.324-5.559h4.235V4.412zM15 6.529l-1.224 2.91-3.01.326 2.256 2.118-.64 3.117L15 13.399l2.618 1.6-.64-3.112 2.258-2.118-3.012-.326zM8.647 9.706H6.676l.023.152c.136.87.344 1.486.594 1.842l.07.091c.195.235.562.455 1.106.641l.178.056zm14.678 0h-1.972v2.782l.179-.056c.544-.186.91-.406 1.106-.64l.07-.091c.25-.357.458-.974.594-1.843z"}))),screens:["tournaments"],comingSoon:!0},quests:{title:"Quests",icon:e=>g.createElement("svg",ws({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),vs||(vs=g.createElement("path",{fill:"#fff",d:"M25.106 6.805a.53.53 0 0 1 .483.527v15.08l-7.412 3.177-6.353-3.177-6.674 2.86a.53.53 0 0 1-.738-.487V9.706l3.314-1.42a7.41 7.41 0 0 0 2.033 6.66L15 20.19l5.241-5.242A7.41 7.41 0 0 0 22.21 7.98l2.642-1.133a.5.5 0 0 1 .255-.041M15 4.412a5.296 5.296 0 0 1 3.744 9.037L15 17.192l-3.744-3.743A5.295 5.295 0 0 1 15 4.412m0 3.53a1.765 1.765 0 1 0 0 3.529 1.765 1.765 0 0 0 0-3.53"}))),screens:["quests"],comingSoon:!0},marketplace:{title:"Marketplace",icon:e=>g.createElement("svg",bs({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),hs||(hs=g.createElement("path",{fill:"#fff",d:"M4.995 4.445a.814.814 0 0 1 1.012.552l.597 2.022H22.52c1.998 0 3.524 1.864 2.948 3.811l-1.797 6.082c-.382 1.296-1.598 2.16-2.948 2.16h-9.943c-1.351 0-2.565-.864-2.949-2.16L4.446 5.458a.814.814 0 0 1 .55-1.013m3.76 18.7a2.443 2.443 0 1 1 4.887 0 2.443 2.443 0 0 1-4.886 0m8.688 0a2.443 2.443 0 1 1 4.886 0 2.443 2.443 0 0 1-4.886 0"}))),screens:["marketplace"],comingSoon:!0}},Ds=({item:e,isActive:t})=>{const a=e.icon,n=b(_),s=e.comingSoon||n,i=(0,Sa.Bd)(),l=w();return(0,r.jsxs)("button",{disabled:s,onClick:()=>{n||l(S(e.screens[0]))},type:"button",className:Ra()("relative flex flex-1 flex-col items-center justify-center gap-2 ml:flex-none"),children:[(0,r.jsxs)("div",{className:Ra()("flex flex-col items-center justify-center gap-2 ml:w-70",t(e.screens)?"text-white":"opacity-40",s&&"cursor-default !opacity-15",!s&&"cursor-pointer hover:opacity-100"),children:[(0,r.jsx)(a,{className:"h-30 w-30"}),(0,r.jsx)("div",{className:"text-super-xs-bold",children:e.title})]}),e.comingSoon&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 rounded-10 border border-brand-black bg-[#262626] px-5 py-1",children:(0,r.jsx)("div",{className:"text-super-xss-bold uppercase opacity-40 ",children:i("","Soon")})})]},e.title)},Es=()=>{const e=b(e=>e.promoLobby.activeScreen),t=t=>t.includes(e);return(0,r.jsx)("div",{className:"md:navbar-gradient-border absolute bottom-40 left-0 right-0 flex justify-between gap-6 bg-brand-black px-20 pb-18 pt-14 mp:rounded-t-20 ml:right-auto ml:top-20 ml:flex-col ml:justify-start ml:gap-20 ml:px-8 ml:pb-16 ml:pt-16",children:Object.values(Ns).map(e=>(0,r.jsx)(Ds,{item:e,isActive:t},e.title))})};var Rs,zs;function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ks.apply(null,arguments)}const Ss=e=>g.createElement("svg",ks({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 46 46"},e),Rs||(Rs=g.createElement("path",{fill:"#fff",d:"M46 23c0 12.703-10.297 23-23 23S0 35.703 0 23 10.298 0 23 0s23 10.298 23 23M2.3 23c0 11.432 9.268 20.7 20.7 20.7S43.7 34.432 43.7 23 34.432 2.3 23 2.3 2.3 11.568 2.3 23"})),zs||(zs=g.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M23 6a17 17 0 0 1 17 17c0 9.389-7.611 17-17 17S6 32.389 6 23 13.611 6 23 6m1.7 18.7h-3.4a10.2 10.2 0 0 0-9.38 6.188A13.58 13.58 0 0 0 23 36.6c4.57 0 8.615-2.255 11.08-5.713A10.2 10.2 0 0 0 24.7 24.7M23 11.1a5.1 5.1 0 1 0 0 10.2 5.1 5.1 0 0 0 0-10.2",clipRule:"evenodd"})));var Bs;function Ps(){return Ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ps.apply(null,arguments)}const Os=e=>g.createElement("svg",Ps({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Bs||(Bs=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 8v3m0-5.224V5.75M2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8"}))),Ls=({className:e=""})=>{var t;const a=b(e=>e.promoLobby.topBarScreen),n=b(Ne),s=b(Ee),{isPending:i,error:l}=b(e=>e.prizeDrop.apiLobbyInit),o=b(e=>e.wallet.trueDecimal),d=b(_),c=null!==(t=null==n?void 0:n.balance)&&void 0!==t?t:0,u=i||!!l||!s,p=d||"wallet-convert-confirm"===a,m=w();return(0,r.jsxs)("div",{className:Ra()("flex w-full max-w-560 items-center justify-between gap-12 px-15 pb-16 ml:px-0",e),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{p||m(P("profile"))},disabled:p,className:Ra()("cursor-pointer opacity-20 transition-all hover:opacity-30","profile"===a&&"opacity-40",p&&"!cursor-default !opacity-10 hover:!opacity-10"),"aria-label":"Profile",children:(0,r.jsx)(Ss,{className:"h-46 w-46"})}),(0,r.jsxs)("button",{type:"button","aria-label":"Wallet",onClick:()=>{p||m(P("wallet"))},disabled:p,className:Ra()("flex items-center gap-6 rounded-full bg-white-10 py-6 pl-6 pr-14 transition-all",("wallet"===a||"wallet-convert"===a||"wallet-convert-confirm"===a)&&"bg-white-20",p&&"!cursor-default opacity-40"),children:[(0,r.jsx)(Xa,{className:"h-28 w-28 shrink-0 text-white"}),u?(0,r.jsx)(tr,{}):(0,r.jsx)("span",{className:"text-medium-bold",children:Be.bp.formatCash(Number(c),{showCurrency:!1,customDecimals:o,roundUp:!0})})]})]}),(0,r.jsx)("button",{type:"button",className:Ra()("flex h-36 w-36 cursor-pointer items-center justify-center rounded-full bg-white-10 transition-all","info"===a&&"bg-white-20",p&&"!cursor-default opacity-40"),onClick:()=>{p||m(P("info"))},disabled:p,children:(0,r.jsx)(Os,{className:"h-16 w-16"})})]})},Is=()=>{const e=b(e=>e.promoLobby.topBarScreen),t=b(e=>e.promoLobby.screenHistory),a=b(e=>e.rewards.rewards),n=b(e=>e.prizeDrop.campaigns),s=b(Pt),i=b(e=>e.prizeDrop.displayedCampaign),l=b(e=>e.prizeDrop.apiJoinCampaign),o=b(Bt),d=b(e=>e.promoLobby.activeScreen),c=b(_),u=w(),p=(0,Sa.Bd)(),m=(0,g.useRef)(!1),v=(0,g.useRef)(""),h=(0,g.useRef)(""),f=(0,g.useRef)(!1),x=(0,g.useRef)(null),{showSuccessToast:y,showFailedToast:j}=qr();(0,g.useEffect)(()=>(Be.h$.emit("promoLobby:opened"),u(ea()),()=>{Be.h$.emit("promoLobby:closed")}),[u]),(0,g.useEffect)(()=>{m.current||(m.current=!0,u(xe()));const t=a.map(e=>e.rewardId).sort().join(",");"true-world"===d&&null===e&&t!==v.current&&(v.current=t,u(de(a.map(e=>e.rewardId))));const r=n.filter(e=>"scheduled"===e.status).map(e=>e.campaignId),s=[...r].sort().join(",");s!==h.current&&(h.current=s,u(pe(r)))},[d,a,n,u,e]),(0,g.useEffect)(()=>{f.current&&(l.data&&(l.data.joined?(y(p("DROP.042","You have successfully joined!")),Be.h$.emit("pdModal:joinSuccess")):(j(In({t:p,error:l.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),Be.h$.emit("pdModal:joinError")),f.current=!1),l.error&&(j(In({t:p,error:l.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),Be.h$.emit("pdModal:joinError"),f.current=!1))},[l.data,l.error,j,y,p]),(0,g.useEffect)(()=>{const t=x.current,a=["wallet-convert","wallet-convert-confirm"],r=a.includes(null!=t?t:""),n=a.includes(null!=e?e:"");r&&!n&&u(Q()),"info"===e&&"info"!==t&&Be.h$.emit("promoLobby:infoViewed"),x.current=e},[u,e]);const C="info"===e,N="campaign"===d,D=t.length>0,E=()=>{c||("wallet-convert"!==e&&"wallet-convert-confirm"!==e||u(Q()),u(Je("promoLobby")))};return(0,r.jsxs)(Bn,{onClose:c?void 0:E,children:[(0,r.jsx)(Sn,{onReturn:D&&!c?()=>{c||u(O())}:void 0,onClose:c?void 0:E,classes:{closeButton:"!top-23",returnButton:"!top-23 ml:!left-98"},children:(0,r.jsx)("div",{className:"title-h1-bold pb-20 pt-34 text-center uppercase",children:p("LOBBY.001","True world")})}),(0,r.jsx)(Ls,{}),(0,r.jsx)(Nn,{scrollbarInsetBottom:N&&s&&!e?64:void 0,className:"mb-120 ml:mb-40",contentClassName:C?"!px-0 !max-w-full":"",children:(0,r.jsx)(ms,{})}),N&&s&&!e&&(0,r.jsx)(Dn,{className:"fixed !bottom-120 left-0 right-0 !bg-brand-black ml:!bottom-40 ",children:(0,r.jsx)(Ia,{isLoading:l.isPending,onClick:()=>{Be.h$.emit("pdModal:startJoin"),f.current=!0,u(_r({campaignId:i.campaignId}))},className:"!bg-brand-gradient",disabled:o})}),(0,r.jsx)(Es,{})]})},Ts=()=>(0,r.jsx)(Qr,{children:(0,r.jsx)(Is,{})}),_s=()=>{const e=b(e=>e.modals.current);return(0,r.jsx)("div",{className:"pointer-events-auto",children:e.map(e=>(e=>{switch(e){case"promoLobby":return(0,r.jsx)(Ts,{},e);case"prizeDropCongratulation":return(0,r.jsx)(Mn,{},e);case"prizeDropClaimed":return(0,r.jsx)(On,{},e);case"prizeDropClaimedSuccess":return(0,r.jsx)(An,{},e);case"prizeDropClaimedFailed":return(0,r.jsx)(Tn,{},e);case"prizeDropClaimedExpired":return(0,r.jsx)(Ln,{},e);case"prizeDropSuccess":return(0,r.jsx)(Jn,{},e);case"prizeDropResultFinished":return(0,r.jsx)(Gn,{},e);case"prizeDropResultCancelled":return(0,r.jsx)(Wn,{},e);case"prizeDropLive":return(0,r.jsx)(Vn,{},e);case"prizeDropJoinError":return(0,r.jsx)(Fn,{},e);case"walletConvertSuccess":return(0,r.jsx)(Kn,{},e);default:return null}})(e))})};var As,Ms,Fs,Us,$s;function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ys.apply(null,arguments)}const Vs=e=>g.createElement("svg",Ys({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 52 52"},e),As||(As=g.createElement("path",{fill:"#000",fillOpacity:.5,stroke:"url(#promo-lobby-icon_svg__a)",strokeWidth:1.7,d:"M15 1.85h22c7.263 0 13.15 5.887 13.15 13.15v22c0 7.263-5.887 13.15-13.15 13.15H15C7.737 50.15 1.85 44.263 1.85 37V15C1.85 7.737 7.737 1.85 15 1.85Z"})),Ms||(Ms=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__b)",d:"M41.5 26 29.593 38 17.687 26l11.906-12z"})),Fs||(Fs=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__c)",d:"m21.535 34.122-2.977 3-2.976-3 2.976-3z"})),Us||(Us=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__d)",d:"M18.92 18.758 14.71 23l-4.21-4.243 4.21-4.243z"})),$s||($s=g.createElement("defs",null,g.createElement("linearGradient",{id:"promo-lobby-icon_svg__a",x1:29.826,x2:30.02,y1:50.743,y2:10.567,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__b",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__c",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__d",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"}))))),Ws=e=>{return!(e.type!==It.Dy.TRUE&&e.type!==It.Dy.CONVERT||(t=e.expiresAt,t&&new Date(t).getTime()<=Date.now()));var t},Gs=e=>"expired"!==e.claimUiStatus&&Ws(e.reward);const Js=({disabled:e=!1,gridClassName:t=""})=>{const a=function(){const e=(0,Da.GV)(e=>e.play.isActive),t=b(De),a=b(e=>e.notification.viewedRewardDropIds),r=b(e=>e.notification.viewedCampaignIds),n=b(e=>e.rewards.rewards),s=b(e=>e.rewards.rewardsQueue),i=b(e=>e.prizeDrop.campaigns.filter(e=>"scheduled"===e.status)),l=b(e=>e.rewards.hasDefferedRewardModal),o=b(e=>!!e.prizeDrop.defferedCampaign),d=b(e=>e.rewards.winReward),c=!!d&&Ws(d),u=b(e=>e.modals.current.some(e=>_t.includes(e))),p=(0,g.useMemo)(()=>((e,t,a)=>{const r=Date.now(),n=[];e.forEach(e=>{e.expiresAt&&n.push(new Date(e.expiresAt).getTime())}),t.forEach(e=>{e.reward.expiresAt&&n.push(new Date(e.reward.expiresAt).getTime())}),(null==a?void 0:a.expiresAt)&&n.push(new Date(a.expiresAt).getTime());const s=n.filter(e=>e>r);return s.length?Math.min(...s):null})(n,s,d),[n,s,d]),[,m]=(0,g.useReducer)(e=>e+1,0);(0,g.useEffect)(()=>{if(null===p)return;const e=Math.max(0,p-Date.now())+50,t=setTimeout(m,e);return()=>clearTimeout(t)},[p]);const v=((e,t)=>!t&&e)((({isActiveWalletNew:e,viewedRewardDropIds:t,viewedCampaignIds:a,rewards:r,rewardsQueue:n,scheduledCampaigns:s,hasDefferedRewardModal:i,hasDefferedCampaign:l,hasDefferedReward:o})=>{if(e)return!0;const d=r.some(e=>Ws(e)&&!t.includes(e.rewardId)),c=n.some(Gs),u=s.some(e=>!a.includes(e.campaignId));return d||c||u||!!i&&(l||o)})({isActiveWalletNew:t,viewedRewardDropIds:a,viewedCampaignIds:r,rewards:n,rewardsQueue:s,scheduledCampaigns:i,hasDefferedRewardModal:l,hasDefferedCampaign:o,hasDefferedReward:c}),u),h=(0,g.useRef)(null),{value:f,nextFrozen:x}=((e,t,a)=>{if(!e)return{value:t,nextFrozen:null};const r=null!=a?a:t;return{value:r,nextFrozen:r}})(e,v,h.current);return h.current=x,f}(),n=(0,Da.jL)(),s=w(),i=(0,g.useRef)(null);return(0,g.useEffect)(()=>{null===i.current?(i.current=a,a&&Be.h$.emit("notification_badge_shown")):i.current!==a&&(i.current=a,a?Be.h$.emit("notification_badge_shown"):Be.h$.emit("notification_badge_cleared"))},[a]),(0,r.jsx)("div",{className:t?`${t} relative bottom-64 h-52 w-52 ml:h-46 ml:w-46`:"",children:(0,r.jsxs)("button",{disabled:e,type:"button",onClick:t=>{t.stopPropagation(),e||(s(Ge("promoLobby")),n((0,Oe.Pp)(!0)))},className:Ra()("pointer-events-auto absolute cursor-pointer items-center justify-center rounded-14",!t&&"bottom-105 left-1/2 m-1 flex origin-top -translate-x-188 ml:bottom-auto ml:left-29 ml:top-1/2 ml:translate-x-0 ml:translate-y-[calc(-100%+167px)]",xn.T.prizeDrop,["[&_svg_stop:nth-child(1)]:[stop-color:var(--colors-gold-stop-0)]","[&_svg_stop:nth-child(2)]:[stop-color:var(--colors-gold-stop-1)]","[&_svg_stop:nth-child(3)]:[stop-color:var(--colors-gold-stop-2)]"],!e&&'after:absolute after:bottom-0 after:left-0 after:right-0 after:top-0 after:rounded-14 after:transition-all after:content-[""] hover:after:bg-white-10',"active:opacity-70","disabled:cursor-default disabled:opacity-40 disabled:hover:after:bg-transparent disabled:active:bg-transparent"),children:[a&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-gold",children:(0,r.jsx)("div",{className:"bg-neon-rouge h-8 w-8 rounded-full"})}),(0,r.jsx)(Vs,{className:"relative z-1 h-52 w-52 ml:h-46 ml:w-46"})]})})},Ks=()=>{var e;const t=(0,Da.GV)(fr.ge),a=(0,Da.GV)(e=>e.round.isRestore),n=(null===(e=(0,Da.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,s=(0,Da.GV)(e=>e.play.isActive),i=(0,Da.GV)(e=>e.app.isUIHidden),l=a||n||s;return(0,r.jsxs)(r.Fragment,{children:[t&&!i&&(0,r.jsx)(Js,{disabled:l}),!t&&!i&&(0,r.jsx)("div",{className:Ra()("pointer-events-none fixed grid","mp:bottom-42 mp:left-1/2 mp:-translate-x-1/2 mp:items-end mp:gap-x-12","ml:right-21 ml:top-1/2 ml:-translate-y-1/2 ml:justify-items-center ml:gap-y-10","mp:grid-cols-[52px_52px_118px_52px_52px]","ml:grid-rows-[46px_46px_110px_46px_46px]",'mp:[grid-template-areas:"menu_stakeAmounts_play_auto_bonus"]','ml:[grid-template-areas:"menu""stakeAmounts""play""auto""bonus"]',"ml:opacity-0","z-51"),children:(0,r.jsx)(Js,{gridClassName:"[grid-area:menu]",disabled:l})})]})},Hs=()=>{const e=(0,Da.GV)(e=>"main"===e.app.screen);return(()=>{const e=(0,Da.GV)(e=>e.app.modulesConfig.promoLobby),t=w(),a=null==e?void 0:e.fakeApi,r=null==e?void 0:e.fakeSocket,n=null==e?void 0:e.lang;(0,g.useEffect)(()=>{e&&a&&(t(ct(a.prizeDropLobbyInit)),t(ut(a.prizeDropJoinCampaign)),a.rewardsList&&t(Xt(a.rewardsList)),a.rewardsClaim&&t(Zt(a.rewardsClaim)),t(ca(a.walletTransactions)),a.walletConvert&&t(q(a.walletConvert)))},[a]),(0,g.useEffect)(()=>{e&&r&&t(gt(r))},[r]),(0,g.useEffect)(()=>{e&&t(pt({url:e.url,token:e.token}))},[e]),(0,g.useEffect)(()=>{e&&n&&t(B(e.lang))},[e])})(),function(){const e=(0,Da.jL)(),t=w();(0,g.useEffect)(()=>{un.j.on("round:opened",()=>{var t,a;try{"live"===zt(wa.getState(),null===(t=wa.getState().prizeDrop.activeCampaign)||void 0===t?void 0:t.campaignId)&&kt(wa.getState())&&e((0,dn.Nl)({pdCampaignId:null===(a=wa.getState().prizeDrop.activeCampaign)||void 0===a?void 0:a.campaignId}));const r=wa.getState().rewards.rewards.find(e=>e.type===It.Dy.CONVERT);r&&e((0,dn.Nl)({pdConvertRewardId:null==r?void 0:r.rewardId}))}catch(t){const a=t;(0,U.PI)(a),Be.vF.error(a),e((0,Pe.qX)(a))}}).on("round:ended",()=>{try{const{defferedCampaign:a}=wa.getState().prizeDrop,{hasDefferedRewardModal:r,winReward:n,rewardsQueue:s}=wa.getState().rewards;if(a&&t(dt(a)),r||a){if(e((0,on.X2)()),e((0,cn.SE)()),e((0,he.Zv)(!1)),"finished"===(null==a?void 0:a.status)?t(Ge("prizeDropResultFinished")):"cancelled"===(null==a?void 0:a.status)&&t(Ge("prizeDropResultCancelled")),n){const e=s.find(e=>e.reward.rewardId===n.rewardId);let a;a=e?At(e):n.type===It.Dy.TRUE?"prizeDropClaimed":"prizeDropCongratulation",t(Ge(a))}t(Jt(!1)),t(wt())}}catch(t){const a=t;(0,U.PI)(a),Be.vF.error(a),e((0,Pe.qX)(a))}}).on("autoplay:restarted",()=>{t((e,t)=>{var a;const r=t(),n=r.modals.current.filter(e=>Ur.includes(e)),s=n.some(e=>_t.includes(e)),i=n.includes("prizeDropClaimed"),l=null===(a=r.rewards.winReward)||void 0===a?void 0:a.rewardId,o=r.modals.current.includes("promoLobby")&&"true-world"===r.promoLobby.activeScreen&&null===r.promoLobby.topBarScreen;n.forEach(t=>{(e=>{switch(e){case"prizeDropCongratulation":case"prizeDropClaimed":return void Be.h$.emit("pdModalWinDrop:closed");case"prizeDropClaimedSuccess":return void Be.h$.emit("pdModalClaimSuccess:closed");case"prizeDropClaimedFailed":return void Be.h$.emit("pdModalClaimFailed:closed");case"prizeDropClaimedExpired":return void Be.h$.emit("pdModalClaimExpired:closed");case"prizeDropResultFinished":Be.h$.emit("pdModalEventEnded:closed");break;case"prizeDropResultCancelled":Be.h$.emit("pdModalEventCancelled:closed")}})(t),e(Je(t))}),i&&l&&o&&e(oe(l)),s&&l&&e(Ht(l)),(s||r.rewards.hasDefferedRewardModal)&&(e(Gt()),e(qt())),e(Jt(!1)),e(wt())})})},[])}(),(()=>{var e;const t=(0,Da.jL)(),a=w(),r=!!b(e=>e.prizeDrop.restData),n=b(e=>e.prizeDrop.campaignsQueue),s=b(e=>e.prizeDrop.displayedCampaign),i=b(e=>e.prizeDrop.apiLobbyInit.isPending),l=(0,Da.GV)(e=>e.play.isActive),o=(0,Da.GV)(e=>e.freeRounds.isActive),d=(null===(e=(0,Da.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,c=b(Ye),u=(0,Da.GV)(e=>e.modals.hasOpened),p=(0,Da.GV)(e=>e.round.isRestore),m=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!m.current&&r&&(a(Mr({shouldFreezeUi:!0})),m.current=!0)},[a,r]),(0,g.useEffect)(()=>{var e;if(!(({hasInitialized:e,hasPromoLobby:t,isPromoLobbyInitPending:a,campaignsQueueLength:r,isPlayActive:n,isFreeRoundsActive:s,isFreeRoundsCurrent:i,hasOpenedModalByCore:l,isRestore:o,isModalMode:d})=>e&&t&&!a&&r>0&&!n&&!s&&!i&&!l&&!o&&!d)({hasInitialized:m.current,hasPromoLobby:r,isPromoLobbyInitPending:i,campaignsQueueLength:null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0,isPlayActive:l,isFreeRoundsActive:o,isFreeRoundsCurrent:d,hasOpenedModalByCore:u,isRestore:p,isModalMode:c}))return;const v=n[0];v&&((null==s?void 0:s.campaignId)!==v.campaignId&&a(ot(v)),t((0,he.M5)()),a(Ge("prizeDropLive")))},[n,a,null==s?void 0:s.campaignId,u,o,d,c,l,r,i,p,t])})(),function(){const e=w(),t=(0,g.useCallback)(t=>{e((e=>t=>{t(be(e.active))})(t)),t.active&&e(Fr())},[e]);(0,g.useEffect)(()=>{Ze.on(Ke.CAMPAIGN_UPDATED,({payload:t})=>{e($r(t))}),Ze.on(Ke.REWARD,({payload:t})=>{e(ln(t))}),Ze.on(Ke.WALLET_STATUS,({payload:e})=>{t(e)})},[e,t]),(0,g.useEffect)(()=>{const a=a=>{var r,n,s;if(a.data.isGUI){if((null===(r=a.data)||void 0===r?void 0:r.type)===Ke.CAMPAIGN_UPDATED){const{payload:t}=a.data;Be.vF.socketEvent(Ke.CAMPAIGN_UPDATED,t),e($r(t))}if((null===(n=a.data)||void 0===n?void 0:n.type)===Ke.REWARD){const{payload:t}=a.data;Be.vF.socketEvent(Ke.REWARD,t),e(ln(t))}if((null===(s=a.data)||void 0===s?void 0:s.type)===Ke.WALLET_STATUS){const{payload:e}=a.data;Be.vF.socketEvent(Ke.WALLET_STATUS,e),t(e)}}};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[e,t])}(),(0,r.jsx)("div",{className:"promo-lobby-container pointer-events-auto",children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ks,{}),(0,r.jsx)(_s,{})]})})},Qs=({dispatch:e})=>{null==e||e((0,n.JI)((()=>{const e=[];return e.push(m,v,h,p,l,o,c,u,i,s,d),e.filter(e=>!!e)})()))},qs=()=>(0,r.jsx)(Ca,{children:(0,r.jsx)(Hs,{})})}}]);
1
+ "use strict";(self.webpackChunk_truelab_truelogic=self.webpackChunk_truelab_truelogic||[]).push([[170],{1316:(e,t,a)=>{a.d(t,{Dy:()=>r.Dy,ti:()=>r.ti});var r=a(2405)},2405:(e,t,a)=>{var r,n;a.d(t,{Dy:()=>r,ti:()=>n}),function(e){e.CASH="cash",e.TRUE="true",e.STAKING="staking",e.CONVERT="convert"}(r||(r={})),function(e){e.ACTIVE="active",e.REDEEMED="redeemed"}(n||(n={}))},5715:(e,t,a)=>{a.r(t),a.d(t,{PromoLobbyModule:()=>qs,init:()=>Qs});var r=a(4848),n=a(8521);const s=a.p+"assets/coming-soon.378973f1d8788623bbe9.webp",i=a.p+"assets/true-coin.1428441fe478e319cb4e.webp",l=a.p+"assets/gradient-bg.ec5b14ea3eb84ebb40c2.jpg",o=a.p+"assets/prize-drop-item.2bf1291207de774584ad.webp",d=a.p+"assets/reward-icon.098bebd610501e5d7344.webp",c=a.p+"assets/bg-wallet.76604959187a933cb30d.jpg",u=a.p+"assets/safe.851b5630bbec8de3e5b1.webp",p=a.p+"assets/cash-prize.4ef22f77cafcace9ef38.webp",m=a.p+"assets/prize-drop-bg-event-landscape.62d513476fec0a205481.webp",v=a.p+"assets/prize-drop-bg-event-portrait.3d627778db401fff49c0.webp",h=a.p+"assets/prize-drop-logo.b4d8a5270f8092b9f573.webp";var g=a(6540),f=a(1468);const x=(0,g.createContext)(null),w=(0,f.iI)(x).withTypes(),b=(0,f.jO)(x).withTypes();var y=a(4644),j=a(38),C=a(1370),N=a(6901),D=a(3588);const E=(e,t)=>{e.screenHistory.push(t)},R=(e,t)=>"wallet-convert"===e.topBarScreen&&"wallet-convert-confirm"===t.topBarScreen,z=(0,D.Kr)({name:"promoLobby",initialState:{activeScreen:"true-world",topBarScreen:null,screenHistory:[],uiBlockers:[],lang:null},reducers:e=>({setPromoLobbyActiveScreen:e.reducer((e,t)=>{if(e.uiBlockers.length>0)return;const a=t.payload;e.activeScreen===a&&null===e.topBarScreen||("true-world"===a?e.screenHistory=[]:E(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen})),e.topBarScreen=null,e.activeScreen=a}),setPromoLobbyLang:e.reducer((e,t)=>{e.lang=t.payload}),setPromoLobbyTopBarScreen:e.reducer((e,t)=>{if(e.uiBlockers.length>0)return;const a=t.payload;e.topBarScreen===a||E(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen}),e.topBarScreen=a}),navigateBack:e.reducer(e=>{if(e.uiBlockers.length>0)return;let t=e.screenHistory.pop();for(;t&&R(e,t);)t=e.screenHistory.pop();t&&(e.activeScreen=t.activeScreen,e.topBarScreen=t.topBarScreen,"true-world"===t.activeScreen&&null===t.topBarScreen&&(e.screenHistory=[]))}),resetPromoLobbyScreen:e.reducer(e=>{e.uiBlockers.length>0||(e.activeScreen="true-world",e.topBarScreen=null,e.screenHistory=[])}),blockPromoLobbyUI:e.reducer((e,t)=>{e.uiBlockers.includes(t.payload)||e.uiBlockers.push(t.payload)}),unblockPromoLobbyUI:e.reducer((e,t)=>{e.uiBlockers=e.uiBlockers.filter(e=>e!==t.payload)})}),selectors:{getActiveScreen:e=>e.activeScreen,getPromoLobbyUIBlocked:e=>e.uiBlockers.length>0}}),{blockPromoLobbyUI:k,setPromoLobbyActiveScreen:S,setPromoLobbyLang:B,setPromoLobbyTopBarScreen:P,navigateBack:O,resetPromoLobbyScreen:L,unblockPromoLobbyUI:T}=z.actions,{getActiveScreen:I,getPromoLobbyUIBlocked:_}=z.selectors,A=z.reducer;var M=a(874),F=a(7542),U=a(3178),$=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const Y={ERR_UNKNOWN:{message:"General error: unknow error occured",languageKey:"LOBBY.100"},ERR_UNAUTHORIZED:{message:"General error: operation is forbidden",languageKey:"LOBBY.101"},ERR_VALIDATION:{message:"Invalid request",languageKey:"LOBBY.100"},ERR_TRUE_WALLET_API:{message:"Error occured while claiming reward (on Wallet side)",languageKey:"LOBBY.102"},ERR_REWARD_NOT_FOUND:{message:"Reward was not found, is not claimable, or is not active",languageKey:"LOBBY.117"},ERR_REWARD_EXPIRED:{message:"Reward claim period expired",languageKey:"LOBBY.104"},ERR_REWARD_CLAIM_FAILED:{message:"Error occured while claiming reward (on PM side)",languageKey:"LOBBY.106"},ERR_CAMPAIGN_NOT_FOUND:{message:"Campaign not found (it was cancelled or expired)",languageKey:"LOBBY.107"},ERR_CAMPAIGN_NOT_AVAILABLE:{message:"Campaign is not available for the user (possible reasons: not valid operator, brand, game, currency or country, or campaign has specific allowed players list)",languageKey:"LOBBY.108"},ERR_CAMPAIGN_ALREADY_JOINED:{message:"User has already joined this campaign",languageKey:"LOBBY.109"},ERR_CAMPAIGN_JOIN_ONCE:{message:"User has already joined to another RUNNING campaign",languageKey:"LOBBY.110"},ERR_TRUE_WALLET_UNAVAILABLE:{message:"Reward claim is temporarily unavailable due to a technical issue. Please try again later.",languageKey:"LOBBY.111"},ERR_REWARD_CLAIM_COOLDOWN:{message:"Too many requests. Please wait before sending another claim request.",languageKey:"LOBBY.112"},ERR_CONVERT_WITHDRAWAL_FAILED:{message:"Convert withdrawal failed.",languageKey:"LOBBY.114"},ERR_CONVERT_VALIDATION:{message:"Invalid convert amount.",languageKey:"LOBBY.115"},ERR_CONVERT_COOLDOWN:{message:"Too many requests. Please wait before sending another convert request.",languageKey:"LOBBY.119"},ERR_CONVERT_ACTIVE_REWARD_LIMIT:{message:"The player already has an active convert reward.",languageKey:"LOBBY.118"}},V=(e,t,a,...r)=>$(void 0,[e,t,a,...r],void 0,function*(e,t,a,r=null,n={}){const s=new Headers;s.append("Content-Type","application/json"),s.append("Authorization",`Bearer ${a}`);const i={method:e,headers:s};r&&(i.body=JSON.stringify(r));const l=new URL(t);l.search=new URLSearchParams(n).toString();const o=l.toString(),d="There were problems with connection, please restart the game",{data:c,error:u}=yield(0,M.TX)((0,M.L5)(()=>$(void 0,void 0,void 0,function*(){var e,t;const{data:a,error:r}=yield(0,M.TX)(fetch(o,i));if(r)throw new Error(d);if(!a.ok){const r={message:`HTTP error: ${a.status}`,languageKey:null},{data:n}=yield(0,M.TX)(a.json());throw(null===(e=null==n?void 0:n.error)||void 0===e?void 0:e.message)&&(r.message=n.error.message),(null===(t=null==n?void 0:n.error)||void 0===t?void 0:t.code)&&Object.assign(r,(e=>{var t,a;return{code:e,message:(null===(t=Y[e])||void 0===t?void 0:t.message)||"Something went wrong",languageKey:(null===(a=Y[e])||void 0===a?void 0:a.languageKey)||null}})(n.error.code)),new Error(r.message,{cause:r})}const{data:n,error:s}=yield(0,M.TX)(a.json());if(s)throw new Error("Something went wrong");return n})));if(u)throw u instanceof Error&&u.message===d&&(0,U.Xm)(u),u;return c});const W=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),G=e=>{if(!W(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},J=(0,D.Kr)({name:"convert",initialState:{amount:"",lastResultEur:null,apiConvert:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setConvertAmount:e.reducer((e,t)=>{e.amount=t.payload}),setConvertLastResultEur:e.reducer((e,t)=>{e.lastResultEur=t.payload}),clearConvertForm:e.reducer(e=>{e.amount="",e.lastResultEur=null,e.apiConvert.data=null,e.apiConvert.error=null,e.apiConvert.isPending=!1}),setApiWalletConvertFake:e.reducer((e,t)=>{e.apiConvert.fake=t.payload}),clearApiWalletConvertError:e.reducer(e=>{e.apiConvert.error=null}),fetchApiWalletConvert:e.asyncThunk((e,t)=>{return a=void 0,r=[e,t],s=function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.convert.apiConvert.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.convert.apiConvert;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("POST",`${u}/wallet/convert`,c,e)}catch(e){const a=(p=e)instanceof Error&&W(p.cause)?G(p.cause):null;if(a)return t(a);throw e}var p},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s},{pending:e=>{e.apiConvert.isPending=!0,e.apiConvert.error=null,e.apiConvert.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=G(t.payload);e.apiConvert.isPending=!1,e.apiConvert.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiConvert.isPending=!1,e.apiConvert.data=t.payload}})}),selectors:{getConvertAmount:e=>e.amount,getConvertLastResultEur:e=>e.lastResultEur,getConvertApiIsPending:e=>e.apiConvert.isPending,getConvertApiError:e=>e.apiConvert.error}}),{setConvertAmount:K,setConvertLastResultEur:H,clearConvertForm:Q,setApiWalletConvertFake:q,clearApiWalletConvertError:X,fetchApiWalletConvert:Z}=J.actions,{getConvertAmount:ee,getConvertLastResultEur:te,getConvertApiIsPending:ae,getConvertApiError:re}=J.selectors,ne=J.reducer,se={viewedRewardDropIds:[],viewedCampaignIds:[]},ie=(0,C.l1)(e=>{var t,a;return Object.assign(Object.assign({},se),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},e=>{var t,a;return Object.assign(Object.assign({},se),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},{whitelist:["notification"]}),le=(0,D.Kr)({name:"notification",initialState:se,reducers:e=>({markNotificationRewardViewed:e.reducer((e,t)=>{e.viewedRewardDropIds.includes(t.payload)||e.viewedRewardDropIds.push(t.payload)}),markNotificationRewardsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedRewardDropIds.includes(t)||e.viewedRewardDropIds.push(t)})}),clearNotificationViewedReward:e.reducer((e,t)=>{e.viewedRewardDropIds=e.viewedRewardDropIds.filter(e=>e!==t.payload)}),markNotificationCampaignViewed:e.reducer((e,t)=>{e.viewedCampaignIds.includes(t.payload)||e.viewedCampaignIds.push(t.payload)}),markNotificationCampaignsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedCampaignIds.includes(t)||e.viewedCampaignIds.push(t)})}),clearNotificationViewedCampaign:e.reducer((e,t)=>{e.viewedCampaignIds=e.viewedCampaignIds.filter(e=>e!==t.payload)})})}),{markNotificationRewardViewed:oe,markNotificationRewardsViewed:de,clearNotificationViewedReward:ce,markNotificationCampaignViewed:ue,markNotificationCampaignsViewed:pe,clearNotificationViewedCampaign:me}=le.actions,ve=le.reducer;var he=a(748);const ge=(0,D.Kr)({name:"wallet",initialState:{isWalletAvailable:!0,trueDecimal:2,trueSessionRate:null,wallets:[],convertParams:{penalty:{amount:"50"},commission:{amount:"1"}},minConvertAmount:5},reducers:e=>({setWallets:e.reducer((e,t)=>{e.wallets=t.payload}),setWalletAvailability:e.reducer((e,t)=>{e.isWalletAvailable=t.payload}),setTrueSessionRate:e.reducer((e,t)=>{e.trueSessionRate=t.payload}),setConvertParams:e.reducer((e,t)=>{t.payload&&(e.convertParams=t.payload)}),incrementWalletBalance:e.reducer((e,t)=>{const a=e.wallets[0];if(a){const e=parseFloat(a.balance)||0;a.balance=String(e+t.payload)}}),markActiveWalletSeen:e.reducer(e=>{const t=e.wallets[0];t&&(t.isNew=!1)}),setMinConvertAmount:e.reducer((e,t)=>{e.minConvertAmount=t.payload})}),selectors:{getActiveWallet:e=>e.wallets[0],getIsWalletAvailable:e=>e.isWalletAvailable,getTrueSessionRate:e=>{var t,a,r;return null!==(a=null===(t=e.wallets[0])||void 0===t?void 0:t.sessionRate)&&void 0!==a?a:null===(r=e.trueSessionRate)||void 0===r?void 0:r.rate},getIsActiveWalletNew:e=>{var t;return!0===(null===(t=e.wallets[0])||void 0===t?void 0:t.isNew)},getConvertParams:e=>e.convertParams,getMinConvertAmount:e=>e.minConvertAmount}}),{incrementWalletBalance:fe,markActiveWalletSeen:xe,setTrueSessionRate:we,setWalletAvailability:be,setWallets:ye,setConvertParams:je,setMinConvertAmount:Ce}=ge.actions,{getActiveWallet:Ne,getIsActiveWalletNew:De,getIsWalletAvailable:Ee,getTrueSessionRate:Re,getConvertParams:ze,getMinConvertAmount:ke}=ge.selectors,Se=ge.reducer;var Be=a(5478),Pe=a(4218),Oe=a(9617);const Le=["promoLobby","prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired","prizeDropSuccess","prizeDropResultFinished","prizeDropResultCancelled","prizeDropLive","prizeDropJoinError","walletConvertSuccess"],Te=e=>Le.includes(e),Ie=(0,j.Z0)({name:"modals",initialState:{hasOpened:!1,current:[],isModalReady:!0},reducers:{setIsModalReady(e,t){e.isModalReady=t.payload},setHasOpened(e,t){e.hasOpened=t.payload},addCurrent(e,t){e.current.push(t.payload)},focusModal(e,t){e.current=e.current.filter(e=>e!==t.payload),e.current.push(t.payload)},closeModalSlice(e,t){(null==t?void 0:t.payload)?e.current=e.current.filter(e=>e!==t.payload):e.current=[],e.hasOpened=!!e.current.length},setModalReady(e){e.isModalReady=!0}},selectors:{getModalsIsModalMode:e=>e.isModalReady&&e.hasOpened,getCurrentModal:e=>e.current.at(-1)||null}}),{closeModalSlice:_e,setModalReady:Ae,setIsModalReady:Me,setHasOpened:Fe,addCurrent:Ue,focusModal:$e}=Ie.actions,{getModalsIsModalMode:Ye,getCurrentModal:Ve}=Ie.selectors,We=Ie.reducer,Ge=e=>(t,a,r)=>{const{current:n}=a().modals;r.mainDispatch((0,Pe.Xm)(!0)),Te(e)&&(r.mainDispatch((0,he.M5)()),r.mainDispatch((0,Pe.lX)(!0))),n.includes(e)?t($e(e)):(Be.h$.emit("modal:opened",e),t(Fe(!0)),t(Ue(e)))},Je=e=>(t,a,r)=>{if("promoLobby"===e){if(a().promoLobby.uiBlockers.length>0)return;t(L()),r.mainDispatch((0,Oe.Pp)(!1))}t(_e(e));const n=a().modals.current,s=n.length<1,i=n.some(Te);r.mainDispatch((0,Pe.lX)(i)),s&&r.mainDispatch((0,Pe.Xm)(!1))};var Ke,He=a(1128);!function(e){e.CAMPAIGN_UPDATED="campaignUpdated",e.REWARD="reward",e.WALLET_STATUS="walletStatus"}(Ke||(Ke={}));const Qe=e=>{try{const t=new URL(e);return t.searchParams.delete("token"),t.searchParams.delete("authorization"),t.toString()}catch(t){return e}},qe=e=>{var t;if(!e||"object"!=typeof e)return e;const a=e;return{constructorName:null===(t=e.constructor)||void 0===t?void 0:t.name,type:a.type,message:a.message,status:a.status,statusText:a.statusText,readyState:a.readyState,responseText:a.responseText}},Xe=({error:e,socket:t,url:a,transports:r})=>{var n,s,i,l,o;const d=e;return{url:Qe(a),transports:null!=r?r:"default",currentTransport:null!==(i=null===(s=null===(n=null==t?void 0:t.io.engine)||void 0===n?void 0:n.transport)||void 0===s?void 0:s.name)&&void 0!==i?i:null,connected:null!==(l=null==t?void 0:t.connected)&&void 0!==l&&l,active:null!==(o=null==t?void 0:t.active)&&void 0!==o&&o,error:d?{name:d.name,message:d.message,description:d.description,type:d.type,context:qe(d.context)}:null}},Ze=new class{constructor(){this.socket=null,this.callbacks=new Map}connect({url:e,token:t,transports:a}){if(!e||!t)return Promise.reject(new Error("Url or token not provided"));this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect());const r=Qe(e);return new Promise((n,s)=>{const i={auth:{token:t}};a&&(i.transports=a),Be.vF.socketEvent("Socket.io connecting",{url:r,transports:null!=a?a:"default",hasAuthToken:!0}),this.socket=(0,He.io)(e,i),this.socket.once("connect",()=>{var e,t,a;const s=null===(e=this.socket)||void 0===e?void 0:e.io.engine;Be.vF.socketEvent("Socket.io connected",{url:r,transport:null!==(a=null===(t=null==s?void 0:s.transport)||void 0===t?void 0:t.name)&&void 0!==a?a:null}),null==s||s.once("upgrade",()=>{Be.vF.socketEvent("Socket.io transport upgraded",{url:r,transport:s.transport.name})}),null==s||s.once("close",e=>{Be.vF.socketEvent("Socket.io engine closed",{url:r,reason:e,transport:s.transport.name})}),n()}),this.socket.once("connect_error",t=>{Be.vF.socketEvent("Socket.io connection error",Xe({error:t,socket:this.socket,url:e,transports:a})),s(t)}),this.socket.once("error",t=>{Be.vF.socketEvent("Socket.io error",Xe({error:t,socket:this.socket,url:e,transports:a})),s(t)}),this.socket.io.on("reconnect_attempt",e=>{var t,a,n,s;return Be.vF.socketEvent("Socket.io trying to reconnect",{url:r,attempt:e,transport:null!==(s=null===(n=null===(a=null===(t=this.socket)||void 0===t?void 0:t.io.engine)||void 0===a?void 0:a.transport)||void 0===n?void 0:n.name)&&void 0!==s?s:null})}),this.socket.io.on("reconnect_error",t=>Be.vF.socketEvent("Socket.io retry failed",Xe({error:t,socket:this.socket,url:e,transports:a}))),this.socket.io.on("reconnect_failed",()=>Be.vF.socketEvent("Socket.io all retries exhausted",{url:r,transports:null!=a?a:"default"})),this.socket.onAny((e,t)=>{const a={type:e,payload:t,timestamp:Date.now()};this.emit(e,a)}),this.socket.on("disconnect",e=>{var t,a;Be.vF.socketEvent("Socket.io disconnected",{url:r,reason:e,active:null!==(a=null===(t=this.socket)||void 0===t?void 0:t.active)&&void 0!==a&&a})})})}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}send(e){this.socket&&this.socket.connected?this.socket.emit(e.type,e.payload):Be.vF.socketEvent("Socket.io not connected. Unable to send:",e)}on(e,t){this.callbacks.has(e)||this.callbacks.set(e,new Set),this.callbacks.get(e).add(t)}off(e,t){var a;null===(a=this.callbacks.get(e))||void 0===a||a.delete(t)}emit(e,t){var a;Be.vF.socketEvent(e,t.payload),null===(a=this.callbacks.get(e))||void 0===a||a.forEach(e=>e(t))}};var et=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const tt=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),at=e=>{if(!tt(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},rt=e=>e instanceof Error&&tt(e.cause)?at(e.cause):null,nt={campaigns:[],activeCampaign:null,displayedCampaign:null,campaignsQueue:[],prizeDropLiveShownCampaignIds:[],apiLobbyInit:{data:null,isPending:!1,error:null,fake:null},apiJoinCampaign:{data:null,isPending:!1,error:null,fake:null},socketConnection:{data:null,isSuccess:!1,isPending:!1,error:null,fake:null}},st=(0,C.l1)(e=>{var t;return Object.assign(Object.assign({},nt),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},e=>{var t;return Object.assign(Object.assign({},nt),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},{whitelist:["prizeDrop"]}),it=(0,D.Kr)({name:"prizeDrop",initialState:nt,reducers:e=>({setPrizeDropRestData:e.reducer((e,t)=>{e.restData=t.payload}),setPrizeDropCampaigns:e.reducer((e,t)=>{e.campaigns=t.payload}),setPrizeDropActiveCampaign:e.reducer((e,t)=>{e.activeCampaign=t.payload}),setPrizeDropDisplayedCampaign:e.reducer((e,t)=>{e.displayedCampaign=t.payload}),setPrizeDropSocketEventCampaignUpdated:e.reducer((e,t)=>{var a,r;const n=t.payload,s=e.campaigns.map(e=>{var t,a;return e.campaignId===n.campaignId?Object.assign(Object.assign({},e),{status:n.status,prizesLeftCount:null!==(t=n.prizesLeftCount)&&void 0!==t?t:e.prizesLeftCount,winnersCount:null!==(a=n.winnersCount)&&void 0!==a?a:e.winnersCount,prizes:n.prizes.length>0?e.prizes.map(e=>{const t=n.prizes.find(t=>t.prizeId===e.prizeId);return t?Object.assign(Object.assign({},e),t):e}):e.prizes}):e});e.campaigns=s;const i=e.campaigns.find(e=>e.campaignId===n.campaignId);(null===(a=e.displayedCampaign)||void 0===a?void 0:a.campaignId)===n.campaignId&&i&&(e.displayedCampaign=i),(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)===n.campaignId&&("finished"===n.status||"cancelled"===n.status?e.activeCampaign=null:e.activeCampaign=i)}),setApiPrizeDropLobbyInitFake:e.reducer((e,t)=>{e.apiLobbyInit.fake=t.payload}),setApiPrizeDropJoinCampaignFake:e.reducer((e,t)=>{e.apiJoinCampaign.fake=t.payload}),setPrizeDropSocketFake:e.reducer((e,t)=>{e.socketConnection.fake=t.payload}),joinPrizeDropCampaign:e.reducer((e,t)=>{t.payload.campaignId===e.displayedCampaign.campaignId&&(e.activeCampaign=e.displayedCampaign,e.activeCampaign.joined=!0,e.campaigns=e.campaigns.map(e=>e.campaignId===t.payload.campaignId?Object.assign(Object.assign({},e),{joined:!0}):e))}),clearPrizeDropJoinCampaignError:e.reducer(e=>{e.apiJoinCampaign.error=null}),clearPrizeDropJoinCampaignData:e.reducer(e=>{e.apiJoinCampaign.data=null,e.apiJoinCampaign.error=null,e.apiJoinCampaign.isPending=!1}),setPrizeDropDefferedCampaign:e.reducer((e,t)=>{e.defferedCampaign=t.payload}),clearPrizeDropDefferedCampaign:e.reducer(e=>{e.defferedCampaign=null}),setPrizeDropCampaignsQueue:e.reducer((e,t)=>{e.campaignsQueue=t.payload}),shiftPrizeDropFromCampaignsQueue:e.reducer(e=>{e.campaignsQueue=e.campaignsQueue.slice(1)}),clearPrizeDropCampaignsQueue:e.reducer(e=>{e.campaignsQueue=[]}),addPrizeDropLiveShownCampaignId:e.reducer((e,t)=>{e.prizeDropLiveShownCampaignIds.includes(t.payload)||e.prizeDropLiveShownCampaignIds.push(t.payload)}),fetchApiPrizeDropLobbyInit:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.prizeDrop.apiLobbyInit.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url,p=o.promoLobby.lang;if(d){const e=o.prizeDrop.apiLobbyInit.fake;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("GET",`${u}/lobby/init`,c,e,{lang:p})}catch(e){const a=rt(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiLobbyInit.isPending=!0,e.apiLobbyInit.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=at(t.payload);e.apiLobbyInit.isPending=!1,e.apiLobbyInit.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiLobbyInit.isPending=!1,e.apiLobbyInit.data=t.payload}}),fetchApiPrizeDropJoinCampaign:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.prizeDrop.apiJoinCampaign.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.url,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.token;if(d){const e=o.prizeDrop.apiJoinCampaign.fake;return yield(0,M.yy)(e.delay),e.hasError&&e.countRetries?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!u)throw Error("Endpoint or token not provided");try{return yield V("POST",`${c}/campaign/join`,u,e)}catch(e){const a=rt(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiJoinCampaign.isPending=!0,e.apiJoinCampaign.error=null,e.apiJoinCampaign.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=at(t.payload);e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.error={name:a,message:r,code:a,languageKey:n},e.apiJoinCampaign.data=null;const s=e.apiJoinCampaign.fake;(null==s?void 0:s.enabled)&&(null==s?void 0:s.countRetries)>0&&(s.countRetries-=1,e.apiJoinCampaign.fake=s)},fulfilled:(e,t)=>{e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.data=t.payload}}),connectPrizeDropSocketService:e.asyncThunk((e,t)=>et(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s;const i=a(),l=null===(r=i.prizeDrop.apiLobbyInit.data)||void 0===r?void 0:r.credentials;if(!l)throw Error("Socket credentials not provided (lobby init response)");const{url:o,token:d,transports:c}=l;if(null!==(s=null===(n=i.prizeDrop.socketConnection.fake)||void 0===n?void 0:n.enabled)&&void 0!==s&&s){const e=i.prizeDrop.socketConnection.fake;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):void 0}yield Ze.connect({url:o,token:d,transports:c})}),{pending:e=>{e.socketConnection.isPending=!0,e.socketConnection.isSuccess=!1,e.socketConnection.error=null},rejected:(e,t)=>{var a,r;e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!1,e.socketConnection.error={name:(null===(a=t.error)||void 0===a?void 0:a.name)||"Oops",message:(null===(r=t.error)||void 0===r?void 0:r.message)||"Something went wrong"}},fulfilled:e=>{e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!0,e.socketConnection.error=null}})}),selectors:{isPrizeDropActive:e=>e.activeCampaign&&"cancelled"!==e.activeCampaign.status,getPrizeDropMode:(e,t)=>{const a=e.campaigns.find(e=>e.campaignId===t);if(a){if("scheduled"===a.status)return"upcoming";if("running"===a.status)return"live"}return"ended"},isPrizeDropJoined:e=>{var t;return null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined},getPrizeDropMaxPrize:e=>{const{prizes:t}=e.displayedCampaign,a=t.find(e=>null==e?void 0:e.topPrize);return!a&&t.length>0?t[0]:a},hasPrizeDropActiveCampaign:e=>{var t,a,r;return(null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined)&&(null===(a=null==e?void 0:e.activeCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.displayedCampaign)||void 0===r?void 0:r.campaignId)},displayPrizeDropJoinButton:e=>{var t,a,r,n;return"running"===(null===(t=null==e?void 0:e.displayedCampaign)||void 0===t?void 0:t.status)&&((null===(a=null==e?void 0:e.displayedCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)||!(null===(n=null==e?void 0:e.activeCampaign)||void 0===n?void 0:n.joined))}}}),{setPrizeDropActiveCampaign:lt,setPrizeDropDisplayedCampaign:ot,setPrizeDropSocketEventCampaignUpdated:dt,setApiPrizeDropLobbyInitFake:ct,setApiPrizeDropJoinCampaignFake:ut,setPrizeDropRestData:pt,fetchApiPrizeDropLobbyInit:mt,fetchApiPrizeDropJoinCampaign:vt,connectPrizeDropSocketService:ht,setPrizeDropSocketFake:gt,joinPrizeDropCampaign:ft,setPrizeDropDefferedCampaign:xt,clearPrizeDropDefferedCampaign:wt,setPrizeDropCampaignsQueue:bt,shiftPrizeDropFromCampaignsQueue:yt,clearPrizeDropCampaignsQueue:jt,addPrizeDropLiveShownCampaignId:Ct,clearPrizeDropJoinCampaignError:Nt,clearPrizeDropJoinCampaignData:Dt,setPrizeDropCampaigns:Et}=it.actions,{isPrizeDropActive:Rt,getPrizeDropMode:zt,isPrizeDropJoined:kt,getPrizeDropMaxPrize:St,hasPrizeDropActiveCampaign:Bt,displayPrizeDropJoinButton:Pt}=it.selectors,Ot=it.reducer,Lt=e=>(t,a,r)=>{const{displayedCampaign:n}=a().prizeDrop;(null==n?void 0:n.campaignId)&&"prizeDropJoinError"!==e&&t(Ct(n.campaignId)),t(Je(e)),t(yt());const{campaignsQueue:s}=a().prizeDrop,i=s[0];i&&(t(ot(i)),r.mainDispatch((0,he.M5)()),t(Ge("prizeDropLive")))};var Tt=a(1316),It=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const _t=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired"],At=e=>{if(e.reward.type!==Tt.Dy.TRUE)return"prizeDropCongratulation";switch(e.claimUiStatus){case"pending":default:return"prizeDropClaimed";case"success":return"prizeDropClaimedSuccess";case"error":return"prizeDropClaimedFailed";case"expired":return"prizeDropClaimedExpired"}},Mt=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),Ft=e=>{if(!Mt(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},Ut=(0,D.Kr)({name:"rewards",initialState:{rewards:[],rewardsQueue:[],winReward:null,hasDefferedRewardModal:!1,apiRewardsList:{data:null,isPending:!1,error:null,fake:null},apiClaim:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setRewards:e.reducer((e,t)=>{e.rewards=t.payload}),upsertReward:e.reducer((e,t)=>{const a=e.rewards.findIndex(e=>e.rewardId===t.payload.rewardId);a>=0?e.rewards[a]=t.payload:e.rewards.push(t.payload)}),removeRewardById:e.reducer((e,t)=>{e.rewards=e.rewards.filter(e=>e.rewardId!==t.payload)}),setWinReward:e.reducer((e,t)=>{e.winReward=t.payload}),clearWinReward:e.reducer(e=>{e.winReward=null}),setHasDefferedRewardModal:e.reducer((e,t)=>{e.hasDefferedRewardModal=t.payload}),addRewardsToQueue:e.reducer((e,t)=>{t.payload.forEach(t=>{const a=e.rewardsQueue.findIndex(e=>e.reward.rewardId===t.rewardId);let r;if(a>=0){const n=e.rewardsQueue[a];let s="pending";"success"===n.claimUiStatus||"error"===n.claimUiStatus?s=n.claimUiStatus:"expired"===n.claimUiStatus&&(s="expired"),r={reward:t,claimUiStatus:s},e.rewardsQueue.splice(a,1)}else r={reward:t,claimUiStatus:"pending"};e.rewardsQueue.unshift(r)})}),removeRewardFromQueueById:e.reducer((e,t)=>{e.rewardsQueue=e.rewardsQueue.filter(e=>e.reward.rewardId!==t.payload)}),updateRewardQueueEntryClaimUiStatus:e.reducer((e,t)=>{const a=e.rewardsQueue.find(e=>e.reward.rewardId===t.payload.rewardId);a&&(a.claimUiStatus=t.payload.claimUiStatus)}),clearApiRewardsClaimData:e.reducer(e=>{e.apiClaim.data=null,e.apiClaim.error=null,e.apiClaim.isPending=!1}),setApiRewardsListFake:e.reducer((e,t)=>{e.apiRewardsList.fake=t.payload}),setApiRewardsClaimFake:e.reducer((e,t)=>{e.apiClaim.fake=t.payload}),fetchApiRewardsList:e.asyncThunk((e,t)=>It(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.rewards.apiRewardsList.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.rewards.apiRewardsList;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");return V("GET",`${u}/rewards`,c)}),{pending:e=>{e.apiRewardsList.isPending=!0,e.apiRewardsList.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=Ft(t.payload);e.apiRewardsList.isPending=!1,e.apiRewardsList.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{e.apiRewardsList.isPending=!1,e.apiRewardsList.data=t.payload,e.rewards=t.payload.data.filter(e=>e.status===Tt.ti.ACTIVE)}}),fetchApiRewardsClaim:e.asyncThunk((e,t)=>It(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l;const o=a(),d=null===(r=o.rewards.apiClaim.fake)||void 0===r?void 0:r.enabled,c=null===(s=null===(n=o.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,u=null===(l=null===(i=o.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(d){const{fake:e}=o.rewards.apiClaim;return yield(0,M.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!c)throw Error("Endpoint or token not provided");try{return yield V("POST",`${u}/rewards/${e.rewardId}/claim`,c,{})}catch(e){const a=(p=e)instanceof Error&&Mt(p.cause)?Ft(p.cause):null;if(a)return t(a);throw e}var p}),{pending:e=>{e.apiClaim.isPending=!0,e.apiClaim.error=null,e.apiClaim.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=Ft(t.payload);e.apiClaim.isPending=!1,e.apiClaim.error={name:a,message:r,code:a,languageKey:n},e.apiClaim.data=null;const s=e.apiClaim.fake;(null==s?void 0:s.enabled)&&(null==s?void 0:s.countRetries)>0&&(s.countRetries-=1,e.apiClaim.fake=s)},fulfilled:(e,t)=>{e.apiClaim.isPending=!1,e.apiClaim.data=t.payload}})})}),{setRewards:$t,upsertReward:Yt,removeRewardById:Vt,setWinReward:Wt,clearWinReward:Gt,setHasDefferedRewardModal:Jt,addRewardsToQueue:Kt,removeRewardFromQueueById:Ht,updateRewardQueueEntryClaimUiStatus:Qt,clearApiRewardsClaimData:qt,setApiRewardsListFake:Xt,setApiRewardsClaimFake:Zt,fetchApiRewardsList:ea,fetchApiRewardsClaim:ta}=Ut.actions,aa=Ut.reducer;var ra=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const na=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),sa=e=>{if(!na(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},ia=(0,D.Kr)({name:"transaction",initialState:{transactions:[],hasMore:!1,currentPage:1,apiTransactions:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setApiTransactionsFake:e.reducer((e,t)=>{var a;e.apiTransactions.fake=null!==(a=t.payload)&&void 0!==a?a:null}),clearTransactions:e.reducer(e=>{e.transactions=[],e.hasMore=!1,e.currentPage=1,e.apiTransactions.error=null,e.apiTransactions.isPending=!1}),addTransaction:e.reducer((e,t)=>{const{amount:a,rewardId:r}=t.payload,n={transactionId:`optimistic-${r}`,createdAt:(new Date).toISOString(),status:"completed",type:"top-up",subType:"prizedrop",amount:a};e.transactions=[n,...e.transactions]}),fetchApiTransactions:e.asyncThunk((e,t)=>ra(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,n,s,i,l,o,d;const c=a(),u=null===(r=c.transaction.apiTransactions.fake)||void 0===r?void 0:r.enabled,p=null===(s=null===(n=c.prizeDrop)||void 0===n?void 0:n.restData)||void 0===s?void 0:s.token,m=null===(l=null===(i=c.prizeDrop)||void 0===i?void 0:i.restData)||void 0===l?void 0:l.url;if(u){const{fake:a}=c.transaction.apiTransactions,r=e&&"object"==typeof e&&"page"in e&&null!==(o=e.page)&&void 0!==o?o:1,{data:n,error:s}=yield(0,M.TX)((0,M.L5)(()=>ra(void 0,void 0,void 0,function*(){const t=a.hasError||a.errorWhenScroll&&r>1;if(Be.vF.fakeApiEvent("/wallet/transactions",e,t?JSON.parse(a.error):JSON.parse(a.response),t),yield(0,M.yy)(a.delay),t)throw new Error(a.error);return JSON.parse(a.response)})));return s?t(JSON.parse(a.error)):n}if(!m||!p)throw Error("Endpoint or token not provided");const v=e&&"object"==typeof e&&"page"in e&&null!==(d=e.page)&&void 0!==d?d:1,h={};v>1&&(h.page=String(v));try{return yield V("GET",`${m}/wallet/transactions`,p,null,h)}catch(e){const a=(g=e)instanceof Error&&na(g.cause)?sa(g.cause):null;if(a)return t(a);throw e}var g}),{pending:e=>{e.apiTransactions.isPending=!0,e.apiTransactions.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:n}=sa(t.payload);e.apiTransactions.isPending=!1,e.apiTransactions.error={name:a,message:r,code:a,languageKey:n}},fulfilled:(e,t)=>{var a;e.apiTransactions.isPending=!1;const{payload:r}=t;e.apiTransactions.data=r;const n=r.transactions.map(e=>{return t=e,Object.assign(Object.assign({},t),{amount:parseFloat(t.amount)||0});var t}),{arg:s}=t.meta,i=s&&"object"==typeof s&&"page"in s&&null!==(a=s.page)&&void 0!==a?a:1;1===i?(e.transactions=n,e.currentPage=1):e.transactions=[...e.transactions,...n],e.currentPage=i,e.hasMore=r.hasMore}})})}),{addTransaction:la,clearTransactions:oa,fetchApiTransactions:da,setApiTransactionsFake:ca}=ia.actions,ua=ia.reducer;var pa,ma;const va=(0,y.HY)({convert:ne,modals:We,notification:ve,prizeDrop:Ot,promoLobby:A,rewards:aa,transaction:ua,wallet:Se}),ha=(0,M.P3)("token"),ga={key:`${null!==(ma=null===(pa=(0,F.p)(ha))||void 0===pa?void 0:pa.gameId)&&void 0!==ma?ma:"sandbox"}:promoLobby`,storage:N.A,whitelist:["notification","prizeDrop"],transforms:[ie,st]},fa=(0,C.rL)(ga,va),xa={mainDispatch:(...e)=>{throw new Error("PromoLobby mainDispatch is not set. Ensure PromoLobbyProvider mounted inside main Provider.")},mainGetState:()=>{throw new Error("PromoLobby mainGetState is not set. Ensure PromoLobbyProvider mounted inside main Provider.")}},wa=(0,j.U1)({reducer:fa,middleware:e=>e({serializableCheck:{ignoredActions:[C.ZM,C.r2,C.Hz,C.DY,C.Cq,C.eY]},thunk:{extraArgument:xa}}),devTools:!1}),ba=(0,C.GM)(wa);var ya=a(8131);const ja=({children:e})=>{const t=(0,f.Pj)();return(0,g.useEffect)(()=>{var e;e={mainDispatch:t.dispatch,mainGetState:()=>t.getState()},xa.mainDispatch=e.mainDispatch,xa.mainGetState=e.mainGetState},[t]),(0,r.jsx)(ya.Q,{loading:null,persistor:ba,children:(0,r.jsx)(f.Kq,{store:wa,context:x,children:e})})},Ca=({children:e})=>(0,r.jsx)(ja,{children:e});var Na,Da=a(9286),Ea=a(6942),Ra=a.n(Ea);function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},za.apply(null,arguments)}const ka=e=>g.createElement("svg",za({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 8 10"},e),Na||(Na=g.createElement("path",{fill:"#fff",d:"M1.083 0v3l1.944 2-1.944 2v3h5.833V7L4.972 5l1.944-2V0z"})));var Sa=a(2192);const Ba=({prizeDropMode:e,className:t})=>{const a=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:Ra()("flex items-center gap-4 rounded-20 px-10 py-4","ended"===e&&"bg-add-gradient","live"===e&&"bg-green","upcoming"===e&&"bg-add-violet backdrop-blur-[20px]",t),children:["live"===e&&(0,r.jsx)("div",{className:"h-6 w-6 rounded-full bg-white"}),"upcoming"===e&&(0,r.jsx)(ka,{className:"h-10 w-8"}),(0,r.jsxs)("span",{className:"text-xs-bold",children:["ended"===e&&a("LOBBY.014","Ended").toUpperCase(),"live"===e&&a("LOBBY.012","Live").toUpperCase(),"upcoming"===e&&a("LOBBY.013","Upcoming").toUpperCase()]})]})};var Pa=a(6098),Oa=a(7052);const La=({onClick:e,isLoading:t,className:a="",text:n,loadingText:s,disabled:i=!1,size:l="middle"})=>(0,r.jsx)(Pa.$,{className:Ra()("mx-auto w-full mp:max-w-530 ml:max-w-560",a),onClick:a=>!t&&e(a),disabled:i||t,size:l,children:t?(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[(0,r.jsx)(Oa.k,{}),s]}):n}),Ta=({onClick:e,isLoading:t,className:a="",disabled:n=!1})=>{const s=(0,Sa.Bd)();return(0,r.jsx)(La,{onClick:e,text:s("DROP.010","Join now"),loadingText:s("DROP.011","Joining..."),isLoading:t,className:a,disabled:n})};var Ia,_a,Aa,Ma,Fa,Ua,$a,Ya,Va,Wa;function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ga.apply(null,arguments)}const Ja=e=>g.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 32 32"},e),Ia||(Ia=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__a)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m-5.548 15.999L16 21.547l5.548-5.548L16 10.45z",clipRule:"evenodd"})),_a||(_a=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__b)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),Aa||(Aa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__c)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),Ma||(Ma=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__d)",d:"M16 2.857C23.26 2.857 29.143 8.74 29.143 16c0 7.258-5.884 13.143-13.143 13.143-7.258 0-13.143-5.885-13.143-13.143S8.742 2.857 16 2.857m0 .571C9.057 3.428 3.43 9.057 3.43 16S9.057 28.57 16 28.57 28.572 22.943 28.572 16 22.943 3.428 16 3.428"})),Fa||(Fa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__e)",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 .571C7.479.571.571 7.48.571 16S7.48 31.429 16 31.429 31.429 24.52 31.429 16 24.52.571 16 .571"})),Ua||(Ua=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__f)",d:"M22.457 15.292a1 1 0 0 1 0 1.414l-5.75 5.75a1 1 0 0 1-1.414 0l-5.75-5.75a1 1 0 0 1 0-1.414l5.75-5.75a1 1 0 0 1 1.414 0zm-12.005.707L16 21.547l5.548-5.548L16 10.45z"})),$a||($a=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__g)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),Ya||(Ya=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__h)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),Va||(Va=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__i)",d:"M21.548 15.999 16 21.547l-5.548-5.548L16 10.45zm-10.288 0 4.74 4.74 4.74-4.74-4.74-4.74z"})),Wa||(Wa=g.createElement("defs",null,g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__d",x1:2.857,x2:29.143,y1:2.857,y2:29.143,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.153,stopColor:"#491B04"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#FFF7D2"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__e",x1:0,x2:32,y1:0,y2:32,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.15,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#734D26"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__g",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.215,stopColor:"#0DF2C1"}),g.createElement("stop",{offset:.5,stopColor:"#F2E70D"}),g.createElement("stop",{offset:.872,stopColor:"#04493A"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__h",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#FFF7D2"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.75,stopColor:"#491B04"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__i",x1:10.452,x2:21.548,y1:10.451,y2:21.547,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#491B04"}),g.createElement("stop",{offset:.748,stopColor:"#FFF7D2"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__a",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.202,stopColor:"#E3C28E"}),g.createElement("stop",{offset:.721,stopColor:"#B37F42"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__b",cx:0,cy:0,r:1,gradientTransform:"matrix(31.98739 31.98739 -45.67082 45.67082 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#19925E"}),g.createElement("stop",{offset:.502,stopColor:"#4BB866",stopOpacity:.8}),g.createElement("stop",{offset:.968,stopColor:"#EBE713"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__c",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__f",cx:0,cy:0,r:1,gradientTransform:"rotate(44.527 -6.37 15.216)scale(21.999 31.4097)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"}))))),Ka={title:{fontSize:36,fontWeight:800,height:42,baseline:32},promo:{fontSize:30,fontWeight:700,height:35,baseline:28},currency:{fontSize:18,fontWeight:700,height:21,baseline:16},text:{fontSize:20,fontWeight:700,height:24,baseline:19}},Ha=({children:e,variant:t="title",className:a="",maxWidth:n})=>{const s=(0,g.useId)().replace(/:/g,"-"),i=`gold-gradient-${s}`,l=`gold-shadow-${s}`,o=(0,g.useRef)(null),[d,c]=(0,g.useState)(200),u=Ka[t],[p,m]=(0,g.useState)(u.fontSize),v=void 0!==n?u.height/2:u.baseline;return(0,g.useLayoutEffect)(()=>{m(u.fontSize)},[e,n,u.fontSize]),(0,g.useLayoutEffect)(()=>{if(o.current){const e=o.current.getBBox(),t=Math.ceil(e.width),a=void 0!==n?Math.min(t,n)+4:t+4;if(void 0!==n&&t>n){const e=Math.max(Math.floor(p*(n/t)),1);p!==e&&m(e)}d!==a&&c(a)}},[e,p,n,u.fontSize,d]),(0,r.jsxs)("svg",{className:a,width:d,height:u.height,viewBox:`0 0 ${d} ${u.height}`,style:{display:"inline-block",overflow:"visible"},children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("radialGradient",{id:i,gradientUnits:"userSpaceOnUse",cx:"0",cy:"0",r:"10",gradientTransform:"matrix(12.479 4.522 17.525 -6.564 0.044977 0.0000027894)",children:[(0,r.jsx)("stop",{stopColor:"#E3C28E",offset:"20.23%"}),(0,r.jsx)("stop",{stopColor:"#CB9A68",offset:"46.16%"}),(0,r.jsx)("stop",{stopColor:"#B37F42",offset:"72.08%"})]}),(0,r.jsx)("filter",{id:l,x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,r.jsx)("feDropShadow",{dx:"0",dy:"1",stdDeviation:"0",floodColor:"black",floodOpacity:"0.3"})})]}),(0,r.jsx)("text",{ref:o,x:"0",y:v,fill:`url(#${i})`,filter:`url(#${l})`,fontFamily:"Roboto, sans-serif",fontSize:p,fontWeight:u.fontWeight,dominantBaseline:void 0!==n?"middle":void 0,children:e})]})};var Qa;function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qa.apply(null,arguments)}const Xa=e=>g.createElement("svg",qa({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Qa||(Qa=g.createElement("path",{fill:"currentColor",d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.418 8 8 11.582 11.582 8 8 4.418z"})));var Za=a(4554),er=a(7031);const tr=({classes:e})=>(0,r.jsxs)("div",{className:"loader",children:[(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot})]});var ar=a(9494),rr=a(7997);const nr=()=>{var e;const t=(0,Sa.Bd)(),a=w(),n=b(Ne),s=null!==(e=b(Re))&&void 0!==e?e:0,i=b(Ee),l=b(e=>e.wallet.trueDecimal),o=b(ze),{isPending:d,error:p}=b(e=>e.prizeDrop.apiLobbyInit),m=b(e=>e.rewards.rewards.some(e=>e.type===Tt.Dy.CONVERT&&e.status===Tt.ti.ACTIVE)),v=(0,Da.GV)(rr.ge),[h,f]=(0,g.useState)(""),x=n?Number(n.balance):0,y=d||!!p||!i,j=Number.isFinite(s)&&s>0,C=!!o&&x>0&&j&&!y,N=m;return(0,g.useEffect)(()=>{f(Be.bp.formatCash(x,{showCurrency:!1,customDecimals:l,roundUp:!0}))},[x,l,s]),(0,r.jsx)("div",{className:"h-200 rounded-30",style:{backgroundImage:`url(${er.f.get(c)})`,backgroundSize:"cover",backgroundPosition:"top right"},children:(0,r.jsxs)("div",{className:"relative flex h-full flex-col justify-between gap-16 rounded-30 border-[3px] border-white-10 p-17",children:[(0,r.jsx)("img",{src:er.f.get(u),alt:"safe",className:"absolute -right-3 bottom-16 w-190"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)(Xa,{className:"h-28 w-28 shrink-0 text-white"}),(0,r.jsx)("div",{className:"title-h3-bold",children:"$TRUE Token"})]}),(0,r.jsxs)("div",{children:[y?(0,r.jsx)("div",{className:"flex h-38 items-center",children:(0,r.jsx)(tr,{classes:{dot:"w-7 h-7"}})}):(0,r.jsx)(ar.$,{className:"m-0 font-extrabold leading-[38px] text-white",text:h,initialFontSize:32,maxWidth:v?240:170}),!y&&x>0&&j&&(0,r.jsxs)("div",{className:"text-medium-reg -mt-3 opacity-60",children:["~",Be.bp.formatCash(x/s,{roundUp:!0})]})]})]}),C?(0,r.jsx)(Pa.$,{className:"!w-fit !min-w-167 !bg-brand-gradient",onClick:()=>{Be.h$.emit("walletConvert:openClicked",(0,Za.p)({exchangeRate:s,penaltyPercent:null==o?void 0:o.penalty.amount,feeTrue:null==o?void 0:o.commission.amount})),a(P("wallet-convert"))},disabled:N,children:o.penalty.amount?t("LOBBY.051",`Convert now (-${Math.round(parseFloat(o.penalty.amount))}%)`,{"@value@":String(Math.round(parseFloat(o.penalty.amount)))}):t("","Convert now")}):(0,r.jsx)("div",{className:"text-medium-reg -mt-3 opacity-60",children:t("","The Power Behind TRUE World")})]})})},sr=()=>{var e,t;const a=(0,Sa.Bd)(),n=b(e=>e.prizeDrop.displayedCampaign.cashPrizePool),s=b(e=>e.prizeDrop.displayedCampaign),i=b(Re),l=b(e=>e.wallet.trueDecimal),o=s.prizes.some(e=>"true"===e.type),d="number"==typeof i&&i>0;return n?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"title-h3-bold text-cente flex items-center justify-center gap-8 text-center",children:[(0,r.jsxs)("div",{children:["🏆 ",a("DROP.003","Prize pool:")," "]}),o?(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-20 w-20"}),(0,r.jsxs)(Ha,{variant:"text",children:[Be.bp.formatCash(null!==(e=null==n?void 0:n.value)&&void 0!==e?e:0,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}):(0,r.jsx)(Ha,{variant:"text",children:Be.bp.formatCash(null==n?void 0:n.value,{customCurrency:null==n?void 0:n.currency,customDecimals:null==n?void 0:n.decimals,roundUp:!0})})]}),o&&d&&(0,r.jsxs)("div",{className:"text-medium-reg text-center opacity-60",children:["~"," ",Be.bp.formatCash((null!==(t=null==n?void 0:n.value)&&void 0!==t?t:0)/i,{roundUp:!0})]})]}):null};a(494),a(2796),a(7317),a(9964),a(813),a(5811),a(9423),a(7205),a(2369),a(5616),a(1340),a(7081),a(4895),a(6007);var ir,lr=a(4353),or=a.n(lr);function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},dr.apply(null,arguments)}const cr=e=>g.createElement("svg",dr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 20"},e),ir||(ir=g.createElement("path",{fill:"#fff",d:"M8 8.333V10H6.333V8.333zm3.333 0V10H9.667V8.333zm3.334 0V10H13V8.333zM16.333 2.5A1.666 1.666 0 0 1 18 4.166v11.667a1.666 1.666 0 0 1-1.667 1.667H4.667A1.667 1.667 0 0 1 3 15.833V4.166A1.667 1.667 0 0 1 4.667 2.5H5.5V.833h1.667V2.5h6.666V.833H15.5V2.5zm0 13.333V6.666H4.667v9.167zM8 11.666v1.667H6.333v-1.667zm3.333 0v1.667H9.667v-1.667zm3.334 0v1.667H13v-1.667z"}))),ur=({dateStart:e,dateEnd:t,className:a=""})=>{const n=(0,Da.GV)(e=>e.localization.lang);return(0,r.jsxs)("div",{className:Ra()(a||"text-small-med mt-12"),children:[(0,r.jsx)(cr,{className:"mr-6 inline-block h-20 w-20"}),or()(e).locale("no"===n?"nb":n).format("MMM D, YYYY")," ","–"," ",or()(t).locale("no"===n?"nb":n).format("MMM D, YYYY")]})},pr=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),n=Math.floor(a/36e5%24),s=Math.floor(a/6e4%60),i=Math.floor(a/1e3%60),l=e=>String(e).padStart(2,"0");return{days:l(r),hours:l(n),mins:l(s),secs:l(i)}},mr=({prizeDropMode:e,className:t=""})=>{const a=(0,Sa.Bd)(),{dateStart:n,dateEnd:s}=b(e=>e.prizeDrop.displayedCampaign),i="upcoming"===e?n:s,l="ended"===e,[o,d]=(0,g.useState)(()=>pr(i));(0,g.useEffect)(()=>{const e=setInterval(()=>{d(pr(i))},1e3);return()=>clearInterval(e)},[i]);const c=[{value:o.days,text:a("DROP.036","Days")},{value:o.hours,text:a("DROP.037","Hrs")},{value:o.mins,text:a("DROP.038","Mins")},{value:o.secs,text:a("DROP.039","Secs")}],u=e=>!!(l||Number(e)<0);return(0,r.jsxs)("div",{className:Ra()("flex flex-col items-center rounded-16 bg-white-6 pb-20 pt-16",t),children:[(0,r.jsxs)("span",{className:"title-h3-bold",children:["live"===e&&a("DROP.035","Ends in"),"ended"===e&&a("DROP.045","Ended"),"upcoming"===e&&a("DROP.068","Starts in")]}),(0,r.jsx)("div",{className:"mt-6 flex gap-4",children:c.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex flex-col rounded-10 bg-white-6 px-14 py-12",children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:u(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))}),(0,r.jsx)(ur,{dateStart:n,dateEnd:s})]})};var vr,hr,gr,fr=a(1601);function xr(){return xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xr.apply(null,arguments)}const wr=e=>g.createElement("svg",xr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 18 18"},e),vr||(vr=g.createElement("path",{fill:"url(#qualified-icon_svg__a)",d:"M8.222.962a1 1 0 0 1 1.556 0l.899 1.112a1 1 0 0 0 1.037.337l1.381-.371a1 1 0 0 1 1.259.914l.073 1.429a1 1 0 0 0 .642.882l1.335.512a1 1 0 0 1 .48 1.479l-.78 1.199a1 1 0 0 0 0 1.09l.78 1.2a1 1 0 0 1-.48 1.479l-1.335.51a1 1 0 0 0-.642.883l-.073 1.429a1 1 0 0 1-1.259.914l-1.38-.371a1 1 0 0 0-1.038.337l-.9 1.112a1 1 0 0 1-1.555 0l-.899-1.112a1 1 0 0 0-1.037-.337l-1.381.37a1 1 0 0 1-1.259-.913l-.073-1.429a1 1 0 0 0-.641-.882l-1.336-.511a1 1 0 0 1-.48-1.48l.78-1.199a1 1 0 0 0 0-1.09l-.78-1.2a1 1 0 0 1 .48-1.478l1.336-.512a1 1 0 0 0 .64-.882l.074-1.429a1 1 0 0 1 1.259-.914l1.38.371a1 1 0 0 0 1.038-.337z"})),hr||(hr=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2,d:"m6 9 2 2 4-4"})),gr||(gr=g.createElement("defs",null,g.createElement("linearGradient",{id:"qualified-icon_svg__a",x1:0,x2:18,y1:6.818,y2:6.818,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#41FF8D"}),g.createElement("stop",{offset:1,stopColor:"#2FA5E8"})))));var br=a(6966);const yr=({betStatus:e})=>{const t=(0,Sa.Bd)(),a=b(e=>e.prizeDrop.displayedCampaign),n=b(e=>e.prizeDrop.activeCampaign),s=(null==a?void 0:a.campaignId)===(null==n?void 0:n.campaignId);if(null===e)return null;const{bgClass:i,icon:l,title:o}=((e,t,a)=>t?e?{bgClass:"bg-green opacity-20",icon:(0,r.jsx)(wr,{className:"z-1"}),title:a("DROP.041","Your current bet meets the requirements")}:{bgClass:"bg-[rgba(255,71,102,0.2)]",icon:(0,r.jsx)("span",{className:"z-1 leading-[18px]",children:"😴"}),title:a("DROP.044","Your current bet does not meet the requirements")}:{bgClass:"bg-[rgba(255,96,71,0.2)]",icon:(0,r.jsx)("div",{className:"bg-add-gradient z-1 flex min-h-18 min-w-18 items-center justify-center rounded-full",children:(0,r.jsx)(br.A,{className:"h-full w-full"})}),title:a("LOBBY.040","You have already joined an active event.")})(e,s,t);return(0,r.jsxs)("div",{className:"relative -mb-10 mt-10 flex items-center gap-6 py-6 pl-6 pr-10",children:[(0,r.jsx)("div",{className:Ra()("absolute inset-0 rounded-20",i)}),l,(0,r.jsx)("span",{className:"text-small-reg z-1",children:o})]})},jr=({prizeDropMode:e,betStatus:t,isJoined:a})=>{const n=(0,Da.GV)(fr.uB),s=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"relative flex flex-col items-center rounded-tl-16 rounded-tr-16 bg-gradient-to-b from-white-6 to-transparent text-center",children:[(0,r.jsx)("img",{src:er.f.get(n?v:m),alt:"bg",className:"absolute left-1/2 top-0 w-full max-w-full -translate-x-1/2 ml:max-w-448"}),(0,r.jsx)(Ba,{prizeDropMode:e,className:"absolute right-10 top-10"}),(0,r.jsx)("img",{src:er.f.get(h),alt:"logo",className:"contain mt-20 h-74 w-140"}),(0,r.jsxs)("span",{className:"title-h3-bold mt-10 px-6",children:["ended"!==e&&s("DROP.002","Spin and win amazing prizes instantly!"),"ended"===e&&`${s("DROP.046","All winners have received their prizes!")} 🥳`]}),"ended"===e&&(0,r.jsxs)("span",{className:"text-medium-reg px-6 leading-[25px]",children:[s("DROP.047","Stay tuned for new events")," 🚀"]}),a&&(0,r.jsx)(yr,{betStatus:t})]})},Cr=({minimumBet:e,className:t=""})=>{const a=(0,Sa.Bd)();return(0,r.jsx)("div",{className:Ra()("rounded-16 bg-white-6 py-14",t),children:(0,r.jsxs)("div",{className:"text-medium-reg text-center",children:[a("DROP.034","Minimum bet to participate:")," ",(0,r.jsx)("span",{className:"font-bold",children:Be.bp.formatCash(e)})]})})},Nr=({className:e=""})=>{const t=b(e=>{var t;return zt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),a=b(e=>e.prizeDrop.displayedCampaign.prizes),n=b(Re),s=b(e=>e.wallet.trueDecimal),i="number"==typeof n&&n>0,l=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:Ra()("flex flex-col gap-1",e),children:[(0,r.jsxs)("div",{className:Ra()("text-small-reg grid rounded-tl-12 rounded-tr-12 bg-white-6 px-20 py-6","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsx)("div",{className:"opacity-60",children:l("DROP.031","Prize")}),(0,r.jsx)("div",{className:"text-right opacity-60",children:l("DROP.032","Count")}),"upcoming"!==t&&(0,r.jsx)("div",{className:"text-right opacity-60",children:l("DROP.033","Left")})]}),a.map(({prizeId:e,leftCount:a,totalCount:l,configCash:o,configTrue:c})=>{var u,p,m,v,h,g,f;return(0,r.jsxs)("div",{className:Ra()("text-medium-reg grid items-center bg-white-10 py-8 pl-16 pr-20 last-of-type:rounded-bl-12 last-of-type:rounded-br-12","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("img",{src:er.f.get(d),alt:"Cash prize",className:"contain h-36 w-36"}),"TRUE"===(null===(u=null==c?void 0:c.amount)||void 0===u?void 0:u.currency)?(0,r.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16"}),Be.bp.formatCash(null===(p=null==c?void 0:c.amount)||void 0===p?void 0:p.value,{showCurrency:!1,customDecimals:s,roundUp:!0})," "]}),i&&(0,r.jsxs)("span",{className:"text-xs-reg opacity-60",children:["~",Be.bp.formatCash((null!==(v=null===(m=null==c?void 0:c.amount)||void 0===m?void 0:m.value)&&void 0!==v?v:0)/n,{roundUp:!0})," "]})]}):(0,r.jsxs)("span",{className:"title-h3-bold",children:[Be.bp.formatCash(null===(h=null==o?void 0:o.amount)||void 0===h?void 0:h.value,{showCurrency:!1,customDecimals:null===(g=null==o?void 0:o.amount)||void 0===g?void 0:g.decimals,roundUp:!0})," ",(0,r.jsx)("span",{className:"text-small-bold",children:null===(f=null==o?void 0:o.amount)||void 0===f?void 0:f.currency})]})]}),(0,r.jsx)("span",{className:"text-right",children:l}),"upcoming"!==t&&(0,r.jsx)("span",{className:"text-right",children:a})]},e)})]})},Dr=({prizesLeftCount:e,winnersCount:t})=>{const a=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"mt-18 flex gap-10",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:e}),(0,r.jsxs)("span",{className:"text-small-med",children:["🎁 ",a("DROP.029","Prizes left")]})]}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:t}),(0,r.jsxs)("span",{className:"text-small-med",children:["⭐️ ",a("DROP.030","Winners")]})]})]})},Er=()=>{const e=(0,Da.GV)(e=>e.stake.current.amount),{prizesLeftCount:t,winnersCount:a,betAmount:n}=b(e=>e.prizeDrop.displayedCampaign),s=b(e=>{var t;return zt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),i=b(kt),l="live"===s?e>=n:null;return(0,g.useEffect)(()=>{Be.h$.emit("pdModal:eventsView")},[]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)(jr,{betStatus:l,prizeDropMode:s,isJoined:i}),"upcoming"===s&&(0,r.jsx)(mr,{prizeDropMode:s,className:"mt-6"}),(0,r.jsxs)("div",{className:Ra()("rounded-16 bg-white-6 px-14 pb-14 pt-16","live"===s&&"mt-6","live"===s&&i&&"!mt-16","ended"===s&&"mt-4"),children:["upcoming"!==s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sr,{}),(0,r.jsx)(Dr,{prizesLeftCount:t,winnersCount:a})]}),"upcoming"===s&&(0,r.jsx)(sr,{}),(0,r.jsx)(Nr,{className:Ra()("upcoming"===s?"mt-18":"mt-10")})]}),(0,r.jsx)(Cr,{minimumBet:n,className:"upcoming"===s&&"mb-13"}),"upcoming"!==s&&(0,r.jsx)(mr,{prizeDropMode:s,className:"mb-10"})]})};var Rr=a(9701);const zr=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),n=Math.floor(a/36e5%24),s=Math.floor(a/6e4%60),i=Math.floor(a/1e3%60),l=e=>String(e).padStart(2,"0");return{days:l(r),hours:l(n),mins:l(s),secs:l(i)}},kr=({dateStart:e,className:t=""})=>{const a=(0,Sa.Bd)(),[n,s]=(0,g.useState)(()=>zr(e));(0,g.useEffect)(()=>{const t=setInterval(()=>{s(zr(e))},1e3);return()=>clearInterval(t)},[e]);const i=[{value:n.days,text:a("DROP.036","Days")},{value:n.hours,text:a("DROP.037","Hrs")},{value:n.mins,text:a("DROP.038","Mins")},{value:n.secs,text:a("DROP.039","Secs")}],l=e=>Number(e)<0;return(0,r.jsxs)("div",{className:Ra()("flex flex-col gap-5",t),children:[(0,r.jsx)("span",{className:"text-small-reg text-left opacity-60",children:a("DROP.068","Starts in")}),(0,r.jsx)("div",{className:"flex gap-4",children:i.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex min-w-40 flex-col rounded-10 bg-white-20 p-8",style:{boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.20) inset"},children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:l(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))})]})},Sr=({campaign:e})=>{var t,a,n,s,i,l,d,c;const u=b(t=>zt(t,e.campaignId)),p="ended"===u,m="upcoming"===u,v="live"===u,h=b(Re),g=b(e=>e.wallet.trueDecimal),f="number"==typeof h&&h>0,x=(0,Da.GV)(fr.ge),y=(0,Sa.Bd)(),j=w(),C=e.prizes.some(e=>"true"===e.type);return(0,r.jsxs)("button",{type:"button",className:"relative flex h-170 w-full cursor-pointer flex-col justify-between overflow-hidden rounded-16 bg-[linear-gradient(79deg,#D1003F_0%,#D1003F_50%,#FF844F_100%)] p-20 drop-shadow-[0_1px_2px_rgba(0,0,0,0.2)]",onClick:()=>(j(ot(e)),void j(S("campaign"))),children:[(0,r.jsxs)("svg",{style:{transform:"rotate(65.125deg) translate(-115%, -36%)",position:"absolute",right:"-160px",top:"0",mixBlendMode:"plus-lighter",width:"268.556px",height:"583.547px"},width:"305",height:"170",viewBox:"0 0 305 170",fill:"none",children:[(0,r.jsxs)("g",{style:{mixBlendMode:"plus-lighter"},children:[(0,r.jsx)("g",{filter:"url(#filter0_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"167.639",cy:"115.844",rx:"167.639",ry:"115.844",transform:"matrix(-0.612432 0.790523 -0.999061 -0.0433308 508.881 -146.403)",fill:"#FF4D00"})}),(0,r.jsx)("g",{filter:"url(#filter1_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"135.464",cy:"72.9381",rx:"135.464",ry:"72.9381",transform:"matrix(0.938677 -0.344798 0.823647 0.567102 188.028 -5.93066)",fill:"#FF4D00"})})]}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("filter",{id:"filter0_f_5002_5141",x:"0.000213623",y:"-287.287",width:"580.958",height:"536.773",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"67.8837",result:"effect1_foregroundBlur_5002_5141"})]}),(0,r.jsxs)("filter",{id:"filter1_f_5002_5141",x:"183.68",y:"-124.579",width:"383.16",height:"226.608",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"25.4564",result:"effect1_foregroundBlur_5002_5141"})]})]})]}),(0,r.jsx)("img",{className:"absolute right-0 top-1/2 h-170 w-190 -translate-y-1/2",src:er.f.get(o),alt:""}),(0,r.jsx)(Ba,{prizeDropMode:u,className:"absolute right-16 top-16 z-[30]"}),(0,r.jsx)(Rr.Y,{className:"title-h1-bold relative z-10 max-w-[50%] text-left uppercase",text:""===(null===(t=e.texts)||void 0===t?void 0:t.title)||null===(null===(a=e.texts)||void 0===a?void 0:a.title)?y("LOBBY.005","Spin and Win"):e.texts.title,initialFontSize:20,initialLineHeight:23,maxHeight:46}),m&&(0,r.jsx)("div",{children:(0,r.jsx)(kr,{dateStart:e.dateStart})}),(v||p)&&(0,r.jsxs)("div",{className:"relative z-10 -mb-3 text-left",children:[(0,r.jsx)("div",{className:"text-small-bold mb-2",children:y("LOBBY.006","Prize pool")}),(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[C&&(0,r.jsx)(Ja,{className:"h-32 w-32"}),(0,r.jsx)(Ha,{variant:"title",className:"-mb-3",maxWidth:x?400:133,children:Be.bp.formatCash(null!==(s=null===(n=e.cashPrizePool)||void 0===n?void 0:n.value)&&void 0!==s?s:0,{showCurrency:!1,customDecimals:C?g:null===(i=e.cashPrizePool)||void 0===i?void 0:i.decimals,roundUp:!0})})]}),(0,r.jsxs)("div",{className:"h-21",children:[C&&f&&(0,r.jsxs)("div",{className:"title-h2-bold",children:["~",Be.bp.formatCash((null!==(d=null===(l=e.cashPrizePool)||void 0===l?void 0:l.value)&&void 0!==d?d:0)/h,{showCurrency:!0,roundUp:!0})]}),!C&&(0,r.jsx)(Ha,{variant:"currency",children:null===(c=e.cashPrizePool)||void 0===c?void 0:c.currency})]})]}),p&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[20] rounded-16 bg-[#000101] opacity-100",style:{mixBlendMode:"color"},"aria-hidden":!0})]},e.campaignId)},Br={running:0,scheduled:1,finished:2},Pr=e=>new Date(e).getTime(),Or=()=>{var e;const t=b(e=>e.prizeDrop.campaigns),a=(0,Sa.Bd)(),n=null!==(e=null==t?void 0:t.filter(e=>"cancelled"!==e.status).sort((e,t)=>{const a=Br[e.status]-Br[t.status];if(0!==a)return a;const r=Pr(e.dateStart),n=Pr(t.dateStart);return"running"===e.status?n-r:r-n}))&&void 0!==e?e:[],s=0===n.filter(e=>!("finished"===e.status)).length;return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-12",children:[(0,r.jsx)("div",{className:"title-h2-bold pl-16",children:a("LOBBY.004","Events")}),(0,r.jsxs)("div",{className:"flex flex-col gap-12",children:[n.map(e=>(0,r.jsx)(Sr,{campaign:e},e.campaignId)),s&&(0,r.jsxs)("div",{className:"text-medium-reg rounded-12 bg-white-10 p-14 text-center opacity-80",children:[a("LOBBY.011","New thrilling events are coming soon — stay tuned 🚀 ")," 🚀"]})]})]})},Lr=({htmlString:e})=>(0,r.jsx)("div",{className:Ra()("[&_h3]:text-medium-bold [&_h3:first-child]:mt-0 [&_h3]:mt-19","[&_p]:text-small-reg [&_p>strong]:text-small-bold [&_p]:mt-4 [&_p]:opacity-80 [&_p]:ml:mt-5","[&_ul]:mt-4 [&_ul]:flex [&_ul]:flex-col [&_ul]:gap-3","[&_li]:text-small-reg [&_li]:relative [&_li]:pl-22 [&_li]:opacity-80 [&_li]:before:absolute [&_li]:before:left-10 [&_li]:before:top-7 [&_li]:before:h-4 [&_li]:before:w-4 [&_li]:before:rounded-full [&_li]:before:bg-additional","[&_table]:mt-4 [&_table]:w-full","[&_thead]:text-small-bold [&_thead>tr>th:first-child]:rounded-tl-10 [&_thead>tr>th:last-child]:rounded-tr-10 [&_thead>tr>th]:h-30 [&_thead>tr>th]:w-1/2 [&_thead>tr>th]:bg-white-10 [&_thead>tr>th]:pl-12 [&_thead>tr>th]:text-left","[&_tbody>tr>td]:text-small-reg [&_tbody>tr>td]:relative [&_tbody>tr>td]:h-30 [&_tbody>tr>td]:pl-12","[&_tbody>tr:last-child>td:first-child]:before:rounded-bl-10 [&_tbody>tr:last-child>td:last-child]:before:rounded-br-10 [&_tbody>tr>td:last-child]:before:border-r [&_tbody>tr>td]:before:absolute [&_tbody>tr>td]:before:left-0 [&_tbody>tr>td]:before:top-0 [&_tbody>tr>td]:before:h-full [&_tbody>tr>td]:before:w-full [&_tbody>tr>td]:before:border-b [&_tbody>tr>td]:before:border-l [&_tbody>tr>td]:before:border-solid [&_tbody>tr>td]:before:border-white-10"),dangerouslySetInnerHTML:{__html:e}}),Tr=()=>{const e=b(e=>e.prizeDrop.displayedCampaign.texts.rules);return(0,g.useEffect)(()=>{Be.h$.emit("pdModal:rulesView")},[]),(0,r.jsx)("div",{className:"mb-19 rounded-16 bg-white-6 p-20 text-white",children:(0,r.jsx)(Lr,{htmlString:e})})},Ir=({config:e,activeTab:t,setActiveTab:a})=>e.length?(0,r.jsx)("div",{className:"flex h-44 w-384",children:e.map(e=>(0,r.jsx)("button",{className:Ra()(["first-of-type:border-l-solid first-of-type:rounded-l-12 first-of-type:border-l-2 first-of-type:border-l-white-20"],["last-of-type:border-r-solid last-of-type:rounded-r-12 last-of-type:border-r-2 last-of-type:border-r-white-20"],"border-y-solid group flex-1 border-y-2 border-y-white-20 ",e.id===t&&"pointer-events-none !border-transparent bg-white-20"),type:"button",onClick:r=>((e,r)=>{e.preventDefault(),r!==t&&a(r)})(r,e.id),children:(0,r.jsx)("span",{className:Ra()("text-medium-bold",e.id===t?"opacity-100":"opacity-40 group-hover:opacity-80 group-hover:transition-opacity"),children:e.title})},e.id))}):null;const _r=({campaignId:e})=>(t,a)=>{return r=void 0,n=void 0,i=function*(){t(vt({campaignId:e})).unwrap().then(a=>{a.joined&&(t(ft({campaignId:e})),t(ht()))}).catch(e=>{Be.vF.error(e)})},new((s=void 0)||(s=Promise))(function(e,t){function a(e){try{o(i.next(e))}catch(e){t(e)}}function l(e){try{o(i.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s(function(e){e(r)})).then(a,l)}o((i=i.apply(r,n||[])).next())});var r,n,s,i};var Ar=function(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{o(r.next(e))}catch(e){s(e)}}function l(e){try{o(r.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,l)}o((r=r.apply(e,t||[])).next())})};const Mr=(e={})=>(t,a,r)=>Ar(void 0,void 0,void 0,function*(){var n;const s=null!==(n=e.shouldFreezeUi)&&void 0!==n&&n;s&&r.mainDispatch((0,Pe.zE)()),t(mt()).unwrap().then(e=>Ar(void 0,void 0,void 0,function*(){var n,i,l,o,d,c,u;s&&r.mainDispatch((0,Pe.GP)());const p=null===(n=null==e?void 0:e.campaigns)||void 0===n?void 0:n.find(e=>e.joined&&"running"===e.status);if(t(Et(null!==(i=null==e?void 0:e.campaigns)&&void 0!==i?i:[])),t(be(null===(l=null==e?void 0:e.isWalletAvailable)||void 0===l||l)),t(we(null!==(o=null==e?void 0:e.trueSessionRate)&&void 0!==o?o:null)),t(ye(null!==(d=null==e?void 0:e.wallets)&&void 0!==d?d:[])),t(je(null!==(c=null==e?void 0:e.convertParams)&&void 0!==c?c:null)),t(ht()),t(ea()),null==p?void 0:p.joined)t(lt(p)),Be.h$.emit("campaignId:set",p.campaignId);else{const r=a().prizeDrop.prizeDropLiveShownCampaignIds,n=null===(u=null==e?void 0:e.campaigns)||void 0===u?void 0:u.filter(e=>"running"===e.status&&!e.joined&&!r.includes(e.campaignId));t(bt(null!=n?n:[])),(null==n?void 0:n.length)>0&&t(ot(null==n?void 0:n[0]))}})).catch(e=>{s&&r.mainDispatch((0,Pe.GP)()),Be.vF.error(e)})}),Fr=()=>(e,t,a)=>Ar(void 0,void 0,void 0,function*(){e(mt()).unwrap().then(a=>Ar(void 0,void 0,void 0,function*(){var r,n,s,i,l;const o=a.campaigns.find(e=>e.joined&&"running"===e.status);e(Et(a.campaigns)),e(be(null===(r=a.isWalletAvailable)||void 0===r||r)),e(we(null!==(n=a.trueSessionRate)&&void 0!==n?n:null)),e(ye(null!==(s=a.wallets)&&void 0!==s?s:[])),e(je(null!==(i=a.convertParams)&&void 0!==i?i:null)),(null===(l=t().prizeDrop.socketConnection)||void 0===l?void 0:l.isSuccess)||e(ht()),e(lt(o))})).catch(e=>{a.mainDispatch((0,Pe.GP)()),Be.vF.error(e)})}),Ur=[..._t,"prizeDropResultFinished","prizeDropResultCancelled"],$r=e=>(t,a,r)=>{const n=r.mainGetState().play.isActive,{activeCampaign:s,campaigns:i}=a().prizeDrop;i.find(t=>t.campaignId===e.campaignId)?"finished"===e.status||"cancelled"===e.status?n&&(null==s?void 0:s.campaignId)===e.campaignId?(t(Dt()),t(xt(e))):(t(dt(e)),(null==s?void 0:s.campaignId)===e.campaignId&&(t(Dt()),"finished"===e.status?t(Ge("prizeDropResultFinished")):"cancelled"===e.status&&t(Ge("prizeDropResultCancelled")))):t(n?xt(e):dt(e)):(a().modals.current.includes("promoLobby")&&t(ue(e.campaignId)),t(Mr()))};var Yr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Vr.apply(null,arguments)}const Wr=e=>g.createElement("svg",Vr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 22 22"},e),Yr||(Yr=g.createElement("path",{fill:"#fff",d:"M13.024 13.024a.75.75 0 0 0 .474-1.423l-.237.711zm-1.732-1.368h-.75c0 .323.207.61.513.712zm.75-2.744a.75.75 0 0 0-1.5 0h1.5m1.219 3.4.237-.711-1.969-.656-.237.711-.237.712 1.969.656zm-1.969-.656h.75V8.912h-1.5v2.744zm5.25-.656h-.75a4.5 4.5 0 0 1-4.5 4.5V17a6 6 0 0 0 6-6zm-5.25 5.25v-.75a4.5 4.5 0 0 1-4.5-4.5h-1.5a6 6 0 0 0 6 6zM6.042 11h.75a4.5 4.5 0 0 1 4.5-4.5V5a6 6 0 0 0-6 6zm5.25-5.25v.75a4.5 4.5 0 0 1 4.5 4.5h1.5a6 6 0 0 0-6-6z"})));var Gr=a(6861),Jr=a(454);const Kr=({text:e,className:t=""})=>(0,r.jsxs)("div",{className:Ra()("relative flex min-w-290 items-center justify-center gap-12 rounded-8 bg-main-ui px-16 py-12 shadow-notify-modals",t),children:[(0,r.jsx)("div",{className:"absolute h-full w-full rounded-8 bg-white-10"}),(0,r.jsx)("div",{className:"bg-add-gradient flex min-h-22 min-w-22 shrink-0 items-center justify-center overflow-hidden rounded-full",children:(0,r.jsx)(Wr,{className:"h-full w-full"})}),(0,r.jsx)("div",{className:"text-medium-med",children:e})]}),Hr=(0,g.createContext)(null),Qr=({children:e})=>{const[t,a]=(0,g.useState)(null),n=(0,g.useRef)(null),s=(0,g.useCallback)((e,t)=>{clearTimeout(n.current),a({type:e,text:t}),n.current=setTimeout(()=>{a(null)},1500)},[]),i=(0,g.useCallback)((e="Reward claimed")=>{s("success",e)},[s]),l=(0,g.useCallback)((e="Something went wrong")=>{s("failed",e)},[s]),o=(0,g.useCallback)((e="Unfortunately, the reward expiration time has ended.")=>{s("expired",e)},[s]),d=(0,g.useMemo)(()=>({showSuccessToast:i,showFailedToast:l,showExpiredToast:o}),[i,l,o]);return(0,r.jsxs)(Hr.Provider,{value:d,children:[e,t&&(0,r.jsxs)("div",{className:"pointer-events-none fixed left-1/2 top-28 z-[71] min-w-290 -translate-x-1/2 text-wrap px-16",children:["success"===t.type&&(0,r.jsx)(Jr.r,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"expired"===t.type&&(0,r.jsx)(Kr,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"failed"===t.type&&(0,r.jsx)(Gr.v,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"})]})]})},qr=()=>{const e=(0,g.useContext)(Hr);if(!e)throw new Error("usePromoLobbyToast must be used within PromoLobbyToastProvider");return e};var Xr;function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Zr.apply(null,arguments)}const en=e=>g.createElement("svg",Zr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Xr||(Xr=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 14h8M8 2v8.333m0 0L11.333 7M8 10.333 4.667 7"}))),tn={deposit:{label:"Received",key:"LOBBY.020"},prizedrop:{label:"Prizedrop Reward",key:"LOBBY.007"},airdrop:{label:"Airdrop Reward",key:"LOBBY.010"},sent:{label:"Sent",key:"LOBBY.019"},conversion:{label:"Conversion",key:"LOBBY.071"}},an=({transaction:e})=>{const t="top-up"===e.type,a=(0,Sa.Bd)(),n=b(e=>e.wallet.trueDecimal);return(0,r.jsxs)("div",{className:"flex items-center gap-10 rounded-16 bg-white-10 py-5 pl-5 pr-15",children:[(0,r.jsx)("div",{className:"flex h-34 w-34 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(en,{className:Ra()("h-16 w-16 opacity-60",!t&&"rotate-180")})}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("span",{className:"text-medium-med",children:a(tn[e.subType].key,tn[e.subType].label)})}),(0,r.jsxs)("div",{className:Ra()("text-medium-bold flex shrink-0 items-center gap-6",t?"text-[#77DA29]":"text-white opacity-60"),children:[t&&(0,r.jsx)("span",{children:"+"}),!t&&(0,r.jsx)("span",{children:"-"}),(0,r.jsx)(Xa,{className:Ra()("h-16 w-16",t?"text-[#77DA29]":"text-white")}),Be.bp.formatCash(Math.abs(e.amount),{showCurrency:!1,customDecimals:n,roundUp:!0})]})]})},rn=()=>{const e=(0,Sa.Bd)(),t=w(),a=b(e=>e.transaction.transactions),n=b(e=>e.transaction.apiTransactions.isPending),s=b(Ee),i=b(e=>e.transaction.hasMore),l=b(e=>e.transaction.currentPage),o=b(e=>e.transaction.apiTransactions.error),{showFailedToast:d}=qr(),c=(0,g.useRef)(null),u=(0,g.useRef)(n),p=n||!s;return(0,g.useEffect)(()=>{const t=u.current;u.current=n,t&&!n&&o&&d(e("LOBBY.037","Something went wrong. Please try again."))},[n,o,d,e]),(0,g.useEffect)(()=>{if(!i||p||o)return;const e=c.current;if(!e)return;const a=new IntersectionObserver(e=>{e[0].isIntersecting&&s&&t(da({page:l+1}))},{threshold:0});return a.observe(e),()=>a.disconnect()},[i,p,l,o]),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-white",children:e("LOBBY.015","History")}),!p&&0===a.length&&(0,r.jsx)("div",{className:"flex h-56 flex-col items-center justify-center rounded-12 bg-white-6 p-12 text-center",children:(0,r.jsx)("div",{className:"text-medium-reg opacity-60",children:e("LOBBY.016","There are no transactions yet")})}),a.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[a.filter(e=>"completed"===e.status).map(e=>(0,r.jsx)(an,{transaction:e},e.transactionId)),i&&(0,r.jsx)("div",{ref:c,className:"h-1"})]}),p&&(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(Oa.k,{className:"!mb-20 !mt-5 !h-17 !w-17 !p-2"})})]})};const nn=({rewardId:e,fromHub:t=!1})=>(a,r)=>{return n=void 0,s=void 0,l=function*(){var n,s,i,l;const o=r().rewards.rewards.find(t=>t.rewardId===e),d=null!==(l=null===(i=null===(s=null===(n=null==o?void 0:o.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0;a(ta({rewardId:e})).unwrap().then(()=>{a(oe(e)),a(ce(e)),d>0&&(a(fe(d)),a(la({amount:d,rewardId:e}))),a(Vt(e)),t&&(a(Ht(e)),a(qt())),r().wallet.isWalletAvailable&&a(da({page:1}))}).catch(e=>{Be.vF.error(e)})},new((i=void 0)||(i=Promise))(function(e,t){function a(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(a,r)}o((l=l.apply(n,s||[])).next())});var n,s,i,l},sn=e=>(t,a,r)=>{var n;const s=null===(n=a().rewards.winReward)||void 0===n?void 0:n.rewardId;t(Je(e)),s&&t(Ht(s)),t(Gt()),t(qt());const{rewardsQueue:i}=a().rewards,l=i[0];l&&(t(Wt(l.reward)),t(Ge(At(l)))),r.mainDispatch((0,he.M5)())},ln=e=>(t,a,r)=>{var n,s,i,l,o,d,c,u;const p=a(),m=r.mainGetState().play.isActive;if(e.status===Tt.ti.REDEEMED&&e.type===Tt.Dy.CONVERT){Be.h$.emit("rewardConvert:pendingCleared",(0,Za.i6)(e,"claimed")),t(Vt(e.rewardId)),t(Ht(e.rewardId));const r=a(),s=r.modals.current.filter(e=>_t.includes(e));if((null===(n=r.rewards.winReward)||void 0===n?void 0:n.rewardId)===e.rewardId&&s.length>0){if(r.rewards.apiClaim.data)return;s.forEach(e=>{t(Je(e))}),t(Gt()),t(qt())}return}const v=!a().rewards.apiClaim.isPending;if(e.status===Tt.ti.REDEEMED&&v)return t(ce(e.rewardId)),t(Vt(e.rewardId)),t(Ht(e.rewardId)),t(Je("prizeDropClaimed")),void t(Je("prizeDropCongratulation"));if(t(Yt(e)),(e.type===Tt.Dy.TRUE||e.type===Tt.Dy.CASH)&&e.status===Tt.ti.ACTIVE){if(e.type===Tt.Dy.TRUE&&Be.h$.emit("prizeDrop:won",(0,Za.ym)(e)),e.type===Tt.Dy.CASH){const a=null!==(o=null===(l=null===(i=null===(s=e.rewardCash)||void 0===s?void 0:s.configCash)||void 0===i?void 0:i.amount)||void 0===l?void 0:l.value)&&void 0!==o?o:0;a>0&&(t(fe(a)),t(la({amount:a,rewardId:e.rewardId})))}t(Kt([e]));const r=a().rewards.rewardsQueue[0];if(!r)return;return m?(t(Wt(r.reward)),void t(Jt(!0))):p.modals.current.some(e=>_t.includes(e))?(a().modals.current.filter(e=>_t.includes(e)).forEach(e=>{t(Je(e))}),t(qt()),t(Wt(r.reward)),void t(Ge(At(r)))):(t(Wt(r.reward)),void t(Ge(At(r))))}if(e.type===Tt.Dy.CONVERT)return;const h=null!==(u=null===(c=null===(d=e.rewardStaking)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.value)&&void 0!==u?u:0;h>0&&(t(fe(h)),t(la({amount:h,rewardId:e.rewardId}))),a().wallet.isWalletAvailable&&t(da({page:1}))};var on=a(8682),dn=a(4354),cn=a(8578),un=a(8608),pn=a(8351),mn=a.n(pn);const vn=e=>""===e?new(mn())(0):new(mn())(e),hn=(e,t)=>vn(e).toDecimalPlaces(t,mn().ROUND_CEIL).toNumber(),gn=(e,t)=>{const a=vn(e).toDecimalPlaces(2,mn().ROUND_FLOOR);if(100===t)return a.toString();const r=vn(e).mul(t).div(100).toDecimalPlaces(2,mn().ROUND_CEIL);return(r.greaterThan(a)?a:r).toString()},fn=({amount:e,commissionAmount:t,currencyDecimals:a,exchangeRate:r,penaltyPercent:n})=>{const s=vn(e).toNumber(),i=vn(1).minus(vn(n).div(100)),l=vn(s).minus(t),o=l.isNegative()?vn(0):l,d=Number.isFinite(r)&&r>0,c=d?vn(1).div(r):vn(0),u=c.mul(i),p=d?hn(c,a):0,m=d?hn(u,a):0,v=d?(h=o.mul(u),g=a,vn(h).toDecimalPlaces(g,mn().ROUND_HALF_UP).toNumber()):0;var h,g;return{inputAmountTrue:s,convertAmountTrue:o.toNumber(),resultEur:v,regularExchangeRate:p,penaltyExchangeRate:m}};var xn=a(5894),wn=a(3372),bn=a(3654),yn=a(7263);const jn=({children:e,onClose:t=null,fullScreen:a=!1,background:n=null,modalName:s="promoLobby"})=>{const i=b(e=>e.modals.current.at(-1)||null),l=(0,Da.GV)(e=>!!e.modals.current.length),o=(0,Da.GV)(e=>e.viewPort.userAgent.browser.isSafari),d=(0,g.useRef)(null),c=o?{isolation:"isolate",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"}:void 0,u=()=>{i===s&&t&&(Be.VH.emit("button:clicked",{name:"modalClose",value:s}),t())};return(0,bn.Ls)([d],u,!l),(0,bn.dD)("Escape",u,!l),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ra()("fixed inset-0 -right-1 bottom-39 bg-brand-black opacity-75",xn.T.modal),style:c}),(0,r.jsx)("div",{className:Ra()("fixed -left-1 -right-1 bottom-0 h-40 bg-brand-black",xn.T.modal),style:c}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:d,"data-testid":(0,wn.j)(`${s}-modal`),className:Ra()("promo-lobby-modal-gradient-border bg-brand-black-95 fixed bottom-40 left-0 right-0 flex w-full flex-col items-center overflow-hidden rounded-t-20",a&&["top-40 bg-white-6-gradient ml:top-20"],!a&&["max-h-[calc(100%-40px-20px)]"],xn.T.modal),style:c,children:[e,n&&(0,r.jsx)(yn.o,{src:er.f.get(n),from:"from-main-ui-bleached-06",className:"!absolute left-1/2 top-1/2 z-[-1] size-1000 min-w-1000 -translate-x-1/2 -translate-y-1/2 opacity-20"})]})})]})},Cn=({children:e,hasShadow:t=!1,className:a="",scrollbarInsetTop:n=0,scrollbarInsetBottom:s=0})=>{const i=b(e=>e.promoLobby.activeScreen),l=b(e=>e.promoLobby.topBarScreen),o=(0,Da.GV)(e=>e.viewPort.style.scale),d=(0,g.useRef)(null),c=(0,g.useRef)(null),u=(0,g.useRef)(null),[p,m]=(0,g.useState)(0),[v,h]=(0,g.useState)(0),[f,x]=(0,g.useState)(0),[w,y]=(0,g.useState)(!1),j=(0,g.useRef)(0),C=v-p<1;function N(){if(c.current&&d.current){const e=c.current.clientHeight,t=d.current.clientHeight;if(e>t){const a=Math.max(0,n),r=Math.max(0,s),i=Math.max(0,t-a-r);h(e-t);const l=i>0?i*t/e:0;x(Math.min(i,l)),y(i>0)}else y(!1),m(0)}}const D=`${i}-${null!=l?l:"null"}`,E=(0,g.useRef)(D);(0,g.useEffect)(()=>{w&&E.current!==D&&(m(0),E.current=D),E.current=D},[w,D]),(0,g.useEffect)(()=>{if(w){const e=e=>{e.preventDefault(),e.stopPropagation()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}}},[w]),(0,fr.st)(N,0,c),(0,g.useEffect)(()=>{w&&p>=c.current.scrollHeight-d.current.clientHeight&&m(c.current.clientHeight-d.current.clientHeight)},[f,w,p]);const R=e=>{const t=d.current;if(!t)return;const a=t.getBoundingClientRect(),r=Math.max(0,n),i=Math.max(0,s),l=Math.max(0,t.clientHeight-r-i),c=Math.max(0,l-f);if(0===c)return;let u=(e.clientY-a.top)/o-r-j.current;u=Math.max(0,Math.min(u,c)),m(u/c*v)},z=()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",z)};return(0,r.jsxs)("div",{ref:d,className:Ra()("relative h-full w-full touch-none overflow-hidden scroll-smooth",a),onWheel:e=>{if(N(),w){const t=p+e.deltaY;m(Math.max(0,Math.min(t,v)))}},onTouchStart:e=>{if(N(),w){const t=e.touches[0].clientY;d.current.dataset.touchStartY=(t/o).toString()}},onTouchMove:e=>{if(N(),w){const t=d.current,a=parseFloat(t.dataset.touchStartY||"0"),r=e.touches[0].clientY,n=p+(a-r/o);m(Math.max(0,Math.min(n,v))),t.dataset.touchStartY=(r/o).toString()}},children:[(0,r.jsx)("div",{ref:c,className:"custom-scroll-content relative scroll-smooth will-change-transform",style:{transform:`translateY(-${p}px)`,transition:"none"},children:e}),t&&(0,r.jsx)("div",{className:Ra()("bg-surface-gradient pointer-events-none absolute -bottom-10 left-0 z-2 h-104 w-full",C?"transition-opacity duration-300":"transition-none"),style:{opacity:C?0:1}}),w&&(0,r.jsx)("div",{ref:u,className:"absolute right-6 top-0 w-3 cursor-pointer rounded-3 bg-white-20 md:right-11",style:{height:`${f}px`,transform:(()=>{var e;const t=(null===(e=d.current)||void 0===e?void 0:e.clientHeight)||0,a=Math.max(0,n),r=Math.max(0,s),i=Math.max(0,t-a-r),l=Math.max(0,i-f);return`translateY(${a+(l>0?l*p/v:0)}px)`})()},onMouseDown:e=>{e.preventDefault();const t=d.current,a=u.current;if(!t||!a)return;const r=a.getBoundingClientRect();j.current=(e.clientY-r.top)/o,document.addEventListener("mousemove",R),document.addEventListener("mouseup",z)}})]})},Nn=({children:e,className:t="",contentClassName:a="",scrollbarInsetTop:n=null,scrollbarInsetBottom:s=null})=>(0,r.jsx)(Cn,{scrollbarInsetTop:n,scrollbarInsetBottom:s,className:Ra()("w-full flex-1",t),children:(0,r.jsx)("div",{className:Ra()("mx-auto max-w-560 px-15 ml:px-0",a),children:e})}),Dn=({children:e,className:t=""})=>(0,r.jsx)("div",{className:Ra()("bg-brand-black-95 w-full px-16 pb-14 ml:pb-6",t),children:e});var En=a(6629),Rn=a(5529),zn=a(3277),kn=a(2306);const Sn=({children:e,onReturn:t=null,onClose:a=null,returnType:n="back",modalName:s="promoLobby",classes:i={closeButton:"",returnButton:""}})=>{const l=!!(0,Da.GV)(e=>e.session.urls.lobby),o=(0,Da.GV)(e=>e.app.urlParams.isHomeButtonDisabled),d=t&&("back"===n||"home"===n&&l&&!o);return(0,r.jsxs)("div",{className:"relative w-full px-60",children:[d&&(0,r.jsx)(kn.K,{"data-testid":"return-button",icon:"home"===n?zn.A:En.A,className:Ra()("absolute left-8 top-8 z-1",null==i?void 0:i.returnButton),onClick:e=>{"home"!==n&&Be.VH.emit("button:clicked",{name:"return"}),t(e)}}),e,a&&(0,r.jsx)(kn.K,{"data-testid":"close-button",icon:Rn.A,className:Ra()("absolute right-8 top-8 z-1",null==i?void 0:i.closeButton),onClick:e=>{e.stopPropagation(),Be.VH.emit("button:clicked",{name:"modalClose",value:s}),a()}})]})},Bn=({children:e,onClose:t=null,background:a=null,modalName:n="promoLobby"})=>{const s=b(e=>e.modals.current.at(-1)||null),i=(0,Da.GV)(e=>!!e.modals.current.length),l=(0,g.useRef)(null),o=()=>{s===n&&t&&!i&&(Be.VH.emit("button:clicked",{name:"modalClose",value:n}),t())};return(0,bn.Ls)([l],o,!i),(0,bn.dD)("Escape",o,!i),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ra()("fixed inset-0 -right-1 bottom-0",xn.T.modal),style:{background:"radial-gradient(107.99% 100% at 50% 0%, rgba(13, 242, 193, 0.1) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(8, 8, 8, 0.00) 100%), var(--colors-brand-black)"}}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:l,"data-testid":(0,wn.j)(`${n}-modal`),className:Ra()("fixed bottom-0 left-0 right-0 top-0 flex w-full flex-col items-center overflow-hidden rounded-t-0",xn.T.modal),children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-0 h-full w-full",children:(0,r.jsx)("img",{className:"h-full w-full object-cover object-center ml:scale-[1.5]",src:er.f.get(a),alt:""})}),e,(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:o,onKeyDown:o,className:"fixed bottom-0 left-0 right-0 h-40 w-full cursor-default"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:o,onKeyDown:o,className:"fixed left-0 right-0 top-0 h-20 w-full cursor-default"})]})})]})},Pn=e=>!!e&&new Date(e).getTime()<=Date.now(),On=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.rewards.apiClaim),u=b(e=>e.modals.current.includes("promoLobby")),p=b(e=>e.promoLobby.activeScreen),f=b(e=>e.promoLobby.topBarScreen),{isPending:x,data:y,error:j}=c,C=b(e=>e.wallet.trueDecimal),N=b(Re),D="number"==typeof N&&N>0,[E,R]=(0,g.useState)(!1),z=(0,Sa.Bd)(),k=w(),S=()=>{Be.h$.emit("reward:expired",(0,Za.rx)(d,"expired")),k(Qt({rewardId:d.rewardId,claimUiStatus:"expired"})),k(ce(d.rewardId)),k(Vt(d.rewardId)),k(qt()),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedExpired"))};(0,g.useEffect)(()=>{Be.h$.emit("pdModalWinTrue:opened",(0,Za.ym)(d))},[d]),(0,g.useEffect)(()=>{R(!1)},[d.rewardId]),(0,g.useEffect)(()=>{if(y&&E&&(Be.h$.emit("reward:claimSuccess",(0,Za.rx)(d,"claimed")),k(Qt({rewardId:d.rewardId,claimUiStatus:"success"})),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedSuccess")),k(qt())),j&&!x&&E){if(Pn(d.expiresAt))return void S();Be.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,Za.rx)(d,"new")),{error_code:j.name})),k(Qt({rewardId:d.rewardId,claimUiStatus:"error"})),k(Je("prizeDropClaimed")),k(Ge("prizeDropClaimedFailed"))}},[E,y,j,x]);const B=()=>{x||(Be.h$.emit("pdModalWinDrop:closed",(0,Za.ym)(d)),u&&"true-world"===p&&null===f&&k(oe(d.rewardId)),k(sn("prizeDropClaimed")))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimed",onClose:B,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimed",onClose:B,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:z("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:z("DROP.072","You've won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:C,roundUp:!0})," "]})]}),D&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/N,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:z("DROP.070","Claim your prize to have it credited to your account")})]}),(0,r.jsx)(La,{text:z("LOBBY.008","Claim"),loadingText:z("LOBBY.036","Pending"),isLoading:x,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{if(R(!0),Pn(d.expiresAt))return(0,M.yy)(300),void S();k(nn({rewardId:d.rewardId}))},disabled:x})]})})]})},Ln=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.wallet.trueDecimal),u=b(Re),p="number"==typeof u&&u>0,h=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimExpired:opened")},[]),(0,g.useEffect)(()=>{},[]);const x=()=>{Be.h$.emit("pdModalClaimExpired:closed"),f(sn("prizeDropClaimedExpired"))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedExpired",onClose:x,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedExpired",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Wr,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:h("DROP.077","Reward expired")}),(0,r.jsx)("div",{className:"title-h3-bold",children:h("DROP.078","Time is up")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:c,roundUp:!0})," "]})]}),p&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/u,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:h("DROP.079","Unfortunately, the reward expiration time has ended.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:x,children:h("GEN.220","Close")})]})})]})},Tn=({t:e,error:t,fallbackKey:a,fallbackMessage:r})=>{var n,s;return(null==t?void 0:t.code)?e(null!==(n=t.languageKey)&&void 0!==n?n:"",null!==(s=t.message)&&void 0!==s?s:r):e(a,r)},In=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.rewards.apiClaim),{isPending:u,data:p,error:h}=c,f=b(e=>e.wallet.trueDecimal),x=b(Re),y="number"==typeof x&&x>0,j=(0,Sa.Bd)(),C=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimFailed:opened")},[]),(0,g.useEffect)(()=>{p&&d&&(C(Qt({rewardId:d.rewardId,claimUiStatus:"success"})),C(Je("prizeDropClaimedFailed")),C(Ge("prizeDropClaimedSuccess")),C(qt()))},[p,C,d]);const N=()=>{u||(Be.h$.emit("pdModalClaimFailed:closed"),C(sn("prizeDropClaimedFailed")))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedFailed",onClose:N,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedFailed",onClose:N,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(br.A,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:j("DROP.074","Claim failed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:j("DROP.075","Something went wrong")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:f,roundUp:!0})," "]})]}),y&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/x,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:Tn({t:j,error:h,fallbackKey:"DROP.076",fallbackMessage:"We couldn't process your request. Please try again later."})})]}),(0,r.jsx)(La,{text:j("DROP.017","Try Again"),loadingText:j("LOBBY.036","Pending"),isLoading:u,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{u||C(nn({rewardId:d.rewardId}))},disabled:u})]})})]})};var _n=a(598);const An=()=>{var e,t,a,n,s,i,l;const o=(0,Da.GV)(fr.uB),d=b(e=>e.rewards.winReward),c=b(e=>e.wallet.trueDecimal),u=b(Re),p="number"==typeof u&&u>0,h=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalClaimSuccess:opened")},[]);const x=()=>{Be.h$.emit("pdModalClaimSuccess:closed"),f(sn("prizeDropClaimedSuccess"))};return(0,r.jsxs)(jn,{modalName:"prizeDropClaimedSuccess",onClose:x,children:[o&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!o&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropClaimedSuccess",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(_n.A,{className:"h-74 w-74 rounded-full bg-green ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:h("DROP.071","Reward claimed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:h("DROP.072","You’ve won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Ja,{className:"h-28 w-28"}),(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=d.rewardTrue)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:c,roundUp:!0})," "]})]}),p&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",Be.bp.formatCash((null!==(l=null===(i=null===(s=null===(n=d.rewardTrue)||void 0===n?void 0:n.configTrue)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.value)&&void 0!==l?l:0)/u,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:h("DROP.073","The reward has been successfully credited to your balance.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:x,children:h("GEN.220","OK")})]})})]})},Mn=()=>{var e,t,a,n,s,i,l,o,d;const c=(0,Da.GV)(fr.uB),u=b(e=>e.rewards.winReward),p=(0,Sa.Bd)(),f=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalWinDrop:opened",(0,Za.ym)(u))},[u]);const x=()=>{Be.h$.emit("pdModalWinDrop:closed",(0,Za.ym)(u)),f(sn("prizeDropCongratulation"))};return(0,r.jsxs)(jn,{modalName:"prizeDropCongratulation",onClose:x,children:[c&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!c&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropCongratulation",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.019","You’ve won a cash prize")})]}),(0,r.jsx)("div",{className:"text-prize-drop",children:(0,r.jsxs)(Ha,{variant:"promo",children:[Be.bp.formatCash(null===(a=null===(t=null===(e=null==u?void 0:u.rewardCash)||void 0===e?void 0:e.configCash)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:null===(i=null===(s=null===(n=null==u?void 0:u.rewardCash)||void 0===n?void 0:n.configCash)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.decimals,roundUp:!0})," ",null===(d=null===(o=null===(l=null==u?void 0:u.rewardCash)||void 0===l?void 0:l.configCash)||void 0===o?void 0:o.amount)||void 0===d?void 0:d.currency]})}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.020","Instantly credited to your account.")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),x()},children:p("DROP.021","Great news!")})]})})]})},Fn=()=>{const{apiJoinCampaign:e}=b(e=>e.prizeDrop),{campaignId:t}=b(e=>e.prizeDrop.displayedCampaign),a=w(),n=(0,Sa.Bd)();(0,g.useEffect)(()=>{Be.h$.emit("pdModalJoinError:opened")},[]),((t,r)=>{const n=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(n.current)return e.data&&(e.data.joined?(Be.h$.emit("pdModalJoinError:successRetry"),a(Ge("prizeDropSuccess")),a(Je("prizeDropJoinError")),a(Dt()),a(ht())):(Be.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(Ge("prizeDropJoinError")))),void(e.error&&(Be.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(Ge("prizeDropJoinError"))))},r),(0,g.useEffect)(()=>{n.current=!0},[])})(0,[e]);const s=()=>{e.isPending||(Be.h$.emit("pdModalJoinError:closed"),a(Lt("prizeDropJoinError")),a(Nt()))};return(0,r.jsxs)(jn,{onClose:s,modalName:"prizeDropJoinError",children:[(0,r.jsx)(Sn,{onClose:s,returnType:"home",modalName:"prizeDropJoinError",children:(0,r.jsx)("div",{className:"title-h1-bold pb-18 pt-25 text-center uppercase ml:pt-19",children:n("DROP.015","Oops")})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-604 select-text flex-col items-center gap-18 px-14 pb-30 ml:px-0 ml:pb-31",children:[(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-medium-reg mb-2",children:Tn({t:n,error:e.error,fallbackKey:"DROP.016",fallbackMessage:"Something's wrong... Please try again."})})}),(0,r.jsx)(La,{text:n("DROP.017","Try Again"),loadingText:n("DROP.011","Joining..."),className:"w-full max-w-354 !bg-brand-gradient",isLoading:e.isPending,onClick:e=>{e.stopPropagation(),Be.VH.emit("button:clicked",{name:"service"}),a(_r({campaignId:t})),Be.h$.emit("pdModalJoinError:startRetry")}})]})})]})};var Un;function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},$n.apply(null,arguments)}const Yn=e=>g.createElement("svg",$n({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 9 8"},e),Un||(Un=g.createElement("path",{fill:"#FC0",d:"m4.5 0 1.08 2.92L8.5 4 5.58 5.08 4.5 8 3.42 5.08.5 4l2.92-1.08z"}))),Vn=()=>{var e,t,a,n,s,i,l,o,d,c;const u=(0,Da.GV)(fr.uB),{dateStart:p,dateEnd:f,betAmount:x,prizesTotalCount:y,campaignId:j,texts:C}=b(e=>e.prizeDrop.displayedCampaign),{apiJoinCampaign:N}=b(e=>e.prizeDrop),D=b(St),E=b(e=>e.wallet.trueDecimal),R=(0,Sa.Bd)(),z=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalLive:opened")},[]),(0,g.useEffect)(()=>{N.data&&(N.data.joined?(Be.h$.emit("pdModalLive:joinSuccess"),z(jt()),z(Dt()),z(Ge("prizeDropSuccess")),z(Lt("prizeDropLive")),z(ht())):(Be.h$.emit("pdModalLive:joinError"),z(Ge("prizeDropJoinError")),z(Je("prizeDropLive")))),N.error&&(Be.h$.emit("pdModalLive:joinError"),z(Ge("prizeDropJoinError")),z(Je("prizeDropLive")))},[N]);const k=()=>{N.isPending||(Be.h$.emit("pdModalLive:later"),z(Lt("prizeDropLive")))};return(0,r.jsxs)(jn,{modalName:"prizeDropLive",onClose:k,children:[(0,r.jsx)(Sn,{modalName:"prizeDropLive",onClose:k,children:(0,r.jsx)("div",{})}),(0,r.jsxs)(Nn,{scrollbarInsetTop:56,children:[u&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!u&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)("div",{className:"mx-auto max-w-604 pt-30 ml:pt-25",children:(0,r.jsxs)("div",{className:"flex flex-col gap-16 px-15 pb-22 text-center ml:px-0 ml:pb-18",children:[(0,r.jsxs)("div",{className:"relative flex w-full flex-col items-center gap-11 text-center ml:gap-10",children:[(0,r.jsx)(Ba,{prizeDropMode:"live",className:"absolute -top-5 left-1/2 translate-x-22"}),(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:(null==C?void 0:C.title)||R("DROP.001","Prize drop event is live!")}),(0,r.jsx)("div",{className:"text-medium-reg",children:(null==C?void 0:C.description)||R("DROP.002","Spin and win amazing prizes instantly!")})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-11 rounded-14 bg-white-6 px-20 pb-22 pt-20 ml:gap-10",children:[(0,r.jsx)(sr,{}),(0,r.jsxs)("div",{className:"text-medium-reg flex flex-col gap-2 pl-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.004","Total prize count:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:y})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[R("DROP.005","Top prize:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:"true"===(null==D?void 0:D.type)?(0,r.jsxs)("div",{children:[Be.bp.formatCash(null!==(a=null===(t=null===(e=null==D?void 0:D.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value)&&void 0!==a?a:0,{showCurrency:!1,customDecimals:E,roundUp:!0})," $TRUE"]}):(0,r.jsx)("div",{children:Be.bp.formatCash(null!==(i=null===(s=null===(n=null==D?void 0:D.configCash)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value)&&void 0!==i?i:0,{customCurrency:null===(o=null===(l=null==D?void 0:D.configCash)||void 0===l?void 0:l.amount)||void 0===o?void 0:o.currency,customDecimals:null===(c=null===(d=null==D?void 0:D.configCash)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.decimals,roundUp:!0})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.006","Min. bet to participate:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:Be.bp.formatCash(x)})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Yn,{width:8,height:8})}),(0,r.jsxs)("div",{children:[R("DROP.007","Every qualified bet can win")," 🚀"]})]})]})]}),(0,r.jsx)(ur,{dateStart:p,dateEnd:f,className:"text-medium-bold mt-0 flex items-center justify-center"})]})})]}),(0,r.jsx)(Dn,{className:"!pb-30 ml:!pb-10",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-560 gap-14 px-14 ml:gap-10 ml:px-0",children:[(0,r.jsx)(Pa.$,{className:"!min-w-170 flex-1",onClick:e=>{e.stopPropagation(),k()},variant:"secondary",children:R("DROP.009","Later")}),(0,r.jsx)(La,{text:R("DROP.010","Join now"),loadingText:R("DROP.011","Joining..."),isLoading:N.isPending,onClick:()=>{Be.h$.emit("pdModalLive:startJoin"),z(_r({campaignId:j}))},className:"text-medium-bold !min-w-170 flex-1 !bg-brand-gradient"})]})})]})},Wn=()=>{const e=(0,Da.GV)(fr.uB),t=(0,Sa.Bd)(),a=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalEventCancelled:opened")},[]);const n=()=>{Be.h$.emit("pdModalEventCancelled:closed"),a(Je("prizeDropResultCancelled"))};return(0,r.jsxs)(jn,{modalName:"prizeDropResultCancelled",onClose:n,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropResultCancelled",onClose:n,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.022","Event cancelled")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.023","The current event has been cancelled. Stay tuned for new events ")} 🚀`})]})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),n()},children:t("DROP.014","OK")})]})})]})},Gn=()=>{const e=(0,Da.GV)(fr.uB),t=(0,Sa.Bd)(),a=w();(0,g.useEffect)(()=>{Be.h$.emit("pdModalEventEnded:opened")},[]);const n=()=>{Be.h$.emit("pdModalEventEnded:closed"),a(Je("prizeDropResultFinished"))};return(0,r.jsxs)(jn,{modalName:"prizeDropResultFinished",onClose:n,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:er.f.get(v),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:er.f.get(m),alt:"event"}),(0,r.jsx)(Sn,{modalName:"prizeDropResultFinished",onClose:n,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:er.f.get(h),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.024","Event ended")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.025","The current event is over. Stay tuned for new events")} 🚀`})]})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),n()},children:t("DROP.014","OK")})]})})]})},Jn=()=>{const e=w(),t=(0,Sa.Bd)();(0,g.useEffect)(()=>{Be.h$.emit("pdModalSuccess:opened")},[]);const a=()=>{Be.h$.emit("pdModalSuccess:closed"),e(Je("prizeDropSuccess"))};return(0,r.jsxs)(jn,{onClose:a,modalName:"prizeDropSuccess",children:[(0,r.jsx)(Sn,{onClose:a,returnType:"home",modalName:"prizeDropSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(_n.A,{className:"",width:46,height:46})})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold",children:t("DROP.012","Success").toUpperCase()}),(0,r.jsx)("span",{className:"text-medium-reg",children:t("DROP.013","You have successfully joined the event!")}),(0,r.jsx)(Pa.$,{className:"w-full max-w-354 !bg-brand-gradient uppercase",onClick:e=>{e.stopPropagation(),a()},children:t("DROP.014","OK")})]})})]})},Kn=()=>{const e=w(),t=(0,Sa.Bd)(),a=b(te),n=()=>{e(Je("walletConvertSuccess")),e(Q())};return(0,g.useEffect)(()=>{Be.h$.emit("walletConvertSuccess:opened",{})},[]),(0,r.jsxs)(jn,{onClose:n,modalName:"walletConvertSuccess",children:[(0,r.jsx)(Sn,{onClose:n,returnType:"home",modalName:"walletConvertSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(_n.A,{width:46,height:46})})}),(0,r.jsx)(Nn,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-12 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold uppercase",children:t("LOBBY.091","CONVERSION COMPLETED")}),a&&(0,r.jsx)("div",{className:"flex flex-col items-center",children:(0,r.jsx)(Ha,{variant:"promo",children:a})}),(0,r.jsx)("p",{className:"text-medium-reg max-w-314 text-center ml:max-w-560",children:t("LOBBY.092","Funds will be credited to your casino balance after 1 spin")})]}),(0,r.jsx)(Pa.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),Be.h$.emit("walletConvertSuccess:continuePlayingClicked",{}),n()},children:t("LOBBY.093","Continue playing")})]})})]})},Hn=()=>{const e=b(Pt),t=(0,Sa.Bd)(),a=[{id:"events",title:t("DROP.027","Event")},{id:"rules",title:t("DROP.028","Rules")}],[n,s]=(0,g.useState)("events");return(0,r.jsxs)("div",{className:Ra()(e&&"!pb-64"),children:[(0,r.jsx)("div",{className:"mb-16 flex flex-col items-center",children:(0,r.jsx)(Ir,{activeTab:n,setActiveTab:s,config:a})}),(0,r.jsx)("div",{className:"mx-auto",children:"events"===n?(0,r.jsx)(Er,{}):(0,r.jsx)(Tr,{})})]})},Qn=()=>{const e=(0,Sa.Bd)(),t=e=>e.split(/(\$TRUE)/g).map((e,t)=>(0,r.jsx)("span",{className:"$TRUE"===e?"text-medium-bold text-white opacity-100":"opacity-60",children:e},`${e}-${t}`));return(0,r.jsxs)("div",{className:"mx-auto flex w-full flex-col items-center pb-28",children:[(0,r.jsx)("h2",{className:"w-340 text-28 font-black leading-[1.3] text-white",children:e("LOBBY.041","Welcome to TRUE World. Play. Earn. Unlock more.")}),(0,r.jsx)("div",{className:"h-322",children:(0,r.jsx)("img",{src:er.f.get(i),alt:"true coin",className:"h-full object-cover object-center"})}),(0,r.jsxs)("div",{className:"text-medium-reg mx-auto max-w-340 text-white",children:[(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.042","TRUE World is your gateway to the next generation of rewards inside TRUE LABS games."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.043","As you play, you automatically earn $TRUE tokens through Prize Drops, leaderboard tournaments, and exclusive airdrops. No extra steps - just enjoy your favorite games and collect rewards."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.044","Your $TRUE tokens open the door to a growing universe of opportunities: trade collectibles on the Marketplace, stake tokens for added benefits, or explore new features across the TRUE World portal."))}),(0,r.jsx)("p",{children:t(e("LOBBY.045","Ownership of $TRUE is more than a bonus - it's your entry ticket to special events and tournaments, unique in-game content, and future perks across the entire TRUE ecosystem. You can even spend $TRUE on exclusive TRUE LABS merchandise and other real-world items."))})]})]})},qn=()=>{const e=(0,Sa.Bd)();return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-16 pb-28",children:[(0,r.jsx)("img",{src:er.f.get(s),alt:"coming soon",className:"h-310 w-414 max-w-none object-cover object-center"}),(0,r.jsxs)("div",{className:"flex w-340 flex-col items-center gap-6 text-center",children:[(0,r.jsx)("h2",{className:"title-h1-bold text-white",children:e("LOBBY.029","Your character's progress")}),(0,r.jsxs)("p",{className:"text-medium-reg text-white opacity-60",children:[e("LOBBY.030","Let your hero grow with every spin!"),(0,r.jsx)("br",{}),e("LOBBY.031","Tease your luck, uncover in-game secrets, and unlock real-world rewards.")]}),(0,r.jsx)("p",{className:"text-medium-bold text-white",children:e("LOBBY.032","Coming soon. Stay tuned!")})]})]})},Xn=e=>{if(!e)return"expired";const t=new Date(e).getTime()-Date.now();if(t<=0)return"expired";const a=Math.floor(t/36e5);return a<1?"lessThanHour":a},Zn=({reward:e,onClaimRequested:t=()=>!0})=>{var a,n,s;const i=(0,Sa.Bd)(),l=w(),{showExpiredToast:o}=qr(),[c,u]=(0,g.useState)(()=>Xn(e.expiresAt)),p=b(e=>e.rewards.apiClaim),{error:m}=p,[v,h]=(0,g.useState)(!1),f=b(e=>e.wallet.trueDecimal),x=b(Re),y=!!(j=e.expiresAt)&&new Date(j).getTime()<=Date.now();var j;const C="number"==typeof x&&x>0;(0,g.useEffect)(()=>{if(!e.expiresAt)return;const t=()=>u(Xn(e.expiresAt)),a=setInterval(t,6e4);return t(),()=>clearInterval(a)},[e.expiresAt]),(0,g.useEffect)(()=>{m&&v&&h(!1)},[m,v]);const N=(0,g.useMemo)(()=>"expired"===c?i("LOBBY.035","Unfortunately, the reward expiration time has ended."):"lessThanHour"===c?i("LOBBY.038","expires in <1 hour"):1===c?i("LOBBY.038","expires in <1 hour").replace("<1","1"):i("LOBBY.009","expires in <HOURS> hours",{"<HOURS>":String(c)}),[c,i]),D=(0,g.useRef)(!1);if((0,g.useEffect)(()=>{y&&!D.current&&(D.current=!0,Be.h$.emit("reward:expired",(0,Za.rx)(e,"expired")),o(i("LOBBY.035","Unfortunately, the reward expiration time has ended.")),l(ce(e.rewardId)),l(Vt(e.rewardId)))},[l,e,e.rewardId,y,o,i]),y)return null;const E=null===(s=null===(n=null===(a=e.rewardTrue)||void 0===a?void 0:a.configTrue)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value;return(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:d,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:i("LOBBY.007","Prizedrop reward")}),(0,r.jsxs)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16"}),Be.bp.formatCash(E,{showCurrency:!1,customDecimals:f,roundUp:!0})]}),C&&(0,r.jsxs)("div",{className:"text-xs-reg mt-1 opacity-70",children:["~",Be.bp.formatCash((null!=E?E:0)/x,{roundUp:!0})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(La,{size:"small",text:i("LOBBY.008","Claim"),loadingText:i("LOBBY.036","Pending"),isLoading:v,className:"!min-w-120 !bg-brand-gradient",onClick:()=>{t(e)&&(Be.h$.emit("reward:claimClicked",(0,Za.rx)(e,"new")),h(!0),l(nn({rewardId:e.rewardId,fromHub:!0})))},disabled:y||v}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:N})]})]})},es=a.p+"assets/reward-convert-icon.00d13d6b7d747ea756ec.webp",ts=({reward:e})=>{var t,a,n,s,i,l,o,d,c;const u=(0,Sa.Bd)(),p=w(),m=(0,Da.jL)();return(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:es,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:u("LOBBY.094","Pending reward")}),(0,r.jsx)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:Be.bp.formatCash(null!==(n=null===(a=null===(t=null==e?void 0:e.rewardConvert)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value)&&void 0!==n?n:0,{roundUp:!0,customCurrency:null!==(l=null===(i=null===(s=e.rewardConvert)||void 0===s?void 0:s.amount)||void 0===i?void 0:i.currency)&&void 0!==l?l:"FUN",customDecimals:null!==(c=null===(d=null===(o=e.rewardConvert)||void 0===o?void 0:o.amount)||void 0===d?void 0:d.decimals)&&void 0!==c?c:2})})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(Pa.$,{size:"small",className:"!min-w-120 !bg-brand-gradient",onClick:()=>{Be.h$.emit("rewardConvert:playClicked",(0,Za.i6)(e,"new")),p(Je("promoLobby")),m((0,Oe.Pp)(!1))},children:u("LOBBY.096","Play")}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:u("LOBBY.095","Unlocks after 1 spin")})]})]})},as=()=>{const e=b(e=>e.rewards.rewards.filter(e=>(e.type===Tt.Dy.TRUE||e.type===Tt.Dy.CONVERT)&&e.status===Tt.ti.ACTIVE)),t=b(e=>e.rewards.apiClaim),{data:a,error:n}=t,s=(0,Sa.Bd)(),i=(0,g.useRef)(!1),l=(0,g.useRef)(null),o=(0,g.useRef)(new Set),{showSuccessToast:d,showFailedToast:c,showExpiredToast:u}=qr();(0,g.useEffect)(()=>{e.forEach(e=>{e.type!==Tt.Dy.CONVERT||o.current.has(e.rewardId)||(o.current.add(e.rewardId),Be.h$.emit("rewardConvert:pendingShown",(0,Za.i6)(e,"new")))})},[e]),(0,g.useEffect)(()=>{a&&i.current&&l.current&&(d(s("LOBBY.034","The reward has been successfully credited to your balance.")),Be.h$.emit("reward:claimSuccess",(0,Za.rx)(l.current,"claimed")),i.current=!1,l.current=null)},[a,d,s]),(0,g.useEffect)(()=>{n&&i.current&&l.current&&(c(Tn({t:s,error:n,fallbackKey:"LOBBY.037",fallbackMessage:"Something went wrong. Please try again later."})),Be.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,Za.rx)(l.current,"new")),{error_code:n.name})),i.current=!1,l.current=null)},[n,c,u,s]);const p=e=>{return(t=e.expiresAt)&&new Date(t).getTime()<=Date.now()?(Be.h$.emit("reward:expired",(0,Za.rx)(e,"expired")),u(s("LOBBY.035","Unfortunately, the reward expiration time has ended.")),!1):(i.current=!0,l.current=e,!0);var t};return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex w-full flex-col rounded-12 bg-white-10 p-16",children:[(0,r.jsx)("h2",{className:"title-h2-bold",children:s("LOBBY.002","Rewards Hub")}),e.map(e=>(0,r.jsxs)(r.Fragment,{children:[e.type===Tt.Dy.TRUE&&(0,r.jsx)(Zn,{reward:e,onClaimRequested:p},e.rewardId),e.type===Tt.Dy.CONVERT&&(0,r.jsx)(ts,{reward:e},e.rewardId)]})),0===e.length&&(0,r.jsxs)("div",{className:"text-medium-reg mt-6 opacity-60",children:[s("LOBBY.003","Just play TRUE LABS games and unlock extra rewards")," 🎁"]})]})})},rs=()=>{const e=w();return(0,g.useEffect)(()=>{e(Fr())},[e]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-16 pb-12",children:[(0,r.jsx)(as,{}),(0,r.jsx)(Or,{})]})};var ns,ss;function is(){return is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},is.apply(null,arguments)}const ls=e=>g.createElement("svg",is({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 36 36"},e),ns||(ns=g.createElement("rect",{width:36,height:36,fill:"#fff",fillOpacity:.1,rx:8})),ss||(ss=g.createElement("path",{stroke:"#DA8A29",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 18.9v-4.485m0 7.81v.04M23.67 26H12.33a3.4 3.4 0 0 1-3.267-2.424c-.176-.598.04-1.22.37-1.751l5.67-10.224c1.328-2.135 4.466-2.135 5.794 0l5.67 10.224c.33.53.546 1.153.37 1.75A3.4 3.4 0 0 1 23.67 26"}))),os=()=>{var e,t;const a=(0,Sa.Bd)(),n=w(),s=b(ee),i=b(ze),l=b(ae),o=b(re),d=b(ke),c=b(e=>e.wallet.trueDecimal),{showFailedToast:u}=qr(),p=(0,g.useRef)(!1),m=null!==(e=b(Re))&&void 0!==e?e:0,v=i?parseFloat(i.penalty.amount):50,h=null!==(t=null==i?void 0:i.commission.amount)&&void 0!==t?t:"0",f=parseFloat(h)||0,{inputAmountTrue:x,convertAmountTrue:y,penaltyExchangeRate:j,regularExchangeRate:C,resultEur:N}=fn({amount:s,commissionAmount:f,currencyDecimals:Be.bp.currencyDecimals,exchangeRate:m,penaltyPercent:v}),D=m>0,E=D&&""!==s&&y>=d,R=(0,g.useMemo)(()=>(0,Za.p)({inputAmountTrue:x,convertAmountTrue:y,feeTrue:f,penaltyPercent:v,exchangeRate:m}),[f,y,m,x,v]),z=e=>Be.bp.formatCash(e,{roundUp:!0}),S=e=>e>0?`~${z(e)}`:"—";return(0,g.useEffect)(()=>{D||(n(Q()),n(P("wallet-convert")))},[n,D]),(0,g.useEffect)(()=>{o&&p.current&&(u(Tn({t:a,error:o,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),p.current=!1,n(X()))},[o,n,u,a]),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-12",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-center",children:a("LOBBY.088","Confirm conversion")}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)("div",{className:"flex w-full items-center justify-center rounded-16 bg-white-10 px-20 py-14",children:(0,r.jsxs)("div",{className:"flex w-full items-center gap-10",children:[(0,r.jsx)("div",{className:"flex h-36 w-36 shrink-0 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(ls,{width:36,height:36})}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsx)("span",{className:"text-medium-bold",children:a("LOBBY.089","Unlock condition")}),(0,r.jsx)("span",{className:"text-small-reg opacity-60",children:a("LOBBY.090","Make 1 bet to credit the amount to your casino balance.")})]})]})}),(0,r.jsx)("div",{className:"flex w-full flex-col rounded-16 bg-white-10 p-16",children:(0,r.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,r.jsxs)("div",{className:"flex w-full items-start justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.082","Exchange rate"),":"]}),(0,r.jsxs)("span",{className:"text-xs-reg opacity-40",children:[a("LOBBY.083","Regular rate"),":"," ",S(C)," "]})]}),(0,r.jsx)("span",{className:"text-medium-bold",children:S(j)})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.085","You convert"),":"]}),(0,r.jsxs)("span",{className:"text-medium-bold",children:[(B=y,Be.bp.formatCash(B,{showCurrency:!1,customDecimals:c,roundUp:!0}))," ",a("","$TRUE")]})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.084","Transfer fee"),":"]}),(0,r.jsxs)("span",{className:"text-medium-bold",children:[f," ",a("","$TRUE")]})]}),(0,r.jsx)("div",{className:"h-px w-full bg-white-10"}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-medium-reg opacity-60",children:[a("LOBBY.059","You get"),":"]}),(0,r.jsx)("span",{className:"text-medium-bold",children:z(N)})]})]})}),(0,r.jsxs)("div",{className:"flex w-full gap-8",children:[(0,r.jsx)(Pa.$,{variant:"secondary",className:"flex-1",onClick:()=>{Be.h$.emit("walletConvertConfirm:cancelled",R),n(Q()),n(P("wallet"))},disabled:l,children:a("LOBBY.065","Cancel")}),(0,r.jsx)(La,{text:a("LOBBY.066","Confirm"),loadingText:a("LOBBY.036","Pending"),onClick:()=>{var e;E&&(p.current=!0,n(H(z(N))),n((e={amount:String(y),commission:{amount:h},penalty:{amount:String(v)}},t=>{return a=void 0,r=void 0,s=function*(){t(k("walletConvert"));const a=(0,Za.p)({convertAmountTrue:e.amount,feeTrue:e.commission.amount,penaltyPercent:e.penalty.amount});try{const r=yield t(Z(e)).unwrap();t(T("walletConvert")),r.success?(Be.h$.emit("walletConvert:success",(0,Za.ST)(a,["amount_true"])),window.sessionStorage.setItem("promoLobby.walletReturnedAfterConvert","true"),t(ea()),t(Je("promoLobby")),t(Ge("walletConvertSuccess"))):Be.h$.emit("walletConvert:failed",a)}catch(e){t(T("walletConvert"));const r=e;Be.h$.emit("walletConvert:failed",Object.assign(Object.assign({},a),{error_code:r.code,error_message:r.message})),Be.vF.error(e)}},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s})))},isLoading:l,disabled:!E,className:"flex-1 !bg-brand-gradient"})]})]})]});var B},ds=[25,50,75,100],cs=()=>{var e;const t=(0,Sa.Bd)(),a=w(),n=b(ee),s=b(Ne),i=b(ze),l=b(ke),o=(0,g.useRef)(null),d=s&&parseFloat(s.balance)||0,c=null!==(e=b(Re))&&void 0!==e?e:0,u=i?parseFloat(i.penalty.amount):50,p=i?parseFloat(i.commission.amount):0;(0,g.useEffect)(()=>{a(Fr())},[a]),(0,g.useEffect)(()=>{c<=0&&""!==n&&a(K(""))},[n,a,c]);const{inputAmountTrue:m,convertAmountTrue:v,penaltyExchangeRate:h,regularExchangeRate:f,resultEur:x}=fn({amount:n,commissionAmount:p,currencyDecimals:Be.bp.currencyDecimals,exchangeRate:c,penaltyPercent:u}),y=c>0,j=!y,C=""!==n&&v<l,N=y&&""!==n&&v>=l,D=C?"text-[#DA2929]":"";let E="border-white-20";C?E="border-[#DA2929]":""!==n&&(E="border-white-30");const R=(0,g.useMemo)(()=>(0,Za.p)({inputAmountTrue:m,convertAmountTrue:v,feeTrue:p,penaltyPercent:u,exchangeRate:c}),[p,v,c,m,u]),z=e=>Be.bp.formatCash(e,{roundUp:!0}),k=e=>e>0?`~${z(e)}`:"—";return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-12",children:[(0,r.jsxs)("p",{className:"text-medium-reg text-center opacity-60",children:[t("LOBBY.081a","You can convert your $TRUE tokens into ")," ",(0,r.jsx)("span",{className:"font-bold text-white opacity-100",children:t("LOBBY.081b","real cash on casino balance")})," ",t("LOBBY.081c",`right now with ${Math.round(u)}% penalty`)]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-20 rounded-16 bg-white-10 p-16",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsx)("span",{className:"text-medium-med text-white",children:t("LOBBY.086","Conversion amount")}),(0,r.jsxs)("div",{className:["flex h-48 items-center justify-between rounded-12 border px-16 py-4","bg-black-20",E,j?"pointer-events-none opacity-40":""].join(" "),onClick:()=>{var e;return!j&&(null===(e=o.current)||void 0===e?void 0:e.focus())},role:"button",tabIndex:-1,onKeyDown:()=>{},children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(Xa,{className:"h-16 w-16 shrink-0 text-white"}),(0,r.jsx)("input",{ref:o,type:"text",inputMode:"decimal",value:n,onChange:e=>(e=>{a(K(((e,t)=>{const[a="",...r]=e.replace(/[^0-9.]/g,"").split("."),n=r.join("").slice(0,2),s=r.length>0?`${a}.${n}`:a;if(!a)return"";const i=new(mn())(s||0),l=vn(t).toDecimalPlaces(2,mn().ROUND_FLOOR);return i.greaterThanOrEqualTo(l)?l.toString():s})(e,d)))})(e.target.value),placeholder:"0",disabled:j,className:"text-medium-bold w-full min-w-0 bg-transparent text-white outline-none"})]}),m>0&&y&&(0,r.jsx)("span",{className:"text-xs-reg ml-8 shrink-0 opacity-60",children:k(m*f)})]}),C&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-small-reg",style:{color:"#DA2929"},children:t("LOBBY.063","Minimum conversion amount is 5 $TRUE")})}),(0,r.jsx)("div",{className:"mt-4 flex gap-4",children:ds.map(e=>{return(0,r.jsxs)(Pa.$,{onClick:()=>(e=>{var t;j||(a(K(gn(d,e))),null===(t=o.current)||void 0===t||t.focus())})(e),variant:"secondary",disabled:j,className:["!h-44 !min-w-0 flex-1",(t=e,""!==n&&d>0&&n===gn(d,t)?"ring-1 ring-white":"")].join(" "),children:[e,"%"]},e);var t})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-0",children:[(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.082","Exchange rate"),":"]}),(0,r.jsxs)("span",{className:"text-small-med",children:["1 $TRUE ",(S=h,S>0?`≈ ${z(S)}`:"—")," "]})]}),(0,r.jsxs)("span",{className:"text-xs-reg opacity-40",children:[t("LOBBY.083","Regular rate"),": ",k(f)]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.084","Transfer fee"),":"]}),(0,r.jsxs)("span",{className:"text-small-med",children:[p," ",t("","$TRUE")]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsxs)("span",{className:"text-small-reg opacity-80",children:[t("LOBBY.085","You convert"),":"]}),m>0&&(0,r.jsxs)("span",{className:["text-small-med",D].join(" "),children:[(e=>Be.bp.formatCash(e,{showCurrency:!1,customDecimals:2,roundUp:!0}))(v)," ",t("","$TRUE")]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("span",{className:"text-medium-med",children:[t("LOBBY.059","You get"),":"]}),m>0&&y&&(0,r.jsx)("span",{className:"text-medium-med",children:z(x)})]})]}),(0,r.jsx)(Pa.$,{className:["w-full !bg-brand-gradient",N?"":"pointer-events-none opacity-40"].join(" "),onClick:()=>{N&&(Be.h$.emit("walletConvert:proceedClicked",(0,Za.ST)(R,["amount_true"])),a(P("wallet-convert-confirm")))},disabled:!N,children:t("LOBBY.052","Convert now")})]}),(0,r.jsx)("div",{className:"flex w-full flex-col items-center rounded-16 bg-white-10 px-20 py-14 text-center",children:(0,r.jsxs)("p",{className:"text-small-reg",children:[(0,r.jsx)("span",{className:"opacity-60",children:t("LOBBY.087a","You will need to make at least")})," ",(0,r.jsx)("span",{className:"font-bold",children:t("LOBBY.087b","1 bet")})," ",(0,r.jsx)("span",{className:"opacity-60",children:t("LOBBY.087c","to receive your conversion reward on the casino balance.")})]})})]});var S};const us=()=>{const e=w(),t=!!b(e=>e.prizeDrop.restData),a=!!b(e=>{var t;return null===(t=e.transaction.apiTransactions.fake)||void 0===t?void 0:t.enabled}),r=b(Ee),n=t||a;(0,g.useEffect)(()=>{n&&(e(oa()),r&&e((e,t)=>{return a=void 0,r=void 0,s=function*(){t().wallet.isWalletAvailable&&e(da(void 0)).unwrap().catch(e=>{Be.vF.error(e)})},new((n=void 0)||(n=Promise))(function(e,t){function i(e){try{o(s.next(e))}catch(e){t(e)}}function l(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,l)}o((s=s.apply(a,r||[])).next())});var a,r,n,s}),e(Fr()))},[e,n,r])},ps=()=>(us(),(0,g.useEffect)(()=>{Be.h$.emit("wallet:opened"),(0,Za.Xg)()&&Be.h$.emit("wallet:returnedAfterAction")},[]),(0,r.jsxs)("div",{className:"flex flex-col gap-24",children:[(0,r.jsx)(nr,{}),(0,r.jsx)(rn,{})]})),ms=()=>{const e=b(e=>e.promoLobby.activeScreen),t=b(e=>e.promoLobby.topBarScreen);return(0,r.jsxs)(r.Fragment,{children:["info"===t&&(0,r.jsx)(Qn,{}),"profile"===t&&(0,r.jsx)(qn,{}),"wallet"===t&&(0,r.jsx)(ps,{}),"wallet-convert"===t&&(0,r.jsx)(cs,{}),"wallet-convert-confirm"===t&&(0,r.jsx)(os,{}),null===t&&(0,r.jsxs)(r.Fragment,{children:["true-world"===e&&(0,r.jsx)(rs,{}),"campaign"===e&&(0,r.jsx)(Hn,{})]})]})};var vs,hs,gs,fs,xs;function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ws.apply(null,arguments)}function bs(){return bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bs.apply(null,arguments)}function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ys.apply(null,arguments)}function js(){return js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},js.apply(null,arguments)}function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Cs.apply(null,arguments)}const Ns={trueWorld:{title:"True World",icon:e=>g.createElement("svg",Cs({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),xs||(xs=g.createElement("path",{fill:"#fff",d:"m27.844 15-9.866 9.88L8.11 15l9.867-9.879zM11.3 21.686l-2.466 2.47-2.467-2.47 2.467-2.47zM9.133 9.038l-3.488 3.493-3.489-3.493 3.489-3.493z"}))),screens:["true-world","campaign"],comingSoon:!1},trueGames:{title:"True Games",icon:e=>g.createElement("svg",js({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),fs||(fs=g.createElement("path",{fill:"#fff",d:"M5.294 15a1.08 1.08 0 0 0 1.078 1.078h6.471A1.08 1.08 0 0 0 13.921 15V6.372a1.08 1.08 0 0 0-1.078-1.078h-6.47a1.08 1.08 0 0 0-1.08 1.078zm0 8.627a1.08 1.08 0 0 0 1.078 1.079h6.471a1.08 1.08 0 0 0 1.078-1.079v-4.313a1.08 1.08 0 0 0-1.078-1.079h-6.47a1.08 1.08 0 0 0-1.08 1.079zm10.784 0a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V15a1.08 1.08 0 0 0-1.079-1.079h-6.47A1.08 1.08 0 0 0 16.078 15zm1.079-18.333a1.08 1.08 0 0 0-1.079 1.078v4.314a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V6.372a1.08 1.08 0 0 0-1.079-1.078z"}))),screens:["true-games"],comingSoon:!0},tournaments:{title:"Tournaments",icon:e=>g.createElement("svg",ys({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),gs||(gs=g.createElement("path",{fill:"#fff",d:"M21.353 4.412v3.176h4.236q-.044 3.834-1.205 5.407l-.119.152q-.933 1.12-3.187 1.592a6.36 6.36 0 0 1-5.017 4.408l-.002.088a4.235 4.235 0 0 0 4.235 4.236v2.117H9.707v-2.117a4.235 4.235 0 0 0 4.236-4.236l-.003-.088a6.36 6.36 0 0 1-5.016-4.408q-2.254-.471-3.187-1.592-1.279-1.534-1.324-5.559h4.235V4.412zM15 6.529l-1.224 2.91-3.01.326 2.256 2.118-.64 3.117L15 13.399l2.618 1.6-.64-3.112 2.258-2.118-3.012-.326zM8.647 9.706H6.676l.023.152c.136.87.344 1.486.594 1.842l.07.091c.195.235.562.455 1.106.641l.178.056zm14.678 0h-1.972v2.782l.179-.056c.544-.186.91-.406 1.106-.64l.07-.091c.25-.357.458-.974.594-1.843z"}))),screens:["tournaments"],comingSoon:!0},quests:{title:"Quests",icon:e=>g.createElement("svg",ws({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),vs||(vs=g.createElement("path",{fill:"#fff",d:"M25.106 6.805a.53.53 0 0 1 .483.527v15.08l-7.412 3.177-6.353-3.177-6.674 2.86a.53.53 0 0 1-.738-.487V9.706l3.314-1.42a7.41 7.41 0 0 0 2.033 6.66L15 20.19l5.241-5.242A7.41 7.41 0 0 0 22.21 7.98l2.642-1.133a.5.5 0 0 1 .255-.041M15 4.412a5.296 5.296 0 0 1 3.744 9.037L15 17.192l-3.744-3.743A5.295 5.295 0 0 1 15 4.412m0 3.53a1.765 1.765 0 1 0 0 3.529 1.765 1.765 0 0 0 0-3.53"}))),screens:["quests"],comingSoon:!0},marketplace:{title:"Marketplace",icon:e=>g.createElement("svg",bs({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),hs||(hs=g.createElement("path",{fill:"#fff",d:"M4.995 4.445a.814.814 0 0 1 1.012.552l.597 2.022H22.52c1.998 0 3.524 1.864 2.948 3.811l-1.797 6.082c-.382 1.296-1.598 2.16-2.948 2.16h-9.943c-1.351 0-2.565-.864-2.949-2.16L4.446 5.458a.814.814 0 0 1 .55-1.013m3.76 18.7a2.443 2.443 0 1 1 4.887 0 2.443 2.443 0 0 1-4.886 0m8.688 0a2.443 2.443 0 1 1 4.886 0 2.443 2.443 0 0 1-4.886 0"}))),screens:["marketplace"],comingSoon:!0}},Ds=({item:e,isActive:t})=>{const a=e.icon,n=b(_),s=e.comingSoon||n,i=(0,Sa.Bd)(),l=w();return(0,r.jsxs)("button",{disabled:s,onClick:()=>{n||l(S(e.screens[0]))},type:"button",className:Ra()("relative flex flex-1 flex-col items-center justify-center gap-2 ml:flex-none"),children:[(0,r.jsxs)("div",{className:Ra()("flex flex-col items-center justify-center gap-2 ml:w-70",t(e.screens)?"text-white":"opacity-40",s&&"cursor-default !opacity-15",!s&&"cursor-pointer hover:opacity-100"),children:[(0,r.jsx)(a,{className:"h-30 w-30"}),(0,r.jsx)("div",{className:"text-super-xs-bold",children:e.title})]}),e.comingSoon&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 rounded-10 border border-brand-black bg-[#262626] px-5 py-1",children:(0,r.jsx)("div",{className:"text-super-xss-bold uppercase opacity-40 ",children:i("","Soon")})})]},e.title)},Es=()=>{const e=b(e=>e.promoLobby.activeScreen),t=t=>t.includes(e);return(0,r.jsx)("div",{className:"md:navbar-gradient-border absolute bottom-40 left-0 right-0 flex justify-between gap-6 bg-brand-black px-20 pb-18 pt-14 mp:rounded-t-20 ml:right-auto ml:top-20 ml:flex-col ml:justify-start ml:gap-20 ml:px-8 ml:pb-16 ml:pt-16",children:Object.values(Ns).map(e=>(0,r.jsx)(Ds,{item:e,isActive:t},e.title))})};var Rs,zs;function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ks.apply(null,arguments)}const Ss=e=>g.createElement("svg",ks({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 46 46"},e),Rs||(Rs=g.createElement("path",{fill:"#fff",d:"M46 23c0 12.703-10.297 23-23 23S0 35.703 0 23 10.298 0 23 0s23 10.298 23 23M2.3 23c0 11.432 9.268 20.7 20.7 20.7S43.7 34.432 43.7 23 34.432 2.3 23 2.3 2.3 11.568 2.3 23"})),zs||(zs=g.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M23 6a17 17 0 0 1 17 17c0 9.389-7.611 17-17 17S6 32.389 6 23 13.611 6 23 6m1.7 18.7h-3.4a10.2 10.2 0 0 0-9.38 6.188A13.58 13.58 0 0 0 23 36.6c4.57 0 8.615-2.255 11.08-5.713A10.2 10.2 0 0 0 24.7 24.7M23 11.1a5.1 5.1 0 1 0 0 10.2 5.1 5.1 0 0 0 0-10.2",clipRule:"evenodd"})));var Bs;function Ps(){return Ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ps.apply(null,arguments)}const Os=e=>g.createElement("svg",Ps({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Bs||(Bs=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 8v3m0-5.224V5.75M2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8"}))),Ls=({className:e=""})=>{var t;const a=b(e=>e.promoLobby.topBarScreen),n=b(Ne),s=b(Ee),{isPending:i,error:l}=b(e=>e.prizeDrop.apiLobbyInit),o=b(e=>e.wallet.trueDecimal),d=b(_),c=null!==(t=null==n?void 0:n.balance)&&void 0!==t?t:0,u=i||!!l||!s,p=d||"wallet-convert-confirm"===a,m=w();return(0,r.jsxs)("div",{className:Ra()("flex w-full max-w-560 items-center justify-between gap-12 px-15 pb-16 ml:px-0",e),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{p||m(P("profile"))},disabled:p,className:Ra()("cursor-pointer opacity-20 transition-all hover:opacity-30","profile"===a&&"opacity-40",p&&"!cursor-default !opacity-10 hover:!opacity-10"),"aria-label":"Profile",children:(0,r.jsx)(Ss,{className:"h-46 w-46"})}),(0,r.jsxs)("button",{type:"button","aria-label":"Wallet",onClick:()=>{p||m(P("wallet"))},disabled:p,className:Ra()("flex items-center gap-6 rounded-full bg-white-10 py-6 pl-6 pr-14 transition-all",("wallet"===a||"wallet-convert"===a||"wallet-convert-confirm"===a)&&"bg-white-20",p&&"!cursor-default opacity-40"),children:[(0,r.jsx)(Xa,{className:"h-28 w-28 shrink-0 text-white"}),u?(0,r.jsx)(tr,{}):(0,r.jsx)("span",{className:"text-medium-bold",children:Be.bp.formatCash(Number(c),{showCurrency:!1,customDecimals:o,roundUp:!0})})]})]}),(0,r.jsx)("button",{type:"button",className:Ra()("flex h-36 w-36 cursor-pointer items-center justify-center rounded-full bg-white-10 transition-all","info"===a&&"bg-white-20",p&&"!cursor-default opacity-40"),onClick:()=>{p||m(P("info"))},disabled:p,children:(0,r.jsx)(Os,{className:"h-16 w-16"})})]})},Ts=()=>{const e=b(e=>e.promoLobby.topBarScreen),t=b(e=>e.promoLobby.screenHistory),a=b(e=>e.rewards.rewards),n=b(e=>e.prizeDrop.campaigns),s=b(Pt),i=b(e=>e.prizeDrop.displayedCampaign),l=b(e=>e.prizeDrop.apiJoinCampaign),o=b(Bt),d=b(e=>e.promoLobby.activeScreen),c=b(_),u=w(),p=(0,Sa.Bd)(),m=(0,g.useRef)(!1),v=(0,g.useRef)(""),h=(0,g.useRef)(""),f=(0,g.useRef)(!1),x=(0,g.useRef)(null),{showSuccessToast:y,showFailedToast:j}=qr();(0,g.useEffect)(()=>(Be.h$.emit("promoLobby:opened"),u(ea()),()=>{Be.h$.emit("promoLobby:closed")}),[u]),(0,g.useEffect)(()=>{m.current||(m.current=!0,u(xe()));const t=a.map(e=>e.rewardId).sort().join(",");"true-world"===d&&null===e&&t!==v.current&&(v.current=t,u(de(a.map(e=>e.rewardId))));const r=n.filter(e=>"scheduled"===e.status).map(e=>e.campaignId),s=[...r].sort().join(",");s!==h.current&&(h.current=s,u(pe(r)))},[d,a,n,u,e]),(0,g.useEffect)(()=>{f.current&&(l.data&&(l.data.joined?(y(p("DROP.042","You have successfully joined!")),Be.h$.emit("pdModal:joinSuccess")):(j(Tn({t:p,error:l.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),Be.h$.emit("pdModal:joinError")),f.current=!1),l.error&&(j(Tn({t:p,error:l.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),Be.h$.emit("pdModal:joinError"),f.current=!1))},[l.data,l.error,j,y,p]),(0,g.useEffect)(()=>{const t=x.current,a=["wallet-convert","wallet-convert-confirm"],r=a.includes(null!=t?t:""),n=a.includes(null!=e?e:"");r&&!n&&u(Q()),"info"===e&&"info"!==t&&Be.h$.emit("promoLobby:infoViewed"),x.current=e},[u,e]);const C="info"===e,N="campaign"===d,D=t.length>0,E=()=>{c||("wallet-convert"!==e&&"wallet-convert-confirm"!==e||u(Q()),u(Je("promoLobby")))};return(0,r.jsxs)(Bn,{onClose:c?void 0:E,children:[(0,r.jsx)(Sn,{onReturn:D&&!c?()=>{c||u(O())}:void 0,onClose:c?void 0:E,classes:{closeButton:"!top-23",returnButton:"!top-23 ml:!left-98"},children:(0,r.jsx)("div",{className:"title-h1-bold pb-20 pt-34 text-center uppercase",children:p("LOBBY.001","True world")})}),(0,r.jsx)(Ls,{}),(0,r.jsx)(Nn,{scrollbarInsetBottom:N&&s&&!e?64:void 0,className:"mb-120 ml:mb-40",contentClassName:C?"!px-0 !max-w-full":"",children:(0,r.jsx)(ms,{})}),N&&s&&!e&&(0,r.jsx)(Dn,{className:"fixed !bottom-120 left-0 right-0 !bg-brand-black ml:!bottom-40 ",children:(0,r.jsx)(Ta,{isLoading:l.isPending,onClick:()=>{Be.h$.emit("pdModal:startJoin"),f.current=!0,u(_r({campaignId:i.campaignId}))},className:"!bg-brand-gradient",disabled:o})}),(0,r.jsx)(Es,{})]})},Is=()=>(0,r.jsx)(Qr,{children:(0,r.jsx)(Ts,{})}),_s=()=>{const e=b(e=>e.modals.current);return(0,r.jsx)("div",{className:"pointer-events-auto",children:e.map(e=>(e=>{switch(e){case"promoLobby":return(0,r.jsx)(Is,{},e);case"prizeDropCongratulation":return(0,r.jsx)(Mn,{},e);case"prizeDropClaimed":return(0,r.jsx)(On,{},e);case"prizeDropClaimedSuccess":return(0,r.jsx)(An,{},e);case"prizeDropClaimedFailed":return(0,r.jsx)(In,{},e);case"prizeDropClaimedExpired":return(0,r.jsx)(Ln,{},e);case"prizeDropSuccess":return(0,r.jsx)(Jn,{},e);case"prizeDropResultFinished":return(0,r.jsx)(Gn,{},e);case"prizeDropResultCancelled":return(0,r.jsx)(Wn,{},e);case"prizeDropLive":return(0,r.jsx)(Vn,{},e);case"prizeDropJoinError":return(0,r.jsx)(Fn,{},e);case"walletConvertSuccess":return(0,r.jsx)(Kn,{},e);default:return null}})(e))})};var As,Ms,Fs,Us,$s;function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ys.apply(null,arguments)}const Vs=e=>g.createElement("svg",Ys({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 52 52"},e),As||(As=g.createElement("path",{fill:"#000",fillOpacity:.5,stroke:"url(#promo-lobby-icon_svg__a)",strokeWidth:1.7,d:"M15 1.85h22c7.263 0 13.15 5.887 13.15 13.15v22c0 7.263-5.887 13.15-13.15 13.15H15C7.737 50.15 1.85 44.263 1.85 37V15C1.85 7.737 7.737 1.85 15 1.85Z"})),Ms||(Ms=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__b)",d:"M41.5 26 29.593 38 17.687 26l11.906-12z"})),Fs||(Fs=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__c)",d:"m21.535 34.122-2.977 3-2.976-3 2.976-3z"})),Us||(Us=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__d)",d:"M18.92 18.758 14.71 23l-4.21-4.243 4.21-4.243z"})),$s||($s=g.createElement("defs",null,g.createElement("linearGradient",{id:"promo-lobby-icon_svg__a",x1:29.826,x2:30.02,y1:50.743,y2:10.567,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__b",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__c",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__d",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"}))))),Ws=e=>{return!(e.type!==Tt.Dy.TRUE&&e.type!==Tt.Dy.CONVERT||(t=e.expiresAt,t&&new Date(t).getTime()<=Date.now()));var t},Gs=e=>"expired"!==e.claimUiStatus&&Ws(e.reward);const Js=({disabled:e=!1,gridClassName:t=""})=>{const a=function(){const e=(0,Da.GV)(e=>e.play.isActive),t=b(De),a=b(e=>e.notification.viewedRewardDropIds),r=b(e=>e.notification.viewedCampaignIds),n=b(e=>e.rewards.rewards),s=b(e=>e.rewards.rewardsQueue),i=b(e=>e.prizeDrop.campaigns.filter(e=>"scheduled"===e.status)),l=b(e=>e.rewards.hasDefferedRewardModal),o=b(e=>!!e.prizeDrop.defferedCampaign),d=b(e=>e.rewards.winReward),c=!!d&&Ws(d),u=b(e=>e.modals.current.some(e=>_t.includes(e))),p=(0,g.useMemo)(()=>((e,t,a)=>{const r=Date.now(),n=[];e.forEach(e=>{e.expiresAt&&n.push(new Date(e.expiresAt).getTime())}),t.forEach(e=>{e.reward.expiresAt&&n.push(new Date(e.reward.expiresAt).getTime())}),(null==a?void 0:a.expiresAt)&&n.push(new Date(a.expiresAt).getTime());const s=n.filter(e=>e>r);return s.length?Math.min(...s):null})(n,s,d),[n,s,d]),[,m]=(0,g.useReducer)(e=>e+1,0);(0,g.useEffect)(()=>{if(null===p)return;const e=Math.max(0,p-Date.now())+50,t=setTimeout(m,e);return()=>clearTimeout(t)},[p]);const v=((e,t)=>!t&&e)((({isActiveWalletNew:e,viewedRewardDropIds:t,viewedCampaignIds:a,rewards:r,rewardsQueue:n,scheduledCampaigns:s,hasDefferedRewardModal:i,hasDefferedCampaign:l,hasDefferedReward:o})=>{if(e)return!0;const d=r.some(e=>Ws(e)&&!t.includes(e.rewardId)),c=n.some(Gs),u=s.some(e=>!a.includes(e.campaignId));return d||c||u||!!i&&(l||o)})({isActiveWalletNew:t,viewedRewardDropIds:a,viewedCampaignIds:r,rewards:n,rewardsQueue:s,scheduledCampaigns:i,hasDefferedRewardModal:l,hasDefferedCampaign:o,hasDefferedReward:c}),u),h=(0,g.useRef)(null),{value:f,nextFrozen:x}=((e,t,a)=>{if(!e)return{value:t,nextFrozen:null};const r=null!=a?a:t;return{value:r,nextFrozen:r}})(e,v,h.current);return h.current=x,f}(),n=(0,Da.jL)(),s=w(),i=(0,g.useRef)(null);return(0,g.useEffect)(()=>{null===i.current?(i.current=a,a&&Be.h$.emit("notification_badge_shown")):i.current!==a&&(i.current=a,a?Be.h$.emit("notification_badge_shown"):Be.h$.emit("notification_badge_cleared"))},[a]),(0,r.jsx)("div",{className:t?`${t} relative bottom-64 h-52 w-52 ml:h-46 ml:w-46`:"",children:(0,r.jsxs)("button",{disabled:e,type:"button",onClick:t=>{t.stopPropagation(),e||(s(Ge("promoLobby")),n((0,Oe.Pp)(!0)))},className:Ra()("pointer-events-auto absolute cursor-pointer items-center justify-center rounded-14",!t&&"bottom-105 left-1/2 m-1 flex origin-top -translate-x-188 ml:bottom-auto ml:left-29 ml:top-1/2 ml:translate-x-0 ml:translate-y-[calc(-100%+167px)]",xn.T.prizeDrop,["[&_svg_stop:nth-child(1)]:[stop-color:var(--colors-gold-stop-0)]","[&_svg_stop:nth-child(2)]:[stop-color:var(--colors-gold-stop-1)]","[&_svg_stop:nth-child(3)]:[stop-color:var(--colors-gold-stop-2)]"],!e&&'after:absolute after:bottom-0 after:left-0 after:right-0 after:top-0 after:rounded-14 after:transition-all after:content-[""] hover:after:bg-white-10',"active:opacity-70","disabled:cursor-default disabled:opacity-40 disabled:hover:after:bg-transparent disabled:active:bg-transparent"),children:[a&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-gold",children:(0,r.jsx)("div",{className:"bg-neon-rouge h-8 w-8 rounded-full"})}),(0,r.jsx)(Vs,{className:"relative z-1 h-52 w-52 ml:h-46 ml:w-46"})]})})},Ks=()=>{var e;const t=(0,Da.GV)(fr.ge),a=(0,Da.GV)(e=>e.round.isRestore),n=(null===(e=(0,Da.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,s=(0,Da.GV)(e=>e.play.isActive),i=(0,Da.GV)(e=>e.app.isUIHidden),l=a||n||s;return(0,r.jsxs)(r.Fragment,{children:[t&&!i&&(0,r.jsx)(Js,{disabled:l}),!t&&!i&&(0,r.jsx)("div",{className:Ra()("pointer-events-none fixed grid","mp:bottom-42 mp:left-1/2 mp:-translate-x-1/2 mp:items-end mp:gap-x-12","ml:right-21 ml:top-1/2 ml:-translate-y-1/2 ml:justify-items-center ml:gap-y-10","mp:grid-cols-[52px_52px_118px_52px_52px]","ml:grid-rows-[46px_46px_110px_46px_46px]",'mp:[grid-template-areas:"menu_stakeAmounts_play_auto_bonus"]','ml:[grid-template-areas:"menu""stakeAmounts""play""auto""bonus"]',"ml:opacity-0","z-51"),children:(0,r.jsx)(Js,{gridClassName:"[grid-area:menu]",disabled:l})})]})},Hs=()=>{const e=(0,Da.GV)(e=>"main"===e.app.screen);return(()=>{const e=(0,Da.GV)(e=>e.app.modulesConfig.promoLobby),t=w(),a=null==e?void 0:e.fakeApi,r=null==e?void 0:e.fakeSocket,n=null==e?void 0:e.lang;(0,g.useEffect)(()=>{e&&a&&(t(ct(a.prizeDropLobbyInit)),t(ut(a.prizeDropJoinCampaign)),a.rewardsList&&t(Xt(a.rewardsList)),a.rewardsClaim&&t(Zt(a.rewardsClaim)),t(ca(a.walletTransactions)),a.walletConvert&&t(q(a.walletConvert)))},[a]),(0,g.useEffect)(()=>{e&&r&&t(gt(r))},[r]),(0,g.useEffect)(()=>{e&&t(pt({url:e.url,token:e.token}))},[e]),(0,g.useEffect)(()=>{e&&n&&t(B(e.lang))},[e])})(),function(){const e=(0,Da.jL)(),t=w();(0,g.useEffect)(()=>{un.j.on("round:opened",()=>{var t,a;try{"live"===zt(wa.getState(),null===(t=wa.getState().prizeDrop.activeCampaign)||void 0===t?void 0:t.campaignId)&&kt(wa.getState())&&e((0,dn.Nl)({pdCampaignId:null===(a=wa.getState().prizeDrop.activeCampaign)||void 0===a?void 0:a.campaignId}));const r=wa.getState().rewards.rewards.find(e=>e.type===Tt.Dy.CONVERT);r&&e((0,dn.Nl)({pdConvertRewardId:null==r?void 0:r.rewardId}))}catch(t){const a=t;(0,U.PI)(a),Be.vF.error(a),e((0,Pe.qX)(a))}}).on("round:ended",()=>{try{const{defferedCampaign:a}=wa.getState().prizeDrop,{hasDefferedRewardModal:r,winReward:n,rewardsQueue:s}=wa.getState().rewards;if(a&&t(dt(a)),r||a){if(e((0,on.X2)()),e((0,cn.SE)()),e((0,he.Zv)(!1)),"finished"===(null==a?void 0:a.status)?t(Ge("prizeDropResultFinished")):"cancelled"===(null==a?void 0:a.status)&&t(Ge("prizeDropResultCancelled")),n){const e=s.find(e=>e.reward.rewardId===n.rewardId);let a;a=e?At(e):n.type===Tt.Dy.TRUE?"prizeDropClaimed":"prizeDropCongratulation",t(Ge(a))}t(Jt(!1)),t(wt())}}catch(t){const a=t;(0,U.PI)(a),Be.vF.error(a),e((0,Pe.qX)(a))}}).on("autoplay:restarted",()=>{t((e,t)=>{var a;const r=t(),n=r.modals.current.filter(e=>Ur.includes(e)),s=n.some(e=>_t.includes(e)),i=n.includes("prizeDropClaimed"),l=null===(a=r.rewards.winReward)||void 0===a?void 0:a.rewardId,o=r.modals.current.includes("promoLobby")&&"true-world"===r.promoLobby.activeScreen&&null===r.promoLobby.topBarScreen;n.forEach(t=>{(e=>{switch(e){case"prizeDropCongratulation":case"prizeDropClaimed":return void Be.h$.emit("pdModalWinDrop:closed");case"prizeDropClaimedSuccess":return void Be.h$.emit("pdModalClaimSuccess:closed");case"prizeDropClaimedFailed":return void Be.h$.emit("pdModalClaimFailed:closed");case"prizeDropClaimedExpired":return void Be.h$.emit("pdModalClaimExpired:closed");case"prizeDropResultFinished":Be.h$.emit("pdModalEventEnded:closed");break;case"prizeDropResultCancelled":Be.h$.emit("pdModalEventCancelled:closed")}})(t),e(Je(t))}),i&&l&&o&&e(oe(l)),s&&l&&e(Ht(l)),(s||r.rewards.hasDefferedRewardModal)&&(e(Gt()),e(qt())),e(Jt(!1)),e(wt())})})},[])}(),(()=>{var e;const t=(0,Da.jL)(),a=w(),r=!!b(e=>e.prizeDrop.restData),n=b(e=>e.prizeDrop.campaignsQueue),s=b(e=>e.prizeDrop.displayedCampaign),i=b(e=>e.prizeDrop.apiLobbyInit.isPending),l=(0,Da.GV)(e=>e.play.isActive),o=(0,Da.GV)(e=>e.freeRounds.isActive),d=(null===(e=(0,Da.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,c=b(Ye),u=(0,Da.GV)(e=>e.modals.hasOpened),p=(0,Da.GV)(e=>e.round.isRestore),m=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!m.current&&r&&(a(Mr({shouldFreezeUi:!0})),m.current=!0)},[a,r]),(0,g.useEffect)(()=>{var e;if(!(({hasInitialized:e,hasPromoLobby:t,isPromoLobbyInitPending:a,campaignsQueueLength:r,isPlayActive:n,isFreeRoundsActive:s,isFreeRoundsCurrent:i,hasOpenedModalByCore:l,isRestore:o,isModalMode:d})=>e&&t&&!a&&r>0&&!n&&!s&&!i&&!l&&!o&&!d)({hasInitialized:m.current,hasPromoLobby:r,isPromoLobbyInitPending:i,campaignsQueueLength:null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0,isPlayActive:l,isFreeRoundsActive:o,isFreeRoundsCurrent:d,hasOpenedModalByCore:u,isRestore:p,isModalMode:c}))return;const v=n[0];v&&((null==s?void 0:s.campaignId)!==v.campaignId&&a(ot(v)),t((0,he.M5)()),a(Ge("prizeDropLive")))},[n,a,null==s?void 0:s.campaignId,u,o,d,c,l,r,i,p,t])})(),function(){const e=w(),t=(0,g.useCallback)(t=>{e((e=>t=>{t(be(e.active))})(t)),t.active&&e(Fr())},[e]);(0,g.useEffect)(()=>{Ze.on(Ke.CAMPAIGN_UPDATED,({payload:t})=>{e($r(t))}),Ze.on(Ke.REWARD,({payload:t})=>{e(ln(t))}),Ze.on(Ke.WALLET_STATUS,({payload:e})=>{t(e)})},[e,t]),(0,g.useEffect)(()=>{const a=a=>{var r,n,s;if(a.data.isGUI){if((null===(r=a.data)||void 0===r?void 0:r.type)===Ke.CAMPAIGN_UPDATED){const{payload:t}=a.data;Be.vF.socketEvent(Ke.CAMPAIGN_UPDATED,t),e($r(t))}if((null===(n=a.data)||void 0===n?void 0:n.type)===Ke.REWARD){const{payload:t}=a.data;Be.vF.socketEvent(Ke.REWARD,t),e(ln(t))}if((null===(s=a.data)||void 0===s?void 0:s.type)===Ke.WALLET_STATUS){const{payload:e}=a.data;Be.vF.socketEvent(Ke.WALLET_STATUS,e),t(e)}}};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[e,t])}(),(0,r.jsx)("div",{className:"promo-lobby-container pointer-events-auto",children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ks,{}),(0,r.jsx)(_s,{})]})})},Qs=({dispatch:e})=>{null==e||e((0,n.JI)((()=>{const e=[];return e.push(m,v,h,p,l,o,c,u,i,s,d),e.filter(e=>!!e)})()))},qs=()=>(0,r.jsx)(Ca,{children:(0,r.jsx)(Hs,{})})}}]);