@everymatrix/casino-engagement-suite-luckywheel-list 1.56.0 → 1.56.3
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-luckywheel-list/casino-engagement-suite-luckywheel-list.esm.js +1 -1
- package/dist/casino-engagement-suite-luckywheel-list/index.esm.js +1 -1
- package/dist/casino-engagement-suite-luckywheel-list/{p-0d270bab.entry.js → p-19bf678d.entry.js} +1 -1
- package/dist/casino-engagement-suite-luckywheel-list/p-89bbc8c4.js +15 -0
- package/dist/casino-engagement-suite-luckywheel-list/p-b1637276.js +2 -0
- package/dist/cjs/{casino-engagement-suite-luckywheel-list-1978fae3.js → casino-engagement-suite-luckywheel-list-660f479c.js} +87 -66
- package/dist/cjs/casino-engagement-suite-luckywheel-list.cjs.js +2 -2
- package/dist/cjs/casino-engagement-suite-luckywheel-list_2.cjs.entry.js +9 -27
- package/dist/cjs/{index-622d50a1.js → index-c93b88f6.js} +71 -206
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/casino-engagement-suite-luckywheel-list/casino-engagement-suite-luckywheel-list.js +43 -62
- package/dist/collection/renders/LuckyWheelsHistory.js +7 -8
- package/dist/esm/{casino-engagement-suite-luckywheel-list-e5d5497e.js → casino-engagement-suite-luckywheel-list-a950eff2.js} +87 -66
- package/dist/esm/casino-engagement-suite-luckywheel-list.js +3 -3
- package/dist/esm/casino-engagement-suite-luckywheel-list_2.entry.js +9 -27
- package/dist/esm/{index-ccb37e4c.js → index-8671bc92.js} +71 -206
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/packages/stencil/casino-engagement-suite-luckywheel-list/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/packages/stencil/casino-engagement-suite-luckywheel-list/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-luckywheel-list/casino-engagement-suite-luckywheel-list.d.ts +4 -5
- package/dist/types/components.d.ts +2 -2
- package/dist/types/models/luckywheel.d.ts +16 -16
- package/dist/types/stencil-public-runtime.d.ts +0 -6
- package/package.json +1 -1
- package/dist/casino-engagement-suite-luckywheel-list/p-95998397.js +0 -1
- package/dist/casino-engagement-suite-luckywheel-list/p-f8cbc45f.js +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/packages/stencil/casino-engagement-suite-luckywheel-list/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/packages/stencil/casino-engagement-suite-luckywheel-list/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel-list/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
import { h } from "@stencil/core";
|
|
2
3
|
import { translate, getTranslations } from "../../utils/locale.utils";
|
|
3
4
|
import "../../../../../casino-engagement-suite-progress-bar/dist/types/index";
|
|
@@ -5,39 +6,6 @@ import "../../../../../../svelte/general-animation-loading/esnext/general-animat
|
|
|
5
6
|
import { getHistoryLoaderTemplate, getLuckyWheelsHistoryTemplate } from "../../renders/LuckyWheelsHistory";
|
|
6
7
|
export class CasinoEngagementSuiteLuckyWheelList {
|
|
7
8
|
constructor() {
|
|
8
|
-
/**
|
|
9
|
-
* Client custom styling via string
|
|
10
|
-
*/
|
|
11
|
-
this.clientStyling = '';
|
|
12
|
-
/**
|
|
13
|
-
* Client custom styling via url
|
|
14
|
-
*/
|
|
15
|
-
this.clientStylingUrl = '';
|
|
16
|
-
/**
|
|
17
|
-
* Language of the widget
|
|
18
|
-
*/
|
|
19
|
-
this.language = 'en';
|
|
20
|
-
/**
|
|
21
|
-
* User's device type
|
|
22
|
-
*/
|
|
23
|
-
this.device = 'Mobile';
|
|
24
|
-
/**
|
|
25
|
-
* List of lucky wheels
|
|
26
|
-
*/
|
|
27
|
-
this.luckyWheels = [];
|
|
28
|
-
/**
|
|
29
|
-
* Translations via URL
|
|
30
|
-
*/
|
|
31
|
-
this.translationUrl = '';
|
|
32
|
-
this.tooltip = false;
|
|
33
|
-
this.timers = {};
|
|
34
|
-
this.limitStylingAppends = false;
|
|
35
|
-
this.activeTab = 1;
|
|
36
|
-
this.historyLoading = false;
|
|
37
|
-
this.luckywheelHistory = {};
|
|
38
|
-
this.openedHistoryIds = [];
|
|
39
|
-
this.historyLoaded = false;
|
|
40
|
-
this.isLoading = false;
|
|
41
9
|
this.setClientStyling = () => {
|
|
42
10
|
let sheet = document.createElement('style');
|
|
43
11
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -88,16 +56,36 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
88
56
|
}
|
|
89
57
|
this.openedHistoryIds = [...this.openedHistoryIds];
|
|
90
58
|
};
|
|
59
|
+
this.clientStyling = '';
|
|
60
|
+
this.clientStylingUrl = '';
|
|
61
|
+
this.language = 'en';
|
|
62
|
+
this.device = 'Mobile';
|
|
63
|
+
this.luckyWheels = [];
|
|
64
|
+
this.translationUrl = '';
|
|
65
|
+
this.tooltip = false;
|
|
66
|
+
this.timers = {};
|
|
67
|
+
this.limitStylingAppends = false;
|
|
68
|
+
this.activeTab = 1;
|
|
69
|
+
this.historyLoading = false;
|
|
70
|
+
this.luckywheelHistory = {};
|
|
71
|
+
this.openedHistoryIds = [];
|
|
72
|
+
this.historyLoaded = false;
|
|
73
|
+
this.isLoading = false;
|
|
91
74
|
}
|
|
92
75
|
handleEvent(e) {
|
|
93
|
-
|
|
76
|
+
var _a;
|
|
77
|
+
const _b = e === null || e === void 0 ? void 0 : e.data, { type } = _b, rest = __rest(_b, ["type"]);
|
|
94
78
|
if (type === 'BarLuckyWheelsClick') {
|
|
95
79
|
this.activeTab = 1;
|
|
96
80
|
this.openedHistoryIds = [];
|
|
97
81
|
}
|
|
98
82
|
if (type === 'LuckywheelHistoryResponse') {
|
|
99
83
|
this.openedHistoryIds = [];
|
|
100
|
-
|
|
84
|
+
const items = rest.data;
|
|
85
|
+
if (items.length > 0) {
|
|
86
|
+
const id = (_a = items[0].Draw) === null || _a === void 0 ? void 0 : _a.LotteryProgramID;
|
|
87
|
+
this.luckywheelHistory[id] = items;
|
|
88
|
+
}
|
|
101
89
|
this.historyLoading = false;
|
|
102
90
|
}
|
|
103
91
|
}
|
|
@@ -137,11 +125,11 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
137
125
|
const now = new Date().getTime();
|
|
138
126
|
this.timers = this.luckyWheels.reduce((acc, luckywheel) => {
|
|
139
127
|
var _a;
|
|
140
|
-
const expirationDate = new Date((_a = luckywheel.
|
|
128
|
+
const expirationDate = new Date((_a = luckywheel.Current) === null || _a === void 0 ? void 0 : _a.EndTime).getTime();
|
|
141
129
|
const diff = expirationDate - now;
|
|
142
130
|
let countdown = '00h:00m:00s';
|
|
143
131
|
if (diff < 1) {
|
|
144
|
-
this.removeLuckyWheel(luckywheel.
|
|
132
|
+
this.removeLuckyWheel(luckywheel.Program.Id);
|
|
145
133
|
}
|
|
146
134
|
else {
|
|
147
135
|
const { days, hours, minutes, seconds } = {
|
|
@@ -154,38 +142,43 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
154
142
|
? `${hours}h:${minutes}m:${seconds}s`
|
|
155
143
|
: `${days}d:${hours}h:${minutes}m`;
|
|
156
144
|
}
|
|
157
|
-
return Object.assign(Object.assign({}, acc), { [luckywheel.
|
|
145
|
+
return Object.assign(Object.assign({}, acc), { [luckywheel.Program.Id]: countdown });
|
|
158
146
|
}, {});
|
|
159
147
|
}
|
|
160
148
|
removeLuckyWheel(id) {
|
|
161
|
-
this.luckyWheels = this.luckyWheels.filter((luckywheel) => luckywheel.
|
|
149
|
+
this.luckyWheels = this.luckyWheels.filter((luckywheel) => luckywheel.Program.Id !== id);
|
|
162
150
|
window.postMessage({ type: 'LuckyWheelHasExpired', id });
|
|
163
151
|
}
|
|
164
152
|
sendHistoryRequest() {
|
|
165
153
|
this.historyLoading = true;
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
this.luckyWheels.forEach((luckyWheel) => {
|
|
155
|
+
window.postMessage({
|
|
156
|
+
type: 'LuckywheelHistoryRequest',
|
|
157
|
+
data: {
|
|
158
|
+
lotteryProgramID: luckyWheel.Program.Id,
|
|
159
|
+
}
|
|
160
|
+
});
|
|
168
161
|
});
|
|
169
162
|
}
|
|
170
163
|
getLuckyWheelClasses(luckyWheel) {
|
|
171
164
|
return {
|
|
172
165
|
LuckyWheelsCard: true,
|
|
173
|
-
LuckyWheelsEmptyNumber: luckyWheel.
|
|
166
|
+
LuckyWheelsEmptyNumber: luckyWheel.Current.RemainingTimes === 0
|
|
174
167
|
};
|
|
175
168
|
}
|
|
176
169
|
getLuckyWheelName(luckywheel) {
|
|
177
170
|
var _a, _b;
|
|
178
|
-
return ((_a = luckywheel.
|
|
171
|
+
return ((_a = luckywheel.Program) === null || _a === void 0 ? void 0 : _a.Name['en']) || ((_b = luckywheel.Program) === null || _b === void 0 ? void 0 : _b.Name['*']);
|
|
179
172
|
}
|
|
180
173
|
getLuckyWheelHeaderTemplate(luckywheel) {
|
|
181
174
|
var _a, _b;
|
|
182
|
-
return (h("div", { class: "LuckyWheelsCardHeader" }, h("div", { class: `LuckyWheelsName` }, this.getLuckyWheelName(luckywheel)), (h("div", { class: "LuckyWheelsCounter" }, h("div", { class: `${((_a = luckywheel.
|
|
175
|
+
return (h("div", { class: "LuckyWheelsCardHeader" }, h("div", { class: `LuckyWheelsName` }, this.getLuckyWheelName(luckywheel)), (h("div", { class: "LuckyWheelsCounter" }, h("div", { class: `${((_a = luckywheel.Current) === null || _a === void 0 ? void 0 : _a.RemainingTimes) ? 'LuckyWheelsHighlightedCounter' : 'LuckyWheelsEmptyCounter'}` }, (_b = luckywheel.Current) === null || _b === void 0 ? void 0 : _b.RemainingTimes)))));
|
|
183
176
|
}
|
|
184
177
|
getLuckyWheelTemplate(luckywheel, index) {
|
|
185
|
-
const countdown = this.timers[luckywheel.
|
|
178
|
+
const countdown = this.timers[luckywheel.Program.Id];
|
|
186
179
|
//TODO: canceled status
|
|
187
|
-
const isCanceled = luckywheel.
|
|
188
|
-
return (h("div", { class: this.getLuckyWheelClasses(luckywheel), onClick: this.handleLuckyWheelClick, key: luckywheel.
|
|
180
|
+
const isCanceled = luckywheel.Current.RemainingTimes === 0;
|
|
181
|
+
return (h("div", { class: this.getLuckyWheelClasses(luckywheel), onClick: this.handleLuckyWheelClick, key: luckywheel.Program.Id, "data-id": luckywheel.Program.Id, "data-index": index }, this.getLuckyWheelHeaderTemplate(luckywheel), isCanceled ? (h("div", { class: "ForfeitedMessage" }, h("div", null, translate('canceled', this.language)), h("div", null, translate('support', this.language)))) : (h("div", { class: "LuckyWheelsCountdownWrapper" }, h("span", { class: "LuckyWheelsCountdown" }, countdown)))));
|
|
189
182
|
}
|
|
190
183
|
getHeaderTemplate() {
|
|
191
184
|
return h("header", { class: "LuckyWheelsListPopupHeader" }, h("button", { onClick: this.showTooltip, class: "EngagementSuiteIconButton Help" }), h("div", { class: "LuckyWheelsListPopupHeaderName" }, translate('luckyWheel', this.language)), h("button", { class: "EngagementSuiteIconButton Close", onClick: this.handleCloseClick }));
|
|
@@ -223,7 +216,7 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
223
216
|
: this.getHistoryTabTemplate();
|
|
224
217
|
}
|
|
225
218
|
render() {
|
|
226
|
-
return h("div", { key: '
|
|
219
|
+
return h("div", { key: 'b640229fe6feea73f03ee6ce4a2e80e269240780', class: `LuckyWheelsListPopup ${this.device}` }, this.getHeaderTemplate(), this.getTabsTemplate(), this.getTabsContentTemplate(), this.getTooltipTemplate());
|
|
227
220
|
}
|
|
228
221
|
static get is() { return "casino-engagement-suite-luckywheel-list"; }
|
|
229
222
|
static get encapsulation() { return "shadow"; }
|
|
@@ -253,8 +246,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
253
246
|
"tags": [],
|
|
254
247
|
"text": "Client custom styling via string"
|
|
255
248
|
},
|
|
256
|
-
"getter": false,
|
|
257
|
-
"setter": false,
|
|
258
249
|
"attribute": "client-styling",
|
|
259
250
|
"reflect": true,
|
|
260
251
|
"defaultValue": "''"
|
|
@@ -273,8 +264,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
273
264
|
"tags": [],
|
|
274
265
|
"text": "Client custom styling via url"
|
|
275
266
|
},
|
|
276
|
-
"getter": false,
|
|
277
|
-
"setter": false,
|
|
278
267
|
"attribute": "client-styling-url",
|
|
279
268
|
"reflect": true,
|
|
280
269
|
"defaultValue": "''"
|
|
@@ -293,8 +282,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
293
282
|
"tags": [],
|
|
294
283
|
"text": "Language of the widget"
|
|
295
284
|
},
|
|
296
|
-
"getter": false,
|
|
297
|
-
"setter": false,
|
|
298
285
|
"attribute": "language",
|
|
299
286
|
"reflect": false,
|
|
300
287
|
"defaultValue": "'en'"
|
|
@@ -313,8 +300,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
313
300
|
"tags": [],
|
|
314
301
|
"text": "User's device type"
|
|
315
302
|
},
|
|
316
|
-
"getter": false,
|
|
317
|
-
"setter": false,
|
|
318
303
|
"attribute": "device",
|
|
319
304
|
"reflect": false,
|
|
320
305
|
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
@@ -328,8 +313,8 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
328
313
|
"references": {
|
|
329
314
|
"LuckyWheel": {
|
|
330
315
|
"location": "import",
|
|
331
|
-
"path": "../../
|
|
332
|
-
"id": "../../../../packages/stencil/casino-engagement-suite-luckywheel-list/src/
|
|
316
|
+
"path": "../../models/luckywheel",
|
|
317
|
+
"id": "../../../../packages/stencil/casino-engagement-suite-luckywheel-list/src/models/luckywheel.ts::LuckyWheel"
|
|
333
318
|
}
|
|
334
319
|
}
|
|
335
320
|
},
|
|
@@ -339,8 +324,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
339
324
|
"tags": [],
|
|
340
325
|
"text": "List of lucky wheels"
|
|
341
326
|
},
|
|
342
|
-
"getter": false,
|
|
343
|
-
"setter": false,
|
|
344
327
|
"defaultValue": "[] as Array<LuckyWheel>"
|
|
345
328
|
},
|
|
346
329
|
"translationUrl": {
|
|
@@ -357,8 +340,6 @@ export class CasinoEngagementSuiteLuckyWheelList {
|
|
|
357
340
|
"tags": [],
|
|
358
341
|
"text": "Translations via URL"
|
|
359
342
|
},
|
|
360
|
-
"getter": false,
|
|
361
|
-
"setter": false,
|
|
362
343
|
"attribute": "translation-url",
|
|
363
344
|
"reflect": false,
|
|
364
345
|
"defaultValue": "''"
|
|
@@ -27,12 +27,12 @@ export const getHistoryLevelTemplate = (level, index, lang) => {
|
|
|
27
27
|
};
|
|
28
28
|
const getRewards = (luckywheel, result) => {
|
|
29
29
|
var _a, _b, _c, _d;
|
|
30
|
-
const index = result.
|
|
31
|
-
const name = (_b = (_a = luckywheel.
|
|
30
|
+
const index = result.WheelOfFortunePartitionIndex || 0;
|
|
31
|
+
const name = (_b = (_a = luckywheel.Program.WheelOfFortune) === null || _a === void 0 ? void 0 : _a.Partitions[index]) === null || _b === void 0 ? void 0 : _b.Name;
|
|
32
32
|
const displayName = name['en'] || name['*'];
|
|
33
|
-
const assets = (_d = (_c = luckywheel.
|
|
33
|
+
const assets = (_d = (_c = luckywheel.Program.WheelOfFortune) === null || _c === void 0 ? void 0 : _c.Partitions[index]) === null || _d === void 0 ? void 0 : _d.Image1;
|
|
34
34
|
const displayAssets = assets['en'] || assets['*'];
|
|
35
|
-
const programName = luckywheel.
|
|
35
|
+
const programName = luckywheel.Program.Name['en'] || luckywheel.Program.Name['*'];
|
|
36
36
|
return h("div", { class: "HistoryRewards" }, displayName ? displayName : displayAssets ? (h("img", { src: displayAssets })) : programName);
|
|
37
37
|
};
|
|
38
38
|
const getStatus = (state) => {
|
|
@@ -43,10 +43,9 @@ export const getLuckyWheelsHistoryTemplate = (luckywheels, historyGroups, opened
|
|
|
43
43
|
return h("p", { class: "HistoryEmptyMessage" }, translate('noHistory', lang));
|
|
44
44
|
}
|
|
45
45
|
return h("div", { class: "HistoryList" }, luckywheels.map((luckywheel) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
46
|
+
var _a;
|
|
47
|
+
return h("div", { key: luckywheel.Program.Id, class: `HistoryListItem ${openedHistoryIds.includes(luckywheel.Program.Id) ? 'Opened' : 'Closed'}` }, h("header", { class: "HistoryListItemHeader", "data-id": luckywheel.Program.Id, onClick: toggleLuckyWheelHistory }, luckywheel.Program.Name['en'] || luckywheel.Program.Name['*'], h("button", { class: "EngagementSuiteIconButton ArrowDown" })), h("div", { class: "HistoryListItemBody" }, h("div", { class: "HistoryInfoRow" }, (_a = historyGroups[luckywheel.Program.Id]) === null || _a === void 0 ? void 0 : _a.map((history) => {
|
|
48
|
+
return (h("div", { class: "HistoryInfo" }, h("div", { class: "HistoryCol Rewards" }, getRewards(luckywheel, history.Draw.Result)), h("div", { class: "HistoryCol Issued" }, getStatus(history.Draw.State)), h("div", { class: "HistoryCol Time" }, format(new Date(history.Draw.Time), 'LLL d, yyyy HH:mm:ss'))));
|
|
50
49
|
}))));
|
|
51
50
|
}));
|
|
52
51
|
};
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import { h as h$1, r as registerInstance, c as createEvent, g as getElement } from './index-
|
|
1
|
+
import { h as h$1, r as registerInstance, c as createEvent, g as getElement } from './index-8671bc92.js';
|
|
2
|
+
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
|
|
18
|
+
function __rest(s, e) {
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
23
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
25
|
+
t[p[i]] = s[p[i]];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
2
29
|
|
|
3
30
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
31
|
const SUPPORTED_LANGUAGES = ['en'];
|
|
@@ -78,7 +105,8 @@ function U(t, e, n) {
|
|
|
78
105
|
}
|
|
79
106
|
}
|
|
80
107
|
function I(t) {
|
|
81
|
-
if (!t)
|
|
108
|
+
if (!t)
|
|
109
|
+
return document;
|
|
82
110
|
const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
|
|
83
111
|
return e && /** @type {ShadowRoot} */
|
|
84
112
|
e.host ? (
|
|
@@ -122,7 +150,8 @@ function _(t) {
|
|
|
122
150
|
p = t;
|
|
123
151
|
}
|
|
124
152
|
function J() {
|
|
125
|
-
if (!p)
|
|
153
|
+
if (!p)
|
|
154
|
+
throw new Error("Function called outside component initialization");
|
|
126
155
|
return p;
|
|
127
156
|
}
|
|
128
157
|
function V(t) {
|
|
@@ -153,7 +182,8 @@ function m() {
|
|
|
153
182
|
} catch (e) {
|
|
154
183
|
throw $.length = 0, f = 0, e;
|
|
155
184
|
}
|
|
156
|
-
for (_(null), $.length = 0, f = 0; w.length; )
|
|
185
|
+
for (_(null), $.length = 0, f = 0; w.length; )
|
|
186
|
+
w.pop()();
|
|
157
187
|
for (let e = 0; e < h.length; e += 1) {
|
|
158
188
|
const n = h[e];
|
|
159
189
|
b.has(n) || (b.add(n), n());
|
|
@@ -2790,12 +2820,12 @@ const getHistoryLoaderTemplate = (lang) => {
|
|
|
2790
2820
|
};
|
|
2791
2821
|
const getRewards = (luckywheel, result) => {
|
|
2792
2822
|
var _a, _b, _c, _d;
|
|
2793
|
-
const index = result.
|
|
2794
|
-
const name = (_b = (_a = luckywheel.
|
|
2823
|
+
const index = result.WheelOfFortunePartitionIndex || 0;
|
|
2824
|
+
const name = (_b = (_a = luckywheel.Program.WheelOfFortune) === null || _a === void 0 ? void 0 : _a.Partitions[index]) === null || _b === void 0 ? void 0 : _b.Name;
|
|
2795
2825
|
const displayName = name['en'] || name['*'];
|
|
2796
|
-
const assets = (_d = (_c = luckywheel.
|
|
2826
|
+
const assets = (_d = (_c = luckywheel.Program.WheelOfFortune) === null || _c === void 0 ? void 0 : _c.Partitions[index]) === null || _d === void 0 ? void 0 : _d.Image1;
|
|
2797
2827
|
const displayAssets = assets['en'] || assets['*'];
|
|
2798
|
-
const programName = luckywheel.
|
|
2828
|
+
const programName = luckywheel.Program.Name['en'] || luckywheel.Program.Name['*'];
|
|
2799
2829
|
return h$1("div", { class: "HistoryRewards" }, displayName ? displayName : displayAssets ? (h$1("img", { src: displayAssets })) : programName);
|
|
2800
2830
|
};
|
|
2801
2831
|
const getStatus = (state) => {
|
|
@@ -2806,18 +2836,17 @@ const getLuckyWheelsHistoryTemplate = (luckywheels, historyGroups, openedHistory
|
|
|
2806
2836
|
return h$1("p", { class: "HistoryEmptyMessage" }, translate('noHistory', lang));
|
|
2807
2837
|
}
|
|
2808
2838
|
return h$1("div", { class: "HistoryList" }, luckywheels.map((luckywheel) => {
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2839
|
+
var _a;
|
|
2840
|
+
return h$1("div", { key: luckywheel.Program.Id, class: `HistoryListItem ${openedHistoryIds.includes(luckywheel.Program.Id) ? 'Opened' : 'Closed'}` },
|
|
2841
|
+
h$1("header", { class: "HistoryListItemHeader", "data-id": luckywheel.Program.Id, onClick: toggleLuckyWheelHistory },
|
|
2842
|
+
luckywheel.Program.Name['en'] || luckywheel.Program.Name['*'],
|
|
2812
2843
|
h$1("button", { class: "EngagementSuiteIconButton ArrowDown" })),
|
|
2813
2844
|
h$1("div", { class: "HistoryListItemBody" },
|
|
2814
|
-
h$1("div", { class: "HistoryInfoRow" },
|
|
2815
|
-
return
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
h$1("div", { class: "HistoryCol Time" }, format(new Date(history.draw.time), 'LLL d, yyyy HH:mm:ss')));
|
|
2820
|
-
});
|
|
2845
|
+
h$1("div", { class: "HistoryInfoRow" }, (_a = historyGroups[luckywheel.Program.Id]) === null || _a === void 0 ? void 0 : _a.map((history) => {
|
|
2846
|
+
return (h$1("div", { class: "HistoryInfo" },
|
|
2847
|
+
h$1("div", { class: "HistoryCol Rewards" }, getRewards(luckywheel, history.Draw.Result)),
|
|
2848
|
+
h$1("div", { class: "HistoryCol Issued" }, getStatus(history.Draw.State)),
|
|
2849
|
+
h$1("div", { class: "HistoryCol Time" }, format(new Date(history.Draw.Time), 'LLL d, yyyy HH:mm:ss'))));
|
|
2821
2850
|
}))));
|
|
2822
2851
|
}));
|
|
2823
2852
|
};
|
|
@@ -2829,39 +2858,6 @@ const CasinoEngagementSuiteLuckyWheelList = class {
|
|
|
2829
2858
|
constructor(hostRef) {
|
|
2830
2859
|
registerInstance(this, hostRef);
|
|
2831
2860
|
this.close = createEvent(this, "close", 7);
|
|
2832
|
-
/**
|
|
2833
|
-
* Client custom styling via string
|
|
2834
|
-
*/
|
|
2835
|
-
this.clientStyling = '';
|
|
2836
|
-
/**
|
|
2837
|
-
* Client custom styling via url
|
|
2838
|
-
*/
|
|
2839
|
-
this.clientStylingUrl = '';
|
|
2840
|
-
/**
|
|
2841
|
-
* Language of the widget
|
|
2842
|
-
*/
|
|
2843
|
-
this.language = 'en';
|
|
2844
|
-
/**
|
|
2845
|
-
* User's device type
|
|
2846
|
-
*/
|
|
2847
|
-
this.device = 'Mobile';
|
|
2848
|
-
/**
|
|
2849
|
-
* List of lucky wheels
|
|
2850
|
-
*/
|
|
2851
|
-
this.luckyWheels = [];
|
|
2852
|
-
/**
|
|
2853
|
-
* Translations via URL
|
|
2854
|
-
*/
|
|
2855
|
-
this.translationUrl = '';
|
|
2856
|
-
this.tooltip = false;
|
|
2857
|
-
this.timers = {};
|
|
2858
|
-
this.limitStylingAppends = false;
|
|
2859
|
-
this.activeTab = 1;
|
|
2860
|
-
this.historyLoading = false;
|
|
2861
|
-
this.luckywheelHistory = {};
|
|
2862
|
-
this.openedHistoryIds = [];
|
|
2863
|
-
this.historyLoaded = false;
|
|
2864
|
-
this.isLoading = false;
|
|
2865
2861
|
this.setClientStyling = () => {
|
|
2866
2862
|
let sheet = document.createElement('style');
|
|
2867
2863
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -2912,16 +2908,36 @@ const CasinoEngagementSuiteLuckyWheelList = class {
|
|
|
2912
2908
|
}
|
|
2913
2909
|
this.openedHistoryIds = [...this.openedHistoryIds];
|
|
2914
2910
|
};
|
|
2911
|
+
this.clientStyling = '';
|
|
2912
|
+
this.clientStylingUrl = '';
|
|
2913
|
+
this.language = 'en';
|
|
2914
|
+
this.device = 'Mobile';
|
|
2915
|
+
this.luckyWheels = [];
|
|
2916
|
+
this.translationUrl = '';
|
|
2917
|
+
this.tooltip = false;
|
|
2918
|
+
this.timers = {};
|
|
2919
|
+
this.limitStylingAppends = false;
|
|
2920
|
+
this.activeTab = 1;
|
|
2921
|
+
this.historyLoading = false;
|
|
2922
|
+
this.luckywheelHistory = {};
|
|
2923
|
+
this.openedHistoryIds = [];
|
|
2924
|
+
this.historyLoaded = false;
|
|
2925
|
+
this.isLoading = false;
|
|
2915
2926
|
}
|
|
2916
2927
|
handleEvent(e) {
|
|
2917
|
-
|
|
2928
|
+
var _a;
|
|
2929
|
+
const _b = e === null || e === void 0 ? void 0 : e.data, { type } = _b, rest = __rest(_b, ["type"]);
|
|
2918
2930
|
if (type === 'BarLuckyWheelsClick') {
|
|
2919
2931
|
this.activeTab = 1;
|
|
2920
2932
|
this.openedHistoryIds = [];
|
|
2921
2933
|
}
|
|
2922
2934
|
if (type === 'LuckywheelHistoryResponse') {
|
|
2923
2935
|
this.openedHistoryIds = [];
|
|
2924
|
-
|
|
2936
|
+
const items = rest.data;
|
|
2937
|
+
if (items.length > 0) {
|
|
2938
|
+
const id = (_a = items[0].Draw) === null || _a === void 0 ? void 0 : _a.LotteryProgramID;
|
|
2939
|
+
this.luckywheelHistory[id] = items;
|
|
2940
|
+
}
|
|
2925
2941
|
this.historyLoading = false;
|
|
2926
2942
|
}
|
|
2927
2943
|
}
|
|
@@ -2961,11 +2977,11 @@ const CasinoEngagementSuiteLuckyWheelList = class {
|
|
|
2961
2977
|
const now = new Date().getTime();
|
|
2962
2978
|
this.timers = this.luckyWheels.reduce((acc, luckywheel) => {
|
|
2963
2979
|
var _a;
|
|
2964
|
-
const expirationDate = new Date((_a = luckywheel.
|
|
2980
|
+
const expirationDate = new Date((_a = luckywheel.Current) === null || _a === void 0 ? void 0 : _a.EndTime).getTime();
|
|
2965
2981
|
const diff = expirationDate - now;
|
|
2966
2982
|
let countdown = '00h:00m:00s';
|
|
2967
2983
|
if (diff < 1) {
|
|
2968
|
-
this.removeLuckyWheel(luckywheel.
|
|
2984
|
+
this.removeLuckyWheel(luckywheel.Program.Id);
|
|
2969
2985
|
}
|
|
2970
2986
|
else {
|
|
2971
2987
|
const { days, hours, minutes, seconds } = {
|
|
@@ -2978,38 +2994,43 @@ const CasinoEngagementSuiteLuckyWheelList = class {
|
|
|
2978
2994
|
? `${hours}h:${minutes}m:${seconds}s`
|
|
2979
2995
|
: `${days}d:${hours}h:${minutes}m`;
|
|
2980
2996
|
}
|
|
2981
|
-
return Object.assign(Object.assign({}, acc), { [luckywheel.
|
|
2997
|
+
return Object.assign(Object.assign({}, acc), { [luckywheel.Program.Id]: countdown });
|
|
2982
2998
|
}, {});
|
|
2983
2999
|
}
|
|
2984
3000
|
removeLuckyWheel(id) {
|
|
2985
|
-
this.luckyWheels = this.luckyWheels.filter((luckywheel) => luckywheel.
|
|
3001
|
+
this.luckyWheels = this.luckyWheels.filter((luckywheel) => luckywheel.Program.Id !== id);
|
|
2986
3002
|
window.postMessage({ type: 'LuckyWheelHasExpired', id });
|
|
2987
3003
|
}
|
|
2988
3004
|
sendHistoryRequest() {
|
|
2989
3005
|
this.historyLoading = true;
|
|
2990
|
-
|
|
2991
|
-
|
|
3006
|
+
this.luckyWheels.forEach((luckyWheel) => {
|
|
3007
|
+
window.postMessage({
|
|
3008
|
+
type: 'LuckywheelHistoryRequest',
|
|
3009
|
+
data: {
|
|
3010
|
+
lotteryProgramID: luckyWheel.Program.Id,
|
|
3011
|
+
}
|
|
3012
|
+
});
|
|
2992
3013
|
});
|
|
2993
3014
|
}
|
|
2994
3015
|
getLuckyWheelClasses(luckyWheel) {
|
|
2995
3016
|
return {
|
|
2996
3017
|
LuckyWheelsCard: true,
|
|
2997
|
-
LuckyWheelsEmptyNumber: luckyWheel.
|
|
3018
|
+
LuckyWheelsEmptyNumber: luckyWheel.Current.RemainingTimes === 0
|
|
2998
3019
|
};
|
|
2999
3020
|
}
|
|
3000
3021
|
getLuckyWheelName(luckywheel) {
|
|
3001
3022
|
var _a, _b;
|
|
3002
|
-
return ((_a = luckywheel.
|
|
3023
|
+
return ((_a = luckywheel.Program) === null || _a === void 0 ? void 0 : _a.Name['en']) || ((_b = luckywheel.Program) === null || _b === void 0 ? void 0 : _b.Name['*']);
|
|
3003
3024
|
}
|
|
3004
3025
|
getLuckyWheelHeaderTemplate(luckywheel) {
|
|
3005
3026
|
var _a, _b;
|
|
3006
|
-
return (h$1("div", { class: "LuckyWheelsCardHeader" }, h$1("div", { class: `LuckyWheelsName` }, this.getLuckyWheelName(luckywheel)), (h$1("div", { class: "LuckyWheelsCounter" }, h$1("div", { class: `${((_a = luckywheel.
|
|
3027
|
+
return (h$1("div", { class: "LuckyWheelsCardHeader" }, h$1("div", { class: `LuckyWheelsName` }, this.getLuckyWheelName(luckywheel)), (h$1("div", { class: "LuckyWheelsCounter" }, h$1("div", { class: `${((_a = luckywheel.Current) === null || _a === void 0 ? void 0 : _a.RemainingTimes) ? 'LuckyWheelsHighlightedCounter' : 'LuckyWheelsEmptyCounter'}` }, (_b = luckywheel.Current) === null || _b === void 0 ? void 0 : _b.RemainingTimes)))));
|
|
3007
3028
|
}
|
|
3008
3029
|
getLuckyWheelTemplate(luckywheel, index) {
|
|
3009
|
-
const countdown = this.timers[luckywheel.
|
|
3030
|
+
const countdown = this.timers[luckywheel.Program.Id];
|
|
3010
3031
|
//TODO: canceled status
|
|
3011
|
-
const isCanceled = luckywheel.
|
|
3012
|
-
return (h$1("div", { class: this.getLuckyWheelClasses(luckywheel), onClick: this.handleLuckyWheelClick, key: luckywheel.
|
|
3032
|
+
const isCanceled = luckywheel.Current.RemainingTimes === 0;
|
|
3033
|
+
return (h$1("div", { class: this.getLuckyWheelClasses(luckywheel), onClick: this.handleLuckyWheelClick, key: luckywheel.Program.Id, "data-id": luckywheel.Program.Id, "data-index": index }, this.getLuckyWheelHeaderTemplate(luckywheel), isCanceled ? (h$1("div", { class: "ForfeitedMessage" }, h$1("div", null, translate('canceled', this.language)), h$1("div", null, translate('support', this.language)))) : (h$1("div", { class: "LuckyWheelsCountdownWrapper" }, h$1("span", { class: "LuckyWheelsCountdown" }, countdown)))));
|
|
3013
3034
|
}
|
|
3014
3035
|
getHeaderTemplate() {
|
|
3015
3036
|
return h$1("header", { class: "LuckyWheelsListPopupHeader" }, h$1("button", { onClick: this.showTooltip, class: "EngagementSuiteIconButton Help" }), h$1("div", { class: "LuckyWheelsListPopupHeaderName" }, translate('luckyWheel', this.language)), h$1("button", { class: "EngagementSuiteIconButton Close", onClick: this.handleCloseClick }));
|
|
@@ -3047,7 +3068,7 @@ const CasinoEngagementSuiteLuckyWheelList = class {
|
|
|
3047
3068
|
: this.getHistoryTabTemplate();
|
|
3048
3069
|
}
|
|
3049
3070
|
render() {
|
|
3050
|
-
return h$1("div", { key: '
|
|
3071
|
+
return h$1("div", { key: 'b640229fe6feea73f03ee6ce4a2e80e269240780', class: `LuckyWheelsListPopup ${this.device}` }, this.getHeaderTemplate(), this.getTabsTemplate(), this.getTabsContentTemplate(), this.getTooltipTemplate());
|
|
3051
3072
|
}
|
|
3052
3073
|
get host() { return getElement(this); }
|
|
3053
3074
|
static get watchers() { return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-8671bc92.js';
|
|
2
|
+
export { s as setNonce } from './index-8671bc92.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
var patchBrowser = () => {
|
|
9
9
|
const importMeta = import.meta.url;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as casino_engagement_suite_luckywheel_list } from './casino-engagement-suite-luckywheel-list-
|
|
2
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
export { C as casino_engagement_suite_luckywheel_list } from './casino-engagement-suite-luckywheel-list-a950eff2.js';
|
|
2
|
+
import { r as registerInstance, h, g as getElement } from './index-8671bc92.js';
|
|
3
3
|
|
|
4
4
|
const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:var(--emw--font-size-small, 14px);line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-gray-300, #666178);border-radius:var(--emw--border-radius-small, 4px);position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:var(--emw--border-radius-small, 4px);background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:var(--emw--engagement-suite-gradient-button, 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-gray-300, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
|
|
5
5
|
const CasinoEngagementSuiteProgressBarStyle0 = casinoEngagementSuiteProgressBarCss;
|
|
@@ -7,31 +7,6 @@ const CasinoEngagementSuiteProgressBarStyle0 = casinoEngagementSuiteProgressBarC
|
|
|
7
7
|
const CasinoEngagementSuiteProgressBar = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
registerInstance(this, hostRef);
|
|
10
|
-
/**
|
|
11
|
-
* Value for the widget
|
|
12
|
-
*/
|
|
13
|
-
this.value = 0;
|
|
14
|
-
/**
|
|
15
|
-
* Shows disabled styles
|
|
16
|
-
*/
|
|
17
|
-
this.disabled = false;
|
|
18
|
-
/**
|
|
19
|
-
* Hide percent value
|
|
20
|
-
*/
|
|
21
|
-
this.hidePercent = false;
|
|
22
|
-
/**
|
|
23
|
-
* Constantly animates
|
|
24
|
-
*/
|
|
25
|
-
this.indeterminate = false;
|
|
26
|
-
/**
|
|
27
|
-
* Client custom styling via string
|
|
28
|
-
*/
|
|
29
|
-
this.clientStyling = '';
|
|
30
|
-
/**
|
|
31
|
-
* Client custom styling via url
|
|
32
|
-
*/
|
|
33
|
-
this.clientStylingUrl = '';
|
|
34
|
-
this.limitStylingAppends = false;
|
|
35
10
|
this.setClientStyling = () => {
|
|
36
11
|
let sheet = document.createElement('style');
|
|
37
12
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -50,6 +25,13 @@ const CasinoEngagementSuiteProgressBar = class {
|
|
|
50
25
|
console.log('Error ', err);
|
|
51
26
|
});
|
|
52
27
|
};
|
|
28
|
+
this.value = 0;
|
|
29
|
+
this.disabled = false;
|
|
30
|
+
this.hidePercent = false;
|
|
31
|
+
this.indeterminate = false;
|
|
32
|
+
this.clientStyling = '';
|
|
33
|
+
this.clientStylingUrl = '';
|
|
34
|
+
this.limitStylingAppends = false;
|
|
53
35
|
}
|
|
54
36
|
componentDidRender() {
|
|
55
37
|
if (!this.limitStylingAppends && this.host) {
|