@everymatrix/bonus-elevate-powerups-lobby 0.0.16 → 0.0.17
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-lobby/bonus-elevate-powerups-lobby-b04a9da7.js +1 -0
- package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.esm.js +1 -1
- package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups_7.entry.js +3 -3
- package/dist/bonus-elevate-powerups-lobby/index.esm.js +1 -1
- package/dist/cjs/{bonus-elevate-powerups-lobby-a19b84c9.js → bonus-elevate-powerups-lobby-c38947f9.js} +12 -12
- package/dist/cjs/bonus-elevate-powerups-lobby.cjs.js +1 -1
- package/dist/cjs/bonus-elevate-powerups_7.cjs.entry.js +59 -22
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.js +10 -10
- package/dist/esm/{bonus-elevate-powerups-lobby-09c95672.js → bonus-elevate-powerups-lobby-b04a9da7.js} +11 -11
- package/dist/esm/bonus-elevate-powerups-lobby.js +1 -1
- package/dist/esm/bonus-elevate-powerups_7.entry.js +60 -23
- 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-lobby/.stencil/libs/common/src/types/casino/powerups.d.ts +7 -6
- package/dist/types/components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby-09c95672.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-64ff3a3a.js';
|
|
2
|
-
import { P as PowerUpStatus, a as BoostingPeriodMode,
|
|
3
|
-
export { B as bonus_elevate_powerups_lobby } from './bonus-elevate-powerups-lobby-
|
|
2
|
+
import { P as PowerUpStatus, a as BoostingPeriodMode, s as setClientStyling, b as setClientStylingURL, c as setStreamStyling } from './bonus-elevate-powerups-lobby-b04a9da7.js';
|
|
3
|
+
export { B as bonus_elevate_powerups_lobby } from './bonus-elevate-powerups-lobby-b04a9da7.js';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_LANGUAGE$2 = 'en';
|
|
6
6
|
const TRANSLATIONS$2 = {
|
|
@@ -9,14 +9,33 @@ const TRANSLATIONS$2 = {
|
|
|
9
9
|
rounds: 'Rounds',
|
|
10
10
|
coins: 'Coins',
|
|
11
11
|
xp: 'XP',
|
|
12
|
+
expiresIn: 'EXPIRES IN ',
|
|
12
13
|
nothingHere: 'Nothing here -- yet!',
|
|
13
14
|
noPowerUps: 'No power-ups have been used at the moment.',
|
|
14
15
|
gotoShop: 'Go to shop to check power-ups availability.',
|
|
15
16
|
termsCon: 'Read full Terms & Conditions',
|
|
16
17
|
games: 'Games',
|
|
17
18
|
selectGameToActive: 'Select the game to activate power-up',
|
|
19
|
+
days: 'days'
|
|
18
20
|
}
|
|
19
21
|
};
|
|
22
|
+
const getTranslations$1 = (url) => {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
fetch(url)
|
|
25
|
+
.then((res) => res.json())
|
|
26
|
+
.then((data) => {
|
|
27
|
+
Object.keys(data).forEach((lang) => {
|
|
28
|
+
if (!TRANSLATIONS$2[lang]) {
|
|
29
|
+
TRANSLATIONS$2[lang] = {};
|
|
30
|
+
}
|
|
31
|
+
for (let key in data[lang]) {
|
|
32
|
+
TRANSLATIONS$2[lang][key] = data[lang][key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
resolve(true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
};
|
|
20
39
|
const translate$2 = (key, customLang, values) => {
|
|
21
40
|
const lang = customLang;
|
|
22
41
|
let translation = TRANSLATIONS$2[(lang !== undefined) && (lang in TRANSLATIONS$2) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
@@ -42,15 +61,15 @@ const ClearSearch$1 = `<svg width="52" height="52" viewBox="0 0 52 52" fill="non
|
|
|
42
61
|
|
|
43
62
|
const powerUpSearchConditions = {
|
|
44
63
|
expand: "games",
|
|
45
|
-
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail
|
|
64
|
+
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,slug,thumbnail)",
|
|
46
65
|
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
47
66
|
};
|
|
48
67
|
const powerUpGameSearchConditions = {
|
|
49
68
|
expand: "games",
|
|
50
|
-
fields: "id,powerUpID,games(id,gameId,name,thumbnail
|
|
69
|
+
fields: "id,powerUpID,games(id,gameId,slug,name,thumbnail)"
|
|
51
70
|
};
|
|
52
71
|
|
|
53
|
-
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
|
|
72
|
+
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}";
|
|
54
73
|
const BonusElevatePowerupsStyle0 = bonusElevatePowerupsCss;
|
|
55
74
|
|
|
56
75
|
const BonusElevatePowerups = class {
|
|
@@ -61,14 +80,15 @@ const BonusElevatePowerups = class {
|
|
|
61
80
|
this.mbSource = undefined;
|
|
62
81
|
this.clientStyling = undefined;
|
|
63
82
|
this.clientStylingUrl = undefined;
|
|
83
|
+
this.translationUrl = '';
|
|
64
84
|
this.language = 'en';
|
|
65
85
|
this.endpoint = undefined;
|
|
66
86
|
this.session = undefined;
|
|
67
|
-
this.
|
|
87
|
+
this.limit = 10;
|
|
88
|
+
this.openTermsPage = true;
|
|
68
89
|
this.isLoading = true;
|
|
69
90
|
this.powerups = [];
|
|
70
91
|
this.offset = 0;
|
|
71
|
-
this.limit = this.pageSize;
|
|
72
92
|
this.total = undefined;
|
|
73
93
|
}
|
|
74
94
|
onReloadPageByType(e) {
|
|
@@ -122,8 +142,11 @@ const BonusElevatePowerups = class {
|
|
|
122
142
|
}
|
|
123
143
|
}
|
|
124
144
|
}
|
|
125
|
-
|
|
126
|
-
window.postMessage({ type: '
|
|
145
|
+
onGameClick(game) {
|
|
146
|
+
window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
|
|
147
|
+
}
|
|
148
|
+
onTermsUrlClick(termsUrl) {
|
|
149
|
+
window.postMessage({ type: 'onPowerupTermsUrlClicked', termsUrl }, '*');
|
|
127
150
|
}
|
|
128
151
|
async loadMoreGames(powerup) {
|
|
129
152
|
var _a;
|
|
@@ -131,11 +154,11 @@ const BonusElevatePowerups = class {
|
|
|
131
154
|
return; // All games already loaded
|
|
132
155
|
}
|
|
133
156
|
try {
|
|
134
|
-
const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${powerup.games.items.length})`);
|
|
157
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups/available?pagination=games(limit=20,offset=${powerup.games.items.length})`);
|
|
135
158
|
const options = {
|
|
136
159
|
headers: { 'x-SessionId': this.session },
|
|
137
160
|
};
|
|
138
|
-
url.searchParams.append('filter', `
|
|
161
|
+
url.searchParams.append('filter', `id=${powerup.powerUpID}`);
|
|
139
162
|
Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
|
|
140
163
|
url.searchParams.append(key, value);
|
|
141
164
|
});
|
|
@@ -192,15 +215,16 @@ const BonusElevatePowerups = class {
|
|
|
192
215
|
});
|
|
193
216
|
}
|
|
194
217
|
render() {
|
|
195
|
-
return h("div", { key: '
|
|
218
|
+
return h("div", { key: '7de60fedad83668fcff2f4a1ea02b489b80d3b12', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
|
|
196
219
|
? h("p", null, "Loading...")
|
|
197
220
|
: !this.total ?
|
|
198
221
|
h("div", { class: 'EmptyPowerups' }, h("div", { class: 'Icon', innerHTML: ClearSearch$1 }), h("span", { class: 'NoPowerTitle' }, translate$2('nothingHere', this.language)), h("span", null, translate$2('noPowerUps')), h("span", null, translate$2('gotoShop')), h("div", null))
|
|
199
222
|
: [h("div", { class: 'PowerUps' }, this.powerups.map(powerup => {
|
|
200
223
|
var _a, _b;
|
|
201
|
-
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 || '
|
|
202
|
-
|
|
203
|
-
|
|
224
|
+
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$2('min', this.language) : translate$2('rounds', this.language), " "), h("span", { class: 'Multiplier' }, "| X ", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", translate$2(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
|
|
225
|
+
? h("a", { href: powerup.termsUrl ? powerup.termsUrl : '#', target: '_blank' }, translate$2('termsCon', this.language))
|
|
226
|
+
: h("span", { onClick: this.onTermsUrlClick.bind(this, powerup.termsUrl) }, translate$2('termsCon', this.language), " "))), h("div", { class: 'GamesContent CardRight' }, h("div", { class: 'GamesTitle' }, h("span", { class: 'Title2' }, " ", translate$2('games', this.language)), h("span", { class: 'GamesAmount' }, " ( ", ((_a = powerup.games) === null || _a === void 0 ? void 0 : _a.total) || 0, " ) ")), h("div", { class: 'GameTitleTip' }, translate$2('selectGameToActive', this.language)), h("div", { class: 'GamesList' }, h("div", { class: 'Games' }, (_b = powerup.games) === null || _b === void 0 ? void 0 : _b.items.map(g => {
|
|
227
|
+
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!")));
|
|
204
228
|
})))));
|
|
205
229
|
})), h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
|
|
206
230
|
h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, "secondary-arrows-active": true, "table-id": this.tableId, total: this.total }))]);
|
|
@@ -223,7 +247,13 @@ const BonusElevatePowerups = class {
|
|
|
223
247
|
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
224
248
|
}
|
|
225
249
|
}
|
|
226
|
-
|
|
250
|
+
handleNewTranslations() {
|
|
251
|
+
getTranslations$1(this.translationUrl);
|
|
252
|
+
}
|
|
253
|
+
async componentWillLoad() {
|
|
254
|
+
if (this.translationUrl) {
|
|
255
|
+
await getTranslations$1(this.translationUrl);
|
|
256
|
+
}
|
|
227
257
|
this.loadData().catch(console.error);
|
|
228
258
|
}
|
|
229
259
|
componentDidLoad() {
|
|
@@ -253,7 +283,8 @@ const BonusElevatePowerups = class {
|
|
|
253
283
|
"endpoint": ["loadData", "handleDataConfigChange"],
|
|
254
284
|
"clientStyling": ["handleClientStylingChange"],
|
|
255
285
|
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
256
|
-
"mbSource": ["handleMbSourceChange"]
|
|
286
|
+
"mbSource": ["handleMbSourceChange"],
|
|
287
|
+
"translationUrl": ["handleNewTranslations"]
|
|
257
288
|
}; }
|
|
258
289
|
};
|
|
259
290
|
BonusElevatePowerups.style = BonusElevatePowerupsStyle0;
|
|
@@ -6028,12 +6059,11 @@ const BonusElevatePowerupsHistory = class {
|
|
|
6028
6059
|
this.language = 'en';
|
|
6029
6060
|
this.endpoint = undefined;
|
|
6030
6061
|
this.session = undefined;
|
|
6031
|
-
this.
|
|
6062
|
+
this.limit = 10;
|
|
6032
6063
|
this.translationUrl = '';
|
|
6033
6064
|
this.isLoading = true;
|
|
6034
6065
|
this.powerups = [];
|
|
6035
6066
|
this.offset = 0;
|
|
6036
|
-
this.limit = this.pageSize;
|
|
6037
6067
|
this.total = undefined;
|
|
6038
6068
|
}
|
|
6039
6069
|
onReloadPageByType(e) {
|
|
@@ -6087,13 +6117,13 @@ const BonusElevatePowerupsHistory = class {
|
|
|
6087
6117
|
}
|
|
6088
6118
|
render() {
|
|
6089
6119
|
var _a;
|
|
6090
|
-
return h("div", { key: '
|
|
6120
|
+
return h("div", { key: '87cc519cc192e9047b1eaa21f982e444f0e1f79a', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
|
|
6091
6121
|
? h("p", null, "Loading...")
|
|
6092
6122
|
: !((_a = this.powerups) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
6093
6123
|
h("div", { class: 'EmptyPowerups' }, h("div", { class: 'Icon', innerHTML: ClearSearch }), h("span", { class: 'NoPowerTitle' }, translate$1('nothingHere', this.language)), h("span", null, translate$1('noPowerUps', this.language)), h("span", null, translate$1('gotoShop', this.language)), h("div", null))
|
|
6094
6124
|
: [h("ul", { class: 'PowerUps' }, this.powerups.map(powerup => {
|
|
6095
6125
|
var _a;
|
|
6096
|
-
return h("li", { class: 'PowerUpItem' }, h("div", { class: 'HistoryLeft' }, h("div", { class: 'DisplayName' }, " ", powerup.displayName || '-', " "), h("div", { class: 'Details' }, h("span", { class: 'BoostingPeriod' }, h("span", { class: 'Period' }, powerup.boostingPeriod.minutes || powerup.boostingPeriod.numberOfRounds, " "), powerup.boostingPeriod.mode === BoostingPeriodMode.TIME_PERIOD ? translate$1('min', this.language) : translate$1('rounds', this.language), " "), h("span", { class: 'Multiplier' }, "| X", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", powerup.multiplier.mode
|
|
6126
|
+
return h("li", { class: 'PowerUpItem' }, h("div", { class: 'HistoryLeft' }, h("div", { class: 'DisplayName' }, " ", powerup.displayName || '-', " "), h("div", { class: 'Details' }, h("span", { class: 'BoostingPeriod' }, h("span", { class: 'Period' }, powerup.boostingPeriod.minutes || powerup.boostingPeriod.numberOfRounds, " "), powerup.boostingPeriod.mode === BoostingPeriodMode.TIME_PERIOD ? translate$1('min', this.language) : translate$1('rounds', this.language), " "), h("span", { class: 'Multiplier' }, "| X ", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", translate$1(powerup.multiplier.mode, this.language), " "))), h("div", { class: 'HistoryRight' }, h("div", null, translate$1(((_a = PowerUpStatusEntry[powerup.status]) === null || _a === void 0 ? void 0 : _a.label) || powerup.status, this.language)), h("div", null, hooks(powerup.status === PowerUpStatus.EXPIRED ? powerup.expireTime : powerup.endTime).format('YYYY-MM-DD HH:mm:ss'), " ")));
|
|
6097
6127
|
})), h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
|
|
6098
6128
|
h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, secondaryArrowsActive: true, "table-id": this.tableId, total: this.total }))]);
|
|
6099
6129
|
}
|
|
@@ -6356,7 +6386,9 @@ const TimeCount = class {
|
|
|
6356
6386
|
constructor(hostRef) {
|
|
6357
6387
|
registerInstance(this, hostRef);
|
|
6358
6388
|
this.expireTime = undefined;
|
|
6389
|
+
this.language = 'en';
|
|
6359
6390
|
this.displayTime = undefined;
|
|
6391
|
+
this.isExpireInDay1 = false;
|
|
6360
6392
|
}
|
|
6361
6393
|
componentWillLoad() {
|
|
6362
6394
|
this.timer = setInterval(() => this.updateDisplayTime(), 1000);
|
|
@@ -6380,6 +6412,7 @@ const TimeCount = class {
|
|
|
6380
6412
|
return;
|
|
6381
6413
|
}
|
|
6382
6414
|
const duration = hooks.duration(start.diff(now));
|
|
6415
|
+
this.isExpireInDay1 = duration.asDays() > 1;
|
|
6383
6416
|
// If the time has already passed
|
|
6384
6417
|
if (duration.asMilliseconds() <= 0) {
|
|
6385
6418
|
this.displayTime = '00:00:00';
|
|
@@ -6388,7 +6421,7 @@ const TimeCount = class {
|
|
|
6388
6421
|
}
|
|
6389
6422
|
const hours = Math.floor(duration.asHours());
|
|
6390
6423
|
if (hours >= 48) {
|
|
6391
|
-
this.displayTime = `${Math.floor(duration.asDays())} days`;
|
|
6424
|
+
this.displayTime = `${Math.floor(duration.asDays())} ${translate$2('days', this.language)}`;
|
|
6392
6425
|
}
|
|
6393
6426
|
else if (hours >= 24) {
|
|
6394
6427
|
this.displayTime = '1 day';
|
|
@@ -6401,7 +6434,11 @@ const TimeCount = class {
|
|
|
6401
6434
|
}
|
|
6402
6435
|
}
|
|
6403
6436
|
render() {
|
|
6404
|
-
return
|
|
6437
|
+
return [
|
|
6438
|
+
this.isExpireInDay1 &&
|
|
6439
|
+
h("span", { key: '8432bdb52f3b5ecd2600c68179a0ee55d785c20c', class: 'Label' }, translate$2('expiresIn', this.language)),
|
|
6440
|
+
h("span", { key: 'fbec64ff41b9dbddd5ef6913e6f778771f55e143', class: 'TimeCountDown' }, this.displayTime)
|
|
6441
|
+
];
|
|
6405
6442
|
}
|
|
6406
6443
|
static get watchers() { return {
|
|
6407
6444
|
"expireTime": ["startTimeChanged"]
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BonusElevatePowerupsLobby } from './bonus-elevate-powerups-lobby-
|
|
1
|
+
export { B as BonusElevatePowerupsLobby } from './bonus-elevate-powerups-lobby-b04a9da7.js';
|
|
2
2
|
import './index-64ff3a3a.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_7",[[1,"bonus-elevate-powerups-lobby",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"session":[513],"
|
|
8
|
+
return bootstrapLazy([["bonus-elevate-powerups_7",[[1,"bonus-elevate-powerups-lobby",{"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],"activeTab":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}],[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"]}],[1,"bonus-elevate-powerups-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"limit":[514],"translationUrl":[513,"translation-url"],"isLoading":[32],"powerups":[32],"offset":[32],"total":[32]},[[8,"reloadPageByType","onReloadPageByType"]],{"offset":["loadData"],"limit":["loadData"],"language":["loadData"],"session":["loadData"],"endpoint":["loadData"],"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,"time-count",{"expireTime":[1,"expire-time"],"language":[1],"displayTime":[32],"isExpireInDay1":[32]},null,{"expireTime":["startTimeChanged"]}],[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,"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;
|
|
@@ -11,8 +11,8 @@ export namespace Components {
|
|
|
11
11
|
"clientStylingUrl": string;
|
|
12
12
|
"endpoint": string;
|
|
13
13
|
"language": string;
|
|
14
|
+
"limit": number;
|
|
14
15
|
"mbSource": string;
|
|
15
|
-
"pageSize": number;
|
|
16
16
|
"session": string;
|
|
17
17
|
"translationUrl": string;
|
|
18
18
|
}
|
|
@@ -34,8 +34,8 @@ declare namespace LocalJSX {
|
|
|
34
34
|
"clientStylingUrl"?: string;
|
|
35
35
|
"endpoint": string;
|
|
36
36
|
"language"?: string;
|
|
37
|
+
"limit"?: number;
|
|
37
38
|
"mbSource"?: string;
|
|
38
|
-
"pageSize"?: number;
|
|
39
39
|
"session": string;
|
|
40
40
|
"translationUrl"?: string;
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./index-64ff3a3a.js";const i="__WIDGET_GLOBAL_STYLE_CACHE__";function s(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function o(t,e){if(!t||!e)return;const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function n(t,e,s,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return s=function(t,e){const i=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(i.innerHTML=e,t.appendChild(i))}))}(t,e),s;window[i]||(window[i]={}),s=function(t,e){return window.emMessageBus.subscribe(e,(s=>{if(!t)return;const o=t.getRootNode(),n=window[i];let a=n[e]&&n[e].sheet;a?n[e].refCount=n[e].refCount+1:(a=new CSSStyleSheet,a.replaceSync(s),n[e]={sheet:a,refCount:1});const r=o.adoptedStyleSheets||[];r.includes(a)||(o.adoptedStyleSheets=[...r,a])}))}(t,e);const n=s.unsubscribe.bind(s);return s.unsubscribe=()=>{if(window[i][e]){const t=window[i][e];t.refCount>1?t.refCount=t.refCount-1:delete window[i][e]}n()},s}const a={en:{history:"History",available:"Available"}},r=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{a[e]||(a[e]={});for(let i in t[e])a[e][i]=t[e][i]})),e(!0)}))})),l=(t,e,i)=>{let s=a[void 0!==e&&e in a?e:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,e)}return s};var c,h,d;!function(t){t[t.COINS=1]="COINS",t[t.XP=2]="XP"}(c||(c={})),function(t){t[t.TIME_PERIOD=1]="TIME_PERIOD",t[t.NUMBER_OF_ROUNDS=2]="NUMBER_OF_ROUNDS"}(h||(h={})),function(t){t[t.ACTIVE=0]="ACTIVE",t[t.ACTIVATED=1]="ACTIVATED",t[t.EXPIRED=2]="EXPIRED",t[t.CONSUMED=3]="CONSUMED",t[t.DISABLED=4]="DISABLED",t[t.ENABLED=6]="ENABLED"}(d||(d={}));const b=class{constructor(e){t(this,e),this.tabsInfo={available:{tabId:"available",offset:0,limit:this.pageSize},history:{tabId:"history",offset:0,limit:this.pageSize}},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.language="en",this.endpoint=void 0,this.session=void 0,this.pageSize=20,this.activeTab=this.tabsInfo.available.tabId}onTabClick(t){this.activeTab=t}render(){return e("div",{key:"28c29b3160d58b90e8d98f0375f2c51763872158",class:"PowerUpsLobby",ref:t=>this.stylingContainer=t},e("div",{key:"fa242490d51a5e38e2c600e57dadb9f2708e21f2",class:"TabTitle"},e("span",{key:"041edb872b4fa22a3822309918767e7f3de9aa3d",class:"Tab TabItem "+("available"===this.activeTab?"Active":""),onClick:this.onTabClick.bind(this,"available")},l("available",this.language)),e("span",{key:"8888c5d09305653b18e82d6ef3a1ae26aceca314",class:"Tab TabItem "+("history"===this.activeTab?"Active":""),onClick:this.onTabClick.bind(this,"history")},l("history",this.language))),e("div",{key:"82132c243f8cd3531c5ca0cb320c4723ffc0f0b4",class:"Desc"}," ",c.XP," "),e("div",{key:"8b638cce7dfe2d0983c82874aef59b1e8ec474dc",class:"TabContent"},"available"===this.activeTab&&e("bonus-elevate-powerups",{key:"5e236af908d621ccb8af1ab61ab62fd8db7694a5",endpoint:this.endpoint,session:this.session,language:this.language,"mb-source":this.mbSource,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"page-size":this.pageSize}),"history"===this.activeTab&&e("bonus-elevate-powerups-history",{key:"7d58ac9a7374f67bea7bd43541dd37b0b2968019",endpoint:this.endpoint,session:this.session,language:this.language,"mb-source":this.mbSource,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"page-size":this.pageSize})))}handleClientStylingChange(t,e){t!=e&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&n(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleNewTranslations(){r(this.translationUrl)}async componentWillLoad(){this.translationUrl&&await r(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"]}}};b.style=':host{display:block}.PowerUpsLobby{padding:10px}.PowerUpsLobby .Desc{display:none !important}.PowerUpsLobby .TabItem{position:relative;cursor:pointer;padding:10px 20px;border-bottom:2px solid transparent}.PowerUpsLobby .TabItem::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background-image:linear-gradient(180deg, var(--emw--color-powup-orange1, #EA9018) 0%, var(--emw--color-powup-orange1, #E0A84E) 100%);transform:scaleX(0)}.PowerUpsLobby .TabItem.Active::after{transform:scaleX(1)}.PowerUpsLobby .TabTitle{display:flex;flex-direction:row;text-transform:uppercase}.PowerUpsLobby .TabTitle .Tab{flex:1;padding:10px 20px;text-align:center;cursor:pointer}.PowerUpsLobby .TabTitle .Active1{border-bottom:2px solid;border-image-source:linear-gradient(180deg, var(--emw--color-powup-orange1, #EA9018) 0%, var(--emw--color-powup-orange1, #E0A84E) 100%);border-image-slice:1}.PowerUpsLobby .TabContent{margin-top:20px}';export{b as B,c as M,d as P,h as a,o as b,n as c,s}
|