@everymatrix/casino-engagement-suite-tournament 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/casino-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -0
  2. package/dist/casino-engagement-suite-tournament/index.esm.js +1 -0
  3. package/dist/casino-engagement-suite-tournament/p-5e83c304.entry.js +1 -0
  4. package/dist/casino-engagement-suite-tournament/p-9996e3fd.js +1 -0
  5. package/dist/casino-engagement-suite-tournament/p-d5ef82db.js +2 -0
  6. package/dist/casino-engagement-suite-tournament/p-e1255160.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/casino-engagement-suite-tournament-d16da103.js +562 -0
  9. package/dist/cjs/casino-engagement-suite-tournament.cjs.entry.js +12 -0
  10. package/dist/cjs/casino-engagement-suite-tournament.cjs.js +25 -0
  11. package/dist/cjs/index-192fed5a.js +1346 -0
  12. package/dist/cjs/index.cjs.js +12 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/collection-manifest.json +12 -0
  15. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +374 -0
  16. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +511 -0
  17. package/dist/collection/components/casino-engagement-suite-tournament/index.js +1 -0
  18. package/dist/collection/index.js +1 -0
  19. package/dist/collection/shared/GradientRoundedButton.js +11 -0
  20. package/dist/collection/shared/icons.js +8 -0
  21. package/dist/collection/shared/renderBar.js +14 -0
  22. package/dist/collection/utils/api.apdater.js +35 -0
  23. package/dist/collection/utils/translations.js +28 -0
  24. package/dist/collection/utils/types.js +18 -0
  25. package/dist/collection/utils/util.date.js +38 -0
  26. package/dist/collection/utils/utils.js +18 -0
  27. package/dist/esm/app-globals-0f993ce5.js +3 -0
  28. package/dist/esm/casino-engagement-suite-tournament-af4ed1fe.js +560 -0
  29. package/dist/esm/casino-engagement-suite-tournament.entry.js +4 -0
  30. package/dist/esm/casino-engagement-suite-tournament.js +20 -0
  31. package/dist/esm/index-c8be0c5b.js +1317 -0
  32. package/dist/esm/index.js +4 -0
  33. package/dist/esm/loader.js +11 -0
  34. package/dist/index.cjs.js +1 -0
  35. package/dist/index.js +1 -0
  36. package/dist/stencil.config.dev.js +14 -0
  37. package/dist/stencil.config.js +17 -0
  38. 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
  39. 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
  40. package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +127 -0
  41. package/dist/types/components/casino-engagement-suite-tournament/index.d.ts +1 -0
  42. package/dist/types/components.d.ts +95 -0
  43. package/dist/types/index.d.ts +1 -0
  44. package/dist/types/shared/GradientRoundedButton.d.ts +5 -0
  45. package/dist/types/shared/icons.d.ts +7 -0
  46. package/dist/types/shared/renderBar.d.ts +1 -0
  47. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  48. package/dist/types/utils/api.apdater.d.ts +3 -0
  49. package/dist/types/utils/translations.d.ts +42 -0
  50. package/dist/types/utils/types.d.ts +95 -0
  51. package/dist/types/utils/util.date.d.ts +6 -0
  52. package/dist/types/utils/utils.d.ts +1 -0
  53. package/loader/cdn.js +1 -0
  54. package/loader/index.cjs.js +1 -0
  55. package/loader/index.d.ts +24 -0
  56. package/loader/index.es2017.js +1 -0
  57. package/loader/index.js +2 -0
  58. package/loader/package.json +11 -0
  59. package/package.json +26 -0
@@ -0,0 +1,511 @@
1
+ import { __rest } from "tslib";
2
+ import { Fragment, h, Host } from "@stencil/core";
3
+ import { TRANSLATIONS, Tab, localePostprocess } from "../../utils/translations";
4
+ import { classnames } from "../../utils/utils";
5
+ import { TournamentState, LeaderboardPage, DialogType, } from "../../utils/types";
6
+ import { GradientRoundedButton } from "../../shared/GradientRoundedButton";
7
+ import { iconBack, iconClose, iconReward, iconEyeClose, iconEyeOpen, iconQuestion, iconTrophy } from "../../shared/icons";
8
+ import { CloseBar } from "../../shared/renderBar";
9
+ import { addSeconds, formatDate, getDifference, getProgress } from "../../utils/util.date";
10
+ import { leaderboardsAdapter, tournamentAdapter } from "../../utils/api.apdater";
11
+ import "../../../../../../svelte/general-animation-loading/es2015/general-animation-loading";
12
+ import "@everymatrix/general-styling-wrapper";
13
+ import "@everymatrix/casino-engagement-suite-progress-bar";
14
+ export class CasinoEngagementSuiteTournament {
15
+ constructor() {
16
+ this.onClickConfirmJoin = () => {
17
+ this.actionJoin(this.tournamentItem);
18
+ this.nextPage = LeaderboardPage.List;
19
+ };
20
+ this.onClickConfirmUnjoin = () => {
21
+ this.close.emit();
22
+ };
23
+ this.onClickDialogUnjoin = () => {
24
+ this.actionJoin(this.dialog.data);
25
+ this.closeDialog();
26
+ };
27
+ this.onClickDialogJoin = () => {
28
+ this.closeDialog();
29
+ };
30
+ this.onClickBarInLayout = () => {
31
+ this.close.emit();
32
+ };
33
+ this.onClickBarInLayoutDialog = () => {
34
+ this.closeDialog();
35
+ };
36
+ this.onClickShowInfo = () => {
37
+ this.isShowInfo = !this.isShowInfo;
38
+ };
39
+ this.onClickBarTip = () => {
40
+ this.openDialog(DialogType.Tip);
41
+ };
42
+ this.onClickBarBack = () => {
43
+ this.setPage(LeaderboardPage.List);
44
+ };
45
+ this.language = 'en';
46
+ this.clientStyling = '';
47
+ this.clientStylingUrl = '';
48
+ this.translationUrl = '';
49
+ this.leaderboardsInit = undefined;
50
+ this.tab = Tab.Info;
51
+ this.locale = TRANSLATIONS;
52
+ this.tournamentItem = undefined;
53
+ this.tournamentList = undefined;
54
+ this.leaderboards = [];
55
+ this.isActionJoinPending = false;
56
+ this.isDialogOpen = false;
57
+ this.isShowInfo = false;
58
+ this.page = LeaderboardPage.List;
59
+ this.tournamentInDialog = undefined;
60
+ this.dialog = {
61
+ isOpen: false,
62
+ type: undefined,
63
+ data: undefined,
64
+ };
65
+ this.time = 0;
66
+ }
67
+ setTimeInterval() {
68
+ this.timeHolder = setInterval(() => {
69
+ if (this.tournamentList || this.tournamentItem) {
70
+ this.time += 1;
71
+ }
72
+ else {
73
+ this.time = 0;
74
+ }
75
+ }, 1000);
76
+ }
77
+ updateTournamentListByItem(tournament) {
78
+ this.tournamentList = this.tournamentList.map((_tournament) => {
79
+ if (_tournament.id === tournament.id) {
80
+ return tournamentAdapter(tournament);
81
+ }
82
+ else {
83
+ return _tournament;
84
+ }
85
+ });
86
+ }
87
+ handleEvent(e) {
88
+ const _a = e.data, { type } = _a, rest = __rest(_a, ["type"]);
89
+ switch (type) {
90
+ case 'ShowLeaderboardRewardModal': {
91
+ const { tournament } = rest;
92
+ this.setPage(LeaderboardPage.Confirm, { tournament: tournamentAdapter(tournament) });
93
+ postMessage({ type: 'BarLeaderboardsClick' });
94
+ break;
95
+ }
96
+ case 'UpdateTournamentsItemRes': {
97
+ const tournamentNew = tournamentAdapter(rest.data.item);
98
+ this.tournamentItem = tournamentNew;
99
+ this.updateTournamentListByItem(tournamentNew);
100
+ break;
101
+ }
102
+ case 'UpdateLeaderboardsRes': {
103
+ this.leaderboards = leaderboardsAdapter(rest.data);
104
+ break;
105
+ }
106
+ case 'JoinTournamentRes':
107
+ case 'UnjoinTournamentRes':
108
+ const { success } = rest;
109
+ if (success) {
110
+ this.tournamentItem = Object.assign(Object.assign({}, this.tournamentItem), { playerEnrolled: !!!this.tournamentItem.playerEnrolled });
111
+ switch (this.page) {
112
+ case LeaderboardPage.Item: {
113
+ break;
114
+ }
115
+ case LeaderboardPage.List: {
116
+ this.updateTournamentListByItem(this.tournamentItem);
117
+ break;
118
+ }
119
+ }
120
+ }
121
+ if (this.nextPage) {
122
+ this.setPage(this.nextPage);
123
+ this.nextPage = undefined;
124
+ }
125
+ this.isActionJoinPending = false;
126
+ break;
127
+ }
128
+ }
129
+ get messageSender() {
130
+ return {
131
+ JoinTournamentReq: (tournament) => { var _a; return window.postMessage({ type: 'JoinTournamentReq', bonusCode: (_a = tournament.wallets[0]) === null || _a === void 0 ? void 0 : _a.code }); },
132
+ UnjoinTournamentReq: (tournament) => window.postMessage({ type: 'UnjoinTournamentReq', id: tournament.id }),
133
+ UpdateTournamentsItemReq: (tournament) => window.postMessage({ type: 'UpdateTournamentsItemReq', id: tournament.id }),
134
+ UpdateLeaderboardsReq: (tournament) => window.postMessage({ type: 'UpdateLeaderboardsReq', id: tournament.id }),
135
+ };
136
+ }
137
+ connectedCallback() {
138
+ this.setTimeInterval();
139
+ }
140
+ disconnectedCallback() {
141
+ clearInterval(this.timeHolder);
142
+ }
143
+ actionJoin(tournament) {
144
+ if (this.isActionJoinPending)
145
+ return;
146
+ this.isActionJoinPending = true;
147
+ try {
148
+ if (tournament.playerEnrolled) {
149
+ this.messageSender.UnjoinTournamentReq(tournament);
150
+ }
151
+ else {
152
+ this.messageSender.JoinTournamentReq(tournament);
153
+ }
154
+ }
155
+ catch (e) {
156
+ console.log('error', e);
157
+ return;
158
+ }
159
+ }
160
+ isTournamentClosed(tournament) {
161
+ return [
162
+ TournamentState.Closed,
163
+ TournamentState.Closing
164
+ ].includes(tournament.state);
165
+ }
166
+ setPage(page, metaData) {
167
+ switch (page) {
168
+ case LeaderboardPage.Confirm:
169
+ case LeaderboardPage.Item:
170
+ this.tournamentItem = metaData.tournament;
171
+ if (!this.tournamentItem) {
172
+ this.messageSender.UpdateTournamentsItemReq(metaData.tournament);
173
+ }
174
+ if (this.isTournamentClosed(this.tournamentItem)) {
175
+ this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
176
+ }
177
+ break;
178
+ case LeaderboardPage.List:
179
+ break;
180
+ }
181
+ this.tab = Tab.Info;
182
+ this.page = page;
183
+ }
184
+ renderPage() {
185
+ switch (this.page) {
186
+ case LeaderboardPage.Confirm: return this.renderPageConfirm();
187
+ case LeaderboardPage.Item: return this.renderPageLeaderboardItem();
188
+ case LeaderboardPage.List: return this.renderPageLeaderboardList();
189
+ }
190
+ }
191
+ render() {
192
+ return (h(Host, { key: '07ebdb6c71a03be84b430e18a80417323a9cd3cc' }, h("general-styling-wrapper", { key: 'ac0134009a6bfcdb4b79816138ea441a8415b953', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
193
+ // @ts-ignore
194
+ targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renderPage()));
195
+ }
196
+ onClickListItemChangePage(tournament) {
197
+ this.setPage(LeaderboardPage.Item, { tournament });
198
+ }
199
+ onClickItemJoin(tournament, e) {
200
+ e.stopPropagation();
201
+ if (tournament.playerEnrolled) {
202
+ this.openDialog(DialogType.Unjoin, tournament);
203
+ }
204
+ else {
205
+ this.actionJoin(tournament);
206
+ this.tournamentItem = tournament;
207
+ }
208
+ }
209
+ onClickTab(tab) {
210
+ this.tab = tab;
211
+ switch (tab) {
212
+ case Tab.Leaderboard:
213
+ this.leaderboards = undefined;
214
+ this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
215
+ break;
216
+ case Tab.Games:
217
+ this.messageSender.UpdateTournamentsItemReq(this.tournamentItem);
218
+ break;
219
+ }
220
+ }
221
+ renderPageLeaderboardList() {
222
+ var _a;
223
+ if (!this.tournamentList) {
224
+ this.tournamentList = (_a = this.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map(item => tournamentAdapter(item));
225
+ return h("general-animation-loading", null);
226
+ }
227
+ const { locale } = this;
228
+ if (this.tournamentList.length) {
229
+ return this.renderLeaderboardContainer(h(Fragment, null, h("div", { class: "Leaderboards Row" }, this.tournamentList.map(_tournament => (h("div", { class: classnames("LeaderboardsItem", _tournament.playerEnrolled ? ' GradientRounded Hollow' : ''), onClick: this.onClickListItemChangePage.bind(this, _tournament) }, h("div", { class: "LeaderboardsItemContainer" }, this.renderTitleContainer(_tournament), this.renderTimeBar(_tournament))))))));
230
+ }
231
+ else {
232
+ return (h("div", { class: "NoLeaderboards Row" }, h("div", null, locale.NoLeaderboards), h("div", null, locale.NoLeaderboardsTip)));
233
+ }
234
+ }
235
+ renderPageConfirm() {
236
+ if (!this.tournamentItem)
237
+ return h("general-animation-loading", null);
238
+ const tournamentName = this.tournamentItem.nameOrTitle;
239
+ const { locale } = this;
240
+ return (h("div", { class: "PageConfirmContainer" }, h("div", { class: "GradientRounded Hollow PageConfirm" }, h("div", null, iconTrophy), h("div", { class: "Title" }, locale.JoinDialog.Tile), h("div", { class: "Description", innerHTML: localePostprocess(locale.JoinDialog.Description, { tournamentName }) }), h("div", { class: "PageConfirmButtonsGroup" }, h(GradientRoundedButton, { statedClasses: {
241
+ isPending: this.isActionJoinPending,
242
+ },
243
+ onClick: this.onClickConfirmJoin,
244
+ innerHTML: locale.JoinDialog.ButtonYes }), h(GradientRoundedButton, { statedClasses: {
245
+ isPending: this.isActionJoinPending,
246
+ isHollow: true,
247
+ },
248
+ onClick: this.onClickConfirmUnjoin,
249
+ innerHTML: locale.JoinDialog.ButtonNo })))));
250
+ }
251
+ renderPageLeaderboardItem() {
252
+ if (!this.tournamentItem)
253
+ return h("general-animation-loading", null);
254
+ return this.renderLeaderboardContainer(h(Fragment, null, this.renderTitleContainer(this.tournamentItem), this.renderTabs(), this.renderTabbedContent()));
255
+ }
256
+ renderDialogContent() {
257
+ switch (this.dialog.type) {
258
+ case DialogType.Unjoin:
259
+ return this.renderDialogContentUnjoin();
260
+ case DialogType.Tip:
261
+ return (h("div", { class: "Tip" }, this.locale.Tip));
262
+ }
263
+ }
264
+ renderDialogContentUnjoin() {
265
+ const { locale } = this;
266
+ return (h("div", { class: "DialogContentUnjoin" }, h("div", { class: "DialogContentUnjoinTitle" }, locale.UnjoinDialog.Title), h("div", { class: "DialogContentUnjoinDescription", innerHTML: locale.UnjoinDialog.Description }), h(GradientRoundedButton, { statedClasses: {
267
+ isPending: this.isActionJoinPending,
268
+ },
269
+ onClick: this.onClickDialogUnjoin,
270
+ innerHTML: locale.UnjoinDialog.ButtonYes }), h(GradientRoundedButton, { statedClasses: {
271
+ isHollow: true,
272
+ isPending: this.isActionJoinPending,
273
+ },
274
+ onClick: this.onClickDialogJoin,
275
+ innerHTML: locale.UnjoinDialog.ButtonNo })));
276
+ }
277
+ renderTitleContainer(tournament) {
278
+ const { locale } = this;
279
+ return (h("div", { class: "TitleContainer" }, h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (h("div", null, h(GradientRoundedButton, { statedClasses: {
280
+ isHollow: tournament.playerEnrolled,
281
+ isPending: this.isActionJoinPending,
282
+ },
283
+ onClick: this.onClickItemJoin.bind(this, tournament),
284
+ innerHTML: tournament.playerEnrolled ? locale.Unjoin : locale.Join })))));
285
+ }
286
+ renderTabbedContent() {
287
+ switch (this.tab) {
288
+ case Tab.Info: return this.renderInfo();
289
+ case Tab.Leaderboard: return this.renderLeaderboard();
290
+ case Tab.Games: return this.renderGames();
291
+ }
292
+ }
293
+ renderGames() {
294
+ var _a;
295
+ return (h("div", { class: "Games" }, (_a = this.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map(game => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
296
+ }
297
+ renderLeaderboard() {
298
+ if (!this.leaderboards)
299
+ return h("general-animation-loading", null);
300
+ if (!this.leaderboards.length)
301
+ return '';
302
+ return (h("table", { class: "Leaderboards" }, this.leaderboards.map(leaderboard => (h("tr", { class: classnames({ isMe: leaderboard.isMe }) }, h("td", { class: "LeaderboardRank" }, h("span", null, leaderboard.rank)), h("td", { class: "LeaderboardName" }, leaderboard.shortName), h("td", { class: "LeaderboardScore" }, leaderboard.score), h("td", { class: "LeaderboardPrize" }, leaderboard.prizeName))))));
303
+ }
304
+ renderTabs() {
305
+ const { locale, tab } = this;
306
+ return (h("div", { class: "TabsContainer" }, h("div", { class: "Tabs" }, Object.keys(Tab).map((_tab) => (h("div", { class: classnames({ active: tab === _tab }),
307
+ onClick: this.onClickTab.bind(this, _tab) }, locale[_tab]))))));
308
+ }
309
+ renderTimeBar(tournament) {
310
+ return (h("section", { class: "TimeContainer" }, h("div", { class: 'Time' }, tournament.playerEnrolled ? (h(Fragment, null, h("div", null, getDifference(addSeconds(tournament.startTime, this.time), tournament.endTime)), h("div", null, h(GradientRoundedButton, { statedClasses: {
311
+ isHollow: true,
312
+ isPendding: false,
313
+ }, innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%` })))) : (h(Fragment, null, h("div", null, formatDate(tournament.startTime)), h("div", null, formatDate(tournament.endTime))))), h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
314
+ }
315
+ renderInfo() {
316
+ var _a, _b;
317
+ const { locale, tournamentItem: tournament, isShowInfo } = this;
318
+ return (h("div", { class: "InfoContainer" }, this.renderTimeBar(tournament), (h("section", { class: "ShowInfo", onClick: this.onClickShowInfo }, h("p", null, h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), h("span", null, locale.LeaderboardDetails)))), isShowInfo && (h("section", { class: "Info" }, h("div", null, tournament.description), h("div", { class: "Criterias" }, h("div", null, locale.ScoreCriteria, ": ", h("span", null, tournament.scoreCriteria)), h("div", null, locale.MinimumBetCriteria, ": ", h("span", null, tournament.minBetCount))), h("div", { class: "TC" }, 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)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, this.getResultPrize((_b = this.leaderboards) === null || _b === void 0 ? void 0 : _b.find(l => l.isMe))) })), h("section", { class: "Prizes" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))));
319
+ }
320
+ getResultPrize(leaderboard) {
321
+ return {
322
+ prize: leaderboard.prizeName,
323
+ place: leaderboard.rank,
324
+ };
325
+ }
326
+ renderCloseBarInLayout() {
327
+ const { left, middle } = this.getWrapperBarData();
328
+ return (h(CloseBar, { left, middle,
329
+ right: (h("span", { onClick: this.onClickBarInLayout }, iconClose)) }));
330
+ }
331
+ renderCloseBarInLayoutDialog() {
332
+ return (h(CloseBar, { right: (h("span", { onClick: this.onClickBarInLayoutDialog }, iconClose)) }));
333
+ }
334
+ renderLeaderboardContainer(render) {
335
+ const { dialog: { isOpen } } = this;
336
+ return (h("div", { class: "Wrapper" }, h("div", { class: classnames("WrapperContent", { faded: isOpen }) }, this.renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen }, h("div", null, this.renderCloseBarInLayoutDialog(), isOpen && this.renderDialogContent())))));
337
+ }
338
+ getWrapperBarData() {
339
+ const { page, locale } = this;
340
+ switch (page) {
341
+ case LeaderboardPage.List:
342
+ return {
343
+ left: h("span", { onClick: this.onClickBarTip }, iconQuestion),
344
+ middle: locale.Leaderboards
345
+ };
346
+ case LeaderboardPage.Item:
347
+ return {
348
+ left: (h("span", { onClick: this.onClickBarBack }, iconBack)),
349
+ middle: '',
350
+ };
351
+ }
352
+ }
353
+ openDialog(type, data = undefined) {
354
+ this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: true, type, data });
355
+ }
356
+ closeDialog() {
357
+ this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: false });
358
+ }
359
+ static get is() { return "casino-engagement-suite-tournament"; }
360
+ static get encapsulation() { return "shadow"; }
361
+ static get originalStyleUrls() {
362
+ return {
363
+ "$": ["casino-engagement-suite-tournament.scss"]
364
+ };
365
+ }
366
+ static get styleUrls() {
367
+ return {
368
+ "$": ["casino-engagement-suite-tournament.css"]
369
+ };
370
+ }
371
+ static get properties() {
372
+ return {
373
+ "language": {
374
+ "type": "string",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "string",
378
+ "resolved": "string",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": "Language"
386
+ },
387
+ "attribute": "language",
388
+ "reflect": false,
389
+ "defaultValue": "'en'"
390
+ },
391
+ "clientStyling": {
392
+ "type": "string",
393
+ "mutable": false,
394
+ "complexType": {
395
+ "original": "string",
396
+ "resolved": "string",
397
+ "references": {}
398
+ },
399
+ "required": false,
400
+ "optional": false,
401
+ "docs": {
402
+ "tags": [],
403
+ "text": "Client custom styling via string"
404
+ },
405
+ "attribute": "client-styling",
406
+ "reflect": true,
407
+ "defaultValue": "''"
408
+ },
409
+ "clientStylingUrl": {
410
+ "type": "string",
411
+ "mutable": false,
412
+ "complexType": {
413
+ "original": "string",
414
+ "resolved": "string",
415
+ "references": {}
416
+ },
417
+ "required": false,
418
+ "optional": false,
419
+ "docs": {
420
+ "tags": [],
421
+ "text": "Client custom styling via url"
422
+ },
423
+ "attribute": "client-styling-url",
424
+ "reflect": true,
425
+ "defaultValue": "''"
426
+ },
427
+ "translationUrl": {
428
+ "type": "string",
429
+ "mutable": false,
430
+ "complexType": {
431
+ "original": "string",
432
+ "resolved": "string",
433
+ "references": {}
434
+ },
435
+ "required": false,
436
+ "optional": false,
437
+ "docs": {
438
+ "tags": [],
439
+ "text": "Translation via url"
440
+ },
441
+ "attribute": "translation-url",
442
+ "reflect": true,
443
+ "defaultValue": "''"
444
+ },
445
+ "leaderboardsInit": {
446
+ "type": "unknown",
447
+ "mutable": false,
448
+ "complexType": {
449
+ "original": "TournamentApi[]",
450
+ "resolved": "TournamentApi[]",
451
+ "references": {
452
+ "TournamentApi": {
453
+ "location": "import",
454
+ "path": "../../utils/types",
455
+ "id": "../../../../packages/stencil/casino-engagement-suite-tournament/src/utils/types.ts::TournamentApi"
456
+ }
457
+ }
458
+ },
459
+ "required": false,
460
+ "optional": false,
461
+ "docs": {
462
+ "tags": [],
463
+ "text": "Raw Leaderboards from API for Init"
464
+ }
465
+ }
466
+ };
467
+ }
468
+ static get states() {
469
+ return {
470
+ "tab": {},
471
+ "locale": {},
472
+ "tournamentItem": {},
473
+ "tournamentList": {},
474
+ "leaderboards": {},
475
+ "isActionJoinPending": {},
476
+ "isDialogOpen": {},
477
+ "isShowInfo": {},
478
+ "page": {},
479
+ "tournamentInDialog": {},
480
+ "dialog": {},
481
+ "time": {}
482
+ };
483
+ }
484
+ static get events() {
485
+ return [{
486
+ "method": "close",
487
+ "name": "close",
488
+ "bubbles": true,
489
+ "cancelable": true,
490
+ "composed": true,
491
+ "docs": {
492
+ "tags": [],
493
+ "text": ""
494
+ },
495
+ "complexType": {
496
+ "original": "void",
497
+ "resolved": "void",
498
+ "references": {}
499
+ }
500
+ }];
501
+ }
502
+ static get listeners() {
503
+ return [{
504
+ "name": "message",
505
+ "method": "handleEvent",
506
+ "target": "window",
507
+ "capture": false,
508
+ "passive": false
509
+ }];
510
+ }
511
+ }
@@ -0,0 +1 @@
1
+ export { CasinoEngagementSuiteTournament } from './casino-engagement-suite-tournament';
@@ -0,0 +1 @@
1
+ export * from './components/casino-engagement-suite-tournament';
@@ -0,0 +1,11 @@
1
+ import { __rest } from "tslib";
2
+ import { h } from "@stencil/core";
3
+ import { classnames } from "../utils/utils";
4
+ export const GradientRoundedButton = (_a) => {
5
+ var { statedClasses, innerHTML } = _a, props = __rest(_a, ["statedClasses", "innerHTML"]);
6
+ const { isHollow, isPending } = statedClasses;
7
+ return (h("button", Object.assign({ class: classnames('GradientRoundedButton', 'GradientRounded', {
8
+ Hollow: isHollow || false,
9
+ Pending: isPending || false,
10
+ }) }, props), h("span", null, innerHTML)));
11
+ };
@@ -0,0 +1,8 @@
1
+ import { h } from "@stencil/core";
2
+ export const iconClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg" });
3
+ export const iconQuestion = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg" });
4
+ export const iconEyeOpen = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg" });
5
+ export const iconEyeClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg" });
6
+ export const iconBack = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg" });
7
+ export const iconReward = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg" });
8
+ export const iconTrophy = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg" });
@@ -0,0 +1,14 @@
1
+ import { h } from "@stencil/core";
2
+ export const CloseBar = (props) => {
3
+ const { left, middle, right } = props;
4
+ const slots = {
5
+ left,
6
+ middle,
7
+ right,
8
+ };
9
+ const getFirstLetterUppercase = (str) => str
10
+ .split('')
11
+ .map((letter, index) => index === 0 ? letter.toUpperCase() : letter)
12
+ .join('');
13
+ return (h("div", { class: "WrapperBar" }, Object.keys(slots).map(slotKey => (h("div", { class: "WrapperBar" + getFirstLetterUppercase(slotKey) }, slots[slotKey] || '')))));
14
+ };
@@ -0,0 +1,35 @@
1
+ export const tournamentAdapter = (tournamentApi) => {
2
+ const keysTime = [
3
+ 'startTime',
4
+ 'endTime',
5
+ 'closeTime',
6
+ 'exhibitionStartTime',
7
+ 'exhibitionEndTime',
8
+ ];
9
+ const tournament = {};
10
+ Object.keys(tournamentApi).map((key) => {
11
+ const value = tournamentApi[key];
12
+ switch (key) {
13
+ case 'games':
14
+ tournament[key] = value.items;
15
+ break;
16
+ default:
17
+ tournament[key] = keysTime.includes(key) ? new Date(value) : value;
18
+ }
19
+ });
20
+ return tournament;
21
+ };
22
+ export const leaderboardsAdapter = (leaderboardRes) => {
23
+ let { item, items: leaderboards } = leaderboardRes;
24
+ if (!item) {
25
+ return leaderboards;
26
+ }
27
+ return leaderboards.map(leaderboard => {
28
+ if (item && item.userID === leaderboard.userID) {
29
+ return Object.assign(Object.assign({}, leaderboard), { isMe: true });
30
+ }
31
+ else {
32
+ return leaderboard;
33
+ }
34
+ });
35
+ };
@@ -0,0 +1,28 @@
1
+ export var Tab;
2
+ (function (Tab) {
3
+ Tab["Info"] = "Info";
4
+ Tab["Leaderboard"] = "Leaderboard";
5
+ Tab["Games"] = "Games";
6
+ })(Tab || (Tab = {}));
7
+ export var Time;
8
+ (function (Time) {
9
+ Time["Starts"] = "Starts";
10
+ Time["Ends"] = "Ends";
11
+ })(Time || (Time = {}));
12
+ export const localePostprocess = (translationText, props) => {
13
+ Object.keys(props).map(key => {
14
+ translationText = translationText.replace(`{${key}}`, props[key]);
15
+ });
16
+ return translationText;
17
+ };
18
+ export 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: {
19
+ Title: 'Quit Leaderboard?',
20
+ 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?',
21
+ ButtonYes: 'Yes, I want to quit leaderboard',
22
+ ButtonNo: 'No, Stay on the leaderboard',
23
+ }, JoinDialog: {
24
+ Tile: 'Congratulations!',
25
+ Description: 'You have unlocked <span>{tournamentName}</span>! <br />Would you like to join?',
26
+ ButtonYes: 'Join',
27
+ ButtonNo: 'Not interested',
28
+ }, 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.' });
@@ -0,0 +1,18 @@
1
+ export var LeaderboardPage;
2
+ (function (LeaderboardPage) {
3
+ LeaderboardPage["Confirm"] = "Confirm";
4
+ LeaderboardPage["List"] = "List";
5
+ LeaderboardPage["Item"] = "Item";
6
+ })(LeaderboardPage || (LeaderboardPage = {}));
7
+ export var TournamentState;
8
+ (function (TournamentState) {
9
+ TournamentState["Running"] = "Running";
10
+ TournamentState["Unstarted"] = "Unstarted";
11
+ TournamentState["Closed"] = "Closed";
12
+ TournamentState["Closing"] = "Closing";
13
+ })(TournamentState || (TournamentState = {}));
14
+ export var DialogType;
15
+ (function (DialogType) {
16
+ DialogType["Unjoin"] = "Unjoin";
17
+ DialogType["Tip"] = "Tip";
18
+ })(DialogType || (DialogType = {}));