@everymatrix/casino-engagement-suite-jackpot-details 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.esm.js +1 -0
- package/dist/casino-engagement-suite-jackpot-details/index.esm.js +0 -0
- package/dist/casino-engagement-suite-jackpot-details/p-9764b08b.entry.js +1 -0
- package/dist/casino-engagement-suite-jackpot-details/p-e36472df.js +1 -0
- package/dist/casino-engagement-suite-jackpot-details/p-e8978b77.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.entry.js +285 -0
- package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.js +19 -0
- package/dist/cjs/casino-engagement-suite-progress-bar.cjs.entry.js +76 -0
- package/dist/cjs/index-8f767151.js +1317 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.css +358 -0
- package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.js +460 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/index.js +1 -0
- package/dist/collection/utils/index.js +5 -0
- package/dist/collection/utils/locale.utils.js +22 -0
- package/dist/components/casino-engagement-suite-jackpot-details.d.ts +11 -0
- package/dist/components/casino-engagement-suite-jackpot-details.js +316 -0
- package/dist/components/casino-engagement-suite-progress-bar.js +97 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-jackpot-details.entry.js +281 -0
- package/dist/esm/casino-engagement-suite-jackpot-details.js +17 -0
- package/dist/esm/casino-engagement-suite-progress-bar.entry.js +72 -0
- package/dist/esm/index-ec30ecaa.js +1290 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-jackpot-details/.stencil/packages/casino-engagement-suite-jackpot-details/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.d.ts +82 -0
- package/dist/types/components.d.ts +88 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/index.d.ts +49 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
package/dist/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.esm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as i}from"./p-e36472df.js";(()=>{const i=import.meta.url,n={};return""!==i&&(n.resourcesUrl=new URL(".",i).href),e(n)})().then((e=>i([["p-9764b08b",[[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"]]]]],["p-e8978b77",[[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)));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as a,g as o}from"./p-e36472df.js";const i=["en"],s={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"}},p=(t,e)=>{const a=e;return s[void 0!==a&&i.includes(a)?a:"en"][t]},n=class{constructor(a){t(this,a),this.close=e(this,"close",7),this.back=e(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=t=>{this.activeTab=+t.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=t=>{t.stopPropagation(),window.postMessage({type:"JackpotChangeStatusRequest",data:{[this.jackpot.Id]:!this.jackpot.Enabled}}),this.loading=!0},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.host.prepend(e)}),1)})).catch((t=>{console.log("Error ",t)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=t=>{const e=t.currentTarget.getAttribute("data-slug");e&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:e}})}}handleEvent(t){const{type:e,data:a}=null==t?void 0:t.data;switch(e){case"UpdateJackpotStatus":this.updateJackpotStatus(t.data.data);break;case"JoinJackpotResult":{const t=a;t.Success&&this.jackpot.Id in t.JackpotIds&&(this.enabled=this.jackpot.Enabled=t.JackpotIds[this.jackpot.Id]),this.loading=!1;break}case"UpdateJackpotBalance":{const t=a.find((t=>t.JackpotId===this.jackpot.Id));t&&(this.balance=this.jackpot.Balance=t.Balance,this.winBalance=this.jackpot.WinBalance=t.WinBalance)}}}componentWillLoad(){this.startCountdown(),this.enabled=this.jackpot.Enabled,this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}componentDidRender(){if(!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2===this.activeTab&&!this.maxVisibleGames){const t="Mobile"===this.device?10:12,e="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-t*(e-1))/e/74*40+t))*e,this.visibleGames=this.jackpot.GamesInfo.slice(0,this.maxVisibleGames)}}disconnectedCallback(){this.clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}updateJackpotStatus(t){t.IsClosed?(this.clearInterval(),this.disabledStatus=t.Reason,this.activeTab=1):(this.disabledStatus="",this.jackpot.JackpotEndTime=t.JackpotEndTime,this.startCountdown())}getTopNavigationTemplate(){return a("div",{class:"JackpotDetailsNavigation"},a("button",{class:"JackpotIconButton",onClick:this.handleBackClick},a("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),a("div",{class:"JackpotPopupName"},p("jackpots",this.language)),a("button",{class:"JackpotIconButton",onClick:this.handleCloseClick},a("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getJackpotBalance(){return function(t,e,a=99999999){return t=Math.min(t,a),`${e} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}`}(this.winBalance||this.balance,this.jackpot.Currency)}getJoinButtonClasses(){return{PopupButton:!0,Active:this.enabled,Loading:this.loading}}getJackpotDetailsHeaderTemplate(){return a("div",{class:"JackpotDetailsHeader"},a("div",null,a("div",{class:"JackpotType"},this.jackpot.Type),a("div",{class:"JackpotBalance"},this.getJackpotBalance())),a("div",{class:"JackpotDetailsHeaderSecondCol"},a("button",{disabled:!!this.disabledStatus,onClick:this.changeJackpotStatus,class:this.getJoinButtonClasses()},p(this.enabled?"unjoin":"join",this.language)),this.winBalance&&a("div",{class:"JackpotIsWon"},p("jackpotIsWon",this.language))))}getTabsTemplate(){return a("div",{class:"JackpotDetailsTabs"},a("div",{"data-index":"1",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(1===this.activeTab?"Active":"")},p("info",this.language)),a("div",{"data-index":"2",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(2===this.activeTab?"Active":"")},p("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getJackpotInfoTemplate():this.getGamesTemplate()}getJackpotDetailsTemplate(){return a("div",null,a("div",{class:"JackpotDetailsButton",onClick:this.toggleShowDetails},a("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),a("span",null,p("jackpotDetails",this.language))),this.showDetails&&a("p",{class:"JackpotDescription"},this.jackpot.Description))}getJackpotInfoTemplate(){return a("div",null,this.jackpot.Description&&this.getJackpotDetailsTemplate(),a("div",{class:"JackpotInfo"},a("div",{class:"JackpotInfoItem"},p("operatorContribution",this.language),": ",a("span",null,this.jackpot.OperatorContributionPercent,"%")),a("div",{class:"JackpotInfoItem"},p("type",this.language),": ",a("span",null,this.jackpot.JackpotTypePresentation)),a("div",{class:"JackpotInfoItem"},p("winningProbability",this.language),": ",a("span",null,"1:",this.jackpot.Probability)),this.jackpot.JackpotRulesUrl&&a("div",{class:"JackpotInfoItem"},a("a",{class:"tc",href:this.jackpot.JackpotRulesUrl,target:"_blank"},p("tc",this.jackpot.JackpotRulesUrl)))))}getGamesTemplate(){const t=this.visibleGames.map((t=>a("div",{onClick:this.onGameClick,class:"JackpotGamesListItem "+(t.GameSlug===this.gameSlug?"Disabled":""),key:t.CasinoGameId,"data-slug":t.GameSlug,style:{background:`center / cover url(${t.GameIcon}) no-repeat`},title:t.GameName})));return[a("div",{class:"JackpotGamesListWrapper",ref:t=>this.gamesListWrapperEl=t},a("div",{class:"JackpotGamesList"},t)),this.visibleGames.length<this.jackpot.GamesInfo.length?a("button",{class:"PopupButton Active JackpotGamesButton",onClick:this.handleLoadMore},p("loadMore",this.language)):""]}getJackpotCountdown(){return a("div",{class:"JackpotCountdown "+(this.disabledStatus?"Suspended":"")},this.disabledStatus||this.timer)}startCountdown(){this.updateTimer(),this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const t=new Date(this.jackpot.JackpotEndTime).getTime()-(new Date).getTime();if(t<1)return void this.clearInterval();const{days:e,hours:a,minutes:o,seconds:i}={days:String(Math.floor(t/864e5)).padStart(2,"0"),hours:String(Math.floor(t%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(t%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(t%6e4/1e3)).padStart(2,"0")};this.timer="00"===e?`${a}h:${o}m:${i}s`:`${e}d:${a}h:${o}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 a("div",{class:this.getPopupClasses()},this.getTopNavigationTemplate(),a("div",{class:"JackpotDetailsPopupContent"},this.getJackpotDetailsHeaderTemplate(),this.getJackpotCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return o(this)}};n.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)}.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}';export{n as casino_engagement_suite_jackpot_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=(e,t,n)=>{n&&n.map((([n,l,s])=>{const i=a(e,n),c=u(t,s),r=f(n);o.ael(i,l,c,r),(t.o=t.o||[]).push((()=>o.rel(i,l,c,r)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){K(e)}},a=(e,t)=>8&t?l:e,f=e=>0!=(2&e),d=new WeakMap,$=e=>"sc-"+e.$,y={},h=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!h(l))&&(l+=""),o&&i?c[c.length-1].h+=l:c.push(o?p(null,l):l),i=o)};if(r(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=p(e,null);return u.m=t,c.length>0&&(u.p=c),u.g=s,u},p=(e,t)=>({t:0,S:e,h:t,k:null,p:null,m:null,g:null}),b={},w=(e,t,n,s,i,c)=>{if(n!==s){let r=J(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if("key"===t);else if("ref"===t)s&&s(e);else if(r||"o"!==t[0]||"n"!==t[1]){const l=h(s);if((r||l&&null!==s)&&!i)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):J(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},g=/\s/,S=e=>e?e.split(g):[],k=(e,t,n,l)=>{const s=11===t.k.nodeType&&t.k.host?t.k.host:t.k,o=e&&e.m||y,i=t.m||y;for(l in o)l in i||w(s,l,o[l],void 0,n,t.t);for(l in i)w(s,l,o[l],i[l],n,t.t)},j=(t,n,l)=>{let o,i,c=n.p[l],r=0;if(null!==c.h)o=c.k=s.createTextNode(c.h);else if(o=c.k=s.createElement(c.S),k(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(r=0;r<c.p.length;++r)i=j(t,c,r),i&&o.appendChild(i);return o},v=(e,n,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=j(null,l,o),c&&(s[o].k=c,r.insertBefore(c,n)))},M=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.k,P(l),s.remove())},C=(e,t)=>e.S===t.S&&e.g===t.g,O=(e,t)=>{const n=t.k=e.k,l=e.p,s=t.p,o=t.h;null===o?("slot"===t.S||k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,c=0,r=0,u=0,a=t.length-1,f=t[0],d=t[a],$=l.length-1,y=l[0],h=l[$];for(;i<=a&&c<=$;)if(null==f)f=t[++i];else if(null==d)d=t[--a];else if(null==y)y=l[++c];else if(null==h)h=l[--$];else if(C(f,y))O(f,y),f=t[++i],y=l[++c];else if(C(d,h))O(d,h),d=t[--a],h=l[--$];else if(C(f,h))O(f,h),e.insertBefore(f.k,d.k.nextSibling),f=t[++i],h=l[--$];else if(C(d,y))O(d,y),e.insertBefore(d.k,f.k),d=t[--a],y=l[++c];else{for(r=-1,u=i;u<=a;++u)if(t[u]&&null!==t[u].g&&t[u].g===y.g){r=u;break}r>=0?(o=t[r],o.S!==y.S?s=j(t&&t[c],n,r):(O(o,y),t[r]=void 0,s=o.k),y=l[++c]):(s=j(t&&t[c],n,c),y=l[++c]),s&&f.k.parentNode.insertBefore(s,f.k)}i>a?v(e,null==l[$+1]?null:l[$+1].k,n,l,c,$):c>$&&M(t,i,a)})(n,l,t,s):null!==s?(null!==e.h&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.h!==o&&(n.data=o)},P=e=>{e.m&&e.m.ref&&e.m.ref(null),e.p&&e.p.map(P)},x=e=>B(e).j,E=(e,t,n)=>{const l=x(e);return{emit:e=>L(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},L=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},N=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},R=(e,t)=>{if(e.t|=16,!(4&e.t))return N(e,e.M),oe((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>q(n,e,t))),e.u=null),l=q(n,"componentWillLoad")),D(l,(()=>W(e,n,t)))},W=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.j,l=t.t,o=((e,t)=>{let n=$(t),l=Y.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=d.get(e=e.head||e);o||d.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);A(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>F(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},A=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C,i=n.O||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,o.P&&(c.m=c.m||{},o.P.map((([e,t])=>c.m[t]=s[e]))),c.S=null,c.t|=4,n.O=c,c.k=i.k=s.shadowRoot||s,e=s["s-sc"],O(i,c)})(n,l)}catch(e){K(e,n.j)}return null},F=e=>{const t=e.j,n=e.M;q(e.i,"componentDidRender"),64&e.t||(e.t|=64,H(t),e.L(t),n||U()),e.v&&(e.v(),e.v=void 0),512&e.t&&se((()=>R(e,!1))),e.t&=-517},U=()=>{H(s.documentElement),se((()=>L(l,"appload",{detail:{namespace:"casino-engagement-suite-jackpot-details"}})))},q=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){K(e)}},D=(e,t)=>e&&e.then?e.then(t):t(),H=e=>e.classList.add("hydrated"),V=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.R.get(t),i=s.t,c=s.i;n=((e,t)=>null==e||h(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),8&i&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),c&&2==(18&i)&&R(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.P.push([e,s]),s}))}}return e},_=(e,t={})=>{const n=[],i=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),y=[];let h,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],$:t[1],N:t[2],T:t[3]};l.N=t[2],l.T=t[3],l.P=[];const s=l.$,a=class extends HTMLElement{constructor(e){super(e),I(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),m?y.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.C,l=()=>{};if(1&t.t)r(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){N(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=X(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(V(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){K(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=$(n);if(!Y.has(t)){const l=()=>{};((e,t,n)=>{let l=Y.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,Y.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,i=()=>R(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=B(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),q(t,"disconnectedCallback")}})()))}componentOnReady(){return B(this).W}};l.A=e[0],i.includes(s)||u.get(s)||(n.push(s),u.define(s,V(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,y.length?y.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(U,30)))},z=new WeakMap,B=e=>z.get(e),G=(e,t)=>z.set(t.i=e,t),I=(e,t)=>{const n={t:0,j:e,C:t,R:new Map};return n.W=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],r(e,n,t.T),z.set(e,n)},J=(e,t)=>t in e,K=(e,t)=>(0,console.error)(e,t),Q=new Map,X=e=>{const t=e.$.replace(/-/g,"_"),n=e.A,l=Q.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(Q.set(n,e),e[t])),K)},Y=new Map,Z=[],ee=[],te=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?se(le):o.raf(le))},ne=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){K(e)}e.length=0},le=()=>{ne(Z),ne(ee),(n=Z.length>0)&&o.raf(le)},se=e=>i().then(e),oe=te(ee,!0);export{_ as b,E as c,x as g,m as h,i as p,G as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,h as e,g as s}from"./p-e36472df.js";const t=class{constructor(e){r(this,e),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let r=document.createElement("style");r.innerHTML=this.clientStyling,this.host.prepend(r)},this.setClientStylingURL=()=>{let r=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(r.href).then((r=>r.text())).then((r=>{e.innerHTML=r,setTimeout((()=>{this.host.prepend(e)}),1)})).catch((r=>{console.log("Error ",r)}))}}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 e("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},e("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},e("slot",{name:"Title"},e("div",null)),e("slot",{name:"Percent"},e("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),e("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},e("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return s(this)}};t.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{t as casino_engagement_suite_progress_bar}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8f767151.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
jackpots: 'Jackpots',
|
|
12
|
+
join: 'Join',
|
|
13
|
+
unjoin: 'Unjoin',
|
|
14
|
+
info: 'Info',
|
|
15
|
+
games: 'Games',
|
|
16
|
+
operatorContribution: 'Operator Contribution',
|
|
17
|
+
type: 'Type',
|
|
18
|
+
winningProbability: 'Winning Probability',
|
|
19
|
+
tc: 'Terms & Conditions',
|
|
20
|
+
jackpotIsWon: 'Jackpot’s won!',
|
|
21
|
+
loadMore: 'Load More',
|
|
22
|
+
jackpotDetails: 'Jackpot Details',
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const translate = (key, customLang) => {
|
|
26
|
+
const lang = customLang;
|
|
27
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function formatBalance(amount, currency, maxAmount = 99999999) {
|
|
31
|
+
amount = Math.min(amount, maxAmount);
|
|
32
|
+
return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
33
|
+
.format(amount)}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const casinoEngagementSuiteJackpotDetailsCss = ":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)}.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}";
|
|
37
|
+
|
|
38
|
+
const CasinoEngagementSuiteJackpotDetails = class {
|
|
39
|
+
constructor(hostRef) {
|
|
40
|
+
index.registerInstance(this, hostRef);
|
|
41
|
+
this.close = index.createEvent(this, "close", 7);
|
|
42
|
+
this.back = index.createEvent(this, "back", 7);
|
|
43
|
+
/**
|
|
44
|
+
* Client custom styling via string
|
|
45
|
+
*/
|
|
46
|
+
this.clientStyling = '';
|
|
47
|
+
/**
|
|
48
|
+
* Client custom styling via url
|
|
49
|
+
*/
|
|
50
|
+
this.clientStylingUrl = '';
|
|
51
|
+
/**
|
|
52
|
+
* Language of the widget
|
|
53
|
+
*/
|
|
54
|
+
this.language = 'en';
|
|
55
|
+
/**
|
|
56
|
+
* Current game slug
|
|
57
|
+
*/
|
|
58
|
+
this.gameSlug = '';
|
|
59
|
+
/**
|
|
60
|
+
* User's device type
|
|
61
|
+
*/
|
|
62
|
+
this.device = 'Mobile';
|
|
63
|
+
this.limitStylingAppends = false;
|
|
64
|
+
this.timer = '';
|
|
65
|
+
this.disabledStatus = '';
|
|
66
|
+
this.activeTab = 1;
|
|
67
|
+
this.visibleGames = [];
|
|
68
|
+
this.loading = false;
|
|
69
|
+
this.enabled = false;
|
|
70
|
+
this.showDetails = false;
|
|
71
|
+
this.maxVisibleGames = 0;
|
|
72
|
+
this.handleTabChange = (e) => {
|
|
73
|
+
this.activeTab = +(e.target.getAttribute('data-index'));
|
|
74
|
+
this.visibleGames = [];
|
|
75
|
+
this.maxVisibleGames = 0;
|
|
76
|
+
};
|
|
77
|
+
this.handleLoadMore = () => {
|
|
78
|
+
this.visibleGames = this.jackpot.GamesInfo.slice(0, this.visibleGames.length + this.maxVisibleGames);
|
|
79
|
+
};
|
|
80
|
+
this.toggleShowDetails = () => {
|
|
81
|
+
this.showDetails = !this.showDetails;
|
|
82
|
+
};
|
|
83
|
+
this.changeJackpotStatus = (ev) => {
|
|
84
|
+
ev.stopPropagation();
|
|
85
|
+
window.postMessage({
|
|
86
|
+
type: 'JackpotChangeStatusRequest',
|
|
87
|
+
data: {
|
|
88
|
+
[this.jackpot.Id]: !this.jackpot.Enabled,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
this.loading = true;
|
|
92
|
+
};
|
|
93
|
+
this.setClientStyling = () => {
|
|
94
|
+
let sheet = document.createElement('style');
|
|
95
|
+
sheet.innerHTML = this.clientStyling;
|
|
96
|
+
this.host.prepend(sheet);
|
|
97
|
+
};
|
|
98
|
+
this.setClientStylingURL = () => {
|
|
99
|
+
let url = new URL(this.clientStylingUrl);
|
|
100
|
+
let cssFile = document.createElement('style');
|
|
101
|
+
fetch(url.href)
|
|
102
|
+
.then((res) => res.text())
|
|
103
|
+
.then((data) => {
|
|
104
|
+
cssFile.innerHTML = data;
|
|
105
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
106
|
+
})
|
|
107
|
+
.catch((err) => {
|
|
108
|
+
console.log('Error ', err);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
this.handleCloseClick = () => {
|
|
112
|
+
this.close.emit();
|
|
113
|
+
};
|
|
114
|
+
this.handleBackClick = () => {
|
|
115
|
+
this.back.emit();
|
|
116
|
+
};
|
|
117
|
+
this.onGameClick = (ev) => {
|
|
118
|
+
const slug = ev.currentTarget.getAttribute('data-slug');
|
|
119
|
+
if (slug) {
|
|
120
|
+
window.postMessage({
|
|
121
|
+
type: 'EngagementSuiteGameRedirect',
|
|
122
|
+
data: {
|
|
123
|
+
Slug: slug
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
handleEvent(e) {
|
|
130
|
+
const { type, data } = e === null || e === void 0 ? void 0 : e.data;
|
|
131
|
+
switch (type) {
|
|
132
|
+
case 'UpdateJackpotStatus': {
|
|
133
|
+
this.updateJackpotStatus(e.data.data);
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case 'JoinJackpotResult': {
|
|
137
|
+
const res = data;
|
|
138
|
+
if (res.Success && this.jackpot.Id in res.JackpotIds) {
|
|
139
|
+
this.enabled = this.jackpot.Enabled = res.JackpotIds[this.jackpot.Id];
|
|
140
|
+
}
|
|
141
|
+
this.loading = false;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
case 'UpdateJackpotBalance': {
|
|
145
|
+
const jackpotUpdate = data
|
|
146
|
+
.find((updateMessage => updateMessage.JackpotId === this.jackpot.Id));
|
|
147
|
+
if (jackpotUpdate) {
|
|
148
|
+
this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
|
|
149
|
+
this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
componentWillLoad() {
|
|
155
|
+
this.startCountdown();
|
|
156
|
+
this.enabled = this.jackpot.Enabled;
|
|
157
|
+
this.balance = this.jackpot.Balance;
|
|
158
|
+
this.winBalance = this.jackpot.WinBalance;
|
|
159
|
+
}
|
|
160
|
+
componentDidRender() {
|
|
161
|
+
if (!this.limitStylingAppends && this.host) {
|
|
162
|
+
if (this.clientStyling)
|
|
163
|
+
this.setClientStyling();
|
|
164
|
+
if (this.clientStylingUrl)
|
|
165
|
+
this.setClientStylingURL();
|
|
166
|
+
this.limitStylingAppends = true;
|
|
167
|
+
}
|
|
168
|
+
if (this.activeTab === 2 && !this.maxVisibleGames) {
|
|
169
|
+
const gap = this.device === 'Mobile' ? 10 : 12;
|
|
170
|
+
const gamesPerRow = this.device === 'Mobile' ? 4 : 5;
|
|
171
|
+
const availableWidth = this.gamesListWrapperEl.offsetWidth - (gap * (gamesPerRow - 1));
|
|
172
|
+
const gameElWidth = availableWidth / gamesPerRow;
|
|
173
|
+
const gameElHeight = (gameElWidth / 74 * 40) + gap;
|
|
174
|
+
this.maxVisibleGames = Math.floor(this.gamesListWrapperEl.offsetHeight / gameElHeight) * gamesPerRow;
|
|
175
|
+
this.visibleGames = this.jackpot.GamesInfo.slice(0, this.maxVisibleGames);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
disconnectedCallback() {
|
|
179
|
+
this.clearInterval();
|
|
180
|
+
}
|
|
181
|
+
clearInterval() {
|
|
182
|
+
if (this.interval) {
|
|
183
|
+
clearInterval(this.interval);
|
|
184
|
+
this.interval = null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
updateJackpotStatus(event) {
|
|
188
|
+
if (event.IsClosed) {
|
|
189
|
+
this.clearInterval();
|
|
190
|
+
this.disabledStatus = event.Reason;
|
|
191
|
+
this.activeTab = 1;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
this.disabledStatus = '';
|
|
195
|
+
this.jackpot.JackpotEndTime = event.JackpotEndTime;
|
|
196
|
+
this.startCountdown();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
getTopNavigationTemplate() {
|
|
200
|
+
return (index.h("div", { class: "JackpotDetailsNavigation" }, index.h("button", { class: "JackpotIconButton", onClick: this.handleBackClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), index.h("div", { class: "JackpotPopupName" }, translate('jackpots', this.language)), index.h("button", { class: "JackpotIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
201
|
+
}
|
|
202
|
+
getJackpotBalance() {
|
|
203
|
+
return formatBalance(this.winBalance || this.balance, this.jackpot.Currency);
|
|
204
|
+
}
|
|
205
|
+
getJoinButtonClasses() {
|
|
206
|
+
return {
|
|
207
|
+
PopupButton: true,
|
|
208
|
+
Active: this.enabled,
|
|
209
|
+
Loading: this.loading
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
getJackpotDetailsHeaderTemplate() {
|
|
213
|
+
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
|
|
214
|
+
? translate('unjoin', this.language)
|
|
215
|
+
: translate('join', this.language)), this.winBalance && index.h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
|
|
216
|
+
}
|
|
217
|
+
getTabsTemplate() {
|
|
218
|
+
return index.h("div", { class: "JackpotDetailsTabs" }, index.h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate('info', this.language)), index.h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate('games', this.language)));
|
|
219
|
+
}
|
|
220
|
+
getTabsContentTemplate() {
|
|
221
|
+
return this.activeTab === 1
|
|
222
|
+
? this.getJackpotInfoTemplate()
|
|
223
|
+
: this.getGamesTemplate();
|
|
224
|
+
}
|
|
225
|
+
getJackpotDetailsTemplate() {
|
|
226
|
+
return index.h("div", null, index.h("div", { class: "JackpotDetailsButton", onClick: this.toggleShowDetails }, index.h("div", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), index.h("span", null, translate('jackpotDetails', this.language))), this.showDetails && index.h("p", { class: "JackpotDescription" }, this.jackpot.Description));
|
|
227
|
+
}
|
|
228
|
+
getJackpotInfoTemplate() {
|
|
229
|
+
return index.h("div", null, this.jackpot.Description && this.getJackpotDetailsTemplate(), index.h("div", { class: "JackpotInfo" }, index.h("div", { class: "JackpotInfoItem" }, translate('operatorContribution', this.language), ":\u00A0", index.h("span", null, this.jackpot.OperatorContributionPercent, "%")), index.h("div", { class: "JackpotInfoItem" }, translate('type', this.language), ":\u00A0", index.h("span", null, this.jackpot.JackpotTypePresentation)), index.h("div", { class: "JackpotInfoItem" }, translate('winningProbability', this.language), ":\u00A0", index.h("span", null, "1:", this.jackpot.Probability)), this.jackpot.JackpotRulesUrl && index.h("div", { class: "JackpotInfoItem" }, index.h("a", { class: "tc", href: this.jackpot.JackpotRulesUrl, target: "_blank" }, translate('tc', this.jackpot.JackpotRulesUrl)))));
|
|
230
|
+
}
|
|
231
|
+
getGamesTemplate() {
|
|
232
|
+
const list = this.visibleGames.map((game) => {
|
|
233
|
+
return index.h("div", { onClick: this.onGameClick, class: `JackpotGamesListItem ${game.GameSlug === this.gameSlug ? 'Disabled' : ''}`, key: game.CasinoGameId, "data-slug": game.GameSlug, style: { background: `center / cover url(${game.GameIcon}) no-repeat` }, title: game.GameName });
|
|
234
|
+
});
|
|
235
|
+
return [
|
|
236
|
+
index.h("div", { class: "JackpotGamesListWrapper", ref: el => this.gamesListWrapperEl = el }, index.h("div", { class: "JackpotGamesList" }, list)),
|
|
237
|
+
this.visibleGames.length < this.jackpot.GamesInfo.length
|
|
238
|
+
? index.h("button", { class: "PopupButton Active JackpotGamesButton", onClick: this.handleLoadMore }, translate('loadMore', this.language))
|
|
239
|
+
: ''
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
getJackpotCountdown() {
|
|
243
|
+
const timerMessage = this.disabledStatus || this.timer;
|
|
244
|
+
return (index.h("div", { class: `JackpotCountdown ${this.disabledStatus ? 'Suspended' : ''}` }, timerMessage));
|
|
245
|
+
}
|
|
246
|
+
startCountdown() {
|
|
247
|
+
this.updateTimer();
|
|
248
|
+
this.interval = setInterval(() => {
|
|
249
|
+
this.updateTimer();
|
|
250
|
+
}, 1000);
|
|
251
|
+
}
|
|
252
|
+
updateTimer() {
|
|
253
|
+
const expirationTime = new Date(this.jackpot.JackpotEndTime).getTime();
|
|
254
|
+
const now = new Date().getTime();
|
|
255
|
+
const distance = expirationTime - now;
|
|
256
|
+
if (distance < 1) {
|
|
257
|
+
this.clearInterval();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const { days, hours, minutes, seconds } = {
|
|
261
|
+
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
262
|
+
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
263
|
+
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
264
|
+
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
265
|
+
};
|
|
266
|
+
this.timer = days === '00'
|
|
267
|
+
? `${hours}h:${minutes}m:${seconds}s`
|
|
268
|
+
: `${days}d:${hours}h:${minutes}m`;
|
|
269
|
+
}
|
|
270
|
+
getPopupClasses() {
|
|
271
|
+
return {
|
|
272
|
+
JackpotDetailsPopup: true,
|
|
273
|
+
Disabled: !!this.disabledStatus,
|
|
274
|
+
[this.device]: true,
|
|
275
|
+
[this.jackpot.Type.charAt(0).toUpperCase() + this.jackpot.Type.slice(1)]: true
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
render() {
|
|
279
|
+
return index.h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), index.h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
|
|
280
|
+
}
|
|
281
|
+
get host() { return index.getElement(this); }
|
|
282
|
+
};
|
|
283
|
+
CasinoEngagementSuiteJackpotDetails.style = casinoEngagementSuiteJackpotDetailsCss;
|
|
284
|
+
|
|
285
|
+
exports.casino_engagement_suite_jackpot_details = CasinoEngagementSuiteJackpotDetails;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-8f767151.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-engagement-suite-jackpot-details.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["casino-engagement-suite-jackpot-details.cjs",[[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"]]]]],["casino-engagement-suite-progress-bar.cjs",[[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]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8f767151.js');
|
|
6
|
+
|
|
7
|
+
const casinoEngagementSuiteProgressBarCss = ":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)}";
|
|
8
|
+
|
|
9
|
+
const CasinoEngagementSuiteProgressBar = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
/**
|
|
13
|
+
* Value for the widget
|
|
14
|
+
*/
|
|
15
|
+
this.value = 0;
|
|
16
|
+
/**
|
|
17
|
+
* Shows disabled styles
|
|
18
|
+
*/
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
/**
|
|
21
|
+
* Hide percent value
|
|
22
|
+
*/
|
|
23
|
+
this.hidePercent = false;
|
|
24
|
+
/**
|
|
25
|
+
* Client custom styling via string
|
|
26
|
+
*/
|
|
27
|
+
this.clientStyling = '';
|
|
28
|
+
/**
|
|
29
|
+
* Client custom styling via url
|
|
30
|
+
*/
|
|
31
|
+
this.clientStylingUrl = '';
|
|
32
|
+
this.limitStylingAppends = false;
|
|
33
|
+
this.setClientStyling = () => {
|
|
34
|
+
let sheet = document.createElement('style');
|
|
35
|
+
sheet.innerHTML = this.clientStyling;
|
|
36
|
+
this.host.prepend(sheet);
|
|
37
|
+
};
|
|
38
|
+
this.setClientStylingURL = () => {
|
|
39
|
+
let url = new URL(this.clientStylingUrl);
|
|
40
|
+
let cssFile = document.createElement('style');
|
|
41
|
+
fetch(url.href)
|
|
42
|
+
.then((res) => res.text())
|
|
43
|
+
.then((data) => {
|
|
44
|
+
cssFile.innerHTML = data;
|
|
45
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
console.log('Error ', err);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
componentDidRender() {
|
|
53
|
+
if (!this.limitStylingAppends && this.host) {
|
|
54
|
+
if (this.clientStyling)
|
|
55
|
+
this.setClientStyling();
|
|
56
|
+
if (this.clientStylingUrl)
|
|
57
|
+
this.setClientStylingURL();
|
|
58
|
+
this.limitStylingAppends = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
getProgressBarClasses() {
|
|
62
|
+
return {
|
|
63
|
+
ProgressBar: true,
|
|
64
|
+
Completed: this.value === 100,
|
|
65
|
+
Disabled: this.disabled,
|
|
66
|
+
HidePercent: this.hidePercent
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return index.h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, index.h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, index.h("slot", { name: "Title" }, index.h("div", null)), index.h("slot", { name: "Percent" }, index.h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), index.h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, index.h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
|
|
71
|
+
}
|
|
72
|
+
get host() { return index.getElement(this); }
|
|
73
|
+
};
|
|
74
|
+
CasinoEngagementSuiteProgressBar.style = casinoEngagementSuiteProgressBarCss;
|
|
75
|
+
|
|
76
|
+
exports.casino_engagement_suite_progress_bar = CasinoEngagementSuiteProgressBar;
|