@everymatrix/bonus-elevate-powerups 0.0.16 → 0.0.18
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/bonus-elevate-powerups/bonus-elevate-powerups-31713cf4.js +1 -0
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups.esm.js +1 -1
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups_5.entry.js +3 -3
- package/dist/bonus-elevate-powerups/index.esm.js +1 -1
- package/dist/cjs/{bonus-elevate-powerups-5d4f1cfd.js → bonus-elevate-powerups-59f31a54.js} +51 -19
- package/dist/cjs/bonus-elevate-powerups.cjs.js +1 -1
- package/dist/cjs/bonus-elevate-powerups_5.cjs.entry.js +10 -3
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.css +18 -4
- package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.js +67 -18
- package/dist/collection/components/time-count/time-count.js +30 -3
- package/dist/collection/utils/locale.utils.js +2 -0
- package/dist/collection/utils/utils.js +2 -2
- package/dist/esm/{bonus-elevate-powerups-550b383c.js → bonus-elevate-powerups-31713cf4.js} +51 -20
- package/dist/esm/bonus-elevate-powerups.js +1 -1
- package/dist/esm/bonus-elevate-powerups_5.entry.js +11 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/types/casino/powerups.d.ts +7 -6
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/types/casino/tournaments.d.ts +111 -0
- package/dist/types/components/bonus-elevate-powerups/bonus-elevate-powerups.d.ts +8 -4
- package/dist/types/components/time-count/time-count.d.ts +3 -1
- package/dist/types/components.d.ts +8 -2
- package/package.json +1 -1
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups-550b383c.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PowerUpStatus } from "../../../../../../../libs/common/src/types/casino/powerups";
|
|
2
2
|
export const powerUpSearchConditions = {
|
|
3
3
|
expand: "games",
|
|
4
|
-
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail
|
|
4
|
+
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,slug,thumbnail)",
|
|
5
5
|
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
6
6
|
};
|
|
7
7
|
export const powerUpGameSearchConditions = {
|
|
8
8
|
expand: "games",
|
|
9
|
-
fields: "id,powerUpID,games(id,gameId,name,thumbnail
|
|
9
|
+
fields: "id,powerUpID,games(id,gameId,slug,name,thumbnail)"
|
|
10
10
|
};
|
|
@@ -120,13 +120,13 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
120
120
|
|
|
121
121
|
var MultiplierMode;
|
|
122
122
|
(function (MultiplierMode) {
|
|
123
|
-
MultiplierMode[
|
|
124
|
-
MultiplierMode[
|
|
123
|
+
MultiplierMode["COINS"] = "coins";
|
|
124
|
+
MultiplierMode["XP"] = "xp";
|
|
125
125
|
})(MultiplierMode || (MultiplierMode = {}));
|
|
126
126
|
var BoostingPeriodMode;
|
|
127
127
|
(function (BoostingPeriodMode) {
|
|
128
|
-
BoostingPeriodMode[
|
|
129
|
-
BoostingPeriodMode[
|
|
128
|
+
BoostingPeriodMode["TIME_PERIOD"] = "timePeriod";
|
|
129
|
+
BoostingPeriodMode["NUMBER_OF_ROUNDS"] = "numberOfRounds";
|
|
130
130
|
})(BoostingPeriodMode || (BoostingPeriodMode = {}));
|
|
131
131
|
var PowerUpStatus;
|
|
132
132
|
(function (PowerUpStatus) {
|
|
@@ -145,14 +145,33 @@ const TRANSLATIONS = {
|
|
|
145
145
|
rounds: 'Rounds',
|
|
146
146
|
coins: 'Coins',
|
|
147
147
|
xp: 'XP',
|
|
148
|
+
expiresIn: 'EXPIRES IN ',
|
|
148
149
|
nothingHere: 'Nothing here -- yet!',
|
|
149
150
|
noPowerUps: 'No power-ups have been used at the moment.',
|
|
150
151
|
gotoShop: 'Go to shop to check power-ups availability.',
|
|
151
152
|
termsCon: 'Read full Terms & Conditions',
|
|
152
153
|
games: 'Games',
|
|
153
154
|
selectGameToActive: 'Select the game to activate power-up',
|
|
155
|
+
days: 'days'
|
|
154
156
|
}
|
|
155
157
|
};
|
|
158
|
+
const getTranslations = (url) => {
|
|
159
|
+
return new Promise((resolve) => {
|
|
160
|
+
fetch(url)
|
|
161
|
+
.then((res) => res.json())
|
|
162
|
+
.then((data) => {
|
|
163
|
+
Object.keys(data).forEach((lang) => {
|
|
164
|
+
if (!TRANSLATIONS[lang]) {
|
|
165
|
+
TRANSLATIONS[lang] = {};
|
|
166
|
+
}
|
|
167
|
+
for (let key in data[lang]) {
|
|
168
|
+
TRANSLATIONS[lang][key] = data[lang][key];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
resolve(true);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
};
|
|
156
175
|
const translate = (key, customLang, values) => {
|
|
157
176
|
const lang = customLang;
|
|
158
177
|
let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
@@ -178,15 +197,15 @@ const ClearSearch = `<svg width="52" height="52" viewBox="0 0 52 52" fill="none"
|
|
|
178
197
|
|
|
179
198
|
const powerUpSearchConditions = {
|
|
180
199
|
expand: "games",
|
|
181
|
-
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail
|
|
200
|
+
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,slug,thumbnail)",
|
|
182
201
|
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
183
202
|
};
|
|
184
203
|
const powerUpGameSearchConditions = {
|
|
185
204
|
expand: "games",
|
|
186
|
-
fields: "id,powerUpID,games(id,gameId,name,thumbnail
|
|
205
|
+
fields: "id,powerUpID,games(id,gameId,slug,name,thumbnail)"
|
|
187
206
|
};
|
|
188
207
|
|
|
189
|
-
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
|
|
208
|
+
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;min-width:320px}.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 time-count{margin-left:3px}.PowerUpsContainer .PowerUps .Card{width:100%;max-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;min-width:339px;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:var(--emw--color-gray-150, #c8d6ce);line-height:1.2rem;flex:1}.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 .PowerUpMultiplier .ExpireCount .Label{text-transform:uppercase}.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 .CardLeft .TermsC a{color:var(--emw--color-powup-light-green, #18CE51)}.PowerUpsContainer .PowerUps .Card .CardLeft .TermsC span{cursor:pointer}.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}";
|
|
190
209
|
const BonusElevatePowerupsStyle0 = bonusElevatePowerupsCss;
|
|
191
210
|
|
|
192
211
|
const BonusElevatePowerups = class {
|
|
@@ -197,14 +216,15 @@ const BonusElevatePowerups = class {
|
|
|
197
216
|
this.mbSource = undefined;
|
|
198
217
|
this.clientStyling = undefined;
|
|
199
218
|
this.clientStylingUrl = undefined;
|
|
219
|
+
this.translationUrl = '';
|
|
200
220
|
this.language = 'en';
|
|
201
221
|
this.endpoint = undefined;
|
|
202
222
|
this.session = undefined;
|
|
203
|
-
this.
|
|
223
|
+
this.limit = 10;
|
|
224
|
+
this.openTermsPage = true;
|
|
204
225
|
this.isLoading = true;
|
|
205
226
|
this.powerups = [];
|
|
206
227
|
this.offset = 0;
|
|
207
|
-
this.limit = this.pageSize;
|
|
208
228
|
this.total = undefined;
|
|
209
229
|
}
|
|
210
230
|
onReloadPageByType(e) {
|
|
@@ -258,8 +278,11 @@ const BonusElevatePowerups = class {
|
|
|
258
278
|
}
|
|
259
279
|
}
|
|
260
280
|
}
|
|
261
|
-
|
|
262
|
-
window.postMessage({ type: '
|
|
281
|
+
onGameClick(game) {
|
|
282
|
+
window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
|
|
283
|
+
}
|
|
284
|
+
onTermsUrlClick(termsUrl) {
|
|
285
|
+
window.postMessage({ type: 'onPowerupTermsUrlClicked', termsUrl }, '*');
|
|
263
286
|
}
|
|
264
287
|
async loadMoreGames(powerup) {
|
|
265
288
|
var _a;
|
|
@@ -267,11 +290,11 @@ const BonusElevatePowerups = class {
|
|
|
267
290
|
return; // All games already loaded
|
|
268
291
|
}
|
|
269
292
|
try {
|
|
270
|
-
const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${powerup.games.items.length})`);
|
|
293
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups/available?pagination=games(limit=20,offset=${powerup.games.items.length})`);
|
|
271
294
|
const options = {
|
|
272
295
|
headers: { 'x-SessionId': this.session },
|
|
273
296
|
};
|
|
274
|
-
url.searchParams.append('filter', `
|
|
297
|
+
url.searchParams.append('filter', `id=${powerup.powerUpID}`);
|
|
275
298
|
Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
|
|
276
299
|
url.searchParams.append(key, value);
|
|
277
300
|
});
|
|
@@ -328,15 +351,16 @@ const BonusElevatePowerups = class {
|
|
|
328
351
|
});
|
|
329
352
|
}
|
|
330
353
|
render() {
|
|
331
|
-
return h("div", { key: '
|
|
354
|
+
return h("div", { key: '7de60fedad83668fcff2f4a1ea02b489b80d3b12', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
|
|
332
355
|
? h("p", null, "Loading...")
|
|
333
356
|
: !this.total ?
|
|
334
357
|
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))
|
|
335
358
|
: [h("div", { class: 'PowerUps' }, this.powerups.map(powerup => {
|
|
336
359
|
var _a, _b;
|
|
337
|
-
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 || '
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
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 || '-', " "), 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', this.language) : translate('rounds', this.language), " "), h("span", { class: 'Multiplier' }, "| X ", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", translate(powerup.multiplier.mode, this.language), " "), powerup.expireTime && [h("span", null, " | "), h("span", { class: 'ExpireCount' }, h("time-count", { "expire-time": powerup.expireTime, language: this.language }))]), h("div", { class: 'Description' }, powerup.description)), h("div", { class: 'TermsC' }, this.openTermsPage
|
|
361
|
+
? h("a", { href: powerup.termsUrl ? powerup.termsUrl : '#', target: '_blank' }, translate('termsCon', this.language))
|
|
362
|
+
: h("span", { onClick: this.onTermsUrlClick.bind(this, powerup.termsUrl) }, 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 : _a.total) || 0, " ) ")), 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 => {
|
|
363
|
+
return h("div", { class: 'Game' }, h("ui-image", { src: g.thumbnail }), h("div", { class: 'GameMask', onClick: this.onGameClick.bind(this, g) }, h("span", { class: 'PlayBtn' }, "Start Now!")));
|
|
340
364
|
})))));
|
|
341
365
|
})), h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
|
|
342
366
|
h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, "secondary-arrows-active": true, "table-id": this.tableId, total: this.total }))]);
|
|
@@ -359,7 +383,13 @@ const BonusElevatePowerups = class {
|
|
|
359
383
|
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
360
384
|
}
|
|
361
385
|
}
|
|
362
|
-
|
|
386
|
+
handleNewTranslations() {
|
|
387
|
+
getTranslations(this.translationUrl);
|
|
388
|
+
}
|
|
389
|
+
async componentWillLoad() {
|
|
390
|
+
if (this.translationUrl) {
|
|
391
|
+
await getTranslations(this.translationUrl);
|
|
392
|
+
}
|
|
363
393
|
this.loadData().catch(console.error);
|
|
364
394
|
}
|
|
365
395
|
componentDidLoad() {
|
|
@@ -389,9 +419,10 @@ const BonusElevatePowerups = class {
|
|
|
389
419
|
"endpoint": ["loadData", "handleDataConfigChange"],
|
|
390
420
|
"clientStyling": ["handleClientStylingChange"],
|
|
391
421
|
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
392
|
-
"mbSource": ["handleMbSourceChange"]
|
|
422
|
+
"mbSource": ["handleMbSourceChange"],
|
|
423
|
+
"translationUrl": ["handleNewTranslations"]
|
|
393
424
|
}; }
|
|
394
425
|
};
|
|
395
426
|
BonusElevatePowerups.style = BonusElevatePowerupsStyle0;
|
|
396
427
|
|
|
397
|
-
export { BonusElevatePowerups as B };
|
|
428
|
+
export { BonusElevatePowerups as B, translate as t };
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["bonus-elevate-powerups_5",[[1,"bonus-elevate-powerups",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"
|
|
19
|
+
return bootstrapLazy([["bonus-elevate-powerups_5",[[1,"bonus-elevate-powerups",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"session":[513],"limit":[1538],"openTermsPage":[4,"open-terms-page"],"isLoading":[32],"powerups":[32],"offset":[32],"total":[32]},[[8,"reloadPageByType","onReloadPageByType"]],{"offset":["loadData"],"limit":["loadData"],"language":["loadData"],"session":["loadData","handleDataConfigChange"],"endpoint":["loadData","handleDataConfigChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}],[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"],"language":[1],"displayTime":[32],"isExpireInDay1":[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);
|
|
20
20
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as translate$1 } from './bonus-elevate-powerups-31713cf4.js';
|
|
2
|
+
export { B as bonus_elevate_powerups } from './bonus-elevate-powerups-31713cf4.js';
|
|
2
3
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c7067e6d.js';
|
|
3
4
|
|
|
4
5
|
const DEFAULT_LANGUAGE = 'en';
|
|
@@ -5882,7 +5883,9 @@ const TimeCount = class {
|
|
|
5882
5883
|
constructor(hostRef) {
|
|
5883
5884
|
registerInstance(this, hostRef);
|
|
5884
5885
|
this.expireTime = undefined;
|
|
5886
|
+
this.language = 'en';
|
|
5885
5887
|
this.displayTime = undefined;
|
|
5888
|
+
this.isExpireInDay1 = false;
|
|
5886
5889
|
}
|
|
5887
5890
|
componentWillLoad() {
|
|
5888
5891
|
this.timer = setInterval(() => this.updateDisplayTime(), 1000);
|
|
@@ -5906,6 +5909,7 @@ const TimeCount = class {
|
|
|
5906
5909
|
return;
|
|
5907
5910
|
}
|
|
5908
5911
|
const duration = hooks.duration(start.diff(now));
|
|
5912
|
+
this.isExpireInDay1 = duration.asDays() > 1;
|
|
5909
5913
|
// If the time has already passed
|
|
5910
5914
|
if (duration.asMilliseconds() <= 0) {
|
|
5911
5915
|
this.displayTime = '00:00:00';
|
|
@@ -5914,7 +5918,7 @@ const TimeCount = class {
|
|
|
5914
5918
|
}
|
|
5915
5919
|
const hours = Math.floor(duration.asHours());
|
|
5916
5920
|
if (hours >= 48) {
|
|
5917
|
-
this.displayTime = `${Math.floor(duration.asDays())} days`;
|
|
5921
|
+
this.displayTime = `${Math.floor(duration.asDays())} ${translate$1('days', this.language)}`;
|
|
5918
5922
|
}
|
|
5919
5923
|
else if (hours >= 24) {
|
|
5920
5924
|
this.displayTime = '1 day';
|
|
@@ -5927,7 +5931,11 @@ const TimeCount = class {
|
|
|
5927
5931
|
}
|
|
5928
5932
|
}
|
|
5929
5933
|
render() {
|
|
5930
|
-
return
|
|
5934
|
+
return [
|
|
5935
|
+
this.isExpireInDay1 &&
|
|
5936
|
+
h("span", { key: '8432bdb52f3b5ecd2600c68179a0ee55d785c20c', class: 'Label' }, translate$1('expiresIn', this.language)),
|
|
5937
|
+
h("span", { key: 'fbec64ff41b9dbddd5ef6913e6f778771f55e143', class: 'TimeCountDown' }, this.displayTime)
|
|
5938
|
+
];
|
|
5931
5939
|
}
|
|
5932
5940
|
static get watchers() { return {
|
|
5933
5941
|
"expireTime": ["startTimeChanged"]
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BonusElevatePowerups } from './bonus-elevate-powerups-
|
|
1
|
+
export { B as BonusElevatePowerups } from './bonus-elevate-powerups-31713cf4.js';
|
|
2
2
|
import './index-c7067e6d.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["bonus-elevate-powerups_5",[[1,"bonus-elevate-powerups",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"
|
|
8
|
+
return bootstrapLazy([["bonus-elevate-powerups_5",[[1,"bonus-elevate-powerups",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"session":[513],"limit":[1538],"openTermsPage":[4,"open-terms-page"],"isLoading":[32],"powerups":[32],"offset":[32],"total":[32]},[[8,"reloadPageByType","onReloadPageByType"]],{"offset":["loadData"],"limit":["loadData"],"language":["loadData"],"session":["loadData","handleDataConfigChange"],"endpoint":["loadData","handleDataConfigChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}],[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"],"language":[1],"displayTime":[32],"isExpireInDay1":[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);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare enum MultiplierMode {
|
|
2
|
-
COINS =
|
|
3
|
-
XP =
|
|
2
|
+
COINS = "coins",
|
|
3
|
+
XP = "xp"
|
|
4
4
|
}
|
|
5
5
|
export declare enum BoostingPeriodMode {
|
|
6
|
-
TIME_PERIOD =
|
|
7
|
-
NUMBER_OF_ROUNDS =
|
|
6
|
+
TIME_PERIOD = "timePeriod",
|
|
7
|
+
NUMBER_OF_ROUNDS = "numberOfRounds"
|
|
8
8
|
}
|
|
9
9
|
export declare enum PowerUpStatus {
|
|
10
10
|
ACTIVE = 0,//'active',
|
|
@@ -15,11 +15,11 @@ export declare enum PowerUpStatus {
|
|
|
15
15
|
ENABLED = 6
|
|
16
16
|
}
|
|
17
17
|
export interface PowerUpMultiplier {
|
|
18
|
-
mode: MultiplierMode |
|
|
18
|
+
mode: MultiplierMode | string;
|
|
19
19
|
coefficient: number;
|
|
20
20
|
}
|
|
21
21
|
export interface PowerUpBoostingPeriod {
|
|
22
|
-
mode: BoostingPeriodMode |
|
|
22
|
+
mode: BoostingPeriodMode | string;
|
|
23
23
|
minutes?: number;
|
|
24
24
|
numberOfRounds?: number;
|
|
25
25
|
}
|
|
@@ -38,6 +38,7 @@ export interface PowerUp {
|
|
|
38
38
|
boostingPeriod: PowerUpBoostingPeriod;
|
|
39
39
|
triggerMethod: PowerUpTriggerMethod;
|
|
40
40
|
displayName: string;
|
|
41
|
+
description?: string;
|
|
41
42
|
validity: number;
|
|
42
43
|
modified: string;
|
|
43
44
|
universalID: string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export type CasinoGame = {
|
|
2
|
+
gameCode?: string;
|
|
3
|
+
id: string;
|
|
4
|
+
gameId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
launchUrl?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
hasFunMode?: boolean;
|
|
10
|
+
platform?: string[];
|
|
11
|
+
backgroundImageUrl?: string;
|
|
12
|
+
popularity?: number;
|
|
13
|
+
isNew?: boolean;
|
|
14
|
+
hasAnonymousFunMode?: boolean;
|
|
15
|
+
defaultThumbnail?: string;
|
|
16
|
+
thumbnail?: string;
|
|
17
|
+
type: string;
|
|
18
|
+
logo?: string;
|
|
19
|
+
htmlDescription?: string;
|
|
20
|
+
vendor?: {
|
|
21
|
+
href: string;
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
image: string;
|
|
26
|
+
logo: string;
|
|
27
|
+
};
|
|
28
|
+
slug?: string;
|
|
29
|
+
href?: string;
|
|
30
|
+
};
|
|
31
|
+
export type Tournament = {
|
|
32
|
+
href: string;
|
|
33
|
+
id: string;
|
|
34
|
+
nameOrTitle?: string;
|
|
35
|
+
description: string;
|
|
36
|
+
termsUrl?: string;
|
|
37
|
+
baseCurrency: string;
|
|
38
|
+
thumbnail?: string;
|
|
39
|
+
thumbnails?: any[];
|
|
40
|
+
startTime: string;
|
|
41
|
+
endTime: string;
|
|
42
|
+
closeTime: string;
|
|
43
|
+
exhibitionStartTime?: string;
|
|
44
|
+
exhibitionEndTime?: string;
|
|
45
|
+
state: string;
|
|
46
|
+
tags?: string;
|
|
47
|
+
minBetCount?: number;
|
|
48
|
+
scoreCriteria?: string;
|
|
49
|
+
enrollCriteria?: string;
|
|
50
|
+
prizes?: TournamentPrize[] | null;
|
|
51
|
+
playerEnrolled?: boolean;
|
|
52
|
+
overview?: {
|
|
53
|
+
participants: number;
|
|
54
|
+
};
|
|
55
|
+
metadata?: {
|
|
56
|
+
sports?: {
|
|
57
|
+
rules?: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
wallet?: {
|
|
61
|
+
casino?: any;
|
|
62
|
+
sports?: any;
|
|
63
|
+
};
|
|
64
|
+
wallets?: Array<{
|
|
65
|
+
code: string;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}>;
|
|
68
|
+
games?: {
|
|
69
|
+
count: number;
|
|
70
|
+
items: CasinoGame[] | null;
|
|
71
|
+
total: number;
|
|
72
|
+
};
|
|
73
|
+
presentPeriod?: {
|
|
74
|
+
start: string;
|
|
75
|
+
end: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare enum TournamentState {
|
|
79
|
+
Unstarted = "Unstarted",
|
|
80
|
+
Ongoing = "Running",
|
|
81
|
+
Closing = "Closing",
|
|
82
|
+
Closed = "Closed"
|
|
83
|
+
}
|
|
84
|
+
export type TournamentPrize = {
|
|
85
|
+
rank?: number;
|
|
86
|
+
count: number;
|
|
87
|
+
name: string;
|
|
88
|
+
bonusProgramID?: string;
|
|
89
|
+
};
|
|
90
|
+
export type LeaderboardItem = {
|
|
91
|
+
id: number;
|
|
92
|
+
insTicks?: string;
|
|
93
|
+
rank?: number;
|
|
94
|
+
rankWithoutUnqualified?: number;
|
|
95
|
+
prizeName?: string;
|
|
96
|
+
domainID: number;
|
|
97
|
+
userID?: string;
|
|
98
|
+
shortName?: string;
|
|
99
|
+
countryCode?: string;
|
|
100
|
+
betCount: number;
|
|
101
|
+
score: number;
|
|
102
|
+
formattedScore?: string;
|
|
103
|
+
unqualified: boolean;
|
|
104
|
+
totalRank?: number;
|
|
105
|
+
};
|
|
106
|
+
export type PthApiResponse = {
|
|
107
|
+
errorCode?: number;
|
|
108
|
+
errorMessage?: string;
|
|
109
|
+
success: boolean;
|
|
110
|
+
[key: string]: any;
|
|
111
|
+
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { PowerUp } from "../../../../../../libs/common/src/types/casino/powerups";
|
|
2
2
|
import "../../../../../../dist/packages/stencil/bonus-pagination-nav/dist/types/index";
|
|
3
3
|
import "../../../../../../dist/packages/stencil/ui-image/dist/types/index";
|
|
4
|
+
import { CasinoGame } from "../../../../../../libs/common/src/types/casino/tournaments";
|
|
4
5
|
export declare class BonusElevatePowerups {
|
|
5
6
|
mbSource: string;
|
|
6
7
|
clientStyling: string;
|
|
7
8
|
clientStylingUrl: string;
|
|
9
|
+
translationUrl: string;
|
|
8
10
|
language: string;
|
|
9
11
|
endpoint: string;
|
|
10
12
|
session: string;
|
|
11
|
-
|
|
13
|
+
limit: number;
|
|
14
|
+
openTermsPage: boolean;
|
|
12
15
|
isLoading: boolean;
|
|
13
16
|
powerups: PowerUp[];
|
|
14
17
|
offset: number;
|
|
15
|
-
limit: number;
|
|
16
18
|
total: number;
|
|
17
19
|
private stylingContainer;
|
|
18
20
|
private stylingSubscription;
|
|
@@ -20,7 +22,8 @@ export declare class BonusElevatePowerups {
|
|
|
20
22
|
private abortController;
|
|
21
23
|
onReloadPageByType(e: CustomEvent): void;
|
|
22
24
|
loadData(): Promise<void>;
|
|
23
|
-
|
|
25
|
+
onGameClick(game: CasinoGame): void;
|
|
26
|
+
onTermsUrlClick(termsUrl: string | undefined): void;
|
|
24
27
|
private loadMoreGames;
|
|
25
28
|
private gameObservers;
|
|
26
29
|
private initializeGamesObserver;
|
|
@@ -30,7 +33,8 @@ export declare class BonusElevatePowerups {
|
|
|
30
33
|
handleClientStylingChange(newValue: any, oldValue: any): void;
|
|
31
34
|
handleClientStylingUrlChange(newValue: any, oldValue: any): void;
|
|
32
35
|
handleMbSourceChange(newValue: any, oldValue: any): void;
|
|
33
|
-
|
|
36
|
+
handleNewTranslations(): void;
|
|
37
|
+
componentWillLoad(): Promise<void>;
|
|
34
38
|
componentDidLoad(): void;
|
|
35
39
|
disconnectedCallback(): void;
|
|
36
40
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export declare class TimeCount {
|
|
2
2
|
expireTime: string;
|
|
3
|
+
language: string;
|
|
3
4
|
displayTime: string;
|
|
5
|
+
isExpireInDay1: boolean;
|
|
4
6
|
private timer;
|
|
5
7
|
componentWillLoad(): void;
|
|
6
8
|
disconnectedCallback(): void;
|
|
7
9
|
startTimeChanged(): void;
|
|
8
10
|
private updateDisplayTime;
|
|
9
|
-
render(): any;
|
|
11
|
+
render(): any[];
|
|
10
12
|
}
|
|
@@ -11,12 +11,15 @@ export namespace Components {
|
|
|
11
11
|
"clientStylingUrl": string;
|
|
12
12
|
"endpoint": string;
|
|
13
13
|
"language": string;
|
|
14
|
+
"limit": number;
|
|
14
15
|
"mbSource": string;
|
|
15
|
-
"
|
|
16
|
+
"openTermsPage": boolean;
|
|
16
17
|
"session": string;
|
|
18
|
+
"translationUrl": string;
|
|
17
19
|
}
|
|
18
20
|
interface TimeCount {
|
|
19
21
|
"expireTime": string;
|
|
22
|
+
"language": string;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
declare global {
|
|
@@ -43,12 +46,15 @@ declare namespace LocalJSX {
|
|
|
43
46
|
"clientStylingUrl"?: string;
|
|
44
47
|
"endpoint": string;
|
|
45
48
|
"language"?: string;
|
|
49
|
+
"limit"?: number;
|
|
46
50
|
"mbSource"?: string;
|
|
47
|
-
"
|
|
51
|
+
"openTermsPage"?: boolean;
|
|
48
52
|
"session": string;
|
|
53
|
+
"translationUrl"?: string;
|
|
49
54
|
}
|
|
50
55
|
interface TimeCount {
|
|
51
56
|
"expireTime"?: string;
|
|
57
|
+
"language"?: string;
|
|
52
58
|
}
|
|
53
59
|
interface IntrinsicElements {
|
|
54
60
|
"bonus-elevate-powerups": BonusElevatePowerups;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t}from"./index-c7067e6d.js";const i="__WIDGET_GLOBAL_STYLE_CACHE__";function o(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function a(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function s(e,t,o,a=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!a)return o=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),o;window[i]||(window[i]={}),o=function(e,t){return window.emMessageBus.subscribe(t,(o=>{if(!e)return;const a=e.getRootNode(),s=window[i];let r=s[t]&&s[t].sheet;r?s[t].refCount=s[t].refCount+1:(r=new CSSStyleSheet,r.replaceSync(o),s[t]={sheet:r,refCount:1});const n=a.adoptedStyleSheets||[];n.includes(r)||(a.adoptedStyleSheets=[...n,r])}))}(e,t);const s=o.unsubscribe.bind(o);return o.unsubscribe=()=>{if(window[i][t]){const e=window[i][t];e.refCount>1?e.refCount=e.refCount-1:delete window[i][t]}s()},o}var r,n,p;!function(e){e[e.COINS=1]="COINS",e[e.XP=2]="XP"}(r||(r={})),function(e){e[e.TIME_PERIOD=1]="TIME_PERIOD",e[e.NUMBER_OF_ROUNDS=2]="NUMBER_OF_ROUNDS"}(n||(n={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.ACTIVATED=1]="ACTIVATED",e[e.EXPIRED=2]="EXPIRED",e[e.CONSUMED=3]="CONSUMED",e[e.DISABLED=4]="DISABLED",e[e.ENABLED=6]="ENABLED"}(p||(p={}));const l={en:{min:"MIN",rounds:"Rounds",coins:"Coins",xp:"XP",nothingHere:"Nothing here -- yet!",noPowerUps:"No power-ups have been used at the moment.",gotoShop:"Go to shop to check power-ups availability.",termsCon:"Read full Terms & Conditions",games:"Games",selectGameToActive:"Select the game to activate power-up"}},d=(e,t,i)=>{let o=l[void 0!==t&&t in l?t:"en"][e];if(void 0!==i)for(const[e,t]of Object.entries(i.values)){const i=new RegExp(`{${e}}`,"g");o=o.replace(i,t)}return o},w={expand:"games",fields:"id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail,launchUrl)",status:`${p.ACTIVE},${p.ACTIVATED}`},h={expand:"games",fields:"id,powerUpID,games(id,gameId,name,thumbnail,launchUrl)"},m=class{constructor(t){e(this,t),this.tableId="powerups",this.gameObservers=new Map,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.endpoint=void 0,this.session=void 0,this.pageSize=20,this.isLoading=!0,this.powerups=[],this.offset=0,this.limit=this.pageSize,this.total=void 0}onReloadPageByType(e){const{limit:t,offset:i,tableId:o}=e.detail;o===this.tableId&&(this.offset=i,this.limit=t)}async loadData(){if(this.endpoint&&this.session){this.isLoading=!0,this.abortController&&this.abortController.abort(),this.abortController=new AbortController;try{const e=new URL(`${this.endpoint}/v1/elevate/powerups?pagination=offset=${this.offset},limit=${this.limit},games(limit=20,offset=0)`);let t={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};Object.entries(w).forEach((([t,i])=>{e.searchParams.append(t,i)})),e.searchParams.append("language",this.language);const i=await fetch(e,t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const{data:o,total:a}=await i.json();this.powerups=o,this.total=a}catch(e){"AbortError"!==e.name&&(console.error("Failed to load powerups history:",e),window.postMessage({type:"peHistoryLoaderError",error:e}))}finally{this.abortController.signal.aborted||(this.isLoading=!1)}}}onGamesHover(e){window.postMessage({type:"PowerUpHover",game:e},"*")}async loadMoreGames(e){var t;if(!(e.games.items.length>=e.games.total))try{const i=new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${e.games.items.length})`),o={headers:{"x-SessionId":this.session}};i.searchParams.append("filter",`powerUpID=${e.powerUpID}`),Object.entries(h).forEach((([e,t])=>{i.searchParams.append(e,t)}));const a=await fetch(i.toString(),o);if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);const{data:s}=await a.json(),r=this.powerups.findIndex((t=>t.id===e.id));if(-1!==r){const e=Object.assign({},this.powerups[r]),i=null==s?void 0:s[0];if(i&&(null===(t=i.games)||void 0===t?void 0:t.items)){e.games.items=[...e.games.items,...i.games.items];const t=[...this.powerups];t[r]=e,this.powerups=t}}}catch(e){console.error("Failed to load more games:",e)}}initializeGamesObserver(e){let t=this.gameObservers.get(e.id);t&&t.disconnect(),t=new IntersectionObserver((i=>{i.forEach((i=>{i.isIntersecting&&(this.loadMoreGames(e),t.unobserve(i.target),this.gameObservers.delete(e.id))}))})),this.gameObservers.set(e.id,t),setTimeout((()=>{const i=this.stylingContainer.querySelector(`.PowerUpItem[data-powerup-id="${e.id}"] .Game:last-child`);i&&t.observe(i)}),200)}componentDidUpdate(){this.powerups.forEach((e=>{var t,i;(null===(t=e.games)||void 0===t?void 0:t.items.length)<(null===(i=e.games)||void 0===i?void 0:i.total)&&this.initializeGamesObserver(e)}))}render(){return t("div",{key:"b40ca849d3de46834e9c7b6dee8d275756921d07",class:"PowerUpsContainer",ref:e=>this.stylingContainer=e},this.isLoading?t("p",null,"Loading..."):this.total?[t("div",{class:"PowerUps"},this.powerups.map((e=>{var i,o;return t("div",{class:"PowerUpItem Card","data-powerup-id":e.id},t("div",{class:"CardLeft"},t("div",{class:"MainInfo"},t("div",{class:"DisplayName"}," ",e.displayName||"Title"," "),t("div",{class:"Title2 PowerUpMultiplier"},t("span",{class:"BoostingPeriod"},t("span",{class:"Period"},e.boostingPeriod.minutes||e.boostingPeriod.numberOfRounds," "),d(e.boostingPeriod.mode===n.TIME_PERIOD?"min":"rounds")," "),t("span",{class:"Multiplier"},"| X",e.multiplier.coefficient," "),t("span",{class:"MultiplierMode"},"| ",d(e.multiplier.mode===r.XP?"xp":"coins")," "),"| ",t("span",{class:"ExpireCount"}," ",t("time-count",{"expire-time":e.expireTime}))),t("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?")),t("div",{class:"TermsC"},d("termsCon",this.language))),t("div",{class:"GamesContent CardRight"},t("div",{class:"GamesTitle"},t("span",{class:"Title2"}," ",d("games",this.language)),t("span",{class:"GamesAmount"},"( ",null===(i=e.games)||void 0===i?void 0:i.total," )")),t("div",{class:"GameTitleTip"},d("selectGameToActive",this.language)),t("div",{class:"GamesList"},t("div",{class:"Games"},null===(o=e.games)||void 0===o?void 0:o.items.map((e=>t("div",{class:"Game"},t("ui-image",{src:e.thumbnail}),t("div",{class:"GameMask",onClick:this.onGamesHover.bind(this,e)},t("span",{class:"PlayBtn"},"Start Now!")))))))))}))),t("div",{class:"Pagination"},this.total&&this.total>this.limit&&t("bonus-pagination-nav",{offset:this.offset,limit:this.limit,"secondary-arrows-active":!0,"table-id":this.tableId,total:this.total}))]:t("div",{class:"EmptyPowerups"},t("div",{class:"Icon",innerHTML:'<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">\n<rect width="52" height="52" fill="url(#pattern0_1132_30534)"/>\n<defs>\n<pattern id="pattern0_1132_30534" patternContentUnits="objectBoundingBox" width="1" height="1">\n<use xlink:href="#image0_1132_30534" transform="scale(0.01)"/>\n</pattern>\n<image id="image0_1132_30534" width="100" height="100" preserveAspectRatio="none" xlink:href="data:image/png;base64,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"/>\n</defs>\n</svg>\n'}),t("span",{class:"NoPowerTitle"},d("nothingHere",this.language)),t("span",null,d("noPowerUps")),t("span",null,d("gotoShop")),t("div",null)))}handleDataConfigChange(){this.loadData().catch(console.error)}handleClientStylingChange(e,t){e!=t&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.loadData().catch(console.error)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.abortController&&this.abortController.abort(),this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.gameObservers.forEach((e=>e.disconnect())),this.gameObservers.clear()}static get assetsDirs(){return["assets"]}static get watchers(){return{offset:["loadData"],limit:["loadData"],language:["loadData"],session:["loadData","handleDataConfigChange"],endpoint:["loadData","handleDataConfigChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};m.style=":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}";export{m as B}
|