@everymatrix/bonus-elevate-powerups 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/bonus-elevate-powerups/app-globals-0f993ce5.js +1 -0
  2. package/dist/bonus-elevate-powerups/bonus-elevate-powerups-550b383c.js +1 -0
  3. package/dist/bonus-elevate-powerups/bonus-elevate-powerups.esm.js +1 -0
  4. package/dist/bonus-elevate-powerups/bonus-elevate-powerups_5.entry.js +9 -0
  5. package/dist/bonus-elevate-powerups/index-c7067e6d.js +2 -0
  6. package/dist/bonus-elevate-powerups/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/bonus-elevate-powerups-5d4f1cfd.js +399 -0
  9. package/dist/cjs/bonus-elevate-powerups.cjs.js +25 -0
  10. package/dist/cjs/bonus-elevate-powerups_5.cjs.entry.js +6182 -0
  11. package/dist/cjs/index-3dbb4007.js +1316 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/assets/clear-search.svg +9 -0
  15. package/dist/collection/assets/left-arrow.svg +3 -0
  16. package/dist/collection/collection-manifest.json +32 -0
  17. package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.css +224 -0
  18. package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.js +388 -0
  19. package/dist/collection/components/bonus-elevate-powerups/index.js +1 -0
  20. package/dist/collection/components/time-count/time-count.js +86 -0
  21. package/dist/collection/index.js +1 -0
  22. package/dist/collection/utils/locale.utils.js +43 -0
  23. package/dist/collection/utils/utils.js +10 -0
  24. package/dist/esm/app-globals-0f993ce5.js +3 -0
  25. package/dist/esm/bonus-elevate-powerups-550b383c.js +397 -0
  26. package/dist/esm/bonus-elevate-powerups.js +20 -0
  27. package/dist/esm/bonus-elevate-powerups_5.entry.js +6174 -0
  28. package/dist/esm/index-c7067e6d.js +1287 -0
  29. package/dist/esm/index.js +2 -0
  30. package/dist/esm/loader.js +11 -0
  31. package/dist/index.cjs.js +1 -0
  32. package/dist/index.js +1 -0
  33. package/dist/stencil.config.dev.js +20 -0
  34. package/dist/stencil.config.js +20 -0
  35. package/dist/storybook/main.js +43 -0
  36. package/dist/storybook/preview.js +9 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/types/casino/powerups.d.ts +57 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/packages/stencil/bonus-elevate-powerups/stencil.config.d.ts +2 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/packages/stencil/bonus-elevate-powerups/stencil.config.dev.d.ts +2 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/packages/stencil/bonus-elevate-powerups/storybook/main.d.ts +3 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/packages/stencil/bonus-elevate-powerups/storybook/preview.d.ts +70 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/index.d.ts +4 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  46. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  47. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  48. package/dist/types/components/bonus-elevate-powerups/bonus-elevate-powerups.d.ts +36 -0
  49. package/dist/types/components/bonus-elevate-powerups/index.d.ts +1 -0
  50. package/dist/types/components/time-count/time-count.d.ts +10 -0
  51. package/dist/types/components.d.ts +66 -0
  52. package/dist/types/index.d.ts +1 -0
  53. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  54. package/dist/types/utils/locale.utils.d.ts +2 -0
  55. package/dist/types/utils/utils.d.ts +9 -0
  56. package/loader/cdn.js +1 -0
  57. package/loader/index.cjs.js +1 -0
  58. package/loader/index.d.ts +24 -0
  59. package/loader/index.es2017.js +1 -0
  60. package/loader/index.js +2 -0
  61. package/loader/package.json +11 -0
  62. package/package.json +27 -0
@@ -0,0 +1,388 @@
1
+ import { h } from "@stencil/core";
2
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
3
+ import { BoostingPeriodMode, MultiplierMode } from "../../../../../../../../libs/common/src/types/casino/powerups";
4
+ import { translate } from "../../utils/locale.utils";
5
+ import ClearSearch from "../../assets/clear-search.svg";
6
+ import "../../../../../bonus-pagination-nav/dist/types/index";
7
+ import "../../../../../ui-image/dist/types/index";
8
+ import { powerUpGameSearchConditions, powerUpSearchConditions } from "../../utils/utils";
9
+ export class BonusElevatePowerups {
10
+ constructor() {
11
+ this.tableId = 'powerups';
12
+ this.gameObservers = new Map();
13
+ this.mbSource = undefined;
14
+ this.clientStyling = undefined;
15
+ this.clientStylingUrl = undefined;
16
+ this.language = 'en';
17
+ this.endpoint = undefined;
18
+ this.session = undefined;
19
+ this.pageSize = 20;
20
+ this.isLoading = true;
21
+ this.powerups = [];
22
+ this.offset = 0;
23
+ this.limit = this.pageSize;
24
+ this.total = undefined;
25
+ }
26
+ onReloadPageByType(e) {
27
+ const { limit, offset, tableId } = e.detail;
28
+ if (tableId !== this.tableId) {
29
+ return;
30
+ }
31
+ this.offset = offset;
32
+ this.limit = limit;
33
+ }
34
+ async loadData() {
35
+ if (!this.endpoint || !this.session) {
36
+ return;
37
+ }
38
+ this.isLoading = true;
39
+ if (this.abortController) {
40
+ this.abortController.abort();
41
+ }
42
+ this.abortController = new AbortController();
43
+ try {
44
+ const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=offset=${this.offset},limit=${this.limit},games(limit=20,offset=0)`);
45
+ let options = {
46
+ headers: {
47
+ 'Content-Type': 'application/json',
48
+ 'x-SessionId': this.session
49
+ },
50
+ method: 'GET',
51
+ signal: this.abortController.signal
52
+ };
53
+ Object.entries(powerUpSearchConditions).forEach(([key, value]) => {
54
+ url.searchParams.append(key, value);
55
+ });
56
+ url.searchParams.append('language', this.language);
57
+ const response = await fetch(url, options);
58
+ if (!response.ok) {
59
+ throw new Error(`HTTP error! status: ${response.status}`);
60
+ }
61
+ const { data, total } = await response.json();
62
+ this.powerups = data;
63
+ this.total = total;
64
+ }
65
+ catch (error) {
66
+ if (error.name !== 'AbortError') {
67
+ console.error("Failed to load powerups history:", error);
68
+ window.postMessage({ type: 'peHistoryLoaderError', error });
69
+ }
70
+ }
71
+ finally {
72
+ if (!this.abortController.signal.aborted) {
73
+ this.isLoading = false;
74
+ }
75
+ }
76
+ }
77
+ onGamesHover(game) {
78
+ window.postMessage({ type: 'PowerUpHover', game }, '*');
79
+ }
80
+ async loadMoreGames(powerup) {
81
+ var _a;
82
+ if (powerup.games.items.length >= powerup.games.total) {
83
+ return; // All games already loaded
84
+ }
85
+ try {
86
+ const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${powerup.games.items.length})`);
87
+ const options = {
88
+ headers: { 'x-SessionId': this.session },
89
+ };
90
+ url.searchParams.append('filter', `powerUpID=${powerup.powerUpID}`);
91
+ Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
92
+ url.searchParams.append(key, value);
93
+ });
94
+ const response = await fetch(url.toString(), options);
95
+ if (!response.ok) {
96
+ throw new Error(`HTTP error! status: ${response.status}`);
97
+ }
98
+ const { data } = await response.json();
99
+ // Find the powerup in the state and append the new games
100
+ const powerupIndex = this.powerups.findIndex(p => p.id === powerup.id);
101
+ if (powerupIndex !== -1) {
102
+ const updatedPowerup = Object.assign({}, this.powerups[powerupIndex]);
103
+ const fetchedPowerUp = data === null || data === void 0 ? void 0 : data[0];
104
+ if (fetchedPowerUp && ((_a = fetchedPowerUp.games) === null || _a === void 0 ? void 0 : _a.items)) {
105
+ updatedPowerup.games.items = [...updatedPowerup.games.items, ...fetchedPowerUp.games.items];
106
+ const newPowerups = [...this.powerups];
107
+ newPowerups[powerupIndex] = updatedPowerup;
108
+ this.powerups = newPowerups;
109
+ }
110
+ }
111
+ }
112
+ catch (error) {
113
+ console.error('Failed to load more games:', error);
114
+ }
115
+ }
116
+ initializeGamesObserver(powerup) {
117
+ let observer = this.gameObservers.get(powerup.id);
118
+ if (observer) {
119
+ observer.disconnect();
120
+ }
121
+ observer = new IntersectionObserver((entries) => {
122
+ entries.forEach((entry) => {
123
+ if (entry.isIntersecting) {
124
+ this.loadMoreGames(powerup);
125
+ observer.unobserve(entry.target);
126
+ this.gameObservers.delete(powerup.id);
127
+ }
128
+ });
129
+ });
130
+ this.gameObservers.set(powerup.id, observer);
131
+ setTimeout(() => {
132
+ const lastGameElement = this.stylingContainer.querySelector(`.PowerUpItem[data-powerup-id="${powerup.id}"] .Game:last-child`);
133
+ if (lastGameElement) {
134
+ observer.observe(lastGameElement);
135
+ }
136
+ }, 200);
137
+ }
138
+ componentDidUpdate() {
139
+ this.powerups.forEach(powerup => {
140
+ var _a, _b;
141
+ if (((_a = powerup.games) === null || _a === void 0 ? void 0 : _a.items.length) < ((_b = powerup.games) === null || _b === void 0 ? void 0 : _b.total)) {
142
+ this.initializeGamesObserver(powerup);
143
+ }
144
+ });
145
+ }
146
+ render() {
147
+ return h("div", { key: 'b40ca849d3de46834e9c7b6dee8d275756921d07', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
148
+ ? h("p", null, "Loading...")
149
+ : !this.total ?
150
+ h("div", { class: 'EmptyPowerups' }, h("div", { class: 'Icon', innerHTML: ClearSearch }), h("span", { class: 'NoPowerTitle' }, translate('nothingHere', this.language)), h("span", null, translate('noPowerUps')), h("span", null, translate('gotoShop')), h("div", null))
151
+ : [h("div", { class: 'PowerUps' }, this.powerups.map(powerup => {
152
+ var _a, _b;
153
+ return h("div", { class: 'PowerUpItem Card', "data-powerup-id": powerup.id }, h("div", { class: 'CardLeft' }, h("div", { class: 'MainInfo' }, h("div", { class: 'DisplayName' }, " ", powerup.displayName || 'Title', " "), h("div", { class: 'Title2 PowerUpMultiplier' }, h("span", { class: 'BoostingPeriod' }, h("span", { class: 'Period' }, powerup.boostingPeriod.minutes || powerup.boostingPeriod.numberOfRounds, " "), powerup.boostingPeriod.mode === BoostingPeriodMode.TIME_PERIOD ? translate('min') : translate('rounds'), " "), h("span", { class: 'Multiplier' }, "| X", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", powerup.multiplier.mode === MultiplierMode.XP ? translate('xp') : translate('coins'), " "), "| ", h("span", { class: 'ExpireCount' }, " ", h("time-count", { "expire-time": powerup.expireTime }))), h("div", { class: 'Description' }, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aperiam autem corporis est harum minus, nam neque nisi quibusdam quod reiciendis rerum saepe temporibus veritatis voluptas! Aperiam cupiditate optio rem?")), h("div", { class: 'TermsC' }, translate('termsCon', this.language))), h("div", { class: 'GamesContent CardRight' }, h("div", { class: 'GamesTitle' }, h("span", { class: 'Title2' }, " ", translate('games', this.language)), h("span", { class: 'GamesAmount' }, "( ", (_a = powerup.games) === null || _a === void 0 ? void 0 :
154
+ _a.total, " )")), h("div", { class: 'GameTitleTip' }, translate('selectGameToActive', this.language)), h("div", { class: 'GamesList' }, h("div", { class: 'Games' }, (_b = powerup.games) === null || _b === void 0 ? void 0 : _b.items.map(g => {
155
+ return h("div", { class: 'Game' }, h("ui-image", { src: g.thumbnail }), h("div", { class: 'GameMask', onClick: this.onGamesHover.bind(this, g) }, h("span", { class: 'PlayBtn' }, "Start Now!")));
156
+ })))));
157
+ })), h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
158
+ h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, "secondary-arrows-active": true, "table-id": this.tableId, total: this.total }))]);
159
+ }
160
+ handleDataConfigChange() {
161
+ this.loadData().catch(console.error);
162
+ }
163
+ handleClientStylingChange(newValue, oldValue) {
164
+ if (newValue != oldValue) {
165
+ setClientStyling(this.stylingContainer, this.clientStyling);
166
+ }
167
+ }
168
+ handleClientStylingUrlChange(newValue, oldValue) {
169
+ if (newValue != oldValue) {
170
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
171
+ }
172
+ }
173
+ handleMbSourceChange(newValue, oldValue) {
174
+ if (newValue != oldValue) {
175
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
176
+ }
177
+ }
178
+ componentWillLoad() {
179
+ this.loadData().catch(console.error);
180
+ }
181
+ componentDidLoad() {
182
+ if (this.stylingContainer) {
183
+ if (this.mbSource)
184
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
185
+ if (this.clientStyling)
186
+ setClientStyling(this.stylingContainer, this.clientStyling);
187
+ if (this.clientStylingUrl)
188
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
189
+ }
190
+ }
191
+ disconnectedCallback() {
192
+ if (this.abortController) {
193
+ this.abortController.abort();
194
+ }
195
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
196
+ this.gameObservers.forEach(obs => obs.disconnect());
197
+ this.gameObservers.clear();
198
+ }
199
+ static get is() { return "bonus-elevate-powerups"; }
200
+ static get encapsulation() { return "shadow"; }
201
+ static get originalStyleUrls() {
202
+ return {
203
+ "$": ["bonus-elevate-powerups.scss"]
204
+ };
205
+ }
206
+ static get styleUrls() {
207
+ return {
208
+ "$": ["bonus-elevate-powerups.css"]
209
+ };
210
+ }
211
+ static get assetsDirs() { return ["assets"]; }
212
+ static get properties() {
213
+ return {
214
+ "mbSource": {
215
+ "type": "string",
216
+ "mutable": false,
217
+ "complexType": {
218
+ "original": "string",
219
+ "resolved": "string",
220
+ "references": {}
221
+ },
222
+ "required": false,
223
+ "optional": false,
224
+ "docs": {
225
+ "tags": [],
226
+ "text": ""
227
+ },
228
+ "attribute": "mb-source",
229
+ "reflect": true
230
+ },
231
+ "clientStyling": {
232
+ "type": "string",
233
+ "mutable": false,
234
+ "complexType": {
235
+ "original": "string",
236
+ "resolved": "string",
237
+ "references": {}
238
+ },
239
+ "required": false,
240
+ "optional": false,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": ""
244
+ },
245
+ "attribute": "client-styling",
246
+ "reflect": true
247
+ },
248
+ "clientStylingUrl": {
249
+ "type": "string",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "string",
253
+ "resolved": "string",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": ""
261
+ },
262
+ "attribute": "client-styling-url",
263
+ "reflect": true
264
+ },
265
+ "language": {
266
+ "type": "string",
267
+ "mutable": false,
268
+ "complexType": {
269
+ "original": "string",
270
+ "resolved": "string",
271
+ "references": {}
272
+ },
273
+ "required": false,
274
+ "optional": false,
275
+ "docs": {
276
+ "tags": [],
277
+ "text": ""
278
+ },
279
+ "attribute": "language",
280
+ "reflect": true,
281
+ "defaultValue": "'en'"
282
+ },
283
+ "endpoint": {
284
+ "type": "string",
285
+ "mutable": false,
286
+ "complexType": {
287
+ "original": "string",
288
+ "resolved": "string",
289
+ "references": {}
290
+ },
291
+ "required": true,
292
+ "optional": false,
293
+ "docs": {
294
+ "tags": [],
295
+ "text": ""
296
+ },
297
+ "attribute": "endpoint",
298
+ "reflect": true
299
+ },
300
+ "session": {
301
+ "type": "string",
302
+ "mutable": false,
303
+ "complexType": {
304
+ "original": "string",
305
+ "resolved": "string",
306
+ "references": {}
307
+ },
308
+ "required": true,
309
+ "optional": false,
310
+ "docs": {
311
+ "tags": [],
312
+ "text": ""
313
+ },
314
+ "attribute": "session",
315
+ "reflect": true
316
+ },
317
+ "pageSize": {
318
+ "type": "number",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "number",
322
+ "resolved": "number",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": false,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": ""
330
+ },
331
+ "attribute": "page-size",
332
+ "reflect": true,
333
+ "defaultValue": "20"
334
+ }
335
+ };
336
+ }
337
+ static get states() {
338
+ return {
339
+ "isLoading": {},
340
+ "powerups": {},
341
+ "offset": {},
342
+ "limit": {},
343
+ "total": {}
344
+ };
345
+ }
346
+ static get watchers() {
347
+ return [{
348
+ "propName": "offset",
349
+ "methodName": "loadData"
350
+ }, {
351
+ "propName": "limit",
352
+ "methodName": "loadData"
353
+ }, {
354
+ "propName": "language",
355
+ "methodName": "loadData"
356
+ }, {
357
+ "propName": "session",
358
+ "methodName": "loadData"
359
+ }, {
360
+ "propName": "endpoint",
361
+ "methodName": "loadData"
362
+ }, {
363
+ "propName": "endpoint",
364
+ "methodName": "handleDataConfigChange"
365
+ }, {
366
+ "propName": "session",
367
+ "methodName": "handleDataConfigChange"
368
+ }, {
369
+ "propName": "clientStyling",
370
+ "methodName": "handleClientStylingChange"
371
+ }, {
372
+ "propName": "clientStylingUrl",
373
+ "methodName": "handleClientStylingUrlChange"
374
+ }, {
375
+ "propName": "mbSource",
376
+ "methodName": "handleMbSourceChange"
377
+ }];
378
+ }
379
+ static get listeners() {
380
+ return [{
381
+ "name": "reloadPageByType",
382
+ "method": "onReloadPageByType",
383
+ "target": "window",
384
+ "capture": false,
385
+ "passive": false
386
+ }];
387
+ }
388
+ }
@@ -0,0 +1 @@
1
+ export { BonusElevatePowerups } from './bonus-elevate-powerups';
@@ -0,0 +1,86 @@
1
+ import { h } from "@stencil/core";
2
+ import moment from "moment";
3
+ export class TimeCount {
4
+ constructor() {
5
+ this.expireTime = undefined;
6
+ this.displayTime = undefined;
7
+ }
8
+ componentWillLoad() {
9
+ this.timer = setInterval(() => this.updateDisplayTime(), 1000);
10
+ this.updateDisplayTime();
11
+ }
12
+ disconnectedCallback() {
13
+ clearInterval(this.timer);
14
+ }
15
+ startTimeChanged() {
16
+ // Reset the timer and update the display when the input time changes
17
+ clearInterval(this.timer);
18
+ this.timer = setInterval(() => this.updateDisplayTime(), 1000);
19
+ this.updateDisplayTime();
20
+ }
21
+ updateDisplayTime() {
22
+ const now = moment();
23
+ const start = moment(this.expireTime);
24
+ if (!start.isValid()) {
25
+ this.displayTime = 'Invalid date';
26
+ clearInterval(this.timer);
27
+ return;
28
+ }
29
+ const duration = moment.duration(start.diff(now));
30
+ // If the time has already passed
31
+ if (duration.asMilliseconds() <= 0) {
32
+ this.displayTime = '00:00:00';
33
+ clearInterval(this.timer);
34
+ return;
35
+ }
36
+ const hours = Math.floor(duration.asHours());
37
+ if (hours >= 48) {
38
+ this.displayTime = `${Math.floor(duration.asDays())} days`;
39
+ }
40
+ else if (hours >= 24) {
41
+ this.displayTime = '1 day';
42
+ }
43
+ else {
44
+ const h = hours;
45
+ const m = duration.minutes();
46
+ const s = duration.seconds();
47
+ this.displayTime = [h, m, s].map(val => String(val).padStart(2, '0')).join(':');
48
+ }
49
+ }
50
+ render() {
51
+ return h("span", { key: 'b242dc33814c57b4d72e2ef165dc116187e3312e' }, this.displayTime);
52
+ }
53
+ static get is() { return "time-count"; }
54
+ static get properties() {
55
+ return {
56
+ "expireTime": {
57
+ "type": "string",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "string",
61
+ "resolved": "string",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "expire-time",
71
+ "reflect": false
72
+ }
73
+ };
74
+ }
75
+ static get states() {
76
+ return {
77
+ "displayTime": {}
78
+ };
79
+ }
80
+ static get watchers() {
81
+ return [{
82
+ "propName": "expireTime",
83
+ "methodName": "startTimeChanged"
84
+ }];
85
+ }
86
+ }
@@ -0,0 +1 @@
1
+ export * from './components/bonus-elevate-powerups';
@@ -0,0 +1,43 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ min: 'MIN',
5
+ rounds: 'Rounds',
6
+ coins: 'Coins',
7
+ xp: 'XP',
8
+ nothingHere: 'Nothing here -- yet!',
9
+ noPowerUps: 'No power-ups have been used at the moment.',
10
+ gotoShop: 'Go to shop to check power-ups availability.',
11
+ termsCon: 'Read full Terms & Conditions',
12
+ games: 'Games',
13
+ selectGameToActive: 'Select the game to activate power-up',
14
+ }
15
+ };
16
+ export const getTranslations = (url) => {
17
+ return new Promise((resolve) => {
18
+ fetch(url)
19
+ .then((res) => res.json())
20
+ .then((data) => {
21
+ Object.keys(data).forEach((lang) => {
22
+ if (!TRANSLATIONS[lang]) {
23
+ TRANSLATIONS[lang] = {};
24
+ }
25
+ for (let key in data[lang]) {
26
+ TRANSLATIONS[lang][key] = data[lang][key];
27
+ }
28
+ });
29
+ resolve(true);
30
+ });
31
+ });
32
+ };
33
+ export const translate = (key, customLang, values) => {
34
+ const lang = customLang;
35
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
36
+ if (values !== undefined) {
37
+ for (const [key, value] of Object.entries(values.values)) {
38
+ const regex = new RegExp(`{${key}}`, 'g');
39
+ translation = translation.replace(regex, value);
40
+ }
41
+ }
42
+ return translation;
43
+ };
@@ -0,0 +1,10 @@
1
+ import { PowerUpStatus } from "../../../../../../../libs/common/src/types/casino/powerups";
2
+ export const powerUpSearchConditions = {
3
+ expand: "games",
4
+ fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail,launchUrl)",
5
+ status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
6
+ };
7
+ export const powerUpGameSearchConditions = {
8
+ expand: "games",
9
+ fields: "id,powerUpID,games(id,gameId,name,thumbnail,launchUrl)"
10
+ };
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };