@everymatrix/casino-engagement-suite-tournament 1.44.0 → 1.45.5
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-tournament/casino-engagement-suite-tournament.esm.js +1 -1
- package/dist/casino-engagement-suite-tournament/index.esm.js +1 -0
- package/dist/casino-engagement-suite-tournament/p-0f4e94ab.entry.js +1 -0
- package/dist/casino-engagement-suite-tournament/p-1bf11325.js +2 -0
- package/dist/casino-engagement-suite-tournament/p-5df3ac81.js +1 -0
- package/dist/casino-engagement-suite-tournament/p-e1255160.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +119 -807
- package/dist/cjs/casino-engagement-suite-tournament-1b738bb2.js +560 -0
- package/dist/cjs/casino-engagement-suite-tournament.cjs.js +16 -10
- package/dist/cjs/index-16d5d7c3.js +1642 -0
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +17 -17
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +492 -582
- package/dist/collection/components/casino-engagement-suite-tournament/index.js +1 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/shared/GradientRoundedButton.js +6 -7
- package/dist/collection/shared/renderBar.js +11 -11
- package/dist/collection/utils/api.apdater.js +30 -30
- package/dist/collection/utils/translations.js +19 -19
- package/dist/collection/utils/types.js +9 -9
- package/dist/collection/utils/util.date.js +26 -26
- package/dist/collection/utils/utils.js +16 -16
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +119 -807
- package/dist/esm/casino-engagement-suite-tournament-d8471680.js +558 -0
- package/dist/esm/casino-engagement-suite-tournament.js +13 -10
- package/dist/esm/index-3962add4.js +1612 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/loader.js +6 -12
- package/dist/stencil.config.dev.js +14 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +120 -123
- package/dist/types/components/casino-engagement-suite-tournament/index.d.ts +1 -0
- package/dist/types/components.d.ts +17 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/GradientRoundedButton.d.ts +3 -3
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/api.apdater.d.ts +2 -30
- package/dist/types/utils/translations.d.ts +35 -35
- package/dist/types/utils/types.d.ts +77 -77
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/casino-engagement-suite-tournament/p-023f3dc7.entry.js +0 -1
- package/dist/casino-engagement-suite-tournament/p-86ce7485.js +0 -1
- package/dist/cjs/index-e778ddd2.js +0 -1733
- package/dist/components/casino-engagement-suite-progress-bar.js +0 -6
- package/dist/components/casino-engagement-suite-progress-bar2.js +0 -107
- package/dist/components/casino-engagement-suite-tournament.d.ts +0 -11
- package/dist/components/casino-engagement-suite-tournament.js +0 -716
- package/dist/components/general-styling-wrapper.js +0 -6
- package/dist/components/general-styling-wrapper2.js +0 -103
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-4e611d33.js +0 -1704
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-tournament/.stencil/packages/casino-engagement-suite-tournament/stencil.config.d.ts +0 -2
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-16d5d7c3.js');
|
|
4
|
+
|
|
5
|
+
/******************************************************************************
|
|
6
|
+
Copyright (c) Microsoft Corporation.
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
***************************************************************************** */
|
|
19
|
+
|
|
20
|
+
function __rest(s, e) {
|
|
21
|
+
var t = {};
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
23
|
+
t[p] = s[p];
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
+
t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
33
|
+
var e = new Error(message);
|
|
34
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var Tab;
|
|
38
|
+
(function (Tab) {
|
|
39
|
+
Tab["Info"] = "Info";
|
|
40
|
+
Tab["Leaderboard"] = "Leaderboard";
|
|
41
|
+
Tab["Games"] = "Games";
|
|
42
|
+
})(Tab || (Tab = {}));
|
|
43
|
+
var Time;
|
|
44
|
+
(function (Time) {
|
|
45
|
+
Time["Starts"] = "Starts";
|
|
46
|
+
Time["Ends"] = "Ends";
|
|
47
|
+
})(Time || (Time = {}));
|
|
48
|
+
const localePostprocess = (translationText, props) => {
|
|
49
|
+
Object.keys(props).map(key => {
|
|
50
|
+
translationText = translationText.replace(`{${key}}`, props[key]);
|
|
51
|
+
});
|
|
52
|
+
return translationText;
|
|
53
|
+
};
|
|
54
|
+
const TRANSLATIONS = Object.assign(Object.assign(Object.assign({ Join: 'Join', Unjoin: 'Unjoin' }, Tab), Time), { TC: 'Terms & Conditions', ScoreCriteria: 'Score Criteria', MinimumBetCriteria: 'Minimum bet criteria', Place: 'place', Prizes: 'Rewards', LeaderboardDetails: 'Leaderboard Details', UnjoinDialog: {
|
|
55
|
+
Title: 'Quit Leaderboard?',
|
|
56
|
+
Description: 'Any progress on the current Leaderboard won’t be kept and you can not rejoin the Leaderboard any more. <br /><br />Would you still like to quit?',
|
|
57
|
+
ButtonYes: 'Yes, I want to quit leaderboard',
|
|
58
|
+
ButtonNo: 'No, Stay on the leaderboard',
|
|
59
|
+
}, JoinDialog: {
|
|
60
|
+
Tile: 'Congratulations!',
|
|
61
|
+
Description: 'You have unlocked <span>{tournamentName}</span>! <br />Would you like to join?',
|
|
62
|
+
ButtonYes: 'Join',
|
|
63
|
+
ButtonNo: 'Not interested',
|
|
64
|
+
}, NoLeaderboards: 'No Leaderboards yet', NoLeaderboardsTip: 'Try winning tickets to Leaderboards as rewards or launching other booster games', Leaderboards: 'Leaderboards', TipPrize: 'You took <span>{place}</span> place and win <span>{prize}</span>', Tip: 'Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward.' });
|
|
65
|
+
|
|
66
|
+
const classnames = (...args) => {
|
|
67
|
+
let classnameArray = [];
|
|
68
|
+
args.map(arg => {
|
|
69
|
+
switch (typeof arg) {
|
|
70
|
+
case 'string':
|
|
71
|
+
classnameArray.push(arg);
|
|
72
|
+
break;
|
|
73
|
+
case 'object':
|
|
74
|
+
Object.keys(arg).map(k => {
|
|
75
|
+
if (arg[k]) {
|
|
76
|
+
classnameArray.push(k);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return classnameArray.join(' ');
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var LeaderboardPage;
|
|
86
|
+
(function (LeaderboardPage) {
|
|
87
|
+
LeaderboardPage["Confirm"] = "Confirm";
|
|
88
|
+
LeaderboardPage["List"] = "List";
|
|
89
|
+
LeaderboardPage["Item"] = "Item";
|
|
90
|
+
})(LeaderboardPage || (LeaderboardPage = {}));
|
|
91
|
+
var TournamentState;
|
|
92
|
+
(function (TournamentState) {
|
|
93
|
+
TournamentState["Running"] = "Running";
|
|
94
|
+
TournamentState["Unstarted"] = "Unstarted";
|
|
95
|
+
TournamentState["Closed"] = "Closed";
|
|
96
|
+
TournamentState["Closing"] = "Closing";
|
|
97
|
+
})(TournamentState || (TournamentState = {}));
|
|
98
|
+
var DialogType;
|
|
99
|
+
(function (DialogType) {
|
|
100
|
+
DialogType["Unjoin"] = "Unjoin";
|
|
101
|
+
DialogType["Tip"] = "Tip";
|
|
102
|
+
})(DialogType || (DialogType = {}));
|
|
103
|
+
|
|
104
|
+
const GradientRoundedButton = (_a) => {
|
|
105
|
+
var { statedClasses, innerHTML } = _a, props = __rest(_a, ["statedClasses", "innerHTML"]);
|
|
106
|
+
const { isHollow, isPending } = statedClasses;
|
|
107
|
+
return (index.h("button", Object.assign({ class: classnames('GradientRoundedButton', 'GradientRounded', {
|
|
108
|
+
Hollow: isHollow || false,
|
|
109
|
+
Pending: isPending || false,
|
|
110
|
+
}) }, props),
|
|
111
|
+
index.h("span", null, innerHTML)));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const iconClose = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg" });
|
|
115
|
+
const iconQuestion = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg" });
|
|
116
|
+
const iconEyeOpen = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg" });
|
|
117
|
+
const iconEyeClose = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg" });
|
|
118
|
+
const iconBack = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg" });
|
|
119
|
+
const iconReward = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg" });
|
|
120
|
+
const iconTrophy = index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg" });
|
|
121
|
+
|
|
122
|
+
const CloseBar = (props) => {
|
|
123
|
+
const { left, middle, right } = props;
|
|
124
|
+
const slots = {
|
|
125
|
+
left,
|
|
126
|
+
middle,
|
|
127
|
+
right,
|
|
128
|
+
};
|
|
129
|
+
const getFirstLetterUppercase = (str) => str
|
|
130
|
+
.split('')
|
|
131
|
+
.map((letter, index) => index === 0 ? letter.toUpperCase() : letter)
|
|
132
|
+
.join('');
|
|
133
|
+
return (index.h("div", { class: "WrapperBar" }, Object.keys(slots).map(slotKey => (index.h("div", { class: "WrapperBar" + getFirstLetterUppercase(slotKey) }, slots[slotKey] || '')))));
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
function formatDate(date) {
|
|
137
|
+
const options = {
|
|
138
|
+
year: 'numeric',
|
|
139
|
+
month: 'long',
|
|
140
|
+
day: 'numeric',
|
|
141
|
+
hour: '2-digit',
|
|
142
|
+
minute: '2-digit',
|
|
143
|
+
hour12: false
|
|
144
|
+
};
|
|
145
|
+
return date.toLocaleDateString('en-US', options).replace(' at', ',');
|
|
146
|
+
}
|
|
147
|
+
function addSeconds(date, seconds) {
|
|
148
|
+
const result = new Date(date);
|
|
149
|
+
result.setSeconds(result.getSeconds() + seconds);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
function getDifference(startDate, endDate) {
|
|
153
|
+
const diffMs = Math.abs(endDate.getTime() - startDate.getTime()); // Difference in milliseconds
|
|
154
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); // Difference in days
|
|
155
|
+
const diffHours = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); // Remaining hours
|
|
156
|
+
const diffMinutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60)); // Remaining minutes
|
|
157
|
+
// Format the output
|
|
158
|
+
const formattedDiff = `${String(diffDays).padStart(2, '0')}d:${String(diffHours).padStart(2, '0')}h:${String(diffMinutes).padStart(2, '0')}m`;
|
|
159
|
+
return formattedDiff;
|
|
160
|
+
}
|
|
161
|
+
function getProgress(startDate, endDate) {
|
|
162
|
+
return (100 * (new Date().getTime() - startDate.getTime()) / (endDate.getTime() - startDate.getTime())).toFixed(0);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const tournamentAdapter = (tournamentApi) => {
|
|
166
|
+
const keysTime = [
|
|
167
|
+
'startTime',
|
|
168
|
+
'endTime',
|
|
169
|
+
'closeTime',
|
|
170
|
+
'exhibitionStartTime',
|
|
171
|
+
'exhibitionEndTime',
|
|
172
|
+
];
|
|
173
|
+
const tournament = {};
|
|
174
|
+
Object.keys(tournamentApi).map((key) => {
|
|
175
|
+
const value = tournamentApi[key];
|
|
176
|
+
switch (key) {
|
|
177
|
+
case 'games':
|
|
178
|
+
tournament[key] = value.items;
|
|
179
|
+
break;
|
|
180
|
+
default:
|
|
181
|
+
tournament[key] = keysTime.includes(key) ? new Date(value) : value;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return tournament;
|
|
185
|
+
};
|
|
186
|
+
const leaderboardsAdapter = (leaderboardRes) => {
|
|
187
|
+
let { item, items: leaderboards } = leaderboardRes;
|
|
188
|
+
if (!item) {
|
|
189
|
+
return leaderboards;
|
|
190
|
+
}
|
|
191
|
+
return leaderboards.map(leaderboard => {
|
|
192
|
+
if (item && item.userID === leaderboard.userID) {
|
|
193
|
+
return Object.assign(Object.assign({}, leaderboard), { isMe: true });
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
return leaderboard;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
var GeneralAnimationLoadingCczQRHih = {};
|
|
202
|
+
|
|
203
|
+
(function (exports) {
|
|
204
|
+
var V=Object.defineProperty,z=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var x=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))G.call(t,n)&&x(e,n,t[n]);if(N)for(var n of N(t))q.call(t,n)&&x(e,n,t[n]);return e},M=(e,t)=>z(e,F(t));var $=(e,t,n)=>x(e,typeof t!="symbol"?t+"":t,n);var T=(e,t,n)=>new Promise((s,l)=>{var i=o=>{try{u(n.next(o));}catch(r){l(r);}},c=o=>{try{u(n.throw(o));}catch(r){l(r);}},u=o=>o.done?s(o.value):Promise.resolve(o.value).then(i,c);u((n=n.apply(e,t)).next());});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function _(){}function H(e){return e()}function B(){return Object.create(null)}function b(e){e.forEach(H);}function I(e){return typeof e=="function"}function K(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Q(e){return Object.keys(e).length===0}function W(e,t){e.appendChild(t);}function X(e,t,n){const s=Y(e);if(!s.getElementById(t)){const l=L("style");l.id=t,l.textContent=n,Z(s,l);}}function Y(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Z(e,t){return W(e.head||e,t),t.sheet}function U(e,t,n){e.insertBefore(t,n||null);}function C(e){e.parentNode&&e.parentNode.removeChild(e);}function L(e){return document.createElement(e)}function tt(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n);}function et(e){return Array.from(e.childNodes)}function nt(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0;}),t}let j;function g(e){j=e;}const h=[],k=[];let p=[];const R=[],it=Promise.resolve();let v=!1;function st(){v||(v=!0,it.then(y));}function E(e){p.push(e);}const w=new Set;let a=0;function y(){if(a!==0)return;const e=j;do{try{for(;a<h.length;){const t=h[a];a++,g(t),rt(t.$$);}}catch(t){throw h.length=0,a=0,t}for(g(null),h.length=0,a=0;k.length;)k.pop()();for(let t=0;t<p.length;t+=1){const n=p[t];w.has(n)||(w.add(n),n());}p.length=0;}while(h.length);for(;R.length;)R.pop()();v=!1,w.clear(),g(e);}function rt(e){if(e.fragment!==null){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(E);}}function lt(e){const t=[],n=[];p.forEach(s=>e.indexOf(s)===-1?t.push(s):n.push(s)),n.forEach(s=>s()),p=t;}const ct=new Set;function ot(e,t){e&&e.i&&(ct.delete(e),e.i(t));}function ut(e,t,n){const{fragment:s,after_update:l}=e.$$;s&&s.m(t,n),E(()=>{const i=e.$$.on_mount.map(H).filter(I);e.$$.on_destroy?e.$$.on_destroy.push(...i):b(i),e.$$.on_mount=[];}),l.forEach(E);}function dt(e,t){const n=e.$$;n.fragment!==null&&(lt(n.after_update),b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[]);}function $t(e,t){e.$$.dirty[0]===-1&&(h.push(e),st(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31;}function ft(e,t,n,s,l,i,c=null,u=[-1]){const o=j;g(e);const r=e.$$={fragment:null,ctx:[],props:i,update:_,not_equal:l,bound:B(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(o?o.$$.context:[])),callbacks:B(),dirty:u,skip_bound:!1,root:t.target||o.$$.root};c&&c(r.root);let f=!1;if(r.ctx=n?n(e,t.props||{},(d,O,...S)=>{const A=S.length?S[0]:O;return r.ctx&&l(r.ctx[d],r.ctx[d]=A)&&(!r.skip_bound&&r.bound[d]&&r.bound[d](A),f&&$t(e,d)),O}):[],r.update(),f=!0,b(r.before_update),r.fragment=s?s(r.ctx):!1,t.target){if(t.hydrate){const d=et(t.target);r.fragment&&r.fragment.l(d),d.forEach(C);}else r.fragment&&r.fragment.c();t.intro&&ot(e.$$.fragment),ut(e,t.target,t.anchor),y();}g(o);}let D;typeof HTMLElement=="function"&&(D=class extends HTMLElement{constructor(t,n,s){super();$(this,"$$ctor");$(this,"$$s");$(this,"$$c");$(this,"$$cn",!1);$(this,"$$d",{});$(this,"$$r",!1);$(this,"$$p_d",{});$(this,"$$l",{});$(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=n,s&&this.attachShadow({mode:"open"});}addEventListener(t,n,s){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const l=this.$$c.$on(t,n);this.$$l_u.set(n,l);}super.addEventListener(t,n,s);}removeEventListener(t,n,s){if(super.removeEventListener(t,n,s),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n));}}connectedCallback(){return T(this,null,function*(){if(this.$$cn=!0,!this.$$c){let t=function(i){return ()=>{let c;return {c:function(){c=L("slot"),i!=="default"&&tt(c,"name",i);},m:function(r,f){U(r,c,f);},d:function(r){r&&C(c);}}}};if(yield Promise.resolve(),!this.$$cn||this.$$c)return;const n={},s=nt(this);for(const i of this.$$s)i in s&&(n[i]=[t(i)]);for(const i of this.attributes){const c=this.$$g_p(i.name);c in this.$$d||(this.$$d[c]=m(c,i.value,this.$$p_d,"toProp"));}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:M(P({},this.$$d),{$$slots:n,$$scope:{ctx:[]}})});const l=()=>{this.$$r=!0;for(const i in this.$$p_d)if(this.$$d[i]=this.$$c.$$.ctx[this.$$c.$$.props[i]],this.$$p_d[i].reflect){const c=m(i,this.$$d[i],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,c);}this.$$r=!1;};this.$$c.$$.after_update.push(l),l();for(const i in this.$$l)for(const c of this.$$l[i]){const u=this.$$c.$on(i,c);this.$$l_u.set(c,u);}this.$$l={};}})}attributeChangedCallback(t,n,s){var l;this.$$r||(t=this.$$g_p(t),this.$$d[t]=m(t,s,this.$$p_d,"toProp"),(l=this.$$c)==null||l.$set({[t]:this.$$d[t]}));}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0);});}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function m(e,t,n,s){var i;const l=(i=n[e])==null?void 0:i.type;if(t=l==="Boolean"&&typeof t!="boolean"?t!=null:t,!s||!n[e])return t;if(s==="toAttribute")switch(l){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(l){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function at(e,t,n,s,l,i){let c=class extends D{constructor(){super(e,n,l),this.$$p_d=t;}static get observedAttributes(){return Object.keys(t).map(u=>(t[u].attribute||u).toLowerCase())}};return Object.keys(t).forEach(u=>{Object.defineProperty(c.prototype,u,{get(){return this.$$c&&u in this.$$c?this.$$c[u]:this.$$d[u]},set(o){var r;o=m(u,o,t),this.$$d[u]=o,(r=this.$$c)==null||r.$set({[u]:o});}});}),s.forEach(u=>{Object.defineProperty(c.prototype,u,{get(){var o;return (o=this.$$c)==null?void 0:o[u]}});}),e.element=c,c}class ht{constructor(){$(this,"$$");$(this,"$$set");}$destroy(){dt(this,1),this.$destroy=_;}$on(t,n){if(!I(n))return _;const s=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return s.push(n),()=>{const l=s.indexOf(n);l!==-1&&s.splice(l,1);}}$set(t){this.$$set&&!Q(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1);}}const _t="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_t);function pt(e){X(e,"svelte-gnt082",".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}");}function gt(e){let t;return {c(){t=L("div"),t.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>';},m(n,s){U(n,t,s),e[3](t);},p:_,i:_,o:_,d(n){n&&C(t),e[3](null);}}}function mt(e,t,n){let{clientstyling:s=""}=t,{clientstylingurl:l=""}=t,i;const c=()=>{let r=document.createElement("style");r.innerHTML=s,i.appendChild(r);},u=()=>{let r=new URL(l),f=document.createElement("style");fetch(r.href).then(d=>d.text()).then(d=>{f.innerHTML=d,setTimeout(()=>{i.appendChild(f);},1),setTimeout(()=>{},500);});};function o(r){k[r?"unshift":"push"](()=>{i=r,n(0,i);});}return e.$$set=r=>{"clientstyling"in r&&n(1,s=r.clientstyling),"clientstylingurl"in r&&n(2,l=r.clientstylingurl);},e.$$.update=()=>{e.$$.dirty&3&&s&&i&&c(),e.$$.dirty&5&&l&&i&&u();},[i,s,l,o]}class J extends ht{constructor(t){super(),ft(this,t,mt,gt,K,{clientstyling:1,clientstylingurl:2},pt);}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),y();}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),y();}}at(J,{clientstyling:{},clientstylingurl:{}},[],[],!0);exports.default=J;
|
|
205
|
+
}(GeneralAnimationLoadingCczQRHih));
|
|
206
|
+
|
|
207
|
+
if(typeof window!="undefined"){let n=function(t){return function(...i){try{return t.apply(this,i)}catch(e){if(e instanceof DOMException&&e.message.includes("has already been used with this registry")||e.message.includes("Cannot define multiple custom elements with the same tag name"))return !1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>GeneralAnimationLoadingCczQRHih).then(({default:t})=>{!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",t.element);});}
|
|
208
|
+
|
|
209
|
+
const casinoEngagementSuiteTournamentCss = ".GradientRounded {\n display: block;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);\n color: rgba(30, 22, 56, 1);\n \n position: relative;\n border-radius: 16px;\n\n &.Hollow {\n background: rgba(30, 22, 56, 1);\n color: #FFFFFF;\n &::before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: 15px;\n border: 1px solid transparent;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;\n -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n -webkit-mask-composite: destination-out;\n mask-composite: exclude;\n }\n\n }\n}\n\n.GradientRoundedButton {\n border: none;\n padding: 7px;\n \n height: 32px;\n width: 100%;\n \n font-size: 14px;\n font-weight: 700;\n line-height: 17.07px;\n text-align: center;\n \n transition: .5s opacity;\n\n cursor: pointer;\n &.Pending {\n cursor: not-allowed;\n opacity: .3;\n }\n\n &.Hollow {\n \n span {\n background: -webkit-linear-gradient(98.25deg, rgb(255, 148, 0) 22.48%, rgb(254, 247, 70) 131.02%, rgb(255, 226, 74) 131.9%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n }\n }\n}\n.Wrapper {\n height: 100%;\n position: relative;\n color: var(--emw--color-typography, #FFFFFF);\n display: flex;\n background-color: var(--emw--color-background, hsl(254, 44%, 15%));\n flex-direction: column;\n border-radius: 8px;\n overflow: hidden;\n}\n\n.WrapperContent {\n padding-bottom: 20px;\n transition: 0.5s filter;\n}\n.WrapperContent.faded {\n filter: brightness(53.3333333333%);\n}\n\n.WrapperBar {\n display: flex;\n width: 100%;\n padding: 12px 8px 8px;\n}\n\n.WrapperBarLeft, .WrapperBarRight {\n cursor: pointer;\n}\n\n.WrapperBarMiddle {\n flex-grow: 1;\n text-align: center;\n font-size: 16px;\n line-height: 16px;\n font-weight: 500;\n color: var(--emw--color-secondary, rgb(187, 185, 195));\n}\n\n:host {\n display: block;\n font-size: 12px;\n font-family: Inter;\n}\n\n.Row {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.LeaderboardsItem {\n margin: 10px 0;\n border: 1px solid rgb(64, 57, 86);\n border-radius: 16px;\n}\n.LeaderboardsItem.Hollow {\n border-color: transparent;\n}\n\n.LeaderboardsItemContainer {\n padding-top: 16px;\n}\n\n.Info {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.TimeContainer {\n margin: 24px 0;\n padding: 0 20px;\n}\n.TimeContainer .Time {\n display: flex;\n justify-content: space-between;\n font-size: 11px;\n align-items: center;\n color: var(--emw--color-secondary, rgb(187, 185, 195));\n}\n.TimeContainer .Time button {\n font-size: 12px;\n height: 20px;\n padding: 0;\n}\n.TimeContainer .Time button::before {\n inset: inherit;\n border: 0;\n}\n\n.ShowInfo {\n margin: 24px 0;\n padding: 0 20px;\n cursor: pointer;\n color: rgb(102, 97, 120);\n}\n.ShowInfo p {\n display: flex;\n gap: 4px;\n}\n\n.TitleContainer {\n display: flex;\n justify-content: space-between;\n margin: 24px 0;\n padding: 0 20px;\n margin-top: 0;\n gap: 10px;\n font-family: Montserrat;\n}\n.TitleContainer .GradientRoundedButton {\n width: 120px;\n}\n\n.TabsContainer {\n margin: 24px 0;\n padding: 0 20px;\n margin: 0 20px;\n padding: 0;\n border-bottom: 1px solid #575757;\n}\n\n.Tabs {\n display: flex;\n justify-content: space-between;\n justify-content: start;\n font-size: 12px;\n margin-bottom: -1px;\n}\n.Tabs > div {\n padding: 10px;\n color: rgb(102, 97, 120);\n cursor: pointer;\n}\n.Tabs > div.active {\n color: var(--emw--color-typography, #FFF);\n border-bottom: 2px solid var(--emw--color-typography, #FFF);\n}\n\n.Title {\n font-size: 16px;\n font-weight: 700;\n line-height: 19.5px;\n text-align: left;\n word-break: break-word;\n}\n\n.TC {\n margin-top: 12px;\n}\n.TC a {\n color: rgb(89, 209, 255);\n}\n\n.Criterias {\n margin: 12px 0;\n}\n.Criterias span {\n color: var(--emw--color-primary, rgb(255, 214, 47));\n font-weight: 400;\n}\n\n.ResultPrize {\n margin: 24px 0;\n padding: 0 20px;\n}\n.ResultPrize span {\n color: var(--emw--color-primary, rgb(255, 214, 47));\n font-weight: 400;\n}\n\n.Prizes {\n margin: 24px 0;\n padding: 0 20px;\n}\n.Prizes .PrizesText {\n margin-left: 3px;\n font-weight: 600;\n}\n.Prizes .PrizesHeader {\n align-items: center;\n display: flex;\n}\n.Prizes .PrizesHeader img {\n width: 12px;\n}\n.Prizes .Prize {\n margin: 8px 0;\n}\n.Prizes .Prize .PrizeText {\n color: var(--emw--color-primary, rgb(255, 214, 47));\n font-weight: 400;\n}\n\n* {\n box-sizing: border-box;\n}\n\n.Leaderboards {\n width: 100%;\n text-align: center;\n border-collapse: collapse;\n}\n.Leaderboards td {\n opacity: 0.6;\n padding: 20px 5px;\n}\n.Leaderboards td:first-child {\n padding-left: 20px;\n}\n.Leaderboards td:last-child {\n padding-right: 20px;\n}\n.Leaderboards .LeaderboardName {\n color: var(--emw--color-typography, #FFF);\n opacity: 1;\n}\n.Leaderboards tr.isMe {\n background: rgba(0, 0, 0, 0.2);\n}\n.Leaderboards tr.isMe .LeaderboardRank span {\n padding: 0px 3px;\n opacity: 1;\n border: 1px solid var(--emw--color-primary, rgb(255, 214, 47));\n border-radius: 11px;\n}\n.Leaderboards tr.isMe td {\n color: var(--emw--color-primary, rgb(255, 214, 47));\n}\n\n.Games {\n margin: 24px 0;\n padding: 0 20px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-evenly;\n gap: 4px 7.25px;\n}\n.Games img {\n width: 60px;\n}\n\ndialog {\n position: absolute;\n top: 30px;\n width: 100%;\n height: 100%;\n background: transparent;\n border: 0;\n padding: 0;\n color: var(--emw--color-typography, #FFFFFF);\n}\ndialog > div {\n margin: 32px;\n border-radius: 8px;\n background: var(--emw--color-background, hsl(254, 44%, 15%));\n border: 1px solid hsl(254, 20%, 28%);\n align-items: center;\n}\n\n.DialogContentUnjoin {\n padding: 32px;\n padding-top: 10px;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.DialogContentUnjoinTitle {\n font-family: Montserrat;\n font-size: 20px;\n font-weight: 600;\n line-height: 24.38px;\n text-align: center;\n}\n\n.DialogContentUnjoinDescription {\n color: var(--emw--color-secondary, rgb(187, 185, 195));\n margin-bottom: 30px;\n}\n\n.Tip {\n padding: 32px;\n padding-top: 10px;\n color: var(--emw--color-secondary, rgb(187, 185, 195));\n font-size: 14px;\n}\n\n.PageConfirmContainer {\n text-align: center;\n width: 80%;\n margin: 0 auto;\n}\n\n.PageConfirm {\n padding: 40px 32px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.PageConfirm .Title {\n font-size: 20px;\n text-align: center;\n}\n.PageConfirm .Description {\n color: var(--emw--color-secondary, rgb(187, 185, 195));\n font-weight: 400;\n}\n.PageConfirm .Description span {\n color: var(--emw--color-typography, #FFF);\n font-weight: 600;\n}\n\n.PageConfirmButtonsGroup {\n width: 150px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}";
|
|
210
|
+
const CasinoEngagementSuiteTournamentStyle0 = casinoEngagementSuiteTournamentCss;
|
|
211
|
+
|
|
212
|
+
const CasinoEngagementSuiteTournament = class {
|
|
213
|
+
constructor(hostRef) {
|
|
214
|
+
index.registerInstance(this, hostRef);
|
|
215
|
+
this.close = index.createEvent(this, "close", 7);
|
|
216
|
+
this.onClickConfirmJoin = () => {
|
|
217
|
+
this.actionJoin(this.tournamentItem);
|
|
218
|
+
this.nextPage = LeaderboardPage.List;
|
|
219
|
+
};
|
|
220
|
+
this.onClickConfirmUnjoin = () => {
|
|
221
|
+
this.close.emit();
|
|
222
|
+
};
|
|
223
|
+
this.onClickDialogUnjoin = () => {
|
|
224
|
+
this.actionJoin(this.dialog.data);
|
|
225
|
+
this.closeDialog();
|
|
226
|
+
};
|
|
227
|
+
this.onClickDialogJoin = () => {
|
|
228
|
+
this.closeDialog();
|
|
229
|
+
};
|
|
230
|
+
this.onClickBarInLayout = () => {
|
|
231
|
+
this.close.emit();
|
|
232
|
+
};
|
|
233
|
+
this.onClickBarInLayoutDialog = () => {
|
|
234
|
+
this.closeDialog();
|
|
235
|
+
};
|
|
236
|
+
this.onClickShowInfo = () => {
|
|
237
|
+
this.isShowInfo = !this.isShowInfo;
|
|
238
|
+
};
|
|
239
|
+
this.onClickBarTip = () => {
|
|
240
|
+
this.openDialog(DialogType.Tip);
|
|
241
|
+
};
|
|
242
|
+
this.onClickBarBack = () => {
|
|
243
|
+
this.setPage(LeaderboardPage.List);
|
|
244
|
+
};
|
|
245
|
+
this.language = 'en';
|
|
246
|
+
this.clientStyling = '';
|
|
247
|
+
this.clientStylingUrl = '';
|
|
248
|
+
this.translationUrl = '';
|
|
249
|
+
this.leaderboardsInit = undefined;
|
|
250
|
+
this.tab = Tab.Info;
|
|
251
|
+
this.locale = TRANSLATIONS;
|
|
252
|
+
this.tournamentItem = undefined;
|
|
253
|
+
this.tournamentList = undefined;
|
|
254
|
+
this.leaderboards = [];
|
|
255
|
+
this.isActionJoinPending = false;
|
|
256
|
+
this.isDialogOpen = false;
|
|
257
|
+
this.isShowInfo = false;
|
|
258
|
+
this.page = LeaderboardPage.List;
|
|
259
|
+
this.tournamentInDialog = undefined;
|
|
260
|
+
this.dialog = {
|
|
261
|
+
isOpen: false,
|
|
262
|
+
type: undefined,
|
|
263
|
+
data: undefined,
|
|
264
|
+
};
|
|
265
|
+
this.time = 0;
|
|
266
|
+
}
|
|
267
|
+
setTimeInterval() {
|
|
268
|
+
this.timeHolder = setInterval(() => {
|
|
269
|
+
if (this.tournamentList || this.tournamentItem) {
|
|
270
|
+
this.time += 1;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
this.time = 0;
|
|
274
|
+
}
|
|
275
|
+
}, 1000);
|
|
276
|
+
}
|
|
277
|
+
updateTournamentListByItem(tournament) {
|
|
278
|
+
this.tournamentList = this.tournamentList.map((_tournament) => {
|
|
279
|
+
if (_tournament.id === tournament.id) {
|
|
280
|
+
return tournamentAdapter(tournament);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return _tournament;
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
handleEvent(e) {
|
|
288
|
+
const _a = e.data, { type } = _a, rest = __rest(_a, ["type"]);
|
|
289
|
+
switch (type) {
|
|
290
|
+
case 'ShowLeaderboardRewardModal': {
|
|
291
|
+
const { tournament } = rest;
|
|
292
|
+
this.setPage(LeaderboardPage.Confirm, { tournament: tournamentAdapter(tournament) });
|
|
293
|
+
postMessage({ type: 'BarLeaderboardsClick' });
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
case 'UpdateTournamentsItemRes': {
|
|
297
|
+
const tournamentNew = tournamentAdapter(rest.data.item);
|
|
298
|
+
this.tournamentItem = tournamentNew;
|
|
299
|
+
this.updateTournamentListByItem(tournamentNew);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case 'UpdateLeaderboardsRes': {
|
|
303
|
+
this.leaderboards = leaderboardsAdapter(rest.data);
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
case 'JoinTournamentRes':
|
|
307
|
+
case 'UnjoinTournamentRes':
|
|
308
|
+
const { success } = rest;
|
|
309
|
+
if (success) {
|
|
310
|
+
this.tournamentItem = Object.assign(Object.assign({}, this.tournamentItem), { playerEnrolled: !!!this.tournamentItem.playerEnrolled });
|
|
311
|
+
switch (this.page) {
|
|
312
|
+
case LeaderboardPage.Item: {
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
case LeaderboardPage.List: {
|
|
316
|
+
this.updateTournamentListByItem(this.tournamentItem);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (this.nextPage) {
|
|
322
|
+
this.setPage(this.nextPage);
|
|
323
|
+
this.nextPage = undefined;
|
|
324
|
+
}
|
|
325
|
+
this.isActionJoinPending = false;
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
get messageSender() {
|
|
330
|
+
return {
|
|
331
|
+
JoinTournamentReq: (tournament) => { var _a; return window.postMessage({ type: 'JoinTournamentReq', bonusCode: (_a = tournament.wallets[0]) === null || _a === void 0 ? void 0 : _a.code }); },
|
|
332
|
+
UnjoinTournamentReq: (tournament) => window.postMessage({ type: 'UnjoinTournamentReq', id: tournament.id }),
|
|
333
|
+
UpdateTournamentsItemReq: (tournament) => window.postMessage({ type: 'UpdateTournamentsItemReq', id: tournament.id }),
|
|
334
|
+
UpdateLeaderboardsReq: (tournament) => window.postMessage({ type: 'UpdateLeaderboardsReq', id: tournament.id }),
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
connectedCallback() {
|
|
338
|
+
this.setTimeInterval();
|
|
339
|
+
}
|
|
340
|
+
disconnectedCallback() {
|
|
341
|
+
clearInterval(this.timeHolder);
|
|
342
|
+
}
|
|
343
|
+
actionJoin(tournament) {
|
|
344
|
+
if (this.isActionJoinPending)
|
|
345
|
+
return;
|
|
346
|
+
this.isActionJoinPending = true;
|
|
347
|
+
try {
|
|
348
|
+
if (tournament.playerEnrolled) {
|
|
349
|
+
this.messageSender.UnjoinTournamentReq(tournament);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.messageSender.JoinTournamentReq(tournament);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
console.log('error', e);
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
isTournamentClosed(tournament) {
|
|
361
|
+
return [
|
|
362
|
+
TournamentState.Closed,
|
|
363
|
+
TournamentState.Closing
|
|
364
|
+
].includes(tournament.state);
|
|
365
|
+
}
|
|
366
|
+
setPage(page, metaData) {
|
|
367
|
+
switch (page) {
|
|
368
|
+
case LeaderboardPage.Confirm:
|
|
369
|
+
case LeaderboardPage.Item:
|
|
370
|
+
this.tournamentItem = metaData.tournament;
|
|
371
|
+
if (!this.tournamentItem) {
|
|
372
|
+
this.messageSender.UpdateTournamentsItemReq(metaData.tournament);
|
|
373
|
+
}
|
|
374
|
+
if (this.isTournamentClosed(this.tournamentItem)) {
|
|
375
|
+
this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
|
|
376
|
+
}
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
this.tab = Tab.Info;
|
|
380
|
+
this.page = page;
|
|
381
|
+
}
|
|
382
|
+
renderPage() {
|
|
383
|
+
switch (this.page) {
|
|
384
|
+
case LeaderboardPage.Confirm: return this.renderPageConfirm();
|
|
385
|
+
case LeaderboardPage.Item: return this.renderPageLeaderboardItem();
|
|
386
|
+
case LeaderboardPage.List: return this.renderPageLeaderboardList();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
render() {
|
|
390
|
+
return (index.h(index.Host, { key: '07ebdb6c71a03be84b430e18a80417323a9cd3cc' }, index.h("general-styling-wrapper", { key: 'ac0134009a6bfcdb4b79816138ea441a8415b953', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
|
|
391
|
+
// @ts-ignore
|
|
392
|
+
targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renderPage()));
|
|
393
|
+
}
|
|
394
|
+
onClickListItemChangePage(tournament) {
|
|
395
|
+
this.setPage(LeaderboardPage.Item, { tournament });
|
|
396
|
+
}
|
|
397
|
+
onClickItemJoin(tournament, e) {
|
|
398
|
+
e.stopPropagation();
|
|
399
|
+
if (tournament.playerEnrolled) {
|
|
400
|
+
this.openDialog(DialogType.Unjoin, tournament);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
this.actionJoin(tournament);
|
|
404
|
+
this.tournamentItem = tournament;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
onClickTab(tab) {
|
|
408
|
+
this.tab = tab;
|
|
409
|
+
switch (tab) {
|
|
410
|
+
case Tab.Leaderboard:
|
|
411
|
+
this.leaderboards = undefined;
|
|
412
|
+
this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
|
|
413
|
+
break;
|
|
414
|
+
case Tab.Games:
|
|
415
|
+
this.messageSender.UpdateTournamentsItemReq(this.tournamentItem);
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
renderPageLeaderboardList() {
|
|
420
|
+
var _a;
|
|
421
|
+
if (!this.tournamentList) {
|
|
422
|
+
this.tournamentList = (_a = this.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map(item => tournamentAdapter(item));
|
|
423
|
+
return index.h("general-animation-loading", null);
|
|
424
|
+
}
|
|
425
|
+
const { locale } = this;
|
|
426
|
+
if (this.tournamentList.length) {
|
|
427
|
+
return this.renderLeaderboardContainer(index.h(index.Fragment, null, index.h("div", { class: "Leaderboards Row" }, this.tournamentList.map(_tournament => (index.h("div", { class: classnames("LeaderboardsItem", _tournament.playerEnrolled ? ' GradientRounded Hollow' : ''), onClick: this.onClickListItemChangePage.bind(this, _tournament) }, index.h("div", { class: "LeaderboardsItemContainer" }, this.renderTitleContainer(_tournament), this.renderTimeBar(_tournament))))))));
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
return (index.h("div", { class: "NoLeaderboards Row" }, index.h("div", null, locale.NoLeaderboards), index.h("div", null, locale.NoLeaderboardsTip)));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
renderPageConfirm() {
|
|
434
|
+
if (!this.tournamentItem)
|
|
435
|
+
return index.h("general-animation-loading", null);
|
|
436
|
+
const tournamentName = this.tournamentItem.nameOrTitle;
|
|
437
|
+
const { locale } = this;
|
|
438
|
+
return (index.h("div", { class: "PageConfirmContainer" }, index.h("div", { class: "GradientRounded Hollow PageConfirm" }, index.h("div", null, iconTrophy), index.h("div", { class: "Title" }, locale.JoinDialog.Tile), index.h("div", { class: "Description", innerHTML: localePostprocess(locale.JoinDialog.Description, { tournamentName }) }), index.h("div", { class: "PageConfirmButtonsGroup" }, index.h(GradientRoundedButton, { statedClasses: {
|
|
439
|
+
isPending: this.isActionJoinPending,
|
|
440
|
+
},
|
|
441
|
+
onClick: this.onClickConfirmJoin,
|
|
442
|
+
innerHTML: locale.JoinDialog.ButtonYes }), index.h(GradientRoundedButton, { statedClasses: {
|
|
443
|
+
isPending: this.isActionJoinPending,
|
|
444
|
+
isHollow: true,
|
|
445
|
+
},
|
|
446
|
+
onClick: this.onClickConfirmUnjoin,
|
|
447
|
+
innerHTML: locale.JoinDialog.ButtonNo })))));
|
|
448
|
+
}
|
|
449
|
+
renderPageLeaderboardItem() {
|
|
450
|
+
if (!this.tournamentItem)
|
|
451
|
+
return index.h("general-animation-loading", null);
|
|
452
|
+
return this.renderLeaderboardContainer(index.h(index.Fragment, null, this.renderTitleContainer(this.tournamentItem), this.renderTabs(), this.renderTabbedContent()));
|
|
453
|
+
}
|
|
454
|
+
renderDialogContent() {
|
|
455
|
+
switch (this.dialog.type) {
|
|
456
|
+
case DialogType.Unjoin:
|
|
457
|
+
return this.renderDialogContentUnjoin();
|
|
458
|
+
case DialogType.Tip:
|
|
459
|
+
return (index.h("div", { class: "Tip" }, this.locale.Tip));
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
renderDialogContentUnjoin() {
|
|
463
|
+
const { locale } = this;
|
|
464
|
+
return (index.h("div", { class: "DialogContentUnjoin" }, index.h("div", { class: "DialogContentUnjoinTitle" }, locale.UnjoinDialog.Title), index.h("div", { class: "DialogContentUnjoinDescription", innerHTML: locale.UnjoinDialog.Description }), index.h(GradientRoundedButton, { statedClasses: {
|
|
465
|
+
isPending: this.isActionJoinPending,
|
|
466
|
+
},
|
|
467
|
+
onClick: this.onClickDialogUnjoin,
|
|
468
|
+
innerHTML: locale.UnjoinDialog.ButtonYes }), index.h(GradientRoundedButton, { statedClasses: {
|
|
469
|
+
isHollow: true,
|
|
470
|
+
isPending: this.isActionJoinPending,
|
|
471
|
+
},
|
|
472
|
+
onClick: this.onClickDialogJoin,
|
|
473
|
+
innerHTML: locale.UnjoinDialog.ButtonNo })));
|
|
474
|
+
}
|
|
475
|
+
renderTitleContainer(tournament) {
|
|
476
|
+
const { locale } = this;
|
|
477
|
+
return (index.h("div", { class: "TitleContainer" }, index.h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (index.h("div", null, index.h(GradientRoundedButton, { statedClasses: {
|
|
478
|
+
isHollow: tournament.playerEnrolled,
|
|
479
|
+
isPending: this.isActionJoinPending,
|
|
480
|
+
},
|
|
481
|
+
onClick: this.onClickItemJoin.bind(this, tournament),
|
|
482
|
+
innerHTML: tournament.playerEnrolled ? locale.Unjoin : locale.Join })))));
|
|
483
|
+
}
|
|
484
|
+
renderTabbedContent() {
|
|
485
|
+
switch (this.tab) {
|
|
486
|
+
case Tab.Info: return this.renderInfo();
|
|
487
|
+
case Tab.Leaderboard: return this.renderLeaderboard();
|
|
488
|
+
case Tab.Games: return this.renderGames();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
renderGames() {
|
|
492
|
+
var _a;
|
|
493
|
+
return (index.h("div", { class: "Games" }, (_a = this.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map(game => (index.h("div", null, index.h("img", { src: game.defaultThumbnail, alt: "" }))))));
|
|
494
|
+
}
|
|
495
|
+
renderLeaderboard() {
|
|
496
|
+
if (!this.leaderboards)
|
|
497
|
+
return index.h("general-animation-loading", null);
|
|
498
|
+
if (!this.leaderboards.length)
|
|
499
|
+
return '';
|
|
500
|
+
return (index.h("table", { class: "Leaderboards" }, this.leaderboards.map(leaderboard => (index.h("tr", { class: classnames({ isMe: leaderboard.isMe }) }, index.h("td", { class: "LeaderboardRank" }, index.h("span", null, leaderboard.rank)), index.h("td", { class: "LeaderboardName" }, leaderboard.shortName), index.h("td", { class: "LeaderboardScore" }, leaderboard.score), index.h("td", { class: "LeaderboardPrize" }, leaderboard.prizeName))))));
|
|
501
|
+
}
|
|
502
|
+
renderTabs() {
|
|
503
|
+
const { locale, tab } = this;
|
|
504
|
+
return (index.h("div", { class: "TabsContainer" }, index.h("div", { class: "Tabs" }, Object.keys(Tab).map((_tab) => (index.h("div", { class: classnames({ active: tab === _tab }),
|
|
505
|
+
onClick: this.onClickTab.bind(this, _tab) }, locale[_tab]))))));
|
|
506
|
+
}
|
|
507
|
+
renderTimeBar(tournament) {
|
|
508
|
+
return (index.h("section", { class: "TimeContainer" }, index.h("div", { class: 'Time' }, tournament.playerEnrolled ? (index.h(index.Fragment, null, index.h("div", null, getDifference(addSeconds(tournament.startTime, this.time), tournament.endTime)), index.h("div", null, index.h(GradientRoundedButton, { statedClasses: {
|
|
509
|
+
isHollow: true,
|
|
510
|
+
isPendding: false,
|
|
511
|
+
}, innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%` })))) : (index.h(index.Fragment, null, index.h("div", null, formatDate(tournament.startTime)), index.h("div", null, formatDate(tournament.endTime))))), index.h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
|
|
512
|
+
}
|
|
513
|
+
renderInfo() {
|
|
514
|
+
var _a, _b;
|
|
515
|
+
const { locale, tournamentItem: tournament, isShowInfo } = this;
|
|
516
|
+
return (index.h("div", { class: "InfoContainer" }, this.renderTimeBar(tournament), (index.h("section", { class: "ShowInfo", onClick: this.onClickShowInfo }, index.h("p", null, index.h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), index.h("span", null, locale.LeaderboardDetails)))), isShowInfo && (index.h("section", { class: "Info" }, index.h("div", null, tournament.description), index.h("div", { class: "Criterias" }, index.h("div", null, locale.ScoreCriteria, ": ", index.h("span", null, tournament.scoreCriteria)), index.h("div", null, locale.MinimumBetCriteria, ": ", index.h("span", null, tournament.minBetCount))), index.h("div", { class: "TC" }, index.h("a", { href: tournament.termsUrl, target: '_blank' }, locale.TC)))), this.isTournamentClosed(this.tournamentItem) && ((_a = this.leaderboards) === null || _a === void 0 ? void 0 : _a.find(l => l.isMe)) && (index.h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, this.getResultPrize((_b = this.leaderboards) === null || _b === void 0 ? void 0 : _b.find(l => l.isMe))) })), index.h("section", { class: "Prizes" }, index.h("div", { class: "PrizesHeader" }, iconReward, index.h("span", { class: "PrizesText" }, locale.Prizes)), tournament.prizes.map((prize, index$1) => (index.h("div", { class: "Prize" }, index$1 + 1, " ", locale.Place, ": ", index.h("span", { class: "PrizeText" }, prize.name)))))));
|
|
517
|
+
}
|
|
518
|
+
getResultPrize(leaderboard) {
|
|
519
|
+
return {
|
|
520
|
+
prize: leaderboard.prizeName,
|
|
521
|
+
place: leaderboard.rank,
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
renderCloseBarInLayout() {
|
|
525
|
+
const { left, middle } = this.getWrapperBarData();
|
|
526
|
+
return (index.h(CloseBar, { left, middle,
|
|
527
|
+
right: (index.h("span", { onClick: this.onClickBarInLayout }, iconClose)) }));
|
|
528
|
+
}
|
|
529
|
+
renderCloseBarInLayoutDialog() {
|
|
530
|
+
return (index.h(CloseBar, { right: (index.h("span", { onClick: this.onClickBarInLayoutDialog }, iconClose)) }));
|
|
531
|
+
}
|
|
532
|
+
renderLeaderboardContainer(render) {
|
|
533
|
+
const { dialog: { isOpen } } = this;
|
|
534
|
+
return (index.h("div", { class: "Wrapper" }, index.h("div", { class: classnames("WrapperContent", { faded: isOpen }) }, this.renderCloseBarInLayout(), index.h("div", { class: "Root" }, index.h("div", { class: "Main" }, render))), index.h("div", { class: "WrapperUtil" }, index.h("dialog", { open: isOpen }, index.h("div", null, this.renderCloseBarInLayoutDialog(), isOpen && this.renderDialogContent())))));
|
|
535
|
+
}
|
|
536
|
+
getWrapperBarData() {
|
|
537
|
+
const { page, locale } = this;
|
|
538
|
+
switch (page) {
|
|
539
|
+
case LeaderboardPage.List:
|
|
540
|
+
return {
|
|
541
|
+
left: index.h("span", { onClick: this.onClickBarTip }, iconQuestion),
|
|
542
|
+
middle: locale.Leaderboards
|
|
543
|
+
};
|
|
544
|
+
case LeaderboardPage.Item:
|
|
545
|
+
return {
|
|
546
|
+
left: (index.h("span", { onClick: this.onClickBarBack }, iconBack)),
|
|
547
|
+
middle: '',
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
openDialog(type, data = undefined) {
|
|
552
|
+
this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: true, type, data });
|
|
553
|
+
}
|
|
554
|
+
closeDialog() {
|
|
555
|
+
this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: false });
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
CasinoEngagementSuiteTournament.style = CasinoEngagementSuiteTournamentStyle0;
|
|
559
|
+
|
|
560
|
+
exports.CasinoEngagementSuiteTournament = CasinoEngagementSuiteTournament;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-16d5d7c3.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
4
7
|
|
|
5
8
|
/*
|
|
6
|
-
Stencil Client Patch Browser
|
|
9
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-engagement-suite-tournament.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
patchBrowser().then(options => {
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
18
22
|
return index.bootstrapLazy([["casino-engagement-suite-progress-bar_3.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
|
|
19
23
|
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|