@everymatrix/casino-engagement-suite-container 1.37.5 → 1.37.7

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.
@@ -1 +1 @@
1
- import{p as e,b as n}from"./p-ae874bf6.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),e(i)})().then((e=>n([["p-b9e1137f",[[1,"casino-engagement-suite-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],orientation:[32],device:[32],showChallengesList:[32],showFreeSpinsList:[32],showJackpotsList:[32],showChallengeDetails:[32],showFreeSpinsDetails:[32],showJackpotDetails:[32],challengePercent:[32],limitStylingAppends:[32],activeWidget:[32],challenges:[32],inProgressChallenges:[32],jackpots:[32],freeSpins:[32],gameSlug:[32],pausedChallengeIds:[32],isChallengeLabel:[32],isJoiningToChallenge:[32],selectedChallenge:[32],selectedJackpot:[32],selectedSpin:[32],selectedSpinId:[32],selectedChallengeId:[32],selectedJackpotId:[32],init:[64]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],pausedChallengeIds:[16],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]}],[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],pausedChallengeIds:[16],tooltip:[32],timers:[32],limitStylingAppends:[32],newChallengeIds:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-bar",{activeWidget:[1537,"active-widget"],challengePercent:[1,"challenge-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],orientation:[1],device:[1],isChallengeLabel:[4,"is-challenge-label"],language:[1],jackpots:[16],freeSpins:[16],limitStylingAppends:[32],activeJackpot:[32]}],[1,"casino-engagement-suite-free-spins-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],spin:[1040],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32],activeTab:[32],visibleGames:[32]}],[1,"casino-engagement-suite-free-spins-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],freeSpins:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32],newSpinIds:[32]}],[1,"casino-engagement-suite-jackpot-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],jackpot:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],limitStylingAppends:[32],timer:[32],disabledStatus:[32],activeTab:[32],visibleGames:[32],loading:[32],enabled:[32],balance:[32],winBalance:[32],showDetails:[32]},[[8,"message","handleEvent"],[9,"resize","handleResize"]]],[1,"casino-engagement-suite-jackpots-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],jackpots:[1040],buttonsLoadingStates:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
1
+ import{p as e,b as n}from"./p-ae874bf6.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),e(i)})().then((e=>n([["p-b595a20a",[[1,"casino-engagement-suite-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],orientation:[32],device:[32],showChallengesList:[32],showFreeSpinsList:[32],showJackpotsList:[32],showChallengeDetails:[32],showFreeSpinsDetails:[32],showJackpotDetails:[32],challengePercent:[32],limitStylingAppends:[32],activeWidget:[32],challenges:[32],inProgressChallenges:[32],jackpots:[32],freeSpins:[32],gameSlug:[32],pausedChallengeIds:[32],isChallengeLabel:[32],isJoiningToChallenge:[32],selectedChallenge:[32],selectedJackpot:[32],selectedSpin:[32],selectedSpinId:[32],selectedChallengeId:[32],selectedJackpotId:[32],init:[64]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],pausedChallengeIds:[16],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]}],[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],pausedChallengeIds:[16],tooltip:[32],timers:[32],limitStylingAppends:[32],newChallengeIds:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-bar",{activeWidget:[1537,"active-widget"],challengePercent:[1,"challenge-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],orientation:[1],device:[1],isChallengeLabel:[4,"is-challenge-label"],language:[1],jackpots:[16],freeSpins:[16],limitStylingAppends:[32],activeJackpot:[32]}],[1,"casino-engagement-suite-free-spins-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],spin:[1040],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32],activeTab:[32],visibleGames:[32]}],[1,"casino-engagement-suite-free-spins-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],freeSpins:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32],newSpinIds:[32]}],[1,"casino-engagement-suite-jackpot-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],jackpot:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],limitStylingAppends:[32],timer:[32],disabledStatus:[32],activeTab:[32],visibleGames:[32],loading:[32],enabled:[32],balance:[32],winBalance:[32],showDetails:[32]},[[8,"message","handleEvent"],[9,"resize","handleResize"]]],[1,"casino-engagement-suite-jackpots-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],jackpots:[1040],buttonsLoadingStates:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as e,h as t,c as i,g as s}from"./p-ae874bf6.js";const o=["en"],a={en:{new:"new"}},n=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.orientation="Landscape",this.device="Mobile",this.isChallengeLabel=!1,this.language="en",this.jackpots=[],this.freeSpins={},this.limitStylingAppends=!1,this.activeJackpot="",this.handleTileClick=e=>{const t=e.target.getAttribute("data-app");window.postMessage({type:`Bar${t}Click`}),this.activeWidget=t,"Jackpots"===t&&(this.activeJackpot=e.target.getAttribute("data-type"))},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.engagementSuiteBar.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.engagementSuiteBar.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.engagementSuiteBar&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getChallengeTile(){return t("button",{class:"Tile Reward Challenges "+("Challenges"===this.activeWidget?"Active":""),"data-app":"Challenges",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,this.challengePercent),t("div",{class:"ChallengeLabel "+(this.isChallengeLabel?"ShowChallengeLabel":"")},t("span",null,(()=>{const e=this.language;return a[void 0!==e&&o.includes(e)?e:"en"].new})())))}getFreeSpinsTile(){const{TotalNumberOfFreeSpins:e,TotalNumberOfUsedFreeSpins:i}=this.freeSpins,s=e-i;return t("button",{class:"Tile Reward FreeSpins "+("FreeSpins"===this.activeWidget?"Active":""),"data-app":"FreeSpins",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,"number"!=typeof s||s<0?"":s))}getJackpotClasses(e){return{Tile:!0,Jackpot:!0,Enabled:e.Enabled,Active:"Jackpots"===this.activeWidget&&this.activeJackpot===e.Type,[e.Type.charAt(0).toUpperCase()+e.Type.slice(1)]:!0}}getJackpotsTemplate(){return this.jackpots.map((e=>{const i=function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(e.WinBalance||e.Balance,e.Currency);return t("div",{class:this.getJackpotClasses(e),"data-app":"Jackpots","data-type":e.Type,onClick:this.handleTileClick},t("div",{class:"JackpotType"},e.Type),t("span",{class:"JackpotBalance"},i))}))}render(){return t("div",{class:`CasinoEngagementSuiteBar ${this.orientation} ${this.device}`,ref:e=>this.engagementSuiteBar=e},t("div",{class:"EngagementSuiteContainer"},!!this.jackpots.length&&this.getJackpotsTemplate(),this.challengePercent&&this.getChallengeTile(),this.freeSpins&&this.getFreeSpinsTile()))}};n.style=':host{display:block}*{box-sizing:border-box}.CasinoEngagementSuiteBar{height:100vh;background-color:var(--emw--color-background, #1E1638);color:var(--emw--color-typography, #FFF);display:flex;justify-content:center;position:relative;z-index:1}.CasinoEngagementSuiteBar .EngagementSuiteContainer{display:flex;align-items:center;gap:4px;scrollbar-gutter:stable;overflow-x:auto;padding:0 9px;width:100%}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar{width:3px;background:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{cursor:pointer;background-color:var(--emw--color-primary, #251D3E);border-radius:var(--emw--border-radius-medium, 4px);display:flex;flex-direction:row;align-items:center;justify-content:center;position:relative;font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-x-small, 12px);font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFF)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile.Active::before{background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #2D2545 82.77%)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile::before{content:"";position:absolute;inset:0;border-radius:var(--emw--border-radius-medium, 4px);padding:1px;background:linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 100%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{padding:14px 8px;flex-direction:column}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotType{display:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotBalance{font-weight:var(--emw--font-weight-semibold, 600);line-height:12px;font-size:12px;color:var(--emw--color-typography, #fff)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled .JackpotBalance{font-weight:var(--emw--font-weight-bold, 800)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{justify-content:space-between;padding:8px;border:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .RewardIcon{width:24px;height:24px;background-size:100%;background-position:center}.Tile.Leaderboard .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg")}.Tile.Leaderboard.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard-pressed.svg")}.Tile.Challenges .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge.svg")}.Tile.Challenges.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge-pressed.svg")}.Tile.Luckywheel .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel.svg")}.Tile.Luckywheel.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel-pressed.svg")}.Tile.FreeSpins .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins.svg")}.Tile.FreeSpins.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins-pressed.svg")}.ChallengeLabel{min-width:23px;height:11px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-4px;right:4px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:7px;line-height:7px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.Landscape.CasinoEngagementSuiteBar{width:152px;padding-top:16px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer{flex-direction:column}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{width:120px;height:40px}.Portrait.CasinoEngagementSuiteBar{border-radius:0 0 var(--emw--border-radius-medium, 4px) var(--emw--border-radius-medium, 4px);height:auto;padding:10px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer{gap:8px;flex-wrap:wrap}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{flex:1 1 0px;height:32px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{min-width:30%;padding:10px 8px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{min-width:20%;padding:4px 8px}.CasinoEngagementSuiteBar.Desktop.Landscape{width:252px}.CasinoEngagementSuiteBar.Desktop.Landscape .EngagementSuiteContainer{gap:12px}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward{padding:8px 20px;height:64px;font-size:var(--emw--font-size-medium, 16px)}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward .RewardIcon{width:48px;height:48px}.CasinoEngagementSuiteBar.Desktop.Landscape .Tile{width:212px}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot{padding-top:35px;min-height:133px;background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/jackpot-bg-stars.svg")}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType{display:block;font-weight:var(--emw--font-weight-bold, 800);margin-bottom:12px;text-transform:uppercase}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType,.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotBalance{font-size:var(--emw--size-large, 24px);line-height:24px}';const r=["en"],l={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",details:"Challenge Details",tc:"Terms & Conditions",level:"Level",place:"Place",bet:"bet",bets:"bets",win:"Win",minBet:"Min Bet",maxBet:"Max Bet",contribution:"Contribution"}},p=(e,t)=>{const i=t;return l[void 0!==i&&r.includes(i)?i:"en"][e]};var c,h;function d(e,t){return`${t}${new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}).format(e).replace(/,/g," ")}`}!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(c||(c={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(h||(h={}));const g=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.pausedChallengeIds=[],this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.changeChallengeStatus=e=>{var t,i;const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})},this.toggle=()=>{this.showDetails=!this.showDetails}}challengePropHandler(e){!this.interval&&e&&(this.updateTimer(),this.startCountdown()),this.interval&&!e&&clearInterval(this.interval)}componentWillLoad(){this.challengePropHandler(this.challenge)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getActionsTemplate(){return t("header",{class:"ChallengeActions"},t("button",{class:"ChallengeIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"ChallengePopupName"},p("challenges",this.language)),t("button",{class:"ChallengeIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getChallengeHeader(){const e=this.challenge.Status===h.InProgress||this.challenge.Status===h.PendingLevelReward;return t("div",{class:"ChallengeDetailsHeader"},t("span",{class:"ChallengeName"},this.challenge.ChallengePresentation.PresentationName),t("button",{onClick:this.changeChallengeStatus,class:`ChallengeJoinButton ${e?"Joined":""}\n ${this.isExpiredChallenge||this.isJoiningToChallenge?"Disabled":""}`,"data-id":this.challenge.Id},p(e?"unjoin":"join",this.language)))}getChallengeCountdown(){return t("div",{class:"ChallengeCountdown "+(this.isExpiredChallenge?"Expired":"")},this.isExpiredChallenge?"Expired":this.timer)}getChallengeDetails(){const e=this.challenge.ChallengePresentation.Description,i=this.challenge.ChallengePresentation.Url,s=this.challenge.Games;return t("div",{class:"CollapseDetails "+(this.showDetails?"ShowDetails":"")},e&&t("div",{class:"ChallengeDescription"},e),i&&t("div",{class:"TC"},t("a",{href:i,target:"_blank"},p("tc",this.language))),(null==s?void 0:s.length)&&t("div",{class:"ChallengeGames"},s.map((e=>t("div",{class:"Game",key:e.CasinoGameId},t("img",{src:e.GameIcon,alt:e.GameName,onClick:this.onGameClick,class:e.GameSlug===this.gameSlug?"Disabled":"","data-slug":e.GameSlug}))))))}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.challenge.ExpirationTime).getTime()-(new Date).getTime();if(e<1)return clearInterval(this.interval),this.timer="",void(this.isExpiredChallenge=!0);const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getLevelTarget(e){const i=(s=e.DisplayCurrencyTargetTurnover,`${this.challenge.CurrencySymbol}${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(s)}`);var s;let o=`${p("place",this.language)} ${i}`;return 1===e.LevelTargetType?o+=` ${p("bet",this.language)}`:2===e.LevelTargetType&&(o+=` ${p("bets",this.language)} X ${e.TargetBetCount}`),t("span",{class:"ChallengeLevelTarget"},o)}getLevelBetRangesDetails(e){var i,s,o,a;if(0===e.LevelTargetType){const n=d(null===(i=e.BetRange)||void 0===i?void 0:i.MinBet,this.challenge.CurrencySymbol),r=d(null===(s=e.BetRange)||void 0===s?void 0:s.MaxBet,this.challenge.CurrencySymbol),l=e.LevelContributionPercent+"%",c="number"==typeof(null===(o=e.BetRange)||void 0===o?void 0:o.MinBet),h="number"==typeof(null===(a=e.BetRange)||void 0===a?void 0:a.MaxBet),g=100!==e.LevelContributionPercent;if(c||h||g)return t("div",{class:"ChallengeLevelBetDetails"},c&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("minBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},n)),h&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("maxBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},r)),g&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("contribution",this.language),": "),t("span",{class:"ChallengeLevelBetContribution"},l)))}}getChallengeLevels(){const e=this.challenge.Status===h.Started&&this.challenge.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(this.challenge.ChallengeId),i=t=>"ChallengeLevelCard "+(1!==t.ProgressStatus||this.isExpiredChallenge||e?"":"InProgress");return t("div",{class:"ChallengeLevels"},this.challenge.LevelProgresses.map(((s,o)=>t("div",{class:i(s)},t("casino-engagement-suite-progress-bar",{class:this.device,value:s.ProgressPercentage,"hide-percent":0===s.ProgressPercentage||100===s.ProgressPercentage,disabled:this.isExpiredChallenge||e},t("span",{slot:"Title",class:"ChallengeLevelTitle"},t("span",null,"Level ",o+1,": "),this.getLevelTarget(s))),t("div",{class:"ChallengeRewardMessage"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg",alt:"win"}),t("span",null,p("win",this.language),": "),t("span",{class:"CustomRewardMessage"},s.CustomRewardMessage)),this.getLevelBetRangesDetails(s)))))}getToggleButton(){return t("div",{class:"ChallengeCollapseButton",onClick:this.toggle},t("span",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,p("details",this.language)))}render(){return t("div",{class:`ChallengeDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"ChallengeDetails"},this.getChallengeHeader(),this.getChallengeCountdown(),this.getToggleButton(),this.getChallengeDetails(),this.getChallengeLevels()))}get host(){return s(this)}static get watchers(){return{challenge:["challengePropHandler"]}}};var u,m;g.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-word}.ChallengeJoinButton.Joined::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin:12px 0}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetails{margin-top:25px;display:flex;flex-wrap:wrap;gap:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetail:not(:last-of-type){margin-right:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetRange,.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetContribution{font-weight:var(--emw--font-weight-semibold, 600)}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelTitle{margin-bottom:2px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;line-height:15px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);word-break:break-word}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:"";position:absolute;inset:0;border-radius:8px;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeDetailsPopup.Tablet .ChallengeActions,.ChallengeDetailsPopup.Desktop .ChallengeActions{padding-top:16px}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .CollapseDetails .ChallengeDescription,.ChallengeDetailsPopup.Desktop .CollapseDetails .ChallengeDescription{font-size:var(--emw--font-size-medium, 16px);line-height:19px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeLevelTitle,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeLevelTitle{margin-bottom:4px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeRewardMessage{margin-top:12px;line-height:17px}',function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(u||(u={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(m||(m={}));const b=["en"],x={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},k=(e,t)=>{const i=t;return x[void 0!==i&&b.includes(i)?i:"en"][e]};function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function f(e){F(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===w(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function v(e,t){return F(2,arguments),f(e).getTime()-f(t).getTime()}var C={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function y(e){return e?C[e]:C.trunc}const D=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.pausedChallengeIds=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,i;e.stopPropagation();const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":{const t=e.data.data.challengeProgressData[0],i=this.challenges.findIndex((e=>function(e,t,i){F(2,arguments);var s=v(e,t)/1e3;return y(null==i?void 0:i.roundingMethod)(s)}(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));i>-1?this.challenges.splice(i,0,t):this.challenges.unshift(t),this.challenges=[...this.challenges],this.newChallengeIds.push(t.Id),window.postMessage({type:"UpdateChallenges"});break}}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==m.Expired)).reduce(((t,i)=>{const s=new Date(i.ExpirationTime).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeChallenge(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===m.InProgress&&!this.pausedChallengeIds.includes(e.ChallengeId),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===m.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.ChallengeId)}isChallengeCompleted(e){return e.Status===m.Completed||e.Status===m.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===m.Completed)return 100;if(this.isChallengePaused(e)||e.Status===m.PendingLevelReward||e.Status===m.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===u.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:i}=e,s=e.Status===m.InProgress||e.Status===m.PendingLevelReward;return t("div",{class:"ChallengeCardHeader"},t("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),t("button",{class:`${s?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":i},k(s?"unjoin":"join",this.language)))}getChallengeTemplate(e){const i=this.getChallengeProgress(e),s=this.timers[e.Id],o=this.newChallengeIds.includes(e.Id),a=i>-1?t("casino-engagement-suite-progress-bar",{class:this.device,value:i,disabled:this.isChallengePaused(e)},t("span",{slot:"Title",class:"ChallengeCountdown"},s)):t("span",{class:"ChallengeCountdown"},s);return t("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),a,t("div",{class:"ChallengeLabel "+(o?"ShowChallengeLabel":"")},t("span",null,k("new",this.language))))}getHeaderTemplate(){return t("header",{class:"ChallengesListPopupHeader"},t("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"ChallengesListPopupHeaderName"},k("challenges",this.language)),t("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?t("div",{class:"ChallengesListWrapper"},t("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):t("div",{class:"ChallengesListEmpty"},t("h2",null,k("noChallenges",this.language)),t("p",null,k("tryOtherGames",this.language)))}getTooltipTemplate(){return t("div",{class:"ChallengesTooltipBackdrop"},t("div",{class:"ChallengesTooltip"},t("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),k("tooltip",this.language)))}render(){return t("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};var J,S;function B(){return window.screen.orientation.type.includes("portrait")?"Portrait":"Landscape"}D.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}',"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(J||(J={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(S||(S={}));const P=class{constructor(t){e(this,t),this.openModal=i(this,"openModal",7),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.orientation="Landscape",this.device="Mobile",this.showChallengesList=!1,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showFreeSpinsDetails=!1,this.showJackpotDetails=!1,this.limitStylingAppends=!1,this.jackpots=[],this.gameSlug="",this.pausedChallengeIds=[],this.isChallengeLabel=!1,this.isJoiningToChallenge=!1,this.handlePopupClose=(e,t)=>()=>{this[e]=!1,this[t]=!1,this.activeWidget=""},this.handleJackpotsPopupClose=()=>{this.showJackpotsList=!1,this.showJackpotDetails=!1,this.activeWidget=""},this.handleChallengePopupBack=()=>{this.showChallengeDetails=!1,this.showChallengesList=!0},this.handleJackpotPopupBack=()=>{this.showJackpotDetails=!1,this.showJackpotsList=!0},this.barHeight=0,this.orientationChangeHandler=()=>{this.orientation=B()},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}handleEvent(e){const t=null==e?void 0:e.data,{type:i}=t,s=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}(t,["type"]);switch(i){case"ChallengeHasExpired":this.setChallengePercent();break;case"BarChallengesClick":this.showChallengesList=!0,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Challenges",this.isChallengeLabel=!1;break;case"BarFreeSpinsClick":this.showFreeSpinsList=!0,this.showChallengesList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="FreeSpins";break;case"BarJackpotsClick":this.showJackpotsList=!0,this.showFreeSpinsList=!1,this.showChallengesList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Jackpots";break;case"ChallengeClick":this.selectedChallengeId=e.data.id,this.selectedChallenge=this.challenges.find((e=>e.Id===this.selectedChallengeId)),this.showChallengesList=!1,this.showChallengeDetails=!0;break;case"FreeSpinClick":this.selectedSpinId=e.data.id,this.selectedSpin=this.freeSpins.VendorFreeSpins.find((e=>e.Id===this.selectedSpinId)),this.showFreeSpinsList=!1,this.showFreeSpinsDetails=!0;break;case"JackpotClick":this.selectedJackpotId=e.data.id,this.selectedJackpot=this.jackpots.find((e=>e.JackpotId===this.selectedJackpotId)),this.showJackpotsList=!1,this.showJackpotDetails=!0;break;case"UpdateChallenges":this.setChallengeLabel();break;case"UpdateChallengeProgress":this.updateChallengeProgress(e.data.data);break;case"ChallengeChangeStatusNotification":{const{IsEnabled:t,ChallengeId:i}=e.data.data;this.pausedChallengeIds=t?this.pausedChallengeIds.filter((e=>e!==i)):[...this.pausedChallengeIds,i];break}case"ShowChallengeRewardModal":{const{ChallengeId:e,LevelId:t,HasError:i,ProcessedRewards:o}=s.data,a={modalType:(null==o?void 0:o.length)?"REWARD_MODAL":"SUPPORT_MODAL",rewardMessage:this.getRewardMessage(e,t),hasError:i};this.openModal.emit(a);break}case"ShowConfirmationModal":this.openModal.emit({modalType:"TARGET_MODAL",confirmationData:s});break;case"ChallengeJoinRequest":this.isJoiningToChallenge=!0;break;case"JoinChallengeResult":{const{Success:t,JoinId:i,UnjoinId:s}=e.data.data;t&&(i&&this.updateChallengeStatus(i,1,!0),s&&this.updateChallengeStatus(s,0,!1),this.challenges=[...this.challenges]),this.isJoiningToChallenge=!1,this.closeModal.emit("TARGET_MODAL");break}case"ShowJackpotRewardModal":{const{Amount:t,Currency:i}=e.data.data;this.openModal.emit({modalType:"JACKPOT_REWARD_MODAL",winAmount:{amount:t,currency:i}});break}case"UpdateJackpotBalance":this.updateJackpotBalance(e.data.data)}}componentDidLoad(){this.orientation=B(),this.device=function(){const e=navigator.userAgent.toLowerCase(),t=screen.availWidth,i=screen.availHeight;if(e.includes("iphone"))return"Mobile";if(e.includes("ipad"))return"Tablet";if(e.includes("android")){if(i>t&&t<800)return"Mobile";if(t>i&&i<800)return"Tablet"}return"Desktop"}(),window.screen.orientation.addEventListener("change",this.orientationChangeHandler)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),this.barHeight=this.barWrapperEl.offsetHeight}disconnectedCallback(){window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}async init(e){var t;this.challenges=e.challenges,this.inProgressChallenges=null===(t=e.challenges)||void 0===t?void 0:t.filter((e=>e.Status===S.InProgress||e.Status===S.PendingLevelReward)).map((e=>e.Id)),this.jackpots=e.jackpots||[],this.freeSpins=e.freeSpins||{},this.gameSlug=e.slug,this.setChallengePercent(),this.setChallengeLabel()}setChallengeLabel(){this.challenges&&(this.isChallengeLabel=!!this.challenges.filter((e=>e.IsNew)).length)}setChallengePercent(){if(!this.challenges)return;const e=this.challenges.find((e=>e.Status===S.InProgress));if(e){const t=e.LevelProgresses.find((e=>e.ProgressStatus===J.InProgress));this.challengePercent=t?`${t.ProgressPercentage}%`:"0%"}else this.challengePercent="—"}updateChallengeProgress(e){var t;const i=null===(t=this.challenges)||void 0===t?void 0:t.find((t=>t.ChallengeId===e.ChallengeId));if(i&&(i.LevelProgresses=i.LevelProgresses.map((t=>{var i;const s=null===(i=e.Levels)||void 0===i?void 0:i.find((e=>e.LevelId===t.LevelId));return s?Object.assign(Object.assign({},t),s):t})),this.challenges=[...this.challenges]),this.showChallengeDetails){const e=this.challenges.find((e=>e.Id===this.selectedChallengeId));e&&(this.selectedChallenge=Object.assign({},e))}this.setChallengePercent()}updateChallengeStatus(e,t,i){var s;const o=null===(s=this.challenges)||void 0===s?void 0:s.find((t=>t.Id===e));o&&(o.Status=t,this.inProgressChallenges=i?[...this.inProgressChallenges,o.Id]:this.inProgressChallenges.filter((e=>e!==o.Id)))}updateJackpotBalance(e){if(this.jackpots=this.jackpots.map((t=>{const i=e.find((e=>e.JackpotId===t.JackpotId));return i?Object.assign(Object.assign({},t),{Balance:i.Balance,WinBalance:i.WinBalance}):t})),this.showJackpotDetails){const e=this.jackpots.find((e=>e.JackpotId===this.selectedJackpotId));e&&(this.selectedJackpot=Object.assign({},e))}}getChallengesWidgets(){return t("div",null,t("div",{class:this.showChallengesList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-challenges-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),challenges:this.challenges,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})),t("div",{class:this.showChallengeDetails?"Backdrop Opened":"Backdrop"},this.showChallengeDetails&&t("casino-engagement-suite-challenges-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),"game-slug":this.gameSlug,challenge:this.selectedChallenge,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})))}getFreeSpinWidgets(){return t("div",null,t("div",{class:this.showFreeSpinsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-free-spins-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),freeSpins:this.freeSpins.VendorFreeSpins})),t("div",{class:this.showFreeSpinsDetails?"Backdrop Opened":"Backdrop"},this.showFreeSpinsDetails&&t("casino-engagement-suite-free-spins-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),"game-slug":this.gameSlug,spin:this.selectedSpin})))}getJackpotsWidgets(){return t("div",null,t("div",{class:this.showJackpotsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-jackpots-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handleJackpotsPopupClose,jackpots:this.jackpots})),this.showJackpotDetails&&t("div",{class:"Backdrop Opened"},t("casino-engagement-suite-jackpot-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleJackpotPopupBack,onClose:this.handleJackpotsPopupClose,"game-slug":this.gameSlug,jackpot:this.selectedJackpot})))}getRewardMessage(e,t){var i,s,o,a;return(null===(a=null===(o=null===(s=null===(i=this.challenges)||void 0===i?void 0:i.find((t=>t.Id===e)))||void 0===s?void 0:s.LevelProgresses)||void 0===o?void 0:o.find((e=>e.LevelId===t)))||void 0===a?void 0:a.CustomRewardMessage)||""}render(){return t("div",{class:`CasinoEngagementSuiteContainer ${this.device} ${this.orientation}`,style:{"--barHeight":`${this.barHeight}px`}},t("div",{class:"barWrapper",ref:e=>this.barWrapperEl=e},t("casino-engagement-suite-bar",{orientation:this.orientation,device:this.device,"active-widget":this.activeWidget,"is-challenge-label":this.isChallengeLabel,jackpots:this.jackpots,freeSpins:this.freeSpins,"challenge-percent":this.challengePercent})),this.challenges&&this.getChallengesWidgets(),this.freeSpins&&this.getFreeSpinWidgets(),!!this.jackpots.length&&this.getJackpotsWidgets(),t("casino-engagement-suite-modal-container",{device:this.device,isJoiningToChallenge:this.isJoiningToChallenge}))}get host(){return s(this)}};P.style=":host{display:inline-block;font-family:inherit}.Backdrop{padding:20px 20px 20px 172px;display:none;position:fixed;inset:0;height:100dvh;width:100vw}.Backdrop.Opened{display:block}.Backdrop .CasinoEngagementSuiteDialog{height:calc(100dvh - 40px);max-width:600px}.CasinoEngagementSuiteContainer.Portrait{width:100vw}.CasinoEngagementSuiteContainer.Portrait .Backdrop{padding:calc(var(--barHeight) + 12px) 0 20px}.CasinoEngagementSuiteContainer.Portrait .Backdrop .CasinoEngagementSuiteDialog{max-width:initial;padding:0 4px;margin:0 auto;height:calc(100dvh - (var(--barHeight) + 20px))}.CasinoEngagementSuiteContainer.Landscape.Mobile .CasinoEngagementSuiteDialog{max-width:366px}.CasinoEngagementSuiteContainer.Landscape.Desktop .Backdrop{padding-left:272px}";const L=["en"],T={en:{freeSpins:"Free Spins",details:"Free Spins Details",tc:"Terms & Conditions",quantityGranted:"Quantity Granted",quantityLeft:"Quantity Left",valueGranted:"Value Granted",valueLeft:"Value Left",info:"Info",games:"Games",loadMore:"Load More"}},E=(e,t)=>{const i=t;return T[void 0!==i&&L.includes(i)?i:"en"][e]},M=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.activeTab=1,this.visibleGames=[],this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.spin.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()}}componentWillLoad(){this.startCountdown()}componentDidRender(){if(!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2===this.activeTab&&!this.maxVisibleGames){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.spin.GamesInfo.slice(0,this.maxVisibleGames)}}disconnectedCallback(){clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}getActionsTemplate(){return t("header",{class:"FreeSpinsActions"},t("button",{class:"FreeSpinsIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"FreeSpinsPopupName"},E("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getFreeSpinsHeader(){const{VendorName:e,NumberOfFreeSpins:i,NumberOfUsedFreeSpins:s}=this.spin;return t("div",{class:"FreeSpinsDetailsHeader"},t("span",{class:"FreeSpinsName"},e),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s),"/",i))}getFreeSpinsCountdown(){const e=this.isExpiredChallenge?"Expired":this.timer,{VendorFreeSpinsCost:i,VendorFreeSpinsRemainingCost:s,CurrencySymbol:o}=this.spin;return t("div",{class:"FreeSpinsCountdown "+(this.isExpiredChallenge?"Expired":"")},e,t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},o,s),"/",o,i))}getTabsTemplate(){return t("div",{class:"FreeSpinsDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(1===this.activeTab?"Active":"")},E("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(2===this.activeTab?"Active":"")},E("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getSpinInfoTemplate():this.getGamesTemplate()}getSpinsDetailsTemplate(){return t("div",null,t("div",{class:"FreeSpinsDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,E("details",this.language))),this.showDetails&&t("p",{class:"FreeSpinsDescription"},this.spin.FreeSpinCampaignPresentation.Description))}getSpinInfoTemplate(){const{NumberOfFreeSpins:e,NumberOfUsedFreeSpins:i,VendorFreeSpinsCost:s,CurrencySymbol:o,VendorFreeSpinsRemainingCost:a}=this.spin;return t("div",null,this.spin.FreeSpinCampaignPresentation.Description&&this.getSpinsDetailsTemplate(),t("div",{class:"FreeSpinsInfo"},t("div",{class:"FreeSpinsInfoItem"},E("quantityGranted",this.language),": ",t("span",null,e)),t("div",{class:"FreeSpinsInfoItem"},E("quantityLeft",this.language),": ",t("span",null,i)),t("div",{class:"FreeSpinsInfoItem"},E("valueGranted",this.language),": ",t("span",null,o,s)),t("div",{class:"FreeSpinsInfoItem"},E("valueGranted",this.language),": ",t("span",null,o,a)),this.spin.FreeSpinCampaignPresentation.Url&&t("div",{class:"FreeSpinsInfoItem"},t("a",{class:"tc",href:this.spin.FreeSpinCampaignPresentation.Url,target:"_blank"},E("tc",this.language)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"FreeSpinsGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"FreeSpinsGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"FreeSpinsGamesList"},e)),this.visibleGames.length<this.spin.GamesInfo.length?t("button",{class:"PopupButton Active FreeSpinsGamesButton",onClick:this.handleLoadMore},E("loadMore",this.language)):""]}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.spin.ExpiryDate).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}render(){return t("div",{class:`FreeSpinsDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"FreeSpinsDetails"},this.getFreeSpinsHeader(),this.getFreeSpinsCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}};M.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.FreeSpinsDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsHeader{opacity:0.5}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsTabs{cursor:default;pointer-events:none}.FreeSpinsDetailsPopup.Disabled .FreeSpinsInfoItem{color:var(--emw--color-primary, #8F8B9C)}.FreeSpinsDetails{overflow:hidden;height:100%;display:flex;flex-direction:column}.FreeSpinsActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsActions .FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsActions .FreeSpinsPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-small-plus, 16px);font-weight:500;line-height:16px}.FreeSpinsDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsDetails::-webkit-scrollbar{display:none}.FreeSpinsDetailsHeader{display:flex;justify-content:space-between;gap:12px;min-width:0;align-items:flex-end}.FreeSpinsDetailsHeader .FreeSpinsName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:var(--emw--font-size-small, 14px);font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:"";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.FreeSpinsGamesLoadMore::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.FreeSpinsCountdown{display:flex;justify-content:space-between;font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.FreeSpinsCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.FreeSpinsDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.FreeSpinsDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.FreeSpinsInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.FreeSpinsInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.FreeSpinsDetailsButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.FreeSpinsDetailsButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.FreeSpinsDetailsButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.FreeSpinsDetailsButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.FreeSpinsDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsGamesListWrapper{overflow:auto;flex-grow:1}.FreeSpinsGamesList{display:flex;gap:10px;flex-wrap:wrap}.FreeSpinsGamesList .FreeSpinsGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.FreeSpinsGamesList .FreeSpinsGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ShowDetails{display:block}.FreeSpinsGamesButton{margin-top:12px;align-self:center;min-width:140px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsActions,.FreeSpinsDetailsPopup.Desktop .FreeSpinsActions{padding-top:16px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsIconButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsDetails,.FreeSpinsDetailsPopup.Desktop .FreeSpinsDetails{padding:20px 24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsName,.FreeSpinsDetailsPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCountdown,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCollapseButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCollapseButton{margin-bottom:12px}.FreeSpinsDetailsPopup.Tablet .PopupButton,.FreeSpinsDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:var(--emw--font-size-small-plus, 16px)}';const I=["en"],A={en:{freeSpins:"Free Spins",tooltip:"Spin the game reels without using your own money",noSpins:"No FreeSpins yet\n",tryOtherGames:"Try winning FreeSpins as rewards or playing other booster games",new:"new"}},z=(e,t)=>{const i=t;return A[void 0!==i&&I.includes(i)?i:"en"][e]},j=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.freeSpins=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newSpinIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newSpinIds=[]},this.handleSpinClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"FreeSpinClick",id:t}),this.newSpinIds=this.newSpinIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1}}spinsPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}componentWillLoad(){this.spinsPropHandler(this.freeSpins)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.freeSpins.reduce(((t,i)=>{const s=new Date(i.ExpiryDate).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeFreeSpin(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}removeFreeSpin(e){const t=this.freeSpins.findIndex((t=>t.Id===e));t>-1&&(this.freeSpins.splice(t,1),window.postMessage({type:"FreeSpinHasExpired",id:e}))}getFreeSpinClasses(){return{FreeSpinsCard:!0}}getChallengeHeaderTemplate(e){const{VendorName:i,NumberOfUsedFreeSpins:s,NumberOfFreeSpins:o}=e;return t("div",{class:"FreeSpinsCardHeader"},t("div",{class:"FreeSpinsName"},i),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s)," /",o))}getFreeSpinTemplate(e){const i=this.timers[e.Id],{VendorFreeSpinsRemainingCost:s,VendorFreeSpinsCost:o,CurrencySymbol:a}=e,n=this.newSpinIds.includes(e.Id);return t("div",{class:this.getFreeSpinClasses(),onClick:this.handleSpinClick,key:e.Id,"data-id":e.Id},t("div",{class:"SpinLabel "+(n?"ShowSpinLabel":"")},t("span",null,z("new",this.language))),this.getChallengeHeaderTemplate(e),t("div",{class:"FreeSpinsCountdownWrapper"},t("span",{class:"FreeSpinsCountdown"},i),";",t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},a,s),"/",a,o)))}getHeaderTemplate(){return t("header",{class:"FreeSpinsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"FreeSpinsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"FreeSpinsListPopupHeaderName"},z("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.freeSpins.length?t("div",{class:"FreeSpinsListWrapper"},t("div",{class:"FreeSpinsList"},this.freeSpins.map((e=>this.getFreeSpinTemplate(e))))):t("div",{class:"FreeSpinsListEmpty"},t("h2",null,z("noSpins",this.language)),t("p",null,z("tryOtherGames",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"FreeSpinsTooltipBackdrop"},t("div",{class:"FreeSpinsTooltip"},t("button",{class:"FreeSpinsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),z("tooltip",this.language))):""}render(){return t("div",{class:`FreeSpinsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{freeSpins:["spinsPropHandler"]}}};j.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.FreeSpinsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.FreeSpinsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.FreeSpinsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsListWrapper::-webkit-scrollbar{display:none}.FreeSpinsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.FreeSpinsRowWrapper{display:flex;justify-content:space-between;min-width:0}.FreeSpinsCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.FreeSpinsCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px;flex:1;min-width:0;align-items:flex-end}.FreeSpinsName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsListEmpty{padding:20px 32px}.FreeSpinsListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:var(--emw--font-size-large, 20px);line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.FreeSpinsListEmpty p{font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.FreeSpinsCountdownWrapper{display:flex;justify-content:space-between;align-items:flex-start}.FreeSpinsCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.SpinLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.SpinLabel span{display:inline-block;text-transform:uppercase;font-size:var(--emw--font-size-x-small, 10px);line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowSpinLabel{display:inline-flex}.FreeSpinsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip .FreeSpinsIconButton{top:12px;right:6px;position:absolute}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeader,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeader{padding-top:16px}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeaderName,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeaderName{font-size:var(--emw--font-size-small-plus, 16px);line-height:16px}.FreeSpinsListPopup.Tablet .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsListPopup.Tablet .FreeSpinsList,.FreeSpinsListPopup.Desktop .FreeSpinsList{padding:20px 24px 0;row-gap:20px}.FreeSpinsListPopup.Tablet .ChallengeCardHeader,.FreeSpinsListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.FreeSpinsListPopup.Tablet .FreeSpinsName,.FreeSpinsListPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsListPopup.Tablet .FreeSpinsCountdown,.FreeSpinsListPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip{padding:60px 65px;font-size:var(--emw--font-size-small-plus, 16px);line-height:20px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip .FreeSpinsIconButton{top:24px;right:24px}';const R=["en"],O={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",info:"Info",games:"Games",operatorContribution:"Operator Contribution",type:"Type",winningProbability:"Winning Probability",tc:"Terms & Conditions",jackpotIsWon:"Jackpot’s won!",loadMore:"Load More",jackpotDetails:"Jackpot Details"}},H=(e,t)=>{const i=t;return O[void 0!==i&&R.includes(i)?i:"en"][e]},$=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.disabledStatus="",this.activeTab=1,this.visibleGames=[],this.loading=!1,this.enabled=!1,this.showDetails=!1,this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.jackpot.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},this.changeJackpotStatus=e=>{e.stopPropagation(),window.postMessage({type:"JackpotChangeStatusRequest",data:{[this.jackpot.JackpotId]:!this.jackpot.Enabled}}),this.loading=!0},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})}}handleEvent(e){const{type:t,data:i}=null==e?void 0:e.data;switch(t){case"UpdateJackpotStatus":this.updateJackpotStatus(e.data.data);break;case"JoinJackpotResult":{const e=i;e.Success&&this.jackpot.JackpotId in e.JackpotIds&&(this.enabled=this.jackpot.Enabled=e.JackpotIds[this.jackpot.JackpotId]),this.loading=!1;break}}}handleJackpotUpdate(){this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}handleResize(){2===this.activeTab&&this.setVisibleGames()}componentWillLoad(){this.startCountdown(),this.enabled=this.jackpot.Enabled,this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2!==this.activeTab||this.maxVisibleGames||this.setVisibleGames()}disconnectedCallback(){this.clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}setVisibleGames(){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.jackpot.GamesInfo.slice(0,this.maxVisibleGames)}updateJackpotStatus(e){e.IsClosed?(this.clearInterval(),this.disabledStatus=e.Reason,this.activeTab=1):(this.disabledStatus="",this.jackpot.JackpotEndTime=e.JackpotEndTime,this.startCountdown())}getTopNavigationTemplate(){return t("div",{class:"JackpotDetailsNavigation"},t("button",{class:"JackpotIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),t("div",{class:"JackpotPopupName"},H("jackpots",this.language)),t("button",{class:"JackpotIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getJackpotBalance(){return function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(this.winBalance||this.balance,this.jackpot.Currency)}getJoinButtonClasses(){return{PopupButton:!0,Active:this.enabled,Loading:this.loading}}getJackpotDetailsHeaderTemplate(){return t("div",{class:"JackpotDetailsHeader"},t("div",null,t("div",{class:"JackpotType"},this.jackpot.Type),t("div",{class:"JackpotBalance"},this.getJackpotBalance())),t("div",{class:"JackpotDetailsHeaderSecondCol"},t("button",{disabled:!!this.disabledStatus,onClick:this.changeJackpotStatus,class:this.getJoinButtonClasses()},H(this.enabled?"unjoin":"join",this.language)),!!this.winBalance&&t("div",{class:"JackpotIsWon"},H("jackpotIsWon",this.language))))}getTabsTemplate(){return t("div",{class:"JackpotDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(1===this.activeTab?"Active":"")},H("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(2===this.activeTab?"Active":"")},H("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getJackpotInfoTemplate():this.getGamesTemplate()}getJackpotDetailsTemplate(){return t("div",null,t("div",{class:"JackpotDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,H("jackpotDetails",this.language))),this.showDetails&&t("p",{class:"JackpotDescription"},this.jackpot.Description))}getJackpotInfoTemplate(){return t("div",{class:"JackpotInfoTabContent"},this.jackpot.Description&&this.getJackpotDetailsTemplate(),t("div",{class:"JackpotInfo"},t("div",{class:"JackpotInfoItem"},H("operatorContribution",this.language),": ",t("span",null,this.jackpot.OperatorContributionPercent,"%")),t("div",{class:"JackpotInfoItem"},H("type",this.language),": ",t("span",null,this.jackpot.JackpotTypePresentation)),t("div",{class:"JackpotInfoItem"},H("winningProbability",this.language),": ",t("span",null,"1:",this.jackpot.Probability)),this.jackpot.JackpotRulesUrl&&t("div",{class:"JackpotInfoItem"},t("a",{class:"tc",href:this.jackpot.JackpotRulesUrl,target:"_blank"},H("tc",this.jackpot.JackpotRulesUrl)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"JackpotGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"JackpotGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"JackpotGamesList"},e)),this.visibleGames.length<this.jackpot.GamesInfo.length?t("button",{class:"PopupButton Active JackpotGamesButton",onClick:this.handleLoadMore},H("loadMore",this.language)):""]}getJackpotCountdown(){return t("div",{class:"JackpotCountdown "+(this.disabledStatus?"Suspended":"")},this.disabledStatus||this.timer)}startCountdown(){this.updateTimer(),this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.jackpot.JackpotEndTime).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getPopupClasses(){return{JackpotDetailsPopup:!0,Disabled:!!this.disabledStatus,[this.device]:!0,[this.jackpot.Type.charAt(0).toUpperCase()+this.jackpot.Type.slice(1)]:!0}}render(){return t("div",{class:this.getPopupClasses()},this.getTopNavigationTemplate(),t("div",{class:"JackpotDetailsPopupContent"},this.getJackpotDetailsHeaderTemplate(),this.getJackpotCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}static get watchers(){return{jackpot:["handleJackpotUpdate"]}}};function G(e,t){F(2,arguments);var i=f(e),s=f(t);return i.getTime()<s.getTime()}$.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none}button:focus{outline:none}button:not(:disabled){cursor:pointer}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:"";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.JackpotDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.JackpotDetailsPopup.Disabled .JackpotDetailsHeader{opacity:0.5}.JackpotDetailsPopup.Disabled .JackpotDetailsTabs{cursor:default;pointer-events:none}.JackpotDetailsPopup.Disabled .JackpotInfoItem{color:var(--emw--color-primary, #8F8B9C)}.JackpotGamesListWrapper,.JackpotInfoTabContent{overflow-x:auto;scrollbar-gutter:stable}.JackpotGamesListWrapper::-webkit-scrollbar,.JackpotInfoTabContent::-webkit-scrollbar{width:3px;background:none}.JackpotGamesListWrapper::-webkit-scrollbar-thumb,.JackpotInfoTabContent::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.JackpotDetailsNavigation{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotDetailsNavigation .JackpotIconButton{width:16px;height:16px;cursor:pointer;display:flex;justify-content:center;align-items:center}.JackpotDetailsNavigation .JackpotPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px;display:none}.JackpotDetailsPopupContent{padding:8px 18px 18px;overflow:hidden;height:100%;display:flex;flex-direction:column}.JackpotDetailsHeader{display:flex;justify-content:space-between;align-items:center;gap:12px}.JackpotDetailsHeader .JackpotDetailsHeaderSecondCol{text-align:right}.JackpotDetailsHeader .JackpotType{text-transform:uppercase;font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.JackpotDetailsHeader .JackpotBalance{margin-top:8px;font-family:Montserrat, sans-serif;font-size:18px;font-weight:var(--emw--font-weight-bold, 800);line-height:18px}.JackpotDetailsHeader .JackpotIsWon{margin-top:8px;font-family:Montserrat, sans-serif;font-weight:var(--emw--font-weight-bold, 700);font-size:12px;line-height:15px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotGamesLoadMore::before,.JackpotJoinButton.Joined::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotGamesButton{margin-top:12px;align-self:center;min-width:140px}.JackpotCountdown{font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.JackpotCountdown.Suspended{font-weight:var(--emw--font-weight-bold, 700);color:var(--emfe-w-color-white, #FFF);text-transform:capitalize}.JackpotDetailsTabsWrapper{display:flex;flex-direction:column}.JackpotDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.JackpotDetailsTabs .JackpotDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.JackpotDetailsTabs .JackpotDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.JackpotDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.JackpotInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:14px;line-height:17px}.JackpotInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.JackpotInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.JackpotGamesListWrapper{overflow:auto;flex-grow:1}.JackpotGamesList{display:flex;gap:10px;flex-wrap:wrap}.JackpotGamesList .JackpotGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.JackpotGamesList .JackpotGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.JackpotDetailsButton{margin-bottom:12px;display:flex;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.JackpotDetailsButton .Toggle{width:16px;height:16px;margin-right:4px}.JackpotDetailsButton .Closed{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg")}.JackpotDetailsButton .Open{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg")}.JackpotDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.JackpotDetailsPopup.Tablet .JackpotDetailsButton,.JackpotDetailsPopup.Desktop .JackpotDetailsButton{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotDescription,.JackpotDetailsPopup.Desktop .JackpotDescription{font-size:var(--emw--font-size-medium, 16px);line-height:22px}.JackpotDetailsPopup.Tablet .JackpotPopupName,.JackpotDetailsPopup.Desktop .JackpotPopupName{display:block}.JackpotDetailsPopup.Tablet .JackpotDetailsNavigation,.JackpotDetailsPopup.Desktop .JackpotDetailsNavigation{padding-top:16px}.JackpotDetailsPopup.Tablet .JackpotIconButton,.JackpotDetailsPopup.Desktop .JackpotIconButton{width:24px;height:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsPopupContent,.JackpotDetailsPopup.Desktop .JackpotDetailsPopupContent{padding:20px 24px 30px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Tablet .JackpotType,.JackpotDetailsPopup.Desktop .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotType{line-height:27px;font-size:22px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotBalance{font-weight:var(--emw--font-weight-bold, 700)}.JackpotDetailsPopup.Tablet .PopupButton,.JackpotDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:16px}.JackpotDetailsPopup.Tablet .JackpotCountdown,.JackpotDetailsPopup.Desktop .JackpotCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotInfoItem,.JackpotDetailsPopup.Desktop .JackpotInfoItem{font-size:16px;line-height:20px}.JackpotDetailsPopup.Tablet .JackpotIsWon,.JackpotDetailsPopup.Desktop .JackpotIsWon{font-size:14px;line-height:17px}.JackpotDetailsPopup.Tablet .JackpotGamesList,.JackpotDetailsPopup.Desktop .JackpotGamesList{gap:12px}.JackpotDetailsPopup.Tablet .JackpotGamesList .JackpotGamesListItem,.JackpotDetailsPopup.Desktop .JackpotGamesList .JackpotGamesListItem{width:calc(20% - 10px)}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs .JackpotDetailsTab,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs .JackpotDetailsTab{font-size:16px;line-height:20px}';const W=["en"],_={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",tooltip:"A payout that increases each time the game is played but the jackpot is not won",mega:"Mega",major:"Major",minor:"Minor",suspended:"Suspended Jackpot",allJackpotsSuspended:"Unfortunately, there are no available jackpots to join. Please, try again later.",jackpotIsWon:"Jackpot is Won",termsAndConditions:"Terms and Conditions",winingProbability:"Winning Probability",type:"Type",operatorContribution:"Operator Contribution",outdatedJackpotCountdown:"We are going to remove this Jackpot in 30 days"}},N=(e,t)=>{const i=t;return _[void 0!==i&&W.includes(i)?i:"en"][e]},U=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.jackpots=[],this.buttonsLoadingStates={},this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeJackpotStatus=e=>{e.stopPropagation();const t=+e.currentTarget.getAttribute("data-id"),i=e.currentTarget.hasAttribute("data-joined");window.postMessage({type:"JackpotChangeStatusRequest",data:{[t]:!i}}),this.buttonsLoadingStates=Object.assign(Object.assign({},this.buttonsLoadingStates),{[t]:!0})},this.handleJackpotClick=e=>{const t=+e.currentTarget.getAttribute("data-id");window.postMessage({type:"JackpotClick",id:t})}}jackpotsPropHandler(e){!this.interval&&e.length&&this.startCountdown(),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){const{type:t,data:i}=e.data;switch(t){case"UpdateJackpotStatus":const e=i;this.jackpots=this.jackpots.map((t=>t.JackpotId===e.JackpotId?Object.assign(Object.assign({},t),{IsClosed:e.IsClosed,JackpotEndTime:t.JackpotEndTime}):t));break;case"JoinJackpotResult":const t=i,s=Object.keys(t.JackpotIds);t.Success&&s.length>0&&(this.jackpots=this.jackpots.map((e=>{const i=s.find((t=>String(t)===String(e.JackpotId)));return i?Object.assign(Object.assign({},e),{Enabled:t.JackpotIds[i]}):e}))),this.buttonsLoadingStates=Object.fromEntries(Object.entries(this.buttonsLoadingStates).filter((([e])=>!s.includes(e))))}}startCountdown(){this.updateTimers(),this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.jackpots.reduce(((t,i)=>{const s=new Date(i.JackpotEndTime).getTime()-e;let o="00h:00m:00s";const{days:a,hours:n,minutes:r,seconds:l}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};return o="00"===a?`${n}h:${r}m:${l}s`:`${a}d:${n}h:${r}m`,Object.assign(Object.assign({},t),{[i.JackpotId]:o})}),{})}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getJackpotClasses(e){return{JackpotCard:!0,JackpotCardSuspended:e.IsClosed,InProgress:e.Enabled&&!e.IsClosed}}getJackpotHeaderTemplate(e){const i=!!e.WinBalance,s=i?e.WinBalance:e.Balance,o=N(e.Type,this.language),a=N("suspended",this.language),n=(null==e?void 0:e.IsClosed)?a:o,r=`JackpotBalance Jackpot${N(e.Type,this.language)}`,l=e.Enabled&&!(null==e?void 0:e.IsClosed)?"JackpotJoinButton Joined":"JackpotJoinButton",p=N(e.Enabled&&!(null==e?void 0:e.IsClosed)?"unjoin":"join",this.language),c=!!this.buttonsLoadingStates[e.JackpotId]||(null==e?void 0:e.IsClosed)||G(new Date(e.JackpotEndTime),new Date);return t("div",{class:"JackpotCardHeader"},t("div",{class:"JackpotTitle"},t("span",{class:"JackpotName"},n),t("span",{class:r},function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(s,e.Currency))),i?t("span",{class:"JackpotWon"},N("jackpotIsWon",this.language)):t("button",{class:l,onClick:this.changeJackpotStatus,"data-id":e.JackpotId,"data-joined":e.Enabled,disabled:c},p))}getJackpotDescriptionTemplate(e){const i=e.OperatorContributionPercent?e.OperatorContributionPercent+"%":"",s=e.Probability?e.Probability+"%":"",o=G(new Date(e.JackpotEndTime),new Date)?N("outdatedJackpotCountdown",this.language):this.timers[e.JackpotId],a=N("operatorContribution",this.language),n=N("type",this.language),r=N("winingProbability",this.language);return t("div",{class:"JackpotCardDescription"},t("span",{class:"JackpotCountdown"},o),t("div",{class:"JackpotCardDescriptionBlock"},t("div",{class:"JackpotCardDescriptionColumn"},i&&this.renderDesciptionRowInfo(`${a}:`,i),this.renderDesciptionRowInfo(`${n}:`,e.JackpotTypePresentation)),t("div",{class:"JackpotCardDescriptionColumn"},s&&this.renderDesciptionRowInfo(`${r}:`,s),t("a",{href:e.JackpotRulesUrl,target:"_blank"},N("termsAndConditions",this.language)))))}renderDesciptionRowInfo(e,i){return t("div",{class:"JackpotCardDescriptionRow"},t("span",null,e),t("span",{class:"JackpotDescriptionValue"},i))}getJackpotTemplate(e){const i=!(null==e?void 0:e.WinBalance);return t("div",{class:this.getJackpotClasses(e),onClick:this.handleJackpotClick,key:e.JackpotId,"data-id":e.JackpotId},this.getJackpotHeaderTemplate(e),i&&this.getJackpotDescriptionTemplate(e))}getHeaderTemplate(){return t("header",{class:"JackpotsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"JackpotsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"JackpotsListPopupHeaderName"},N("jackpots",this.language)),t("button",{class:"JackpotsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close jackpots list"})))}getListTemplate(){const e=this.jackpots.every((e=>e.IsClosed));return this.jackpots.length?t("div",{class:"JackpotsListWrapper"},e&&t("div",{class:"JackpotsListSuspended"},t("h2",null,N("allJackpotsSuspended",this.language))),t("div",{class:"JackpotsList"},this.jackpots.map((e=>this.getJackpotTemplate(e))))):t("div",{class:"JackpotsListSuspended"},t("h2",null,N("allJackpotsSuspended",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"JackpotsTooltipBackdrop"},t("div",{class:"JackpotsTooltip"},t("button",{class:"JackpotsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),N("tooltip",this.language))):""}render(){return t("div",{class:`JackpotsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{jackpots:["jackpotsPropHandler"]}}};U.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}body{margin:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.JackpotsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:var(--emw--border-radius-medium, 8px);overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.JackpotsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotsIconButton{width:16px;height:16px;cursor:pointer}.JackpotsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.JackpotsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.JackpotsListWrapper::-webkit-scrollbar{display:none}.JackpotsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.JackpotCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:var(--emw--border-radius-small, 6px);position:relative;cursor:pointer}.JackpotJoinButton:not([disabled]).Joined::before,.JackpotCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotCard.JackpotCardSuspended *{color:var(--emw--color-primary, #8F8B9C)}.JackpotCard.JackpotCardSuspended .JackpotBalance,.JackpotCard.JackpotCardSuspended .JackpotWon{-webkit-text-fill-color:var(--emw--color-primary, #8F8B9C)}.JackpotCardHeader{display:flex;justify-content:space-between;gap:24px}.JackpotTitle{display:flex;flex-direction:column;justify-content:space-between}.JackpotName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;margin-bottom:4px}.JackpotMega,.JackpotWon{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%)}.JackpotMajor{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%)}.JackpotMinor{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%)}.JackpotBalance,.JackpotWon{font-weight:bold;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.JackpotCardDescription{display:flex;flex-direction:column;margin-top:12px}.JackpotCardDescriptionRow{display:flex;align-items:center;color:var(--emw--color-primary, #8F8B9C);font-size:12px;line-height:12px}.JackpotCardDescriptionRow .JackpotDescriptionValue{font-weight:600;margin-left:2px}.JackpotCardDescriptionColumn{display:flex;flex-direction:column;row-gap:4px}.JackpotCardDescriptionBlock{display:flex;justify-content:space-between;column-gap:14px}.JackpotCardDescriptionBlock a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px;font-size:11px}.JackpotJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.JackpotJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.JackpotJoinButton.Joined:not([disabled])::before{border-radius:99px}.JackpotJoinButton[disabled]{opacity:0.5;pointer-events:none;cursor:auto}.JackpotsListSuspended{padding:20px 19px}.JackpotsListSuspended h2{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);font-weight:400}.JackpotCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px;margin-bottom:12px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:6px;position:absolute}.JackpotsListPopup.Tablet .JackpotsListPopupHeader,.JackpotsListPopup.Desktop .JackpotsListPopupHeader{padding-top:16px}.JackpotsListPopup.Tablet .JackpotsListPopupHeaderName,.JackpotsListPopup.Desktop .JackpotsListPopupHeaderName{font-size:16px;line-height:16px}.JackpotsListPopup.Tablet .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotsIconButton{width:24px;height:24px}.JackpotsListPopup.Tablet .JackpotsList,.JackpotsListPopup.Desktop .JackpotsList{padding:20px 24px 0;row-gap:20px}.JackpotsListPopup.Tablet .JackpotCardHeader,.JackpotsListPopup.Desktop .JackpotCardHeader{margin-bottom:16px}.JackpotsListPopup.Tablet .JackpotName,.JackpotsListPopup.Desktop .JackpotName{line-height:27px;font-size:22px}.JackpotsListPopup.Tablet .JackpotJoinButton,.JackpotsListPopup.Desktop .JackpotJoinButton{min-width:100px;height:36px;font-size:16px}.JackpotsListPopup.Tablet .JackpotCountdown,.JackpotsListPopup.Desktop .JackpotCountdown{font-size:14px;line-height:14px}.JackpotsListPopup.Tablet .JackpotTooltip,.JackpotsListPopup.Desktop .JackpotTooltip{padding:60px 65px;font-size:16px;line-height:20px}.JackpotsListPopup.Tablet .JackpotTooltip .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotTooltip .JackpotsIconButton{top:24px;right:24px}';const q=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.showAnimation=!1,this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.isLoading||this.closeModal.emit(this.modalType)},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return t("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device} ${this.showAnimation&&"ShowAnimation"}`},t("div",{class:"ModalWinAnimation"}),t("div",{class:"ModalContent GradientBorder"},t("div",{class:"IconCloseContainer"},t("button",{class:"IconCloseButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Сlose modal"}))),this.contentIcon?t("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):null,t("div",{class:"ModalHeader"},t("h1",null,this.header)),t("div",{class:"ModalBody"},t("slot",{name:"body"})),t("div",{class:"ModalFooter"},t("slot",{name:"footer"}))))}get host(){return s(this)}};q.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:"Montserrat", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:"Inter", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}';const V=["en"],Q={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward",jackpotWin:"Total Jackpot Win!"}},K=(e,t)=>{const i=t;return Q[void 0!==i&&V.includes(i)?i:"en"][e]},Y=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=e=>{const t=e.currentTarget.getAttribute("data-type");this.closeModal.emit(t)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.isModalOpen=e=>Boolean(this.openModals.find((t=>t===e)))}openModalHandler(e){const{modalType:t,rewardMessage:i,hasError:s,confirmationData:o,winAmount:a}=e.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,t],this.rewardMessage=i,this.hasError=s,o&&(this.confirmationData=o)}closeModalHandler(e){this.openModals=this.openModals.filter((t=>t!==e.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:e}=this.confirmationData||{};return t("div",{class:`ModalContainer ${this.device}`},t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},t("div",{slot:"body"},t("p",null,K("won",this.language)," ",t("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&t("p",{class:"SupportInfo"},K("supportInfo",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},K("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},t("div",{slot:"body"},t("div",{class:"JackpotWinText"},K("jackpotWin",this.language)),t("div",{class:"JackpotWinAmount"},(i=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(i)}`))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},K("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:K(e?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},t("div",{slot:"body"},t("p",{class:"LeftAlign"},K("desc",this.language)),t("p",{class:"LeftAlign"},K(e?"joinQuestion":"unJoinQuestion",this.language))),t("div",{slot:"footer",class:"ManyActions"},t("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},K(e?"joinConfirm":"unJoinConfirm",this.language)),t("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},t("div",{class:"GradientText"},K(e?"joinReject":"unJoinReject",this.language))))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:K("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},t("div",{slot:"body"},t("span",null,K("contactSupport",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},K("okContinue",this.language)))));var i}get host(){return s(this)}};Y.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';const X=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return t("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},t("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},t("slot",{name:"Title"},t("div",null)),t("slot",{name:"Percent"},t("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),t("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},t("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return s(this)}};X.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";export{n as casino_engagement_suite_bar,g as casino_engagement_suite_challenges_details,D as casino_engagement_suite_challenges_list,P as casino_engagement_suite_container,M as casino_engagement_suite_free_spins_details,j as casino_engagement_suite_free_spins_list,$ as casino_engagement_suite_jackpot_details,U as casino_engagement_suite_jackpots_list,q as casino_engagement_suite_modal,Y as casino_engagement_suite_modal_container,X as casino_engagement_suite_progress_bar}
@@ -112,7 +112,8 @@ const CasinoEngagementSuiteBar = class {
112
112
  }
113
113
  getJackpotsTemplate() {
114
114
  return this.jackpots.map((jackpot) => {
115
- return index.h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, index.h("div", { class: "JackpotType" }, jackpot.Type), index.h("span", { class: "JackpotBalance" }, formatBalance$4(jackpot.Balance, jackpot.Currency)));
115
+ const jackpotBalance = formatBalance$4(jackpot.WinBalance || jackpot.Balance, jackpot.Currency);
116
+ return index.h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, index.h("div", { class: "JackpotType" }, jackpot.Type), index.h("span", { class: "JackpotBalance" }, jackpotBalance));
116
117
  });
117
118
  }
118
119
  render() {
@@ -1104,6 +1105,9 @@ const CasinoEngagementSuiteContainer = class {
1104
1105
  this.openModal.emit(event);
1105
1106
  break;
1106
1107
  }
1108
+ case 'UpdateJackpotBalance':
1109
+ this.updateJackpotBalance(e.data.data);
1110
+ break;
1107
1111
  }
1108
1112
  }
1109
1113
  componentDidLoad() {
@@ -1154,9 +1158,7 @@ const CasinoEngagementSuiteContainer = class {
1154
1158
  if (activeChallenge) {
1155
1159
  const activeLevel = activeChallenge.LevelProgresses
1156
1160
  .find(progress => progress.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
1157
- if (activeLevel) {
1158
- this.challengePercent = `${activeLevel.ProgressPercentage}%`;
1159
- }
1161
+ this.challengePercent = activeLevel ? `${activeLevel.ProgressPercentage}%` : '0%';
1160
1162
  }
1161
1163
  else {
1162
1164
  this.challengePercent = '—';
@@ -1191,6 +1193,19 @@ const CasinoEngagementSuiteContainer = class {
1191
1193
  : this.inProgressChallenges.filter(id => id !== challenge.Id);
1192
1194
  }
1193
1195
  }
1196
+ updateJackpotBalance(updatedJackpots) {
1197
+ this.jackpots = this.jackpots.map(jackpot => {
1198
+ const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
1199
+ return updatedJackpot
1200
+ ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
1201
+ });
1202
+ if (this.showJackpotDetails) {
1203
+ const updatedSelectedJackpot = this.jackpots.find(jackpot => jackpot.JackpotId === this.selectedJackpotId);
1204
+ if (updatedSelectedJackpot) {
1205
+ this.selectedJackpot = Object.assign({}, updatedSelectedJackpot);
1206
+ }
1207
+ }
1208
+ }
1194
1209
  getChallengesWidgets() {
1195
1210
  return index.h("div", null, index.h("div", { class: this.showChallengesList ? 'Backdrop Opened' : 'Backdrop' }, index.h("casino-engagement-suite-challenges-list", { device: this.device, class: "CasinoEngagementSuiteDialog", onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), challenges: this.challenges, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds })), index.h("div", { class: this.showChallengeDetails ? 'Backdrop Opened' : 'Backdrop' }, this.showChallengeDetails && (index.h("casino-engagement-suite-challenges-details", { device: this.device, class: "CasinoEngagementSuiteDialog", onBack: this.handleChallengePopupBack, onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), "game-slug": this.gameSlug, challenge: this.selectedChallenge, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds }))));
1196
1211
  }
@@ -1732,16 +1747,12 @@ const CasinoEngagementSuiteJackpotDetails = class {
1732
1747
  this.loading = false;
1733
1748
  break;
1734
1749
  }
1735
- case 'UpdateJackpotBalance': {
1736
- const jackpotUpdate = data
1737
- .find((updateMessage => updateMessage.JackpotId === this.jackpot.JackpotId));
1738
- if (jackpotUpdate) {
1739
- this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
1740
- this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
1741
- }
1742
- }
1743
1750
  }
1744
1751
  }
1752
+ handleJackpotUpdate() {
1753
+ this.balance = this.jackpot.Balance;
1754
+ this.winBalance = this.jackpot.WinBalance;
1755
+ }
1745
1756
  handleResize() {
1746
1757
  this.activeTab === 2 && this.setVisibleGames();
1747
1758
  }
@@ -1809,7 +1820,7 @@ const CasinoEngagementSuiteJackpotDetails = class {
1809
1820
  getJackpotDetailsHeaderTemplate() {
1810
1821
  return (index.h("div", { class: "JackpotDetailsHeader" }, index.h("div", null, index.h("div", { class: "JackpotType" }, this.jackpot.Type), index.h("div", { class: "JackpotBalance" }, this.getJackpotBalance())), index.h("div", { class: "JackpotDetailsHeaderSecondCol" }, index.h("button", { disabled: !!this.disabledStatus, onClick: this.changeJackpotStatus, class: this.getJoinButtonClasses() }, this.enabled
1811
1822
  ? translate$2('unjoin', this.language)
1812
- : translate$2('join', this.language)), this.winBalance && index.h("div", { class: "JackpotIsWon" }, translate$2('jackpotIsWon', this.language)))));
1823
+ : translate$2('join', this.language)), !!this.winBalance && index.h("div", { class: "JackpotIsWon" }, translate$2('jackpotIsWon', this.language)))));
1813
1824
  }
1814
1825
  getTabsTemplate() {
1815
1826
  return index.h("div", { class: "JackpotDetailsTabs" }, index.h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate$2('info', this.language)), index.h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate$2('games', this.language)));
@@ -1876,6 +1887,9 @@ const CasinoEngagementSuiteJackpotDetails = class {
1876
1887
  return index.h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), index.h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
1877
1888
  }
1878
1889
  get host() { return index.getElement(this); }
1890
+ static get watchers() { return {
1891
+ "jackpot": ["handleJackpotUpdate"]
1892
+ }; }
1879
1893
  };
1880
1894
  CasinoEngagementSuiteJackpotDetails.style = casinoEngagementSuiteJackpotDetailsCss;
1881
1895
 
@@ -2027,20 +2041,13 @@ const CasinoEngagementSuiteJackpotsList = class {
2027
2041
  handleEvent(e) {
2028
2042
  const { type, data } = e.data;
2029
2043
  switch (type) {
2030
- case 'UpdateJackpotBalance':
2031
- const updatedJackpots = e.data.data;
2032
- this.jackpots = this.jackpots.map(jackpot => {
2033
- const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
2034
- return updatedJackpot
2035
- ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
2036
- });
2037
- break;
2038
2044
  case 'UpdateJackpotStatus':
2039
2045
  const statusUpdate = data;
2040
- const index = this.jackpots.findIndex((jackpot) => jackpot.JackpotId === statusUpdate.JackpotId);
2041
- if (index !== 1) {
2042
- this.jackpots[index].IsClosed = statusUpdate.IsClosed;
2043
- }
2046
+ this.jackpots = this.jackpots.map(jackpot => {
2047
+ const jackpotToUpdate = jackpot.JackpotId === statusUpdate.JackpotId;
2048
+ return jackpotToUpdate
2049
+ ? Object.assign(Object.assign({}, jackpot), { IsClosed: statusUpdate.IsClosed, JackpotEndTime: jackpot.JackpotEndTime }) : jackpot;
2050
+ });
2044
2051
  break;
2045
2052
  case 'JoinJackpotResult':
2046
2053
  const joinJackpotResult = data;
@@ -2115,20 +2122,19 @@ const CasinoEngagementSuiteJackpotsList = class {
2115
2122
  const buttonText = jackpot.Enabled && !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed)
2116
2123
  ? translate$1('unjoin', this.language)
2117
2124
  : translate$1('join', this.language);
2118
- const buttonIsVisible = !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
2119
- const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId];
2120
- return (index.h("div", { class: "JackpotCardHeader" }, index.h("div", { class: "JackpotTitle" }, index.h("span", { class: "JackpotName" }, jackpotLabel), index.h("span", { class: jackpotClasses }, formatBalance$1(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (index.h("span", { class: "JackpotWon" }, translate$1('jackpotIsWon', this.language))) : (buttonIsVisible && (index.h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText)))));
2125
+ const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId] || (jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
2126
+ return (index.h("div", { class: "JackpotCardHeader" }, index.h("div", { class: "JackpotTitle" }, index.h("span", { class: "JackpotName" }, jackpotLabel), index.h("span", { class: jackpotClasses }, formatBalance$1(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (index.h("span", { class: "JackpotWon" }, translate$1('jackpotIsWon', this.language))) : (index.h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText))));
2121
2127
  }
2122
2128
  getJackpotDescriptionTemplate(jackpot) {
2123
- const operatorContributionPercent = jackpot.OperatorContributionPercent + '%';
2124
- const winingProbabilityPercent = jackpot.Probability + '%';
2129
+ const operatorContributionPercent = jackpot.OperatorContributionPercent ? jackpot.OperatorContributionPercent + '%' : '';
2130
+ const winingProbabilityPercent = jackpot.Probability ? jackpot.Probability + '%' : '';
2125
2131
  const countdownValue = isBefore(new Date(jackpot.JackpotEndTime), new Date())
2126
2132
  ? translate$1('outdatedJackpotCountdown', this.language)
2127
2133
  : this.timers[jackpot.JackpotId];
2128
2134
  const operatorContibutionLabel = translate$1('operatorContribution', this.language);
2129
2135
  const typeLabel = translate$1('type', this.language);
2130
2136
  const winingProbabilityLabel = translate$1('winingProbability', this.language);
2131
- return (index.h("div", { class: "JackpotCardDescription" }, index.h("span", { class: "JackpotCountdown" }, countdownValue), index.h("div", { class: "JackpotCardDescriptionBlock" }, index.h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), index.h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), index.h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate$1('termsAndConditions', this.language))))));
2137
+ return (index.h("div", { class: "JackpotCardDescription" }, index.h("span", { class: "JackpotCountdown" }, countdownValue), index.h("div", { class: "JackpotCardDescriptionBlock" }, index.h("div", { class: "JackpotCardDescriptionColumn" }, operatorContributionPercent && this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), index.h("div", { class: "JackpotCardDescriptionColumn" }, winingProbabilityPercent && this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), index.h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate$1('termsAndConditions', this.language))))));
2132
2138
  }
2133
2139
  renderDesciptionRowInfo(title, value) {
2134
2140
  return (index.h("div", { class: "JackpotCardDescriptionRow" }, index.h("span", null, title), index.h("span", { class: "JackpotDescriptionValue" }, value)));
@@ -207,6 +207,9 @@ export class CasinoEngagementSuiteContainer {
207
207
  this.openModal.emit(event);
208
208
  break;
209
209
  }
210
+ case 'UpdateJackpotBalance':
211
+ this.updateJackpotBalance(e.data.data);
212
+ break;
210
213
  }
211
214
  }
212
215
  componentDidLoad() {
@@ -257,9 +260,7 @@ export class CasinoEngagementSuiteContainer {
257
260
  if (activeChallenge) {
258
261
  const activeLevel = activeChallenge.LevelProgresses
259
262
  .find(progress => progress.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
260
- if (activeLevel) {
261
- this.challengePercent = `${activeLevel.ProgressPercentage}%`;
262
- }
263
+ this.challengePercent = activeLevel ? `${activeLevel.ProgressPercentage}%` : '0%';
263
264
  }
264
265
  else {
265
266
  this.challengePercent = '—';
@@ -294,6 +295,19 @@ export class CasinoEngagementSuiteContainer {
294
295
  : this.inProgressChallenges.filter(id => id !== challenge.Id);
295
296
  }
296
297
  }
298
+ updateJackpotBalance(updatedJackpots) {
299
+ this.jackpots = this.jackpots.map(jackpot => {
300
+ const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
301
+ return updatedJackpot
302
+ ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
303
+ });
304
+ if (this.showJackpotDetails) {
305
+ const updatedSelectedJackpot = this.jackpots.find(jackpot => jackpot.JackpotId === this.selectedJackpotId);
306
+ if (updatedSelectedJackpot) {
307
+ this.selectedJackpot = Object.assign({}, updatedSelectedJackpot);
308
+ }
309
+ }
310
+ }
297
311
  getChallengesWidgets() {
298
312
  return h("div", null,
299
313
  h("div", { class: this.showChallengesList ? 'Backdrop Opened' : 'Backdrop' },
@@ -110,7 +110,8 @@ const CasinoEngagementSuiteBar = /*@__PURE__*/ proxyCustomElement(class extends
110
110
  }
111
111
  getJackpotsTemplate() {
112
112
  return this.jackpots.map((jackpot) => {
113
- return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, h("div", { class: "JackpotType" }, jackpot.Type), h("span", { class: "JackpotBalance" }, formatBalance(jackpot.Balance, jackpot.Currency)));
113
+ const jackpotBalance = formatBalance(jackpot.WinBalance || jackpot.Balance, jackpot.Currency);
114
+ return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, h("div", { class: "JackpotType" }, jackpot.Type), h("span", { class: "JackpotBalance" }, jackpotBalance));
114
115
  });
115
116
  }
116
117
  render() {
@@ -293,6 +293,9 @@ const CasinoEngagementSuiteContainer$1 = /*@__PURE__*/ proxyCustomElement(class
293
293
  this.openModal.emit(event);
294
294
  break;
295
295
  }
296
+ case 'UpdateJackpotBalance':
297
+ this.updateJackpotBalance(e.data.data);
298
+ break;
296
299
  }
297
300
  }
298
301
  componentDidLoad() {
@@ -343,9 +346,7 @@ const CasinoEngagementSuiteContainer$1 = /*@__PURE__*/ proxyCustomElement(class
343
346
  if (activeChallenge) {
344
347
  const activeLevel = activeChallenge.LevelProgresses
345
348
  .find(progress => progress.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
346
- if (activeLevel) {
347
- this.challengePercent = `${activeLevel.ProgressPercentage}%`;
348
- }
349
+ this.challengePercent = activeLevel ? `${activeLevel.ProgressPercentage}%` : '0%';
349
350
  }
350
351
  else {
351
352
  this.challengePercent = '—';
@@ -380,6 +381,19 @@ const CasinoEngagementSuiteContainer$1 = /*@__PURE__*/ proxyCustomElement(class
380
381
  : this.inProgressChallenges.filter(id => id !== challenge.Id);
381
382
  }
382
383
  }
384
+ updateJackpotBalance(updatedJackpots) {
385
+ this.jackpots = this.jackpots.map(jackpot => {
386
+ const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
387
+ return updatedJackpot
388
+ ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
389
+ });
390
+ if (this.showJackpotDetails) {
391
+ const updatedSelectedJackpot = this.jackpots.find(jackpot => jackpot.JackpotId === this.selectedJackpotId);
392
+ if (updatedSelectedJackpot) {
393
+ this.selectedJackpot = Object.assign({}, updatedSelectedJackpot);
394
+ }
395
+ }
396
+ }
383
397
  getChallengesWidgets() {
384
398
  return h("div", null, h("div", { class: this.showChallengesList ? 'Backdrop Opened' : 'Backdrop' }, h("casino-engagement-suite-challenges-list", { device: this.device, class: "CasinoEngagementSuiteDialog", onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), challenges: this.challenges, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds })), h("div", { class: this.showChallengeDetails ? 'Backdrop Opened' : 'Backdrop' }, this.showChallengeDetails && (h("casino-engagement-suite-challenges-details", { device: this.device, class: "CasinoEngagementSuiteDialog", onBack: this.handleChallengePopupBack, onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), "game-slug": this.gameSlug, challenge: this.selectedChallenge, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds }))));
385
399
  }
@@ -139,16 +139,12 @@ const CasinoEngagementSuiteJackpotDetails = /*@__PURE__*/ proxyCustomElement(cla
139
139
  this.loading = false;
140
140
  break;
141
141
  }
142
- case 'UpdateJackpotBalance': {
143
- const jackpotUpdate = data
144
- .find((updateMessage => updateMessage.JackpotId === this.jackpot.JackpotId));
145
- if (jackpotUpdate) {
146
- this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
147
- this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
148
- }
149
- }
150
142
  }
151
143
  }
144
+ handleJackpotUpdate() {
145
+ this.balance = this.jackpot.Balance;
146
+ this.winBalance = this.jackpot.WinBalance;
147
+ }
152
148
  handleResize() {
153
149
  this.activeTab === 2 && this.setVisibleGames();
154
150
  }
@@ -216,7 +212,7 @@ const CasinoEngagementSuiteJackpotDetails = /*@__PURE__*/ proxyCustomElement(cla
216
212
  getJackpotDetailsHeaderTemplate() {
217
213
  return (h("div", { class: "JackpotDetailsHeader" }, h("div", null, h("div", { class: "JackpotType" }, this.jackpot.Type), h("div", { class: "JackpotBalance" }, this.getJackpotBalance())), h("div", { class: "JackpotDetailsHeaderSecondCol" }, h("button", { disabled: !!this.disabledStatus, onClick: this.changeJackpotStatus, class: this.getJoinButtonClasses() }, this.enabled
218
214
  ? translate('unjoin', this.language)
219
- : translate('join', this.language)), this.winBalance && h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
215
+ : translate('join', this.language)), !!this.winBalance && h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
220
216
  }
221
217
  getTabsTemplate() {
222
218
  return h("div", { class: "JackpotDetailsTabs" }, h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate('info', this.language)), h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate('games', this.language)));
@@ -283,6 +279,9 @@ const CasinoEngagementSuiteJackpotDetails = /*@__PURE__*/ proxyCustomElement(cla
283
279
  return h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
284
280
  }
285
281
  get host() { return this; }
282
+ static get watchers() { return {
283
+ "jackpot": ["handleJackpotUpdate"]
284
+ }; }
286
285
  static get style() { return casinoEngagementSuiteJackpotDetailsCss; }
287
286
  }, [1, "casino-engagement-suite-jackpot-details", {
288
287
  "clientStyling": [513, "client-styling"],
@@ -151,20 +151,13 @@ const CasinoEngagementSuiteJackpotsList = /*@__PURE__*/ proxyCustomElement(class
151
151
  handleEvent(e) {
152
152
  const { type, data } = e.data;
153
153
  switch (type) {
154
- case 'UpdateJackpotBalance':
155
- const updatedJackpots = e.data.data;
156
- this.jackpots = this.jackpots.map(jackpot => {
157
- const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
158
- return updatedJackpot
159
- ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
160
- });
161
- break;
162
154
  case 'UpdateJackpotStatus':
163
155
  const statusUpdate = data;
164
- const index = this.jackpots.findIndex((jackpot) => jackpot.JackpotId === statusUpdate.JackpotId);
165
- if (index !== 1) {
166
- this.jackpots[index].IsClosed = statusUpdate.IsClosed;
167
- }
156
+ this.jackpots = this.jackpots.map(jackpot => {
157
+ const jackpotToUpdate = jackpot.JackpotId === statusUpdate.JackpotId;
158
+ return jackpotToUpdate
159
+ ? Object.assign(Object.assign({}, jackpot), { IsClosed: statusUpdate.IsClosed, JackpotEndTime: jackpot.JackpotEndTime }) : jackpot;
160
+ });
168
161
  break;
169
162
  case 'JoinJackpotResult':
170
163
  const joinJackpotResult = data;
@@ -239,20 +232,19 @@ const CasinoEngagementSuiteJackpotsList = /*@__PURE__*/ proxyCustomElement(class
239
232
  const buttonText = jackpot.Enabled && !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed)
240
233
  ? translate('unjoin', this.language)
241
234
  : translate('join', this.language);
242
- const buttonIsVisible = !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
243
- const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId];
244
- return (h("div", { class: "JackpotCardHeader" }, h("div", { class: "JackpotTitle" }, h("span", { class: "JackpotName" }, jackpotLabel), h("span", { class: jackpotClasses }, formatBalance(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (h("span", { class: "JackpotWon" }, translate('jackpotIsWon', this.language))) : (buttonIsVisible && (h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText)))));
235
+ const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId] || (jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
236
+ return (h("div", { class: "JackpotCardHeader" }, h("div", { class: "JackpotTitle" }, h("span", { class: "JackpotName" }, jackpotLabel), h("span", { class: jackpotClasses }, formatBalance(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (h("span", { class: "JackpotWon" }, translate('jackpotIsWon', this.language))) : (h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText))));
245
237
  }
246
238
  getJackpotDescriptionTemplate(jackpot) {
247
- const operatorContributionPercent = jackpot.OperatorContributionPercent + '%';
248
- const winingProbabilityPercent = jackpot.Probability + '%';
239
+ const operatorContributionPercent = jackpot.OperatorContributionPercent ? jackpot.OperatorContributionPercent + '%' : '';
240
+ const winingProbabilityPercent = jackpot.Probability ? jackpot.Probability + '%' : '';
249
241
  const countdownValue = isBefore(new Date(jackpot.JackpotEndTime), new Date())
250
242
  ? translate('outdatedJackpotCountdown', this.language)
251
243
  : this.timers[jackpot.JackpotId];
252
244
  const operatorContibutionLabel = translate('operatorContribution', this.language);
253
245
  const typeLabel = translate('type', this.language);
254
246
  const winingProbabilityLabel = translate('winingProbability', this.language);
255
- return (h("div", { class: "JackpotCardDescription" }, h("span", { class: "JackpotCountdown" }, countdownValue), h("div", { class: "JackpotCardDescriptionBlock" }, h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate('termsAndConditions', this.language))))));
247
+ return (h("div", { class: "JackpotCardDescription" }, h("span", { class: "JackpotCountdown" }, countdownValue), h("div", { class: "JackpotCardDescriptionBlock" }, h("div", { class: "JackpotCardDescriptionColumn" }, operatorContributionPercent && this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), h("div", { class: "JackpotCardDescriptionColumn" }, winingProbabilityPercent && this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate('termsAndConditions', this.language))))));
256
248
  }
257
249
  renderDesciptionRowInfo(title, value) {
258
250
  return (h("div", { class: "JackpotCardDescriptionRow" }, h("span", null, title), h("span", { class: "JackpotDescriptionValue" }, value)));
@@ -108,7 +108,8 @@ const CasinoEngagementSuiteBar = class {
108
108
  }
109
109
  getJackpotsTemplate() {
110
110
  return this.jackpots.map((jackpot) => {
111
- return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, h("div", { class: "JackpotType" }, jackpot.Type), h("span", { class: "JackpotBalance" }, formatBalance$4(jackpot.Balance, jackpot.Currency)));
111
+ const jackpotBalance = formatBalance$4(jackpot.WinBalance || jackpot.Balance, jackpot.Currency);
112
+ return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, h("div", { class: "JackpotType" }, jackpot.Type), h("span", { class: "JackpotBalance" }, jackpotBalance));
112
113
  });
113
114
  }
114
115
  render() {
@@ -1100,6 +1101,9 @@ const CasinoEngagementSuiteContainer = class {
1100
1101
  this.openModal.emit(event);
1101
1102
  break;
1102
1103
  }
1104
+ case 'UpdateJackpotBalance':
1105
+ this.updateJackpotBalance(e.data.data);
1106
+ break;
1103
1107
  }
1104
1108
  }
1105
1109
  componentDidLoad() {
@@ -1150,9 +1154,7 @@ const CasinoEngagementSuiteContainer = class {
1150
1154
  if (activeChallenge) {
1151
1155
  const activeLevel = activeChallenge.LevelProgresses
1152
1156
  .find(progress => progress.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
1153
- if (activeLevel) {
1154
- this.challengePercent = `${activeLevel.ProgressPercentage}%`;
1155
- }
1157
+ this.challengePercent = activeLevel ? `${activeLevel.ProgressPercentage}%` : '0%';
1156
1158
  }
1157
1159
  else {
1158
1160
  this.challengePercent = '—';
@@ -1187,6 +1189,19 @@ const CasinoEngagementSuiteContainer = class {
1187
1189
  : this.inProgressChallenges.filter(id => id !== challenge.Id);
1188
1190
  }
1189
1191
  }
1192
+ updateJackpotBalance(updatedJackpots) {
1193
+ this.jackpots = this.jackpots.map(jackpot => {
1194
+ const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
1195
+ return updatedJackpot
1196
+ ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
1197
+ });
1198
+ if (this.showJackpotDetails) {
1199
+ const updatedSelectedJackpot = this.jackpots.find(jackpot => jackpot.JackpotId === this.selectedJackpotId);
1200
+ if (updatedSelectedJackpot) {
1201
+ this.selectedJackpot = Object.assign({}, updatedSelectedJackpot);
1202
+ }
1203
+ }
1204
+ }
1190
1205
  getChallengesWidgets() {
1191
1206
  return h("div", null, h("div", { class: this.showChallengesList ? 'Backdrop Opened' : 'Backdrop' }, h("casino-engagement-suite-challenges-list", { device: this.device, class: "CasinoEngagementSuiteDialog", onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), challenges: this.challenges, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds })), h("div", { class: this.showChallengeDetails ? 'Backdrop Opened' : 'Backdrop' }, this.showChallengeDetails && (h("casino-engagement-suite-challenges-details", { device: this.device, class: "CasinoEngagementSuiteDialog", onBack: this.handleChallengePopupBack, onClose: this.handlePopupClose('showChallengesList', 'showChallengeDetails'), "game-slug": this.gameSlug, challenge: this.selectedChallenge, inProgressChallenges: this.inProgressChallenges, isJoiningToChallenge: this.isJoiningToChallenge, pausedChallengeIds: this.pausedChallengeIds }))));
1192
1207
  }
@@ -1728,16 +1743,12 @@ const CasinoEngagementSuiteJackpotDetails = class {
1728
1743
  this.loading = false;
1729
1744
  break;
1730
1745
  }
1731
- case 'UpdateJackpotBalance': {
1732
- const jackpotUpdate = data
1733
- .find((updateMessage => updateMessage.JackpotId === this.jackpot.JackpotId));
1734
- if (jackpotUpdate) {
1735
- this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
1736
- this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
1737
- }
1738
- }
1739
1746
  }
1740
1747
  }
1748
+ handleJackpotUpdate() {
1749
+ this.balance = this.jackpot.Balance;
1750
+ this.winBalance = this.jackpot.WinBalance;
1751
+ }
1741
1752
  handleResize() {
1742
1753
  this.activeTab === 2 && this.setVisibleGames();
1743
1754
  }
@@ -1805,7 +1816,7 @@ const CasinoEngagementSuiteJackpotDetails = class {
1805
1816
  getJackpotDetailsHeaderTemplate() {
1806
1817
  return (h("div", { class: "JackpotDetailsHeader" }, h("div", null, h("div", { class: "JackpotType" }, this.jackpot.Type), h("div", { class: "JackpotBalance" }, this.getJackpotBalance())), h("div", { class: "JackpotDetailsHeaderSecondCol" }, h("button", { disabled: !!this.disabledStatus, onClick: this.changeJackpotStatus, class: this.getJoinButtonClasses() }, this.enabled
1807
1818
  ? translate$2('unjoin', this.language)
1808
- : translate$2('join', this.language)), this.winBalance && h("div", { class: "JackpotIsWon" }, translate$2('jackpotIsWon', this.language)))));
1819
+ : translate$2('join', this.language)), !!this.winBalance && h("div", { class: "JackpotIsWon" }, translate$2('jackpotIsWon', this.language)))));
1809
1820
  }
1810
1821
  getTabsTemplate() {
1811
1822
  return h("div", { class: "JackpotDetailsTabs" }, h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate$2('info', this.language)), h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate$2('games', this.language)));
@@ -1872,6 +1883,9 @@ const CasinoEngagementSuiteJackpotDetails = class {
1872
1883
  return h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
1873
1884
  }
1874
1885
  get host() { return getElement(this); }
1886
+ static get watchers() { return {
1887
+ "jackpot": ["handleJackpotUpdate"]
1888
+ }; }
1875
1889
  };
1876
1890
  CasinoEngagementSuiteJackpotDetails.style = casinoEngagementSuiteJackpotDetailsCss;
1877
1891
 
@@ -2023,20 +2037,13 @@ const CasinoEngagementSuiteJackpotsList = class {
2023
2037
  handleEvent(e) {
2024
2038
  const { type, data } = e.data;
2025
2039
  switch (type) {
2026
- case 'UpdateJackpotBalance':
2027
- const updatedJackpots = e.data.data;
2028
- this.jackpots = this.jackpots.map(jackpot => {
2029
- const updatedJackpot = updatedJackpots.find(updatedJackpot => updatedJackpot.JackpotId === jackpot.JackpotId);
2030
- return updatedJackpot
2031
- ? Object.assign(Object.assign({}, jackpot), { Balance: updatedJackpot.Balance, WinBalance: updatedJackpot.WinBalance }) : jackpot;
2032
- });
2033
- break;
2034
2040
  case 'UpdateJackpotStatus':
2035
2041
  const statusUpdate = data;
2036
- const index = this.jackpots.findIndex((jackpot) => jackpot.JackpotId === statusUpdate.JackpotId);
2037
- if (index !== 1) {
2038
- this.jackpots[index].IsClosed = statusUpdate.IsClosed;
2039
- }
2042
+ this.jackpots = this.jackpots.map(jackpot => {
2043
+ const jackpotToUpdate = jackpot.JackpotId === statusUpdate.JackpotId;
2044
+ return jackpotToUpdate
2045
+ ? Object.assign(Object.assign({}, jackpot), { IsClosed: statusUpdate.IsClosed, JackpotEndTime: jackpot.JackpotEndTime }) : jackpot;
2046
+ });
2040
2047
  break;
2041
2048
  case 'JoinJackpotResult':
2042
2049
  const joinJackpotResult = data;
@@ -2111,20 +2118,19 @@ const CasinoEngagementSuiteJackpotsList = class {
2111
2118
  const buttonText = jackpot.Enabled && !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed)
2112
2119
  ? translate$1('unjoin', this.language)
2113
2120
  : translate$1('join', this.language);
2114
- const buttonIsVisible = !(jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
2115
- const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId];
2116
- return (h("div", { class: "JackpotCardHeader" }, h("div", { class: "JackpotTitle" }, h("span", { class: "JackpotName" }, jackpotLabel), h("span", { class: jackpotClasses }, formatBalance$1(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (h("span", { class: "JackpotWon" }, translate$1('jackpotIsWon', this.language))) : (buttonIsVisible && (h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText)))));
2121
+ const actionButtonIsDisabled = !!this.buttonsLoadingStates[jackpot.JackpotId] || (jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
2122
+ return (h("div", { class: "JackpotCardHeader" }, h("div", { class: "JackpotTitle" }, h("span", { class: "JackpotName" }, jackpotLabel), h("span", { class: jackpotClasses }, formatBalance$1(jackpotBalance, jackpot.Currency))), jackpotIsWon ? (h("span", { class: "JackpotWon" }, translate$1('jackpotIsWon', this.language))) : (h("button", { class: buttonClass, onClick: this.changeJackpotStatus, "data-id": jackpot.JackpotId, "data-joined": jackpot.Enabled, disabled: actionButtonIsDisabled }, buttonText))));
2117
2123
  }
2118
2124
  getJackpotDescriptionTemplate(jackpot) {
2119
- const operatorContributionPercent = jackpot.OperatorContributionPercent + '%';
2120
- const winingProbabilityPercent = jackpot.Probability + '%';
2125
+ const operatorContributionPercent = jackpot.OperatorContributionPercent ? jackpot.OperatorContributionPercent + '%' : '';
2126
+ const winingProbabilityPercent = jackpot.Probability ? jackpot.Probability + '%' : '';
2121
2127
  const countdownValue = isBefore(new Date(jackpot.JackpotEndTime), new Date())
2122
2128
  ? translate$1('outdatedJackpotCountdown', this.language)
2123
2129
  : this.timers[jackpot.JackpotId];
2124
2130
  const operatorContibutionLabel = translate$1('operatorContribution', this.language);
2125
2131
  const typeLabel = translate$1('type', this.language);
2126
2132
  const winingProbabilityLabel = translate$1('winingProbability', this.language);
2127
- return (h("div", { class: "JackpotCardDescription" }, h("span", { class: "JackpotCountdown" }, countdownValue), h("div", { class: "JackpotCardDescriptionBlock" }, h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), h("div", { class: "JackpotCardDescriptionColumn" }, this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate$1('termsAndConditions', this.language))))));
2133
+ return (h("div", { class: "JackpotCardDescription" }, h("span", { class: "JackpotCountdown" }, countdownValue), h("div", { class: "JackpotCardDescriptionBlock" }, h("div", { class: "JackpotCardDescriptionColumn" }, operatorContributionPercent && this.renderDesciptionRowInfo(`${operatorContibutionLabel}:`, operatorContributionPercent), this.renderDesciptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation)), h("div", { class: "JackpotCardDescriptionColumn" }, winingProbabilityPercent && this.renderDesciptionRowInfo(`${winingProbabilityLabel}:`, winingProbabilityPercent), h("a", { href: jackpot.JackpotRulesUrl, target: "_blank" }, translate$1('termsAndConditions', this.language))))));
2128
2134
  }
2129
2135
  renderDesciptionRowInfo(title, value) {
2130
2136
  return (h("div", { class: "JackpotCardDescriptionRow" }, h("span", null, title), h("span", { class: "JackpotDescriptionValue" }, value)));
@@ -7,7 +7,7 @@ import '@everymatrix/casino-engagement-suite-free-spins-details';
7
7
  import '@everymatrix/casino-engagement-suite-jackpots-list';
8
8
  import '@everymatrix/casino-engagement-suite-jackpot-details';
9
9
  import '@everymatrix/casino-engagement-suite-modal-container';
10
- import { CasinoEngagementSuiteConfig, Challenge, ChallengeProgressUpdateMessage, Jackpot, OpenModalEvent, FreeSpins, VendorFreeSpins } from '../../models/casino-engagement-suite-config';
10
+ import { CasinoEngagementSuiteConfig, Challenge, ChallengeProgressUpdateMessage, Jackpot, OpenModalEvent, FreeSpins, VendorFreeSpins, UpdateJackpotBalanceMessage } from '../../models/casino-engagement-suite-config';
11
11
  export declare class CasinoEngagementSuiteContainer {
12
12
  /**
13
13
  * Client custom styling via string
@@ -71,6 +71,7 @@ export declare class CasinoEngagementSuiteContainer {
71
71
  setChallengePercent(): void;
72
72
  updateChallengeProgress(data: ChallengeProgressUpdateMessage): void;
73
73
  updateChallengeStatus(id: string, status: number, addToInProgress: boolean): void;
74
+ updateJackpotBalance(updatedJackpots: Array<UpdateJackpotBalanceMessage>): void;
74
75
  getChallengesWidgets(): any;
75
76
  getFreeSpinWidgets(): any;
76
77
  getJackpotsWidgets(): any;
@@ -1,3 +1,8 @@
1
+ export interface UpdateJackpotBalanceMessage {
2
+ JackpotId: number;
3
+ Balance: number;
4
+ WinBalance: number;
5
+ }
1
6
  export interface OpenModalEvent {
2
7
  modalType: string;
3
8
  rewardMessage?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-container",
3
- "version": "1.37.5",
3
+ "version": "1.37.7",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,h as t,c as i,g as s}from"./p-ae874bf6.js";const o=["en"],a={en:{new:"new"}},n=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.orientation="Landscape",this.device="Mobile",this.isChallengeLabel=!1,this.language="en",this.jackpots=[],this.freeSpins={},this.limitStylingAppends=!1,this.activeJackpot="",this.handleTileClick=e=>{const t=e.target.getAttribute("data-app");window.postMessage({type:`Bar${t}Click`}),this.activeWidget=t,"Jackpots"===t&&(this.activeJackpot=e.target.getAttribute("data-type"))},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.engagementSuiteBar.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.engagementSuiteBar.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.engagementSuiteBar&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getChallengeTile(){return t("button",{class:"Tile Reward Challenges "+("Challenges"===this.activeWidget?"Active":""),"data-app":"Challenges",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,this.challengePercent),t("div",{class:"ChallengeLabel "+(this.isChallengeLabel?"ShowChallengeLabel":"")},t("span",null,(()=>{const e=this.language;return a[void 0!==e&&o.includes(e)?e:"en"].new})())))}getFreeSpinsTile(){const{TotalNumberOfFreeSpins:e,TotalNumberOfUsedFreeSpins:i}=this.freeSpins,s=e-i;return t("button",{class:"Tile Reward FreeSpins "+("FreeSpins"===this.activeWidget?"Active":""),"data-app":"FreeSpins",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,"number"!=typeof s||s<0?"":s))}getJackpotClasses(e){return{Tile:!0,Jackpot:!0,Enabled:e.Enabled,Active:"Jackpots"===this.activeWidget&&this.activeJackpot===e.Type,[e.Type.charAt(0).toUpperCase()+e.Type.slice(1)]:!0}}getJackpotsTemplate(){return this.jackpots.map((e=>t("div",{class:this.getJackpotClasses(e),"data-app":"Jackpots","data-type":e.Type,onClick:this.handleTileClick},t("div",{class:"JackpotType"},e.Type),t("span",{class:"JackpotBalance"},function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(e.Balance,e.Currency)))))}render(){return t("div",{class:`CasinoEngagementSuiteBar ${this.orientation} ${this.device}`,ref:e=>this.engagementSuiteBar=e},t("div",{class:"EngagementSuiteContainer"},!!this.jackpots.length&&this.getJackpotsTemplate(),this.challengePercent&&this.getChallengeTile(),this.freeSpins&&this.getFreeSpinsTile()))}};n.style=':host{display:block}*{box-sizing:border-box}.CasinoEngagementSuiteBar{height:100vh;background-color:var(--emw--color-background, #1E1638);color:var(--emw--color-typography, #FFF);display:flex;justify-content:center;position:relative;z-index:1}.CasinoEngagementSuiteBar .EngagementSuiteContainer{display:flex;align-items:center;gap:4px;scrollbar-gutter:stable;overflow-x:auto;padding:0 9px;width:100%}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar{width:3px;background:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{cursor:pointer;background-color:var(--emw--color-primary, #251D3E);border-radius:var(--emw--border-radius-medium, 4px);display:flex;flex-direction:row;align-items:center;justify-content:center;position:relative;font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-x-small, 12px);font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFF)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile.Active::before{background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #2D2545 82.77%)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile::before{content:"";position:absolute;inset:0;border-radius:var(--emw--border-radius-medium, 4px);padding:1px;background:linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 100%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{padding:14px 8px;flex-direction:column}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotType{display:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotBalance{font-weight:var(--emw--font-weight-semibold, 600);line-height:12px;font-size:12px;color:var(--emw--color-typography, #fff)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled .JackpotBalance{font-weight:var(--emw--font-weight-bold, 800)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{justify-content:space-between;padding:8px;border:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .RewardIcon{width:24px;height:24px;background-size:100%;background-position:center}.Tile.Leaderboard .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg")}.Tile.Leaderboard.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard-pressed.svg")}.Tile.Challenges .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge.svg")}.Tile.Challenges.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge-pressed.svg")}.Tile.Luckywheel .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel.svg")}.Tile.Luckywheel.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel-pressed.svg")}.Tile.FreeSpins .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins.svg")}.Tile.FreeSpins.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins-pressed.svg")}.ChallengeLabel{min-width:23px;height:11px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-4px;right:4px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:7px;line-height:7px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.Landscape.CasinoEngagementSuiteBar{width:152px;padding-top:16px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer{flex-direction:column}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{width:120px;height:40px}.Portrait.CasinoEngagementSuiteBar{border-radius:0 0 var(--emw--border-radius-medium, 4px) var(--emw--border-radius-medium, 4px);height:auto;padding:10px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer{gap:8px;flex-wrap:wrap}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{flex:1 1 0px;height:32px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{min-width:30%;padding:10px 8px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{min-width:20%;padding:4px 8px}.CasinoEngagementSuiteBar.Desktop.Landscape{width:252px}.CasinoEngagementSuiteBar.Desktop.Landscape .EngagementSuiteContainer{gap:12px}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward{padding:8px 20px;height:64px;font-size:var(--emw--font-size-medium, 16px)}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward .RewardIcon{width:48px;height:48px}.CasinoEngagementSuiteBar.Desktop.Landscape .Tile{width:212px}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot{padding-top:35px;min-height:133px;background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/jackpot-bg-stars.svg")}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType{display:block;font-weight:var(--emw--font-weight-bold, 800);margin-bottom:12px;text-transform:uppercase}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType,.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotBalance{font-size:var(--emw--size-large, 24px);line-height:24px}';const r=["en"],l={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",details:"Challenge Details",tc:"Terms & Conditions",level:"Level",place:"Place",bet:"bet",bets:"bets",win:"Win",minBet:"Min Bet",maxBet:"Max Bet",contribution:"Contribution"}},p=(e,t)=>{const i=t;return l[void 0!==i&&r.includes(i)?i:"en"][e]};var c,h;function d(e,t){return`${t}${new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}).format(e).replace(/,/g," ")}`}!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(c||(c={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(h||(h={}));const g=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.pausedChallengeIds=[],this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.changeChallengeStatus=e=>{var t,i;const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})},this.toggle=()=>{this.showDetails=!this.showDetails}}challengePropHandler(e){!this.interval&&e&&(this.updateTimer(),this.startCountdown()),this.interval&&!e&&clearInterval(this.interval)}componentWillLoad(){this.challengePropHandler(this.challenge)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getActionsTemplate(){return t("header",{class:"ChallengeActions"},t("button",{class:"ChallengeIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"ChallengePopupName"},p("challenges",this.language)),t("button",{class:"ChallengeIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getChallengeHeader(){const e=this.challenge.Status===h.InProgress||this.challenge.Status===h.PendingLevelReward;return t("div",{class:"ChallengeDetailsHeader"},t("span",{class:"ChallengeName"},this.challenge.ChallengePresentation.PresentationName),t("button",{onClick:this.changeChallengeStatus,class:`ChallengeJoinButton ${e?"Joined":""}\n ${this.isExpiredChallenge||this.isJoiningToChallenge?"Disabled":""}`,"data-id":this.challenge.Id},p(e?"unjoin":"join",this.language)))}getChallengeCountdown(){return t("div",{class:"ChallengeCountdown "+(this.isExpiredChallenge?"Expired":"")},this.isExpiredChallenge?"Expired":this.timer)}getChallengeDetails(){const e=this.challenge.ChallengePresentation.Description,i=this.challenge.ChallengePresentation.Url,s=this.challenge.Games;return t("div",{class:"CollapseDetails "+(this.showDetails?"ShowDetails":"")},e&&t("div",{class:"ChallengeDescription"},e),i&&t("div",{class:"TC"},t("a",{href:i,target:"_blank"},p("tc",this.language))),(null==s?void 0:s.length)&&t("div",{class:"ChallengeGames"},s.map((e=>t("div",{class:"Game",key:e.CasinoGameId},t("img",{src:e.GameIcon,alt:e.GameName,onClick:this.onGameClick,class:e.GameSlug===this.gameSlug?"Disabled":"","data-slug":e.GameSlug}))))))}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.challenge.ExpirationTime).getTime()-(new Date).getTime();if(e<1)return clearInterval(this.interval),this.timer="",void(this.isExpiredChallenge=!0);const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getLevelTarget(e){const i=(s=e.DisplayCurrencyTargetTurnover,`${this.challenge.CurrencySymbol}${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(s)}`);var s;let o=`${p("place",this.language)} ${i}`;return 1===e.LevelTargetType?o+=` ${p("bet",this.language)}`:2===e.LevelTargetType&&(o+=` ${p("bets",this.language)} X ${e.TargetBetCount}`),t("span",{class:"ChallengeLevelTarget"},o)}getLevelBetRangesDetails(e){var i,s,o,a;if(0===e.LevelTargetType){const n=d(null===(i=e.BetRange)||void 0===i?void 0:i.MinBet,this.challenge.CurrencySymbol),r=d(null===(s=e.BetRange)||void 0===s?void 0:s.MaxBet,this.challenge.CurrencySymbol),l=e.LevelContributionPercent+"%",c="number"==typeof(null===(o=e.BetRange)||void 0===o?void 0:o.MinBet),h="number"==typeof(null===(a=e.BetRange)||void 0===a?void 0:a.MaxBet),g=100!==e.LevelContributionPercent;if(c||h||g)return t("div",{class:"ChallengeLevelBetDetails"},c&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("minBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},n)),h&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("maxBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},r)),g&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("contribution",this.language),": "),t("span",{class:"ChallengeLevelBetContribution"},l)))}}getChallengeLevels(){const e=this.challenge.Status===h.Started&&this.challenge.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(this.challenge.ChallengeId),i=t=>"ChallengeLevelCard "+(1!==t.ProgressStatus||this.isExpiredChallenge||e?"":"InProgress");return t("div",{class:"ChallengeLevels"},this.challenge.LevelProgresses.map(((s,o)=>t("div",{class:i(s)},t("casino-engagement-suite-progress-bar",{class:this.device,value:s.ProgressPercentage,"hide-percent":0===s.ProgressPercentage||100===s.ProgressPercentage,disabled:this.isExpiredChallenge||e},t("span",{slot:"Title",class:"ChallengeLevelTitle"},t("span",null,"Level ",o+1,": "),this.getLevelTarget(s))),t("div",{class:"ChallengeRewardMessage"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg",alt:"win"}),t("span",null,p("win",this.language),": "),t("span",{class:"CustomRewardMessage"},s.CustomRewardMessage)),this.getLevelBetRangesDetails(s)))))}getToggleButton(){return t("div",{class:"ChallengeCollapseButton",onClick:this.toggle},t("span",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,p("details",this.language)))}render(){return t("div",{class:`ChallengeDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"ChallengeDetails"},this.getChallengeHeader(),this.getChallengeCountdown(),this.getToggleButton(),this.getChallengeDetails(),this.getChallengeLevels()))}get host(){return s(this)}static get watchers(){return{challenge:["challengePropHandler"]}}};var u,m;g.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-word}.ChallengeJoinButton.Joined::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin:12px 0}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetails{margin-top:25px;display:flex;flex-wrap:wrap;gap:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetail:not(:last-of-type){margin-right:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetRange,.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetContribution{font-weight:var(--emw--font-weight-semibold, 600)}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelTitle{margin-bottom:2px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;line-height:15px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);word-break:break-word}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:"";position:absolute;inset:0;border-radius:8px;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeDetailsPopup.Tablet .ChallengeActions,.ChallengeDetailsPopup.Desktop .ChallengeActions{padding-top:16px}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .CollapseDetails .ChallengeDescription,.ChallengeDetailsPopup.Desktop .CollapseDetails .ChallengeDescription{font-size:var(--emw--font-size-medium, 16px);line-height:19px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeLevelTitle,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeLevelTitle{margin-bottom:4px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeRewardMessage{margin-top:12px;line-height:17px}',function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(u||(u={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(m||(m={}));const b=["en"],x={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},k=(e,t)=>{const i=t;return x[void 0!==i&&b.includes(i)?i:"en"][e]};function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function f(e){F(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===w(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function v(e,t){return F(2,arguments),f(e).getTime()-f(t).getTime()}var C={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function y(e){return e?C[e]:C.trunc}const D=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.pausedChallengeIds=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,i;e.stopPropagation();const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":{const t=e.data.data.challengeProgressData[0],i=this.challenges.findIndex((e=>function(e,t,i){F(2,arguments);var s=v(e,t)/1e3;return y(null==i?void 0:i.roundingMethod)(s)}(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));i>-1?this.challenges.splice(i,0,t):this.challenges.unshift(t),this.challenges=[...this.challenges],this.newChallengeIds.push(t.Id),window.postMessage({type:"UpdateChallenges"});break}}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==m.Expired)).reduce(((t,i)=>{const s=new Date(i.ExpirationTime).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeChallenge(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===m.InProgress&&!this.pausedChallengeIds.includes(e.ChallengeId),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===m.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.ChallengeId)}isChallengeCompleted(e){return e.Status===m.Completed||e.Status===m.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===m.Completed)return 100;if(this.isChallengePaused(e)||e.Status===m.PendingLevelReward||e.Status===m.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===u.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:i}=e,s=e.Status===m.InProgress||e.Status===m.PendingLevelReward;return t("div",{class:"ChallengeCardHeader"},t("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),t("button",{class:`${s?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":i},k(s?"unjoin":"join",this.language)))}getChallengeTemplate(e){const i=this.getChallengeProgress(e),s=this.timers[e.Id],o=this.newChallengeIds.includes(e.Id),a=i>-1?t("casino-engagement-suite-progress-bar",{class:this.device,value:i,disabled:this.isChallengePaused(e)},t("span",{slot:"Title",class:"ChallengeCountdown"},s)):t("span",{class:"ChallengeCountdown"},s);return t("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),a,t("div",{class:"ChallengeLabel "+(o?"ShowChallengeLabel":"")},t("span",null,k("new",this.language))))}getHeaderTemplate(){return t("header",{class:"ChallengesListPopupHeader"},t("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"ChallengesListPopupHeaderName"},k("challenges",this.language)),t("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?t("div",{class:"ChallengesListWrapper"},t("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):t("div",{class:"ChallengesListEmpty"},t("h2",null,k("noChallenges",this.language)),t("p",null,k("tryOtherGames",this.language)))}getTooltipTemplate(){return t("div",{class:"ChallengesTooltipBackdrop"},t("div",{class:"ChallengesTooltip"},t("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),k("tooltip",this.language)))}render(){return t("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};var J,S;function B(){return window.screen.orientation.type.includes("portrait")?"Portrait":"Landscape"}D.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}',"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(J||(J={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(S||(S={}));const P=class{constructor(t){e(this,t),this.openModal=i(this,"openModal",7),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.orientation="Landscape",this.device="Mobile",this.showChallengesList=!1,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showFreeSpinsDetails=!1,this.showJackpotDetails=!1,this.limitStylingAppends=!1,this.jackpots=[],this.gameSlug="",this.pausedChallengeIds=[],this.isChallengeLabel=!1,this.isJoiningToChallenge=!1,this.handlePopupClose=(e,t)=>()=>{this[e]=!1,this[t]=!1,this.activeWidget=""},this.handleJackpotsPopupClose=()=>{this.showJackpotsList=!1,this.showJackpotDetails=!1,this.activeWidget=""},this.handleChallengePopupBack=()=>{this.showChallengeDetails=!1,this.showChallengesList=!0},this.handleJackpotPopupBack=()=>{this.showJackpotDetails=!1,this.showJackpotsList=!0},this.barHeight=0,this.orientationChangeHandler=()=>{this.orientation=B()},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}handleEvent(e){const t=null==e?void 0:e.data,{type:i}=t,s=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}(t,["type"]);switch(i){case"ChallengeHasExpired":this.setChallengePercent();break;case"BarChallengesClick":this.showChallengesList=!0,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Challenges",this.isChallengeLabel=!1;break;case"BarFreeSpinsClick":this.showFreeSpinsList=!0,this.showChallengesList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="FreeSpins";break;case"BarJackpotsClick":this.showJackpotsList=!0,this.showFreeSpinsList=!1,this.showChallengesList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Jackpots";break;case"ChallengeClick":this.selectedChallengeId=e.data.id,this.selectedChallenge=this.challenges.find((e=>e.Id===this.selectedChallengeId)),this.showChallengesList=!1,this.showChallengeDetails=!0;break;case"FreeSpinClick":this.selectedSpinId=e.data.id,this.selectedSpin=this.freeSpins.VendorFreeSpins.find((e=>e.Id===this.selectedSpinId)),this.showFreeSpinsList=!1,this.showFreeSpinsDetails=!0;break;case"JackpotClick":this.selectedJackpotId=e.data.id,this.selectedJackpot=this.jackpots.find((e=>e.JackpotId===this.selectedJackpotId)),this.showJackpotsList=!1,this.showJackpotDetails=!0;break;case"UpdateChallenges":this.setChallengeLabel();break;case"UpdateChallengeProgress":this.updateChallengeProgress(e.data.data);break;case"ChallengeChangeStatusNotification":{const{IsEnabled:t,ChallengeId:i}=e.data.data;this.pausedChallengeIds=t?this.pausedChallengeIds.filter((e=>e!==i)):[...this.pausedChallengeIds,i];break}case"ShowChallengeRewardModal":{const{ChallengeId:e,LevelId:t,HasError:i,ProcessedRewards:o}=s.data,a={modalType:(null==o?void 0:o.length)?"REWARD_MODAL":"SUPPORT_MODAL",rewardMessage:this.getRewardMessage(e,t),hasError:i};this.openModal.emit(a);break}case"ShowConfirmationModal":this.openModal.emit({modalType:"TARGET_MODAL",confirmationData:s});break;case"ChallengeJoinRequest":this.isJoiningToChallenge=!0;break;case"JoinChallengeResult":{const{Success:t,JoinId:i,UnjoinId:s}=e.data.data;t&&(i&&this.updateChallengeStatus(i,1,!0),s&&this.updateChallengeStatus(s,0,!1),this.challenges=[...this.challenges]),this.isJoiningToChallenge=!1,this.closeModal.emit("TARGET_MODAL");break}case"ShowJackpotRewardModal":{const{Amount:t,Currency:i}=e.data.data;this.openModal.emit({modalType:"JACKPOT_REWARD_MODAL",winAmount:{amount:t,currency:i}});break}}}componentDidLoad(){this.orientation=B(),this.device=function(){const e=navigator.userAgent.toLowerCase(),t=screen.availWidth,i=screen.availHeight;if(e.includes("iphone"))return"Mobile";if(e.includes("ipad"))return"Tablet";if(e.includes("android")){if(i>t&&t<800)return"Mobile";if(t>i&&i<800)return"Tablet"}return"Desktop"}(),window.screen.orientation.addEventListener("change",this.orientationChangeHandler)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),this.barHeight=this.barWrapperEl.offsetHeight}disconnectedCallback(){window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}async init(e){var t;this.challenges=e.challenges,this.inProgressChallenges=null===(t=e.challenges)||void 0===t?void 0:t.filter((e=>e.Status===S.InProgress||e.Status===S.PendingLevelReward)).map((e=>e.Id)),this.jackpots=e.jackpots||[],this.freeSpins=e.freeSpins||{},this.gameSlug=e.slug,this.setChallengePercent(),this.setChallengeLabel()}setChallengeLabel(){this.challenges&&(this.isChallengeLabel=!!this.challenges.filter((e=>e.IsNew)).length)}setChallengePercent(){if(!this.challenges)return;const e=this.challenges.find((e=>e.Status===S.InProgress));if(e){const t=e.LevelProgresses.find((e=>e.ProgressStatus===J.InProgress));t&&(this.challengePercent=`${t.ProgressPercentage}%`)}else this.challengePercent="—"}updateChallengeProgress(e){var t;const i=null===(t=this.challenges)||void 0===t?void 0:t.find((t=>t.ChallengeId===e.ChallengeId));if(i&&(i.LevelProgresses=i.LevelProgresses.map((t=>{var i;const s=null===(i=e.Levels)||void 0===i?void 0:i.find((e=>e.LevelId===t.LevelId));return s?Object.assign(Object.assign({},t),s):t})),this.challenges=[...this.challenges]),this.showChallengeDetails){const e=this.challenges.find((e=>e.Id===this.selectedChallengeId));e&&(this.selectedChallenge=Object.assign({},e))}this.setChallengePercent()}updateChallengeStatus(e,t,i){var s;const o=null===(s=this.challenges)||void 0===s?void 0:s.find((t=>t.Id===e));o&&(o.Status=t,this.inProgressChallenges=i?[...this.inProgressChallenges,o.Id]:this.inProgressChallenges.filter((e=>e!==o.Id)))}getChallengesWidgets(){return t("div",null,t("div",{class:this.showChallengesList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-challenges-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),challenges:this.challenges,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})),t("div",{class:this.showChallengeDetails?"Backdrop Opened":"Backdrop"},this.showChallengeDetails&&t("casino-engagement-suite-challenges-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),"game-slug":this.gameSlug,challenge:this.selectedChallenge,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})))}getFreeSpinWidgets(){return t("div",null,t("div",{class:this.showFreeSpinsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-free-spins-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),freeSpins:this.freeSpins.VendorFreeSpins})),t("div",{class:this.showFreeSpinsDetails?"Backdrop Opened":"Backdrop"},this.showFreeSpinsDetails&&t("casino-engagement-suite-free-spins-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),"game-slug":this.gameSlug,spin:this.selectedSpin})))}getJackpotsWidgets(){return t("div",null,t("div",{class:this.showJackpotsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-jackpots-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handleJackpotsPopupClose,jackpots:this.jackpots})),this.showJackpotDetails&&t("div",{class:"Backdrop Opened"},t("casino-engagement-suite-jackpot-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleJackpotPopupBack,onClose:this.handleJackpotsPopupClose,"game-slug":this.gameSlug,jackpot:this.selectedJackpot})))}getRewardMessage(e,t){var i,s,o,a;return(null===(a=null===(o=null===(s=null===(i=this.challenges)||void 0===i?void 0:i.find((t=>t.Id===e)))||void 0===s?void 0:s.LevelProgresses)||void 0===o?void 0:o.find((e=>e.LevelId===t)))||void 0===a?void 0:a.CustomRewardMessage)||""}render(){return t("div",{class:`CasinoEngagementSuiteContainer ${this.device} ${this.orientation}`,style:{"--barHeight":`${this.barHeight}px`}},t("div",{class:"barWrapper",ref:e=>this.barWrapperEl=e},t("casino-engagement-suite-bar",{orientation:this.orientation,device:this.device,"active-widget":this.activeWidget,"is-challenge-label":this.isChallengeLabel,jackpots:this.jackpots,freeSpins:this.freeSpins,"challenge-percent":this.challengePercent})),this.challenges&&this.getChallengesWidgets(),this.freeSpins&&this.getFreeSpinWidgets(),!!this.jackpots.length&&this.getJackpotsWidgets(),t("casino-engagement-suite-modal-container",{device:this.device,isJoiningToChallenge:this.isJoiningToChallenge}))}get host(){return s(this)}};P.style=":host{display:inline-block;font-family:inherit}.Backdrop{padding:20px 20px 20px 172px;display:none;position:fixed;inset:0;height:100dvh;width:100vw}.Backdrop.Opened{display:block}.Backdrop .CasinoEngagementSuiteDialog{height:calc(100dvh - 40px);max-width:600px}.CasinoEngagementSuiteContainer.Portrait{width:100vw}.CasinoEngagementSuiteContainer.Portrait .Backdrop{padding:calc(var(--barHeight) + 12px) 0 20px}.CasinoEngagementSuiteContainer.Portrait .Backdrop .CasinoEngagementSuiteDialog{max-width:initial;padding:0 4px;margin:0 auto;height:calc(100dvh - (var(--barHeight) + 20px))}.CasinoEngagementSuiteContainer.Landscape.Mobile .CasinoEngagementSuiteDialog{max-width:366px}.CasinoEngagementSuiteContainer.Landscape.Desktop .Backdrop{padding-left:272px}";const L=["en"],T={en:{freeSpins:"Free Spins",details:"Free Spins Details",tc:"Terms & Conditions",quantityGranted:"Quantity Granted",quantityLeft:"Quantity Left",valueGranted:"Value Granted",valueLeft:"Value Left",info:"Info",games:"Games",loadMore:"Load More"}},E=(e,t)=>{const i=t;return T[void 0!==i&&L.includes(i)?i:"en"][e]},M=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.activeTab=1,this.visibleGames=[],this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.spin.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()}}componentWillLoad(){this.startCountdown()}componentDidRender(){if(!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2===this.activeTab&&!this.maxVisibleGames){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.spin.GamesInfo.slice(0,this.maxVisibleGames)}}disconnectedCallback(){clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}getActionsTemplate(){return t("header",{class:"FreeSpinsActions"},t("button",{class:"FreeSpinsIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"FreeSpinsPopupName"},E("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getFreeSpinsHeader(){const{VendorName:e,NumberOfFreeSpins:i,NumberOfUsedFreeSpins:s}=this.spin;return t("div",{class:"FreeSpinsDetailsHeader"},t("span",{class:"FreeSpinsName"},e),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s),"/",i))}getFreeSpinsCountdown(){const e=this.isExpiredChallenge?"Expired":this.timer,{VendorFreeSpinsCost:i,VendorFreeSpinsRemainingCost:s,CurrencySymbol:o}=this.spin;return t("div",{class:"FreeSpinsCountdown "+(this.isExpiredChallenge?"Expired":"")},e,t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},o,s),"/",o,i))}getTabsTemplate(){return t("div",{class:"FreeSpinsDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(1===this.activeTab?"Active":"")},E("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(2===this.activeTab?"Active":"")},E("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getSpinInfoTemplate():this.getGamesTemplate()}getSpinsDetailsTemplate(){return t("div",null,t("div",{class:"FreeSpinsDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,E("details",this.language))),this.showDetails&&t("p",{class:"FreeSpinsDescription"},this.spin.FreeSpinCampaignPresentation.Description))}getSpinInfoTemplate(){const{NumberOfFreeSpins:e,NumberOfUsedFreeSpins:i,VendorFreeSpinsCost:s,CurrencySymbol:o,VendorFreeSpinsRemainingCost:a}=this.spin;return t("div",null,this.spin.FreeSpinCampaignPresentation.Description&&this.getSpinsDetailsTemplate(),t("div",{class:"FreeSpinsInfo"},t("div",{class:"FreeSpinsInfoItem"},E("quantityGranted",this.language),": ",t("span",null,e)),t("div",{class:"FreeSpinsInfoItem"},E("quantityLeft",this.language),": ",t("span",null,i)),t("div",{class:"FreeSpinsInfoItem"},E("valueGranted",this.language),": ",t("span",null,o,s)),t("div",{class:"FreeSpinsInfoItem"},E("valueGranted",this.language),": ",t("span",null,o,a)),this.spin.FreeSpinCampaignPresentation.Url&&t("div",{class:"FreeSpinsInfoItem"},t("a",{class:"tc",href:this.spin.FreeSpinCampaignPresentation.Url,target:"_blank"},E("tc",this.language)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"FreeSpinsGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"FreeSpinsGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"FreeSpinsGamesList"},e)),this.visibleGames.length<this.spin.GamesInfo.length?t("button",{class:"PopupButton Active FreeSpinsGamesButton",onClick:this.handleLoadMore},E("loadMore",this.language)):""]}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.spin.ExpiryDate).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}render(){return t("div",{class:`FreeSpinsDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"FreeSpinsDetails"},this.getFreeSpinsHeader(),this.getFreeSpinsCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}};M.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.FreeSpinsDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsHeader{opacity:0.5}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsTabs{cursor:default;pointer-events:none}.FreeSpinsDetailsPopup.Disabled .FreeSpinsInfoItem{color:var(--emw--color-primary, #8F8B9C)}.FreeSpinsDetails{overflow:hidden;height:100%;display:flex;flex-direction:column}.FreeSpinsActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsActions .FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsActions .FreeSpinsPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-small-plus, 16px);font-weight:500;line-height:16px}.FreeSpinsDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsDetails::-webkit-scrollbar{display:none}.FreeSpinsDetailsHeader{display:flex;justify-content:space-between;gap:12px;min-width:0;align-items:flex-end}.FreeSpinsDetailsHeader .FreeSpinsName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:var(--emw--font-size-small, 14px);font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:"";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.FreeSpinsGamesLoadMore::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.FreeSpinsCountdown{display:flex;justify-content:space-between;font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.FreeSpinsCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.FreeSpinsDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.FreeSpinsDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.FreeSpinsInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.FreeSpinsInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.FreeSpinsDetailsButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.FreeSpinsDetailsButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.FreeSpinsDetailsButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.FreeSpinsDetailsButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.FreeSpinsDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsGamesListWrapper{overflow:auto;flex-grow:1}.FreeSpinsGamesList{display:flex;gap:10px;flex-wrap:wrap}.FreeSpinsGamesList .FreeSpinsGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.FreeSpinsGamesList .FreeSpinsGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ShowDetails{display:block}.FreeSpinsGamesButton{margin-top:12px;align-self:center;min-width:140px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsActions,.FreeSpinsDetailsPopup.Desktop .FreeSpinsActions{padding-top:16px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsIconButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsDetails,.FreeSpinsDetailsPopup.Desktop .FreeSpinsDetails{padding:20px 24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsName,.FreeSpinsDetailsPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCountdown,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCollapseButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCollapseButton{margin-bottom:12px}.FreeSpinsDetailsPopup.Tablet .PopupButton,.FreeSpinsDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:var(--emw--font-size-small-plus, 16px)}';const I=["en"],A={en:{freeSpins:"Free Spins",tooltip:"Spin the game reels without using your own money",noSpins:"No FreeSpins yet\n",tryOtherGames:"Try winning FreeSpins as rewards or playing other booster games",new:"new"}},z=(e,t)=>{const i=t;return A[void 0!==i&&I.includes(i)?i:"en"][e]},j=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.freeSpins=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newSpinIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newSpinIds=[]},this.handleSpinClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"FreeSpinClick",id:t}),this.newSpinIds=this.newSpinIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1}}spinsPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}componentWillLoad(){this.spinsPropHandler(this.freeSpins)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.freeSpins.reduce(((t,i)=>{const s=new Date(i.ExpiryDate).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeFreeSpin(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}removeFreeSpin(e){const t=this.freeSpins.findIndex((t=>t.Id===e));t>-1&&(this.freeSpins.splice(t,1),window.postMessage({type:"FreeSpinHasExpired",id:e}))}getFreeSpinClasses(){return{FreeSpinsCard:!0}}getChallengeHeaderTemplate(e){const{VendorName:i,NumberOfUsedFreeSpins:s,NumberOfFreeSpins:o}=e;return t("div",{class:"FreeSpinsCardHeader"},t("div",{class:"FreeSpinsName"},i),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s)," /",o))}getFreeSpinTemplate(e){const i=this.timers[e.Id],{VendorFreeSpinsRemainingCost:s,VendorFreeSpinsCost:o,CurrencySymbol:a}=e,n=this.newSpinIds.includes(e.Id);return t("div",{class:this.getFreeSpinClasses(),onClick:this.handleSpinClick,key:e.Id,"data-id":e.Id},t("div",{class:"SpinLabel "+(n?"ShowSpinLabel":"")},t("span",null,z("new",this.language))),this.getChallengeHeaderTemplate(e),t("div",{class:"FreeSpinsCountdownWrapper"},t("span",{class:"FreeSpinsCountdown"},i),";",t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},a,s),"/",a,o)))}getHeaderTemplate(){return t("header",{class:"FreeSpinsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"FreeSpinsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"FreeSpinsListPopupHeaderName"},z("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.freeSpins.length?t("div",{class:"FreeSpinsListWrapper"},t("div",{class:"FreeSpinsList"},this.freeSpins.map((e=>this.getFreeSpinTemplate(e))))):t("div",{class:"FreeSpinsListEmpty"},t("h2",null,z("noSpins",this.language)),t("p",null,z("tryOtherGames",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"FreeSpinsTooltipBackdrop"},t("div",{class:"FreeSpinsTooltip"},t("button",{class:"FreeSpinsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),z("tooltip",this.language))):""}render(){return t("div",{class:`FreeSpinsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{freeSpins:["spinsPropHandler"]}}};j.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.FreeSpinsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.FreeSpinsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.FreeSpinsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsListWrapper::-webkit-scrollbar{display:none}.FreeSpinsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.FreeSpinsRowWrapper{display:flex;justify-content:space-between;min-width:0}.FreeSpinsCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.FreeSpinsCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px;flex:1;min-width:0;align-items:flex-end}.FreeSpinsName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsListEmpty{padding:20px 32px}.FreeSpinsListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:var(--emw--font-size-large, 20px);line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.FreeSpinsListEmpty p{font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.FreeSpinsCountdownWrapper{display:flex;justify-content:space-between;align-items:flex-start}.FreeSpinsCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.SpinLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.SpinLabel span{display:inline-block;text-transform:uppercase;font-size:var(--emw--font-size-x-small, 10px);line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowSpinLabel{display:inline-flex}.FreeSpinsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip .FreeSpinsIconButton{top:12px;right:6px;position:absolute}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeader,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeader{padding-top:16px}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeaderName,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeaderName{font-size:var(--emw--font-size-small-plus, 16px);line-height:16px}.FreeSpinsListPopup.Tablet .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsListPopup.Tablet .FreeSpinsList,.FreeSpinsListPopup.Desktop .FreeSpinsList{padding:20px 24px 0;row-gap:20px}.FreeSpinsListPopup.Tablet .ChallengeCardHeader,.FreeSpinsListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.FreeSpinsListPopup.Tablet .FreeSpinsName,.FreeSpinsListPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsListPopup.Tablet .FreeSpinsCountdown,.FreeSpinsListPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip{padding:60px 65px;font-size:var(--emw--font-size-small-plus, 16px);line-height:20px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip .FreeSpinsIconButton{top:24px;right:24px}';const R=["en"],O={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",info:"Info",games:"Games",operatorContribution:"Operator Contribution",type:"Type",winningProbability:"Winning Probability",tc:"Terms & Conditions",jackpotIsWon:"Jackpot’s won!",loadMore:"Load More",jackpotDetails:"Jackpot Details"}},H=(e,t)=>{const i=t;return O[void 0!==i&&R.includes(i)?i:"en"][e]},$=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.disabledStatus="",this.activeTab=1,this.visibleGames=[],this.loading=!1,this.enabled=!1,this.showDetails=!1,this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.jackpot.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},this.changeJackpotStatus=e=>{e.stopPropagation(),window.postMessage({type:"JackpotChangeStatusRequest",data:{[this.jackpot.JackpotId]:!this.jackpot.Enabled}}),this.loading=!0},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})}}handleEvent(e){const{type:t,data:i}=null==e?void 0:e.data;switch(t){case"UpdateJackpotStatus":this.updateJackpotStatus(e.data.data);break;case"JoinJackpotResult":{const e=i;e.Success&&this.jackpot.JackpotId in e.JackpotIds&&(this.enabled=this.jackpot.Enabled=e.JackpotIds[this.jackpot.JackpotId]),this.loading=!1;break}case"UpdateJackpotBalance":{const e=i.find((e=>e.JackpotId===this.jackpot.JackpotId));e&&(this.balance=this.jackpot.Balance=e.Balance,this.winBalance=this.jackpot.WinBalance=e.WinBalance)}}}handleResize(){2===this.activeTab&&this.setVisibleGames()}componentWillLoad(){this.startCountdown(),this.enabled=this.jackpot.Enabled,this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2!==this.activeTab||this.maxVisibleGames||this.setVisibleGames()}disconnectedCallback(){this.clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}setVisibleGames(){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.jackpot.GamesInfo.slice(0,this.maxVisibleGames)}updateJackpotStatus(e){e.IsClosed?(this.clearInterval(),this.disabledStatus=e.Reason,this.activeTab=1):(this.disabledStatus="",this.jackpot.JackpotEndTime=e.JackpotEndTime,this.startCountdown())}getTopNavigationTemplate(){return t("div",{class:"JackpotDetailsNavigation"},t("button",{class:"JackpotIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),t("div",{class:"JackpotPopupName"},H("jackpots",this.language)),t("button",{class:"JackpotIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getJackpotBalance(){return function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(this.winBalance||this.balance,this.jackpot.Currency)}getJoinButtonClasses(){return{PopupButton:!0,Active:this.enabled,Loading:this.loading}}getJackpotDetailsHeaderTemplate(){return t("div",{class:"JackpotDetailsHeader"},t("div",null,t("div",{class:"JackpotType"},this.jackpot.Type),t("div",{class:"JackpotBalance"},this.getJackpotBalance())),t("div",{class:"JackpotDetailsHeaderSecondCol"},t("button",{disabled:!!this.disabledStatus,onClick:this.changeJackpotStatus,class:this.getJoinButtonClasses()},H(this.enabled?"unjoin":"join",this.language)),this.winBalance&&t("div",{class:"JackpotIsWon"},H("jackpotIsWon",this.language))))}getTabsTemplate(){return t("div",{class:"JackpotDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(1===this.activeTab?"Active":"")},H("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(2===this.activeTab?"Active":"")},H("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getJackpotInfoTemplate():this.getGamesTemplate()}getJackpotDetailsTemplate(){return t("div",null,t("div",{class:"JackpotDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,H("jackpotDetails",this.language))),this.showDetails&&t("p",{class:"JackpotDescription"},this.jackpot.Description))}getJackpotInfoTemplate(){return t("div",{class:"JackpotInfoTabContent"},this.jackpot.Description&&this.getJackpotDetailsTemplate(),t("div",{class:"JackpotInfo"},t("div",{class:"JackpotInfoItem"},H("operatorContribution",this.language),": ",t("span",null,this.jackpot.OperatorContributionPercent,"%")),t("div",{class:"JackpotInfoItem"},H("type",this.language),": ",t("span",null,this.jackpot.JackpotTypePresentation)),t("div",{class:"JackpotInfoItem"},H("winningProbability",this.language),": ",t("span",null,"1:",this.jackpot.Probability)),this.jackpot.JackpotRulesUrl&&t("div",{class:"JackpotInfoItem"},t("a",{class:"tc",href:this.jackpot.JackpotRulesUrl,target:"_blank"},H("tc",this.jackpot.JackpotRulesUrl)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"JackpotGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"JackpotGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"JackpotGamesList"},e)),this.visibleGames.length<this.jackpot.GamesInfo.length?t("button",{class:"PopupButton Active JackpotGamesButton",onClick:this.handleLoadMore},H("loadMore",this.language)):""]}getJackpotCountdown(){return t("div",{class:"JackpotCountdown "+(this.disabledStatus?"Suspended":"")},this.disabledStatus||this.timer)}startCountdown(){this.updateTimer(),this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.jackpot.JackpotEndTime).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getPopupClasses(){return{JackpotDetailsPopup:!0,Disabled:!!this.disabledStatus,[this.device]:!0,[this.jackpot.Type.charAt(0).toUpperCase()+this.jackpot.Type.slice(1)]:!0}}render(){return t("div",{class:this.getPopupClasses()},this.getTopNavigationTemplate(),t("div",{class:"JackpotDetailsPopupContent"},this.getJackpotDetailsHeaderTemplate(),this.getJackpotCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}};function G(e,t){F(2,arguments);var i=f(e),s=f(t);return i.getTime()<s.getTime()}$.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none}button:focus{outline:none}button:not(:disabled){cursor:pointer}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:"";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.JackpotDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.JackpotDetailsPopup.Disabled .JackpotDetailsHeader{opacity:0.5}.JackpotDetailsPopup.Disabled .JackpotDetailsTabs{cursor:default;pointer-events:none}.JackpotDetailsPopup.Disabled .JackpotInfoItem{color:var(--emw--color-primary, #8F8B9C)}.JackpotGamesListWrapper,.JackpotInfoTabContent{overflow-x:auto;scrollbar-gutter:stable}.JackpotGamesListWrapper::-webkit-scrollbar,.JackpotInfoTabContent::-webkit-scrollbar{width:3px;background:none}.JackpotGamesListWrapper::-webkit-scrollbar-thumb,.JackpotInfoTabContent::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.JackpotDetailsNavigation{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotDetailsNavigation .JackpotIconButton{width:16px;height:16px;cursor:pointer;display:flex;justify-content:center;align-items:center}.JackpotDetailsNavigation .JackpotPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px;display:none}.JackpotDetailsPopupContent{padding:8px 18px 18px;overflow:hidden;height:100%;display:flex;flex-direction:column}.JackpotDetailsHeader{display:flex;justify-content:space-between;align-items:center;gap:12px}.JackpotDetailsHeader .JackpotDetailsHeaderSecondCol{text-align:right}.JackpotDetailsHeader .JackpotType{text-transform:uppercase;font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.JackpotDetailsHeader .JackpotBalance{margin-top:8px;font-family:Montserrat, sans-serif;font-size:18px;font-weight:var(--emw--font-weight-bold, 800);line-height:18px}.JackpotDetailsHeader .JackpotIsWon{margin-top:8px;font-family:Montserrat, sans-serif;font-weight:var(--emw--font-weight-bold, 700);font-size:12px;line-height:15px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotGamesLoadMore::before,.JackpotJoinButton.Joined::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotGamesButton{margin-top:12px;align-self:center;min-width:140px}.JackpotCountdown{font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.JackpotCountdown.Suspended{font-weight:var(--emw--font-weight-bold, 700);color:var(--emfe-w-color-white, #FFF);text-transform:capitalize}.JackpotDetailsTabsWrapper{display:flex;flex-direction:column}.JackpotDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.JackpotDetailsTabs .JackpotDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.JackpotDetailsTabs .JackpotDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.JackpotDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.JackpotInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:14px;line-height:17px}.JackpotInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.JackpotInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.JackpotGamesListWrapper{overflow:auto;flex-grow:1}.JackpotGamesList{display:flex;gap:10px;flex-wrap:wrap}.JackpotGamesList .JackpotGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.JackpotGamesList .JackpotGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.JackpotDetailsButton{margin-bottom:12px;display:flex;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.JackpotDetailsButton .Toggle{width:16px;height:16px;margin-right:4px}.JackpotDetailsButton .Closed{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg")}.JackpotDetailsButton .Open{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg")}.JackpotDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.JackpotDetailsPopup.Tablet .JackpotDetailsButton,.JackpotDetailsPopup.Desktop .JackpotDetailsButton{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotDescription,.JackpotDetailsPopup.Desktop .JackpotDescription{font-size:var(--emw--font-size-medium, 16px);line-height:22px}.JackpotDetailsPopup.Tablet .JackpotPopupName,.JackpotDetailsPopup.Desktop .JackpotPopupName{display:block}.JackpotDetailsPopup.Tablet .JackpotDetailsNavigation,.JackpotDetailsPopup.Desktop .JackpotDetailsNavigation{padding-top:16px}.JackpotDetailsPopup.Tablet .JackpotIconButton,.JackpotDetailsPopup.Desktop .JackpotIconButton{width:24px;height:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsPopupContent,.JackpotDetailsPopup.Desktop .JackpotDetailsPopupContent{padding:20px 24px 30px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Tablet .JackpotType,.JackpotDetailsPopup.Desktop .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotType{line-height:27px;font-size:22px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotBalance{font-weight:var(--emw--font-weight-bold, 700)}.JackpotDetailsPopup.Tablet .PopupButton,.JackpotDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:16px}.JackpotDetailsPopup.Tablet .JackpotCountdown,.JackpotDetailsPopup.Desktop .JackpotCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotInfoItem,.JackpotDetailsPopup.Desktop .JackpotInfoItem{font-size:16px;line-height:20px}.JackpotDetailsPopup.Tablet .JackpotIsWon,.JackpotDetailsPopup.Desktop .JackpotIsWon{font-size:14px;line-height:17px}.JackpotDetailsPopup.Tablet .JackpotGamesList,.JackpotDetailsPopup.Desktop .JackpotGamesList{gap:12px}.JackpotDetailsPopup.Tablet .JackpotGamesList .JackpotGamesListItem,.JackpotDetailsPopup.Desktop .JackpotGamesList .JackpotGamesListItem{width:calc(20% - 10px)}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs .JackpotDetailsTab,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs .JackpotDetailsTab{font-size:16px;line-height:20px}';const W=["en"],_={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",tooltip:"A payout that increases each time the game is played but the jackpot is not won",mega:"Mega",major:"Major",minor:"Minor",suspended:"Suspended Jackpot",allJackpotsSuspended:"Unfortunately, there are no available jackpots to join. Please, try again later.",jackpotIsWon:"Jackpot is Won",termsAndConditions:"Terms and Conditions",winingProbability:"Winning Probability",type:"Type",operatorContribution:"Operator Contribution",outdatedJackpotCountdown:"We are going to remove this Jackpot in 30 days"}},N=(e,t)=>{const i=t;return _[void 0!==i&&W.includes(i)?i:"en"][e]},U=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.jackpots=[],this.buttonsLoadingStates={},this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeJackpotStatus=e=>{e.stopPropagation();const t=+e.currentTarget.getAttribute("data-id"),i=e.currentTarget.hasAttribute("data-joined");window.postMessage({type:"JackpotChangeStatusRequest",data:{[t]:!i}}),this.buttonsLoadingStates=Object.assign(Object.assign({},this.buttonsLoadingStates),{[t]:!0})},this.handleJackpotClick=e=>{const t=+e.currentTarget.getAttribute("data-id");window.postMessage({type:"JackpotClick",id:t})}}jackpotsPropHandler(e){!this.interval&&e.length&&this.startCountdown(),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){const{type:t,data:i}=e.data;switch(t){case"UpdateJackpotBalance":const t=e.data.data;this.jackpots=this.jackpots.map((e=>{const i=t.find((t=>t.JackpotId===e.JackpotId));return i?Object.assign(Object.assign({},e),{Balance:i.Balance,WinBalance:i.WinBalance}):e}));break;case"UpdateJackpotStatus":const s=i,o=this.jackpots.findIndex((e=>e.JackpotId===s.JackpotId));1!==o&&(this.jackpots[o].IsClosed=s.IsClosed);break;case"JoinJackpotResult":const a=i,n=Object.keys(a.JackpotIds);a.Success&&n.length>0&&(this.jackpots=this.jackpots.map((e=>{const t=n.find((t=>String(t)===String(e.JackpotId)));return t?Object.assign(Object.assign({},e),{Enabled:a.JackpotIds[t]}):e}))),this.buttonsLoadingStates=Object.fromEntries(Object.entries(this.buttonsLoadingStates).filter((([e])=>!n.includes(e))))}}startCountdown(){this.updateTimers(),this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.jackpots.reduce(((t,i)=>{const s=new Date(i.JackpotEndTime).getTime()-e;let o="00h:00m:00s";const{days:a,hours:n,minutes:r,seconds:l}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};return o="00"===a?`${n}h:${r}m:${l}s`:`${a}d:${n}h:${r}m`,Object.assign(Object.assign({},t),{[i.JackpotId]:o})}),{})}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getJackpotClasses(e){return{JackpotCard:!0,JackpotCardSuspended:e.IsClosed,InProgress:e.Enabled&&!e.IsClosed}}getJackpotHeaderTemplate(e){const i=!!e.WinBalance,s=i?e.WinBalance:e.Balance,o=N(e.Type,this.language),a=N("suspended",this.language),n=(null==e?void 0:e.IsClosed)?a:o,r=`JackpotBalance Jackpot${N(e.Type,this.language)}`,l=e.Enabled&&!(null==e?void 0:e.IsClosed)?"JackpotJoinButton Joined":"JackpotJoinButton",p=N(e.Enabled&&!(null==e?void 0:e.IsClosed)?"unjoin":"join",this.language),c=!(null==e?void 0:e.IsClosed)||G(new Date(e.JackpotEndTime),new Date),h=!!this.buttonsLoadingStates[e.JackpotId];return t("div",{class:"JackpotCardHeader"},t("div",{class:"JackpotTitle"},t("span",{class:"JackpotName"},n),t("span",{class:r},function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(s,e.Currency))),i?t("span",{class:"JackpotWon"},N("jackpotIsWon",this.language)):c&&t("button",{class:l,onClick:this.changeJackpotStatus,"data-id":e.JackpotId,"data-joined":e.Enabled,disabled:h},p))}getJackpotDescriptionTemplate(e){const i=e.OperatorContributionPercent+"%",s=e.Probability+"%",o=G(new Date(e.JackpotEndTime),new Date)?N("outdatedJackpotCountdown",this.language):this.timers[e.JackpotId],a=N("operatorContribution",this.language),n=N("type",this.language),r=N("winingProbability",this.language);return t("div",{class:"JackpotCardDescription"},t("span",{class:"JackpotCountdown"},o),t("div",{class:"JackpotCardDescriptionBlock"},t("div",{class:"JackpotCardDescriptionColumn"},this.renderDesciptionRowInfo(`${a}:`,i),this.renderDesciptionRowInfo(`${n}:`,e.JackpotTypePresentation)),t("div",{class:"JackpotCardDescriptionColumn"},this.renderDesciptionRowInfo(`${r}:`,s),t("a",{href:e.JackpotRulesUrl,target:"_blank"},N("termsAndConditions",this.language)))))}renderDesciptionRowInfo(e,i){return t("div",{class:"JackpotCardDescriptionRow"},t("span",null,e),t("span",{class:"JackpotDescriptionValue"},i))}getJackpotTemplate(e){const i=!(null==e?void 0:e.WinBalance);return t("div",{class:this.getJackpotClasses(e),onClick:this.handleJackpotClick,key:e.JackpotId,"data-id":e.JackpotId},this.getJackpotHeaderTemplate(e),i&&this.getJackpotDescriptionTemplate(e))}getHeaderTemplate(){return t("header",{class:"JackpotsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"JackpotsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"JackpotsListPopupHeaderName"},N("jackpots",this.language)),t("button",{class:"JackpotsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close jackpots list"})))}getListTemplate(){const e=this.jackpots.every((e=>e.IsClosed));return this.jackpots.length?t("div",{class:"JackpotsListWrapper"},e&&t("div",{class:"JackpotsListSuspended"},t("h2",null,N("allJackpotsSuspended",this.language))),t("div",{class:"JackpotsList"},this.jackpots.map((e=>this.getJackpotTemplate(e))))):t("div",{class:"JackpotsListSuspended"},t("h2",null,N("allJackpotsSuspended",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"JackpotsTooltipBackdrop"},t("div",{class:"JackpotsTooltip"},t("button",{class:"JackpotsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),N("tooltip",this.language))):""}render(){return t("div",{class:`JackpotsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{jackpots:["jackpotsPropHandler"]}}};U.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}body{margin:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.JackpotsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:var(--emw--border-radius-medium, 8px);overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.JackpotsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotsIconButton{width:16px;height:16px;cursor:pointer}.JackpotsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.JackpotsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.JackpotsListWrapper::-webkit-scrollbar{display:none}.JackpotsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.JackpotCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:var(--emw--border-radius-small, 6px);position:relative;cursor:pointer}.JackpotJoinButton:not([disabled]).Joined::before,.JackpotCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotCard.JackpotCardSuspended *{color:var(--emw--color-primary, #8F8B9C)}.JackpotCard.JackpotCardSuspended .JackpotBalance,.JackpotCard.JackpotCardSuspended .JackpotWon{-webkit-text-fill-color:var(--emw--color-primary, #8F8B9C)}.JackpotCardHeader{display:flex;justify-content:space-between;gap:24px}.JackpotTitle{display:flex;flex-direction:column;justify-content:space-between}.JackpotName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;margin-bottom:4px}.JackpotMega,.JackpotWon{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%)}.JackpotMajor{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%)}.JackpotMinor{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%)}.JackpotBalance,.JackpotWon{font-weight:bold;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.JackpotCardDescription{display:flex;flex-direction:column;margin-top:12px}.JackpotCardDescriptionRow{display:flex;align-items:center;color:var(--emw--color-primary, #8F8B9C);font-size:12px;line-height:12px}.JackpotCardDescriptionRow .JackpotDescriptionValue{font-weight:600;margin-left:2px}.JackpotCardDescriptionColumn{display:flex;flex-direction:column;row-gap:4px}.JackpotCardDescriptionBlock{display:flex;justify-content:space-between;column-gap:14px}.JackpotCardDescriptionBlock a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px;font-size:11px}.JackpotJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.JackpotJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.JackpotJoinButton.Joined:not([disabled])::before{border-radius:99px}.JackpotJoinButton[disabled]{opacity:0.5;pointer-events:none;cursor:auto}.JackpotsListSuspended{padding:20px 19px}.JackpotsListSuspended h2{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);font-weight:400}.JackpotCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px;margin-bottom:12px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:6px;position:absolute}.JackpotsListPopup.Tablet .JackpotsListPopupHeader,.JackpotsListPopup.Desktop .JackpotsListPopupHeader{padding-top:16px}.JackpotsListPopup.Tablet .JackpotsListPopupHeaderName,.JackpotsListPopup.Desktop .JackpotsListPopupHeaderName{font-size:16px;line-height:16px}.JackpotsListPopup.Tablet .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotsIconButton{width:24px;height:24px}.JackpotsListPopup.Tablet .JackpotsList,.JackpotsListPopup.Desktop .JackpotsList{padding:20px 24px 0;row-gap:20px}.JackpotsListPopup.Tablet .JackpotCardHeader,.JackpotsListPopup.Desktop .JackpotCardHeader{margin-bottom:16px}.JackpotsListPopup.Tablet .JackpotName,.JackpotsListPopup.Desktop .JackpotName{line-height:27px;font-size:22px}.JackpotsListPopup.Tablet .JackpotJoinButton,.JackpotsListPopup.Desktop .JackpotJoinButton{min-width:100px;height:36px;font-size:16px}.JackpotsListPopup.Tablet .JackpotCountdown,.JackpotsListPopup.Desktop .JackpotCountdown{font-size:14px;line-height:14px}.JackpotsListPopup.Tablet .JackpotTooltip,.JackpotsListPopup.Desktop .JackpotTooltip{padding:60px 65px;font-size:16px;line-height:20px}.JackpotsListPopup.Tablet .JackpotTooltip .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotTooltip .JackpotsIconButton{top:24px;right:24px}';const q=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.showAnimation=!1,this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.isLoading||this.closeModal.emit(this.modalType)},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return t("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device} ${this.showAnimation&&"ShowAnimation"}`},t("div",{class:"ModalWinAnimation"}),t("div",{class:"ModalContent GradientBorder"},t("div",{class:"IconCloseContainer"},t("button",{class:"IconCloseButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Сlose modal"}))),this.contentIcon?t("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):null,t("div",{class:"ModalHeader"},t("h1",null,this.header)),t("div",{class:"ModalBody"},t("slot",{name:"body"})),t("div",{class:"ModalFooter"},t("slot",{name:"footer"}))))}get host(){return s(this)}};q.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:"Montserrat", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:"Inter", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}';const V=["en"],Q={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward",jackpotWin:"Total Jackpot Win!"}},K=(e,t)=>{const i=t;return Q[void 0!==i&&V.includes(i)?i:"en"][e]},Y=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=e=>{const t=e.currentTarget.getAttribute("data-type");this.closeModal.emit(t)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.isModalOpen=e=>Boolean(this.openModals.find((t=>t===e)))}openModalHandler(e){const{modalType:t,rewardMessage:i,hasError:s,confirmationData:o,winAmount:a}=e.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,t],this.rewardMessage=i,this.hasError=s,o&&(this.confirmationData=o)}closeModalHandler(e){this.openModals=this.openModals.filter((t=>t!==e.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:e}=this.confirmationData||{};return t("div",{class:`ModalContainer ${this.device}`},t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},t("div",{slot:"body"},t("p",null,K("won",this.language)," ",t("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&t("p",{class:"SupportInfo"},K("supportInfo",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},K("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},t("div",{slot:"body"},t("div",{class:"JackpotWinText"},K("jackpotWin",this.language)),t("div",{class:"JackpotWinAmount"},(i=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(i)}`))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},K("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:K(e?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},t("div",{slot:"body"},t("p",{class:"LeftAlign"},K("desc",this.language)),t("p",{class:"LeftAlign"},K(e?"joinQuestion":"unJoinQuestion",this.language))),t("div",{slot:"footer",class:"ManyActions"},t("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},K(e?"joinConfirm":"unJoinConfirm",this.language)),t("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},t("div",{class:"GradientText"},K(e?"joinReject":"unJoinReject",this.language))))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:K("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},t("div",{slot:"body"},t("span",null,K("contactSupport",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},K("okContinue",this.language)))));var i}get host(){return s(this)}};Y.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';const X=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return t("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},t("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},t("slot",{name:"Title"},t("div",null)),t("slot",{name:"Percent"},t("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),t("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},t("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return s(this)}};X.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";export{n as casino_engagement_suite_bar,g as casino_engagement_suite_challenges_details,D as casino_engagement_suite_challenges_list,P as casino_engagement_suite_container,M as casino_engagement_suite_free_spins_details,j as casino_engagement_suite_free_spins_list,$ as casino_engagement_suite_jackpot_details,U as casino_engagement_suite_jackpots_list,q as casino_engagement_suite_modal,Y as casino_engagement_suite_modal_container,X as casino_engagement_suite_progress_bar}