@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.
- package/dist/bonus-elevate-powerups/app-globals-0f993ce5.js +1 -0
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups-550b383c.js +1 -0
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups.esm.js +1 -0
- package/dist/bonus-elevate-powerups/bonus-elevate-powerups_5.entry.js +9 -0
- package/dist/bonus-elevate-powerups/index-c7067e6d.js +2 -0
- package/dist/bonus-elevate-powerups/index.esm.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/bonus-elevate-powerups-5d4f1cfd.js +399 -0
- package/dist/cjs/bonus-elevate-powerups.cjs.js +25 -0
- package/dist/cjs/bonus-elevate-powerups_5.cjs.entry.js +6182 -0
- package/dist/cjs/index-3dbb4007.js +1316 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/assets/clear-search.svg +9 -0
- package/dist/collection/assets/left-arrow.svg +3 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.css +224 -0
- package/dist/collection/components/bonus-elevate-powerups/bonus-elevate-powerups.js +388 -0
- package/dist/collection/components/bonus-elevate-powerups/index.js +1 -0
- package/dist/collection/components/time-count/time-count.js +86 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +43 -0
- package/dist/collection/utils/utils.js +10 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/bonus-elevate-powerups-550b383c.js +397 -0
- package/dist/esm/bonus-elevate-powerups.js +20 -0
- package/dist/esm/bonus-elevate-powerups_5.entry.js +6174 -0
- package/dist/esm/index-c7067e6d.js +1287 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +20 -0
- package/dist/stencil.config.js +20 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/libs/common/src/types/casino/powerups.d.ts +57 -0
- 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
- 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
- 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
- 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
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/bonus-elevate-powerups/bonus-elevate-powerups.d.ts +36 -0
- package/dist/types/components/bonus-elevate-powerups/index.d.ts +1 -0
- package/dist/types/components/time-count/time-count.d.ts +10 -0
- package/dist/types/components.d.ts +66 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +9 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-c7067e6d.js';
|
|
2
|
+
|
|
3
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name setClientStyling
|
|
7
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
8
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
9
|
+
* @param {string} clientStyling The style content
|
|
10
|
+
*/
|
|
11
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
12
|
+
if (stylingContainer) {
|
|
13
|
+
const sheet = document.createElement('style');
|
|
14
|
+
sheet.innerHTML = clientStyling;
|
|
15
|
+
stylingContainer.appendChild(sheet);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @name setClientStylingURL
|
|
21
|
+
* @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
|
|
22
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
23
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
24
|
+
*/
|
|
25
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
27
|
+
|
|
28
|
+
const url = new URL(clientStylingUrl);
|
|
29
|
+
|
|
30
|
+
fetch(url.href)
|
|
31
|
+
.then((res) => res.text())
|
|
32
|
+
.then((data) => {
|
|
33
|
+
const cssFile = document.createElement('style');
|
|
34
|
+
cssFile.innerHTML = data;
|
|
35
|
+
if (stylingContainer) {
|
|
36
|
+
stylingContainer.appendChild(cssFile);
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
.catch((err) => {
|
|
40
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @name setStreamLibrary
|
|
46
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
47
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
48
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
49
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
50
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
51
|
+
*/
|
|
52
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
53
|
+
if (!window.emMessageBus) return;
|
|
54
|
+
|
|
55
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
56
|
+
|
|
57
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
58
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
59
|
+
|
|
60
|
+
return subscription;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!window[StyleCacheKey]) {
|
|
64
|
+
window[StyleCacheKey] = {};
|
|
65
|
+
}
|
|
66
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
67
|
+
|
|
68
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
69
|
+
const wrappedUnsubscribe = () => {
|
|
70
|
+
if (window[StyleCacheKey][domain]) {
|
|
71
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
72
|
+
cachedObject.refCount > 1
|
|
73
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
74
|
+
: delete window[StyleCacheKey][domain];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
originalUnsubscribe();
|
|
78
|
+
};
|
|
79
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
80
|
+
|
|
81
|
+
return subscription;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
85
|
+
const sheet = document.createElement('style');
|
|
86
|
+
|
|
87
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
88
|
+
if (stylingContainer) {
|
|
89
|
+
sheet.innerHTML = data;
|
|
90
|
+
stylingContainer.appendChild(sheet);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
96
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
97
|
+
if (!stylingContainer) return;
|
|
98
|
+
|
|
99
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
100
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
101
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
102
|
+
|
|
103
|
+
if (!cachedStyle) {
|
|
104
|
+
cachedStyle = new CSSStyleSheet();
|
|
105
|
+
cachedStyle.replaceSync(data);
|
|
106
|
+
cacheStyleObject[domain] = {
|
|
107
|
+
sheet: cachedStyle,
|
|
108
|
+
refCount: 1
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
115
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
116
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var MultiplierMode;
|
|
122
|
+
(function (MultiplierMode) {
|
|
123
|
+
MultiplierMode[MultiplierMode["COINS"] = 1] = "COINS";
|
|
124
|
+
MultiplierMode[MultiplierMode["XP"] = 2] = "XP";
|
|
125
|
+
})(MultiplierMode || (MultiplierMode = {}));
|
|
126
|
+
var BoostingPeriodMode;
|
|
127
|
+
(function (BoostingPeriodMode) {
|
|
128
|
+
BoostingPeriodMode[BoostingPeriodMode["TIME_PERIOD"] = 1] = "TIME_PERIOD";
|
|
129
|
+
BoostingPeriodMode[BoostingPeriodMode["NUMBER_OF_ROUNDS"] = 2] = "NUMBER_OF_ROUNDS";
|
|
130
|
+
})(BoostingPeriodMode || (BoostingPeriodMode = {}));
|
|
131
|
+
var PowerUpStatus;
|
|
132
|
+
(function (PowerUpStatus) {
|
|
133
|
+
PowerUpStatus[PowerUpStatus["ACTIVE"] = 0] = "ACTIVE";
|
|
134
|
+
PowerUpStatus[PowerUpStatus["ACTIVATED"] = 1] = "ACTIVATED";
|
|
135
|
+
PowerUpStatus[PowerUpStatus["EXPIRED"] = 2] = "EXPIRED";
|
|
136
|
+
PowerUpStatus[PowerUpStatus["CONSUMED"] = 3] = "CONSUMED";
|
|
137
|
+
PowerUpStatus[PowerUpStatus["DISABLED"] = 4] = "DISABLED";
|
|
138
|
+
PowerUpStatus[PowerUpStatus["ENABLED"] = 6] = "ENABLED";
|
|
139
|
+
})(PowerUpStatus || (PowerUpStatus = {}));
|
|
140
|
+
|
|
141
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
142
|
+
const TRANSLATIONS = {
|
|
143
|
+
en: {
|
|
144
|
+
min: 'MIN',
|
|
145
|
+
rounds: 'Rounds',
|
|
146
|
+
coins: 'Coins',
|
|
147
|
+
xp: 'XP',
|
|
148
|
+
nothingHere: 'Nothing here -- yet!',
|
|
149
|
+
noPowerUps: 'No power-ups have been used at the moment.',
|
|
150
|
+
gotoShop: 'Go to shop to check power-ups availability.',
|
|
151
|
+
termsCon: 'Read full Terms & Conditions',
|
|
152
|
+
games: 'Games',
|
|
153
|
+
selectGameToActive: 'Select the game to activate power-up',
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const translate = (key, customLang, values) => {
|
|
157
|
+
const lang = customLang;
|
|
158
|
+
let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
159
|
+
if (values !== undefined) {
|
|
160
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
161
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
162
|
+
translation = translation.replace(regex, value);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return translation;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
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">
|
|
169
|
+
<rect width="52" height="52" fill="url(#pattern0_1132_30534)"/>
|
|
170
|
+
<defs>
|
|
171
|
+
<pattern id="pattern0_1132_30534" patternContentUnits="objectBoundingBox" width="1" height="1">
|
|
172
|
+
<use xlink:href="#image0_1132_30534" transform="scale(0.01)"/>
|
|
173
|
+
</pattern>
|
|
174
|
+
<image id="image0_1132_30534" width="100" height="100" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHlElEQVR4nO2daYwURRTH/4tnvPCI9xE1ahQTNZmp6gXRzar4wTtGvPWLUeIVPxgVNWbizqvZRdTAGoioEQwaFDWK0YBCvMUbJWJIBD8QOUIEowhEQFjzepu4WaZ6qnp6tqub+iX9hexUV/W/Xh3vvSoAj8fj8Xg8Ho/H4/F4ikapB8PLNY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CFEU2BfVipNLQb9P6bWkt4vGWoTCl3zmkW+cQJFolRgDYd8ROyjDvNrk145v4csvwx15grOOuWAoxKgXNCpXMSq6uoP/J4R3BeGrKHPxVw4ohR++/98nRQc1O3ORiNAMSZPYPC3Ai+EQXgyH8GI4hBfDIbwYDuHFcAgvhkN4MRzCi+EQXgyH8GI4hBcjLzfBDfDaupaDW3g4WcBbhuuieDEcEsWL4Q5hnpOfMzwej8fj8Xg8Ho/H4/GgyPwHN+MBWXHaP7AAAAAASUVORK5CYII="/>
|
|
175
|
+
</defs>
|
|
176
|
+
</svg>
|
|
177
|
+
`;
|
|
178
|
+
|
|
179
|
+
const powerUpSearchConditions = {
|
|
180
|
+
expand: "games",
|
|
181
|
+
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,currentTime,expireTime,games(id,gameId,name,thumbnail,launchUrl)",
|
|
182
|
+
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
183
|
+
};
|
|
184
|
+
const powerUpGameSearchConditions = {
|
|
185
|
+
expand: "games",
|
|
186
|
+
fields: "id,powerUpID,games(id,gameId,name,thumbnail,launchUrl)"
|
|
187
|
+
};
|
|
188
|
+
|
|
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:#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}";
|
|
190
|
+
const BonusElevatePowerupsStyle0 = bonusElevatePowerupsCss;
|
|
191
|
+
|
|
192
|
+
const BonusElevatePowerups = class {
|
|
193
|
+
constructor(hostRef) {
|
|
194
|
+
registerInstance(this, hostRef);
|
|
195
|
+
this.tableId = 'powerups';
|
|
196
|
+
this.gameObservers = new Map();
|
|
197
|
+
this.mbSource = undefined;
|
|
198
|
+
this.clientStyling = undefined;
|
|
199
|
+
this.clientStylingUrl = undefined;
|
|
200
|
+
this.language = 'en';
|
|
201
|
+
this.endpoint = undefined;
|
|
202
|
+
this.session = undefined;
|
|
203
|
+
this.pageSize = 20;
|
|
204
|
+
this.isLoading = true;
|
|
205
|
+
this.powerups = [];
|
|
206
|
+
this.offset = 0;
|
|
207
|
+
this.limit = this.pageSize;
|
|
208
|
+
this.total = undefined;
|
|
209
|
+
}
|
|
210
|
+
onReloadPageByType(e) {
|
|
211
|
+
const { limit, offset, tableId } = e.detail;
|
|
212
|
+
if (tableId !== this.tableId) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this.offset = offset;
|
|
216
|
+
this.limit = limit;
|
|
217
|
+
}
|
|
218
|
+
async loadData() {
|
|
219
|
+
if (!this.endpoint || !this.session) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
this.isLoading = true;
|
|
223
|
+
if (this.abortController) {
|
|
224
|
+
this.abortController.abort();
|
|
225
|
+
}
|
|
226
|
+
this.abortController = new AbortController();
|
|
227
|
+
try {
|
|
228
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=offset=${this.offset},limit=${this.limit},games(limit=20,offset=0)`);
|
|
229
|
+
let options = {
|
|
230
|
+
headers: {
|
|
231
|
+
'Content-Type': 'application/json',
|
|
232
|
+
'x-SessionId': this.session
|
|
233
|
+
},
|
|
234
|
+
method: 'GET',
|
|
235
|
+
signal: this.abortController.signal
|
|
236
|
+
};
|
|
237
|
+
Object.entries(powerUpSearchConditions).forEach(([key, value]) => {
|
|
238
|
+
url.searchParams.append(key, value);
|
|
239
|
+
});
|
|
240
|
+
url.searchParams.append('language', this.language);
|
|
241
|
+
const response = await fetch(url, options);
|
|
242
|
+
if (!response.ok) {
|
|
243
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
244
|
+
}
|
|
245
|
+
const { data, total } = await response.json();
|
|
246
|
+
this.powerups = data;
|
|
247
|
+
this.total = total;
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
if (error.name !== 'AbortError') {
|
|
251
|
+
console.error("Failed to load powerups history:", error);
|
|
252
|
+
window.postMessage({ type: 'peHistoryLoaderError', error });
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
finally {
|
|
256
|
+
if (!this.abortController.signal.aborted) {
|
|
257
|
+
this.isLoading = false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
onGamesHover(game) {
|
|
262
|
+
window.postMessage({ type: 'PowerUpHover', game }, '*');
|
|
263
|
+
}
|
|
264
|
+
async loadMoreGames(powerup) {
|
|
265
|
+
var _a;
|
|
266
|
+
if (powerup.games.items.length >= powerup.games.total) {
|
|
267
|
+
return; // All games already loaded
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups?pagination=games(limit=20,offset=${powerup.games.items.length})`);
|
|
271
|
+
const options = {
|
|
272
|
+
headers: { 'x-SessionId': this.session },
|
|
273
|
+
};
|
|
274
|
+
url.searchParams.append('filter', `powerUpID=${powerup.powerUpID}`);
|
|
275
|
+
Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
|
|
276
|
+
url.searchParams.append(key, value);
|
|
277
|
+
});
|
|
278
|
+
const response = await fetch(url.toString(), options);
|
|
279
|
+
if (!response.ok) {
|
|
280
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
281
|
+
}
|
|
282
|
+
const { data } = await response.json();
|
|
283
|
+
// Find the powerup in the state and append the new games
|
|
284
|
+
const powerupIndex = this.powerups.findIndex(p => p.id === powerup.id);
|
|
285
|
+
if (powerupIndex !== -1) {
|
|
286
|
+
const updatedPowerup = Object.assign({}, this.powerups[powerupIndex]);
|
|
287
|
+
const fetchedPowerUp = data === null || data === void 0 ? void 0 : data[0];
|
|
288
|
+
if (fetchedPowerUp && ((_a = fetchedPowerUp.games) === null || _a === void 0 ? void 0 : _a.items)) {
|
|
289
|
+
updatedPowerup.games.items = [...updatedPowerup.games.items, ...fetchedPowerUp.games.items];
|
|
290
|
+
const newPowerups = [...this.powerups];
|
|
291
|
+
newPowerups[powerupIndex] = updatedPowerup;
|
|
292
|
+
this.powerups = newPowerups;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
console.error('Failed to load more games:', error);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
initializeGamesObserver(powerup) {
|
|
301
|
+
let observer = this.gameObservers.get(powerup.id);
|
|
302
|
+
if (observer) {
|
|
303
|
+
observer.disconnect();
|
|
304
|
+
}
|
|
305
|
+
observer = new IntersectionObserver((entries) => {
|
|
306
|
+
entries.forEach((entry) => {
|
|
307
|
+
if (entry.isIntersecting) {
|
|
308
|
+
this.loadMoreGames(powerup);
|
|
309
|
+
observer.unobserve(entry.target);
|
|
310
|
+
this.gameObservers.delete(powerup.id);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
this.gameObservers.set(powerup.id, observer);
|
|
315
|
+
setTimeout(() => {
|
|
316
|
+
const lastGameElement = this.stylingContainer.querySelector(`.PowerUpItem[data-powerup-id="${powerup.id}"] .Game:last-child`);
|
|
317
|
+
if (lastGameElement) {
|
|
318
|
+
observer.observe(lastGameElement);
|
|
319
|
+
}
|
|
320
|
+
}, 200);
|
|
321
|
+
}
|
|
322
|
+
componentDidUpdate() {
|
|
323
|
+
this.powerups.forEach(powerup => {
|
|
324
|
+
var _a, _b;
|
|
325
|
+
if (((_a = powerup.games) === null || _a === void 0 ? void 0 : _a.items.length) < ((_b = powerup.games) === null || _b === void 0 ? void 0 : _b.total)) {
|
|
326
|
+
this.initializeGamesObserver(powerup);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
render() {
|
|
331
|
+
return h("div", { key: 'b40ca849d3de46834e9c7b6dee8d275756921d07', class: `PowerUpsContainer`, ref: (el) => (this.stylingContainer = el) }, this.isLoading
|
|
332
|
+
? h("p", null, "Loading...")
|
|
333
|
+
: !this.total ?
|
|
334
|
+
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
|
+
: [h("div", { class: 'PowerUps' }, this.powerups.map(powerup => {
|
|
336
|
+
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 || 'Title', " "), h("div", { class: 'Title2 PowerUpMultiplier' }, h("span", { class: 'BoostingPeriod' }, h("span", { class: 'Period' }, powerup.boostingPeriod.minutes || powerup.boostingPeriod.numberOfRounds, " "), powerup.boostingPeriod.mode === BoostingPeriodMode.TIME_PERIOD ? translate('min') : translate('rounds'), " "), h("span", { class: 'Multiplier' }, "| X", powerup.multiplier.coefficient, " "), h("span", { class: 'MultiplierMode' }, "| ", powerup.multiplier.mode === MultiplierMode.XP ? translate('xp') : translate('coins'), " "), "| ", h("span", { class: 'ExpireCount' }, " ", h("time-count", { "expire-time": powerup.expireTime }))), h("div", { class: 'Description' }, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aperiam autem corporis est harum minus, nam neque nisi quibusdam quod reiciendis rerum saepe temporibus veritatis voluptas! Aperiam cupiditate optio rem?")), h("div", { class: 'TermsC' }, translate('termsCon', this.language))), h("div", { class: 'GamesContent CardRight' }, h("div", { class: 'GamesTitle' }, h("span", { class: 'Title2' }, " ", translate('games', this.language)), h("span", { class: 'GamesAmount' }, "( ", (_a = powerup.games) === null || _a === void 0 ? void 0 :
|
|
338
|
+
_a.total, " )")), h("div", { class: 'GameTitleTip' }, translate('selectGameToActive', this.language)), h("div", { class: 'GamesList' }, h("div", { class: 'Games' }, (_b = powerup.games) === null || _b === void 0 ? void 0 : _b.items.map(g => {
|
|
339
|
+
return h("div", { class: 'Game' }, h("ui-image", { src: g.thumbnail }), h("div", { class: 'GameMask', onClick: this.onGamesHover.bind(this, g) }, h("span", { class: 'PlayBtn' }, "Start Now!")));
|
|
340
|
+
})))));
|
|
341
|
+
})), h("div", { class: 'Pagination' }, this.total && this.total > this.limit &&
|
|
342
|
+
h("bonus-pagination-nav", { offset: this.offset, limit: this.limit, "secondary-arrows-active": true, "table-id": this.tableId, total: this.total }))]);
|
|
343
|
+
}
|
|
344
|
+
handleDataConfigChange() {
|
|
345
|
+
this.loadData().catch(console.error);
|
|
346
|
+
}
|
|
347
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
348
|
+
if (newValue != oldValue) {
|
|
349
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
353
|
+
if (newValue != oldValue) {
|
|
354
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
358
|
+
if (newValue != oldValue) {
|
|
359
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
componentWillLoad() {
|
|
363
|
+
this.loadData().catch(console.error);
|
|
364
|
+
}
|
|
365
|
+
componentDidLoad() {
|
|
366
|
+
if (this.stylingContainer) {
|
|
367
|
+
if (this.mbSource)
|
|
368
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
369
|
+
if (this.clientStyling)
|
|
370
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
371
|
+
if (this.clientStylingUrl)
|
|
372
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
disconnectedCallback() {
|
|
376
|
+
if (this.abortController) {
|
|
377
|
+
this.abortController.abort();
|
|
378
|
+
}
|
|
379
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
380
|
+
this.gameObservers.forEach(obs => obs.disconnect());
|
|
381
|
+
this.gameObservers.clear();
|
|
382
|
+
}
|
|
383
|
+
static get assetsDirs() { return ["assets"]; }
|
|
384
|
+
static get watchers() { return {
|
|
385
|
+
"offset": ["loadData"],
|
|
386
|
+
"limit": ["loadData"],
|
|
387
|
+
"language": ["loadData"],
|
|
388
|
+
"session": ["loadData", "handleDataConfigChange"],
|
|
389
|
+
"endpoint": ["loadData", "handleDataConfigChange"],
|
|
390
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
391
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
392
|
+
"mbSource": ["handleMbSourceChange"]
|
|
393
|
+
}; }
|
|
394
|
+
};
|
|
395
|
+
BonusElevatePowerups.style = BonusElevatePowerupsStyle0;
|
|
396
|
+
|
|
397
|
+
export { BonusElevatePowerups as B };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-c7067e6d.js';
|
|
2
|
+
export { s as setNonce } from './index-c7067e6d.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
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],"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);
|
|
20
|
+
});
|