@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,399 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-3dbb4007.js');
4
+
5
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
6
+
7
+ /**
8
+ * @name setClientStyling
9
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
10
+ * @param {HTMLElement} stylingContainer The reference element of the widget
11
+ * @param {string} clientStyling The style content
12
+ */
13
+ function setClientStyling(stylingContainer, clientStyling) {
14
+ if (stylingContainer) {
15
+ const sheet = document.createElement('style');
16
+ sheet.innerHTML = clientStyling;
17
+ stylingContainer.appendChild(sheet);
18
+ }
19
+ }
20
+
21
+ /**
22
+ * @name setClientStylingURL
23
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
24
+ * @param {HTMLElement} stylingContainer The reference element of the widget
25
+ * @param {string} clientStylingUrl The URL of the style content
26
+ */
27
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
28
+ if (!stylingContainer || !clientStylingUrl) return;
29
+
30
+ const url = new URL(clientStylingUrl);
31
+
32
+ fetch(url.href)
33
+ .then((res) => res.text())
34
+ .then((data) => {
35
+ const cssFile = document.createElement('style');
36
+ cssFile.innerHTML = data;
37
+ if (stylingContainer) {
38
+ stylingContainer.appendChild(cssFile);
39
+ }
40
+ })
41
+ .catch((err) => {
42
+ console.error('There was an error while trying to load client styling from URL', err);
43
+ });
44
+ }
45
+
46
+ /**
47
+ * @name setStreamLibrary
48
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
49
+ * @param {HTMLElement} stylingContainer The highest element of the widget
50
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
51
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
52
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
53
+ */
54
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
55
+ if (!window.emMessageBus) return;
56
+
57
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
58
+
59
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
60
+ subscription = getStyleTagSubscription(stylingContainer, domain);
61
+
62
+ return subscription;
63
+ }
64
+
65
+ if (!window[StyleCacheKey]) {
66
+ window[StyleCacheKey] = {};
67
+ }
68
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
69
+
70
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
71
+ const wrappedUnsubscribe = () => {
72
+ if (window[StyleCacheKey][domain]) {
73
+ const cachedObject = window[StyleCacheKey][domain];
74
+ cachedObject.refCount > 1
75
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
76
+ : delete window[StyleCacheKey][domain];
77
+ }
78
+
79
+ originalUnsubscribe();
80
+ };
81
+ subscription.unsubscribe = wrappedUnsubscribe;
82
+
83
+ return subscription;
84
+ }
85
+
86
+ function getStyleTagSubscription(stylingContainer, domain) {
87
+ const sheet = document.createElement('style');
88
+
89
+ return window.emMessageBus.subscribe(domain, (data) => {
90
+ if (stylingContainer) {
91
+ sheet.innerHTML = data;
92
+ stylingContainer.appendChild(sheet);
93
+ }
94
+ });
95
+ }
96
+
97
+ function getAdoptStyleSubscription(stylingContainer, domain) {
98
+ return window.emMessageBus.subscribe(domain, (data) => {
99
+ if (!stylingContainer) return;
100
+
101
+ const shadowRoot = stylingContainer.getRootNode();
102
+ const cacheStyleObject = window[StyleCacheKey];
103
+ let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
104
+
105
+ if (!cachedStyle) {
106
+ cachedStyle = new CSSStyleSheet();
107
+ cachedStyle.replaceSync(data);
108
+ cacheStyleObject[domain] = {
109
+ sheet: cachedStyle,
110
+ refCount: 1
111
+ };
112
+ } else {
113
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
114
+ }
115
+
116
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
117
+ if (!currentSheets.includes(cachedStyle)) {
118
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
119
+ }
120
+ });
121
+ }
122
+
123
+ var MultiplierMode;
124
+ (function (MultiplierMode) {
125
+ MultiplierMode[MultiplierMode["COINS"] = 1] = "COINS";
126
+ MultiplierMode[MultiplierMode["XP"] = 2] = "XP";
127
+ })(MultiplierMode || (MultiplierMode = {}));
128
+ var BoostingPeriodMode;
129
+ (function (BoostingPeriodMode) {
130
+ BoostingPeriodMode[BoostingPeriodMode["TIME_PERIOD"] = 1] = "TIME_PERIOD";
131
+ BoostingPeriodMode[BoostingPeriodMode["NUMBER_OF_ROUNDS"] = 2] = "NUMBER_OF_ROUNDS";
132
+ })(BoostingPeriodMode || (BoostingPeriodMode = {}));
133
+ var PowerUpStatus;
134
+ (function (PowerUpStatus) {
135
+ PowerUpStatus[PowerUpStatus["ACTIVE"] = 0] = "ACTIVE";
136
+ PowerUpStatus[PowerUpStatus["ACTIVATED"] = 1] = "ACTIVATED";
137
+ PowerUpStatus[PowerUpStatus["EXPIRED"] = 2] = "EXPIRED";
138
+ PowerUpStatus[PowerUpStatus["CONSUMED"] = 3] = "CONSUMED";
139
+ PowerUpStatus[PowerUpStatus["DISABLED"] = 4] = "DISABLED";
140
+ PowerUpStatus[PowerUpStatus["ENABLED"] = 6] = "ENABLED";
141
+ })(PowerUpStatus || (PowerUpStatus = {}));
142
+
143
+ const DEFAULT_LANGUAGE = 'en';
144
+ const TRANSLATIONS = {
145
+ en: {
146
+ min: 'MIN',
147
+ rounds: 'Rounds',
148
+ coins: 'Coins',
149
+ xp: 'XP',
150
+ nothingHere: 'Nothing here -- yet!',
151
+ noPowerUps: 'No power-ups have been used at the moment.',
152
+ gotoShop: 'Go to shop to check power-ups availability.',
153
+ termsCon: 'Read full Terms & Conditions',
154
+ games: 'Games',
155
+ selectGameToActive: 'Select the game to activate power-up',
156
+ }
157
+ };
158
+ const translate = (key, customLang, values) => {
159
+ const lang = customLang;
160
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
161
+ if (values !== undefined) {
162
+ for (const [key, value] of Object.entries(values.values)) {
163
+ const regex = new RegExp(`{${key}}`, 'g');
164
+ translation = translation.replace(regex, value);
165
+ }
166
+ }
167
+ return translation;
168
+ };
169
+
170
+ const ClearSearch = `<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
171
+ <rect width="52" height="52" fill="url(#pattern0_1132_30534)"/>
172
+ <defs>
173
+ <pattern id="pattern0_1132_30534" patternContentUnits="objectBoundingBox" width="1" height="1">
174
+ <use xlink:href="#image0_1132_30534" transform="scale(0.01)"/>
175
+ </pattern>
176
+ <image id="image0_1132_30534" width="100" height="100" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHlElEQVR4nO2daYwURRTH/4tnvPCI9xE1ahQTNZmp6gXRzar4wTtGvPWLUeI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yaxHM4jFoSnOcWI877Yknji5Wv6BOFZnht0J7AaDFFrZQ0XowgkOp/RhzbObDQeRlr5EOamne2YGc0elmlnNwv7vuJuDWrRIwi/8WXNKAppnlyShHad674Fz2o+SsBnCFEU2BfVipNLQb9P6bWkt4vGWoTCl3zmkW+cQJFolRgDYd8ROyjDvNrk145v4csvwx15grOOuWAoxKgXNCpXMSq6uoP/J4R3BeGrKHPxVw4ohR++/98nRQc1O3ORiNAMSZPYPC3Ai+EQXgyH8GI4hBfDIbwYDuHFcAgvhkN4MRzCi+EQXgyH8GI4hBcjLzfBDfDaupaDW3g4WcBbhuuieDEcEsWL4Q5hnpOfMzwej8fj8Xg8Ho/H4/GgyPwHN+MBWXHaP7AAAAAASUVORK5CYII="/>
177
+ </defs>
178
+ </svg>
179
+ `;
180
+
181
+ const powerUpSearchConditions = {
182
+ expand: "games",
183
+ fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail,launchUrl)",
184
+ status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
185
+ };
186
+ const powerUpGameSearchConditions = {
187
+ expand: "games",
188
+ fields: "id,powerUpID,games(id,gameId,name,thumbnail,launchUrl)"
189
+ };
190
+
191
+ const bonusElevatePowerupsCss = ":host{display:block;font-family:inherit;--game-amount-line:4}@media screen and (max-width: 768px){.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game{width:32%}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardLeft,.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardRight{padding:8px}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardRight{margin:8px}}@media screen and (max-width: 470px){.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game{width:45%}.PowerUpsContainer .PowerUps .PowerUpItem.Card{max-height:600px;height:fit-content;flex-direction:column}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardLeft{gap:10px}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardRight{height:51%;overflow:auto}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardLeft,.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardRight{width:auto;margin:auto}.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardLeft .Game,.PowerUpsContainer .PowerUps .PowerUpItem.Card .CardRight .Game{width:45%}}.PowerUpsContainer{font-size:0.95rem;display:flex;flex-direction:column;min-height:300px}.PowerUpsContainer .EmptyPowerups{align-items:center;justify-content:center;font-weight:400;font-size:1.2em;line-height:24px;text-align:center;vertical-align:middle;width:max-content;margin:auto;display:flex;flex-direction:column;padding:50px}.PowerUpsContainer .EmptyPowerups .Icon,.PowerUpsContainer .EmptyPowerups .NoPowerTitle{text-align:center}.PowerUpsContainer .EmptyPowerups .Icon svg,.PowerUpsContainer .EmptyPowerups .NoPowerTitle svg{width:40px}.PowerUpsContainer .EmptyPowerups .NoPowerTitle{font-size:1.2em;font-weight:bold;margin:10px}.PowerUpsContainer .PowerUps{width:100%;gap:12px;display:flex;flex-direction:column}.PowerUpsContainer .PowerUps .Card{width:100%;height:307px;gap:12px;border-radius:12px;border:2px solid var(--emw--button-border-color-secondary, rgba(188, 252, 177, 0.0509803922));display:flex;flex-direction:row}.PowerUpsContainer .PowerUps .Card .CardLeft,.PowerUpsContainer .PowerUps .Card .CardRight{display:flex;flex-direction:column}.PowerUpsContainer .PowerUps .Card .CardLeft{padding:20px;width:35%;display:flex;flex-direction:column;justify-content:space-between}.PowerUpsContainer .PowerUps .Card .CardLeft .MainInfo{display:flex;flex-direction:column;gap:12px}.PowerUpsContainer .PowerUps .Card .CardRight{padding:10px}.PowerUpsContainer .PowerUps .Card .Description{color:#C8D6CE;overflow-y:auto;height:calc(100% - 60px)}.PowerUpsContainer .PowerUps .Card .CardLeft .DisplayName{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;height:22px;gap:12px}.PowerUpsContainer .PowerUps .Card .CardLeft .PowerUpMultiplier{text-transform:uppercase;font-size:0.85em;color:var(--emw--color-gray-dark, #727672)}.PowerUpsContainer .PowerUps .Card .CardLeft .PowerUpMultiplier .ExpireCount{background-image:linear-gradient(180deg, var(--emw--color-powup-orange1, #EA9018) 0%, var(--emw--color-powup-orange2, #E0A84E) 100%)}.PowerUpsContainer .PowerUps .Card .CardLeft .ExpireCount,.PowerUpsContainer .PowerUps .Card .CardLeft .TermsC{display:inline-block;-webkit-background-clip:text;background-clip:text;color:transparent}.PowerUpsContainer .PowerUps .Card .CardLeft .TermsC{text-transform:uppercase;background-image:linear-gradient(180deg, var(--emw--color-powup-green, #24B24E) 0%, var(--emw--color-powup-light-green, #18CE51) 100%);font-size:0.8em;font-weight:bold}.PowerUpsContainer .PowerUps .Card .GamesContent{margin:20px;flex:1;gap:12px;display:flex;border-radius:8px;border:2px solid var(--emw--color-powup-light-green-0D, rgba(188, 252, 177, 0.0509803922))}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesTitle{display:flex;flex-direction:row}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesTitle .Title2{text-transform:capitalize}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesTitle .GamesAmount{opacity:0.8}.PowerUpsContainer .PowerUps .Card .GamesContent .GameTitleTip{color:var(--emw--color-powup-gray-green, #C8D6CE);font-size:0.8rem}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList{display:flex;justify-content:center;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--emw--background-gray-color, gray) transparent}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList::-webkit-scrollbar-track{background-color:transparent;border-radius:5px}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games{padding:0;display:flex;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap;gap:calc(30px / (var(--game-amount-line) - 1))}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game{width:calc((100% - 30px) / var(--game-amount-line));cursor:pointer;position:relative}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game .GameMask{transition:opacity;transition-duration:0.2s;opacity:0;position:absolute;width:70%;height:100%}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game:hover .mask-filter{opacity:1}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game:hover img{opacity:0.4;filter:blur(1.5px)}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game:hover .GameMask{opacity:1;mix-blend-mode:screen;background-color:var(--emw--color-powup-green, #24B24E);display:flex;justify-content:center;align-items:center;position:absolute;width:100%;left:0;height:100%;top:0;border-radius:8px}.PowerUpsContainer .PowerUps .Card .GamesContent .GamesList .Games .Game:hover .GameMask .PlayBtn{border:2px solid var(--emw--color-powup-gray, #f0f0f0);padding:5px 3px;border-radius:3px}.PowerUpsContainer .Pagination{display:flex;justify-content:center}";
192
+ const BonusElevatePowerupsStyle0 = bonusElevatePowerupsCss;
193
+
194
+ const BonusElevatePowerups = class {
195
+ constructor(hostRef) {
196
+ index.registerInstance(this, hostRef);
197
+ this.tableId = 'powerups';
198
+ this.gameObservers = new Map();
199
+ this.mbSource = undefined;
200
+ this.clientStyling = undefined;
201
+ this.clientStylingUrl = undefined;
202
+ this.language = 'en';
203
+ this.endpoint = undefined;
204
+ this.session = undefined;
205
+ this.pageSize = 20;
206
+ this.isLoading = true;
207
+ this.powerups = [];
208
+ this.offset = 0;
209
+ this.limit = this.pageSize;
210
+ this.total = undefined;
211
+ }
212
+ onReloadPageByType(e) {
213
+ const { limit, offset, tableId } = e.detail;
214
+ if (tableId !== this.tableId) {
215
+ return;
216
+ }
217
+ this.offset = offset;
218
+ this.limit = limit;
219
+ }
220
+ async loadData() {
221
+ if (!this.endpoint || !this.session) {
222
+ return;
223
+ }
224
+ this.isLoading = true;
225
+ if (this.abortController) {
226
+ this.abortController.abort();
227
+ }
228
+ this.abortController = new AbortController();
229
+ try {
230
+ const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=offset=${this.offset},limit=${this.limit},games(limit=20,offset=0)`);
231
+ let options = {
232
+ headers: {
233
+ 'Content-Type': 'application/json',
234
+ 'x-SessionId': this.session
235
+ },
236
+ method: 'GET',
237
+ signal: this.abortController.signal
238
+ };
239
+ Object.entries(powerUpSearchConditions).forEach(([key, value]) => {
240
+ url.searchParams.append(key, value);
241
+ });
242
+ url.searchParams.append('language', this.language);
243
+ const response = await fetch(url, options);
244
+ if (!response.ok) {
245
+ throw new Error(`HTTP error! status: ${response.status}`);
246
+ }
247
+ const { data, total } = await response.json();
248
+ this.powerups = data;
249
+ this.total = total;
250
+ }
251
+ catch (error) {
252
+ if (error.name !== 'AbortError') {
253
+ console.error("Failed to load powerups history:", error);
254
+ window.postMessage({ type: 'peHistoryLoaderError', error });
255
+ }
256
+ }
257
+ finally {
258
+ if (!this.abortController.signal.aborted) {
259
+ this.isLoading = false;
260
+ }
261
+ }
262
+ }
263
+ onGamesHover(game) {
264
+ window.postMessage({ type: 'PowerUpHover', game }, '*');
265
+ }
266
+ async loadMoreGames(powerup) {
267
+ var _a;
268
+ if (powerup.games.items.length >= powerup.games.total) {
269
+ return; // All games already loaded
270
+ }
271
+ try {
272
+ const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${powerup.games.items.length})`);
273
+ const options = {
274
+ headers: { 'x-SessionId': this.session },
275
+ };
276
+ url.searchParams.append('filter', `powerUpID=${powerup.powerUpID}`);
277
+ Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
278
+ url.searchParams.append(key, value);
279
+ });
280
+ const response = await fetch(url.toString(), options);
281
+ if (!response.ok) {
282
+ throw new Error(`HTTP error! status: ${response.status}`);
283
+ }
284
+ const { data } = await response.json();
285
+ // Find the powerup in the state and append the new games
286
+ const powerupIndex = this.powerups.findIndex(p => p.id === powerup.id);
287
+ if (powerupIndex !== -1) {
288
+ const updatedPowerup = Object.assign({}, this.powerups[powerupIndex]);
289
+ const fetchedPowerUp = data === null || data === void 0 ? void 0 : data[0];
290
+ if (fetchedPowerUp && ((_a = fetchedPowerUp.games) === null || _a === void 0 ? void 0 : _a.items)) {
291
+ updatedPowerup.games.items = [...updatedPowerup.games.items, ...fetchedPowerUp.games.items];
292
+ const newPowerups = [...this.powerups];
293
+ newPowerups[powerupIndex] = updatedPowerup;
294
+ this.powerups = newPowerups;
295
+ }
296
+ }
297
+ }
298
+ catch (error) {
299
+ console.error('Failed to load more games:', error);
300
+ }
301
+ }
302
+ initializeGamesObserver(powerup) {
303
+ let observer = this.gameObservers.get(powerup.id);
304
+ if (observer) {
305
+ observer.disconnect();
306
+ }
307
+ observer = new IntersectionObserver((entries) => {
308
+ entries.forEach((entry) => {
309
+ if (entry.isIntersecting) {
310
+ this.loadMoreGames(powerup);
311
+ observer.unobserve(entry.target);
312
+ this.gameObservers.delete(powerup.id);
313
+ }
314
+ });
315
+ });
316
+ this.gameObservers.set(powerup.id, observer);
317
+ setTimeout(() => {
318
+ const lastGameElement = this.stylingContainer.querySelector(`.PowerUpItem[data-powerup-id="${powerup.id}"] .Game:last-child`);
319
+ if (lastGameElement) {
320
+ observer.observe(lastGameElement);
321
+ }
322
+ }, 200);
323
+ }
324
+ componentDidUpdate() {
325
+ this.powerups.forEach(powerup => {
326
+ var _a, _b;
327
+ if (((_a = powerup.games) === null || _a === void 0 ? void 0 : _a.items.length) < ((_b = powerup.games) === null || _b === void 0 ? void 0 : _b.total)) {
328
+ this.initializeGamesObserver(powerup);
329
+ }
330
+ });
331
+ }
332
+ render() {
333
+ return index.h("div", { key: 'b40ca849d3de46834e9c7b6dee8d275756921d07', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
334
+ ? index.h("p", null, "Loading...")
335
+ : !this.total ?
336
+ index.h("div", { class: 'EmptyPowerups' }, index.h("div", { class: 'Icon', innerHTML: ClearSearch }), index.h("span", { class: 'NoPowerTitle' }, translate('nothingHere', this.language)), index.h("span", null, translate('noPowerUps')), index.h("span", null, translate('gotoShop')), index.h("div", null))
337
+ : [index.h("div", { class: 'PowerUps' }, this.powerups.map(powerup => {
338
+ var _a, _b;
339
+ return index.h("div", { class: 'PowerUpItem Card', "data-powerup-id": powerup.id }, index.h("div", { class: 'CardLeft' }, index.h("div", { class: 'MainInfo' }, index.h("div", { class: 'DisplayName' }, " ", powerup.displayName || 'Title', " "), index.h("div", { class: 'Title2 PowerUpMultiplier' }, index.h("span", { class: 'BoostingPeriod' }, index.h("span", { class: 'Period' }, powerup.boostingPeriod.minutes || powerup.boostingPeriod.numberOfRounds, " "), powerup.boostingPeriod.mode === BoostingPeriodMode.TIME_PERIOD ? translate('min') : translate('rounds'), " "), index.h("span", { class: 'Multiplier' }, "| X", powerup.multiplier.coefficient, " "), index.h("span", { class: 'MultiplierMode' }, "| ", powerup.multiplier.mode === MultiplierMode.XP ? translate('xp') : translate('coins'), " "), "| ", index.h("span", { class: 'ExpireCount' }, " ", index.h("time-count", { "expire-time": powerup.expireTime }))), index.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?")), index.h("div", { class: 'TermsC' }, translate('termsCon', this.language))), index.h("div", { class: 'GamesContent CardRight' }, index.h("div", { class: 'GamesTitle' }, index.h("span", { class: 'Title2' }, " ", translate('games', this.language)), index.h("span", { class: 'GamesAmount' }, "( ", (_a = powerup.games) === null || _a === void 0 ? void 0 :
340
+ _a.total, " )")), index.h("div", { class: 'GameTitleTip' }, translate('selectGameToActive', this.language)), index.h("div", { class: 'GamesList' }, index.h("div", { class: 'Games' }, (_b = powerup.games) === null || _b === void 0 ? void 0 : _b.items.map(g => {
341
+ return index.h("div", { class: 'Game' }, index.h("ui-image", { src: g.thumbnail }), index.h("div", { class: 'GameMask', onClick: this.onGamesHover.bind(this, g) }, index.h("span", { class: 'PlayBtn' }, "Start Now!")));
342
+ })))));
343
+ })), index.h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
344
+ index.h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, "secondary-arrows-active": true, "table-id": this.tableId, total: this.total }))]);
345
+ }
346
+ handleDataConfigChange() {
347
+ this.loadData().catch(console.error);
348
+ }
349
+ handleClientStylingChange(newValue, oldValue) {
350
+ if (newValue != oldValue) {
351
+ setClientStyling(this.stylingContainer, this.clientStyling);
352
+ }
353
+ }
354
+ handleClientStylingUrlChange(newValue, oldValue) {
355
+ if (newValue != oldValue) {
356
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
357
+ }
358
+ }
359
+ handleMbSourceChange(newValue, oldValue) {
360
+ if (newValue != oldValue) {
361
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
362
+ }
363
+ }
364
+ componentWillLoad() {
365
+ this.loadData().catch(console.error);
366
+ }
367
+ componentDidLoad() {
368
+ if (this.stylingContainer) {
369
+ if (this.mbSource)
370
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
371
+ if (this.clientStyling)
372
+ setClientStyling(this.stylingContainer, this.clientStyling);
373
+ if (this.clientStylingUrl)
374
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
375
+ }
376
+ }
377
+ disconnectedCallback() {
378
+ if (this.abortController) {
379
+ this.abortController.abort();
380
+ }
381
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
382
+ this.gameObservers.forEach(obs => obs.disconnect());
383
+ this.gameObservers.clear();
384
+ }
385
+ static get assetsDirs() { return ["assets"]; }
386
+ static get watchers() { return {
387
+ "offset": ["loadData"],
388
+ "limit": ["loadData"],
389
+ "language": ["loadData"],
390
+ "session": ["loadData", "handleDataConfigChange"],
391
+ "endpoint": ["loadData", "handleDataConfigChange"],
392
+ "clientStyling": ["handleClientStylingChange"],
393
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
394
+ "mbSource": ["handleMbSourceChange"]
395
+ }; }
396
+ };
397
+ BonusElevatePowerups.style = BonusElevatePowerupsStyle0;
398
+
399
+ exports.BonusElevatePowerups = BonusElevatePowerups;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-3dbb4007.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('bonus-elevate-powerups.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["bonus-elevate-powerups_5.cjs",[[1,"bonus-elevate-powerups",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"pageSize":[514,"page-size"],"isLoading":[32],"powerups":[32],"offset":[32],"limit":[32],"total":[32]},[[8,"reloadPageByType","onReloadPageByType"]],{"offset":["loadData"],"limit":["loadData"],"language":["loadData"],"session":["loadData","handleDataConfigChange"],"endpoint":["loadData","handleDataConfigChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"bonus-pagination-nav",{"total":[1538],"limit":[1538],"offset":[1538],"tableId":[1537,"table-id"],"language":[1537],"translationUrl":[513,"translation-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"displayPageNumbers":[1540,"display-page-numbers"],"displayRangeOfTotal":[1540,"display-range-of-total"],"navItemAccount":[1538,"nav-item-account"],"endPageIndex":[32],"pagesArray":[32],"currentPage":[32],"showAsEllipsisMid":[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]],[0,"time-count",{"expireTime":[1,"expire-time"],"displayTime":[32]},null,{"expireTime":["startTimeChanged"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;