@everymatrix/bonus-elevate-powerups-lobby 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/bonus-elevate-powerups-lobby/app-globals-0f993ce5.js +1 -0
  2. package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby-09c95672.js +1 -0
  3. package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.esm.js +1 -0
  4. package/dist/bonus-elevate-powerups-lobby/bonus-elevate-powerups_7.entry.js +9 -0
  5. package/dist/bonus-elevate-powerups-lobby/index-64ff3a3a.js +2 -0
  6. package/dist/bonus-elevate-powerups-lobby/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/bonus-elevate-powerups-lobby-a19b84c9.js +256 -0
  9. package/dist/cjs/bonus-elevate-powerups-lobby.cjs.js +25 -0
  10. package/dist/cjs/bonus-elevate-powerups_7.cjs.entry.js +6657 -0
  11. package/dist/cjs/index-d5c2977d.js +1316 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/collection-manifest.json +44 -0
  15. package/dist/collection/components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.css +48 -0
  16. package/dist/collection/components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.js +242 -0
  17. package/dist/collection/components/bonus-elevate-powerups-lobby/index.js +1 -0
  18. package/dist/collection/index.js +1 -0
  19. package/dist/collection/utils/locale.utils.js +35 -0
  20. package/dist/collection/utils/utils.js +0 -0
  21. package/dist/esm/app-globals-0f993ce5.js +3 -0
  22. package/dist/esm/bonus-elevate-powerups-lobby-09c95672.js +251 -0
  23. package/dist/esm/bonus-elevate-powerups-lobby.js +20 -0
  24. package/dist/esm/bonus-elevate-powerups_7.entry.js +6648 -0
  25. package/dist/esm/index-64ff3a3a.js +1287 -0
  26. package/dist/esm/index.js +2 -0
  27. package/dist/esm/loader.js +11 -0
  28. package/dist/index.cjs.js +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/stencil.config.dev.js +21 -0
  31. package/dist/stencil.config.js +24 -0
  32. package/dist/storybook/main.js +43 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/libs/common/src/types/casino/powerups.d.ts +57 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/packages/stencil/bonus-elevate-powerups-lobby/stencil.config.d.ts +2 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/packages/stencil/bonus-elevate-powerups-lobby/stencil.config.dev.d.ts +2 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/packages/stencil/bonus-elevate-powerups-lobby/storybook/main.d.ts +3 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/packages/stencil/bonus-elevate-powerups-lobby/storybook/preview.d.ts +70 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/tools/plugins/index.d.ts +4 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-lobby/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  45. package/dist/types/components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.d.ts +25 -0
  46. package/dist/types/components/bonus-elevate-powerups-lobby/index.d.ts +1 -0
  47. package/dist/types/components.d.ts +53 -0
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  50. package/dist/types/utils/locale.utils.d.ts +2 -0
  51. package/dist/types/utils/utils.d.ts +0 -0
  52. package/loader/cdn.js +1 -0
  53. package/loader/index.cjs.js +1 -0
  54. package/loader/index.d.ts +24 -0
  55. package/loader/index.es2017.js +1 -0
  56. package/loader/index.js +2 -0
  57. package/loader/package.json +11 -0
  58. package/package.json +27 -0
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const bonusElevatePowerupsLobby = require('./bonus-elevate-powerups-lobby-a19b84c9.js');
6
+ require('./index-d5c2977d.js');
7
+
8
+
9
+
10
+ exports.BonusElevatePowerupsLobby = bonusElevatePowerupsLobby.BonusElevatePowerupsLobby;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-d5c2977d.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["bonus-elevate-powerups_7.cjs",[[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],"pageSize":[514,"page-size"],"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"],"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"]}],[1,"bonus-elevate-powerups-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"pageSize":[514,"page-size"],"translationUrl":[513,"translation-url"],"isLoading":[32],"powerups":[32],"offset":[32],"limit":[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"],"displayTime":[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);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,44 @@
1
+ {
2
+ "entries": [
3
+ "components/bonus-elevate-powerups-lobby/bonus-elevate-powerups-lobby.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.19.2",
8
+ "typescriptVersion": "5.4.5"
9
+ },
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/bonus-elevate-powerups",
13
+ "tags": [
14
+ "bonus-elevate-powerups",
15
+ "time-count"
16
+ ]
17
+ },
18
+ {
19
+ "name": "@everymatrix/bonus-elevate-powerups-history",
20
+ "tags": [
21
+ "bonus-elevate-powerups-history"
22
+ ]
23
+ },
24
+ {
25
+ "name": "@everymatrix/bonus-pagination-nav",
26
+ "tags": [
27
+ "bonus-pagination-nav"
28
+ ]
29
+ },
30
+ {
31
+ "name": "@everymatrix/ui-image",
32
+ "tags": [
33
+ "ui-image"
34
+ ]
35
+ },
36
+ {
37
+ "name": "@everymatrix/ui-skeleton",
38
+ "tags": [
39
+ "ui-skeleton"
40
+ ]
41
+ }
42
+ ],
43
+ "bundles": []
44
+ }
@@ -0,0 +1,48 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .PowerUpsLobby {
6
+ padding: 10px;
7
+ }
8
+ .PowerUpsLobby .Desc {
9
+ display: none !important;
10
+ }
11
+ .PowerUpsLobby .TabItem {
12
+ position: relative;
13
+ cursor: pointer;
14
+ padding: 10px 20px;
15
+ border-bottom: 2px solid transparent;
16
+ }
17
+ .PowerUpsLobby .TabItem::after {
18
+ content: "";
19
+ position: absolute;
20
+ bottom: 0;
21
+ left: 0;
22
+ width: 100%;
23
+ height: 2px;
24
+ background-image: linear-gradient(180deg, var(--emw--color-powup-orange1, #EA9018) 0%, var(--emw--color-powup-orange1, #E0A84E) 100%);
25
+ transform: scaleX(0);
26
+ }
27
+ .PowerUpsLobby .TabItem.Active::after {
28
+ transform: scaleX(1);
29
+ }
30
+ .PowerUpsLobby .TabTitle {
31
+ display: flex;
32
+ flex-direction: row;
33
+ text-transform: uppercase;
34
+ }
35
+ .PowerUpsLobby .TabTitle .Tab {
36
+ flex: 1;
37
+ padding: 10px 20px;
38
+ text-align: center;
39
+ cursor: pointer;
40
+ }
41
+ .PowerUpsLobby .TabTitle .Active1 {
42
+ border-bottom: 2px solid;
43
+ border-image-source: linear-gradient(180deg, var(--emw--color-powup-orange1, #EA9018) 0%, var(--emw--color-powup-orange1, #E0A84E) 100%);
44
+ border-image-slice: 1;
45
+ }
46
+ .PowerUpsLobby .TabContent {
47
+ margin-top: 20px;
48
+ }
@@ -0,0 +1,242 @@
1
+ import { h } from "@stencil/core";
2
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
3
+ import { getTranslations, translate } from "../../utils/locale.utils";
4
+ import { MultiplierMode } from "../../../../../../../../libs/common/src/types/casino/powerups";
5
+ import "../../../../../bonus-elevate-powerups/dist/types/index";
6
+ import "../../../../../bonus-elevate-powerups-history/dist/types/index";
7
+ export class BonusElevatePowerupsLobby {
8
+ constructor() {
9
+ this.tabsInfo = {
10
+ 'available': { tabId: 'available', offset: 0, limit: this.pageSize },
11
+ 'history': { tabId: 'history', offset: 0, limit: this.pageSize
12
+ }
13
+ };
14
+ this.mbSource = undefined;
15
+ this.clientStyling = undefined;
16
+ this.clientStylingUrl = undefined;
17
+ this.translationUrl = undefined;
18
+ this.language = 'en';
19
+ this.endpoint = undefined;
20
+ this.session = undefined;
21
+ this.pageSize = 20;
22
+ this.activeTab = this.tabsInfo.available.tabId;
23
+ }
24
+ onTabClick(tab) {
25
+ this.activeTab = tab;
26
+ }
27
+ render() {
28
+ return h("div", { key: '28c29b3160d58b90e8d98f0375f2c51763872158', class: 'PowerUpsLobby', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'fa242490d51a5e38e2c600e57dadb9f2708e21f2', class: 'TabTitle' }, h("span", { key: '041edb872b4fa22a3822309918767e7f3de9aa3d', class: `Tab TabItem ${this.activeTab === 'available' ? 'Active' : ''}`, onClick: this.onTabClick.bind(this, 'available') }, translate('available', this.language)), h("span", { key: '8888c5d09305653b18e82d6ef3a1ae26aceca314', class: `Tab TabItem ${this.activeTab === 'history' ? 'Active' : ''}`, onClick: this.onTabClick.bind(this, 'history') }, translate('history', this.language))), h("div", { key: '82132c243f8cd3531c5ca0cb320c4723ffc0f0b4', class: 'Desc' }, " ", MultiplierMode.XP, " "), h("div", { key: '8b638cce7dfe2d0983c82874aef59b1e8ec474dc', class: 'TabContent' }, this.activeTab === 'available' &&
29
+ h("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 }), this.activeTab === 'history' &&
30
+ h("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 })));
31
+ }
32
+ handleClientStylingChange(newValue, oldValue) {
33
+ if (newValue != oldValue) {
34
+ setClientStyling(this.stylingContainer, this.clientStyling);
35
+ }
36
+ }
37
+ handleClientStylingUrlChange(newValue, oldValue) {
38
+ if (newValue != oldValue) {
39
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
40
+ }
41
+ }
42
+ handleMbSourceChange(newValue, oldValue) {
43
+ if (newValue != oldValue) {
44
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
45
+ }
46
+ }
47
+ handleNewTranslations() {
48
+ getTranslations(this.translationUrl);
49
+ }
50
+ async componentWillLoad() {
51
+ if (this.translationUrl) {
52
+ await getTranslations(this.translationUrl);
53
+ }
54
+ }
55
+ componentDidLoad() {
56
+ if (this.stylingContainer) {
57
+ if (this.mbSource)
58
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
59
+ if (this.clientStyling)
60
+ setClientStyling(this.stylingContainer, this.clientStyling);
61
+ if (this.clientStylingUrl)
62
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
63
+ }
64
+ }
65
+ disconnectedCallback() {
66
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
67
+ }
68
+ static get is() { return "bonus-elevate-powerups-lobby"; }
69
+ static get encapsulation() { return "shadow"; }
70
+ static get originalStyleUrls() {
71
+ return {
72
+ "$": ["bonus-elevate-powerups-lobby.scss"]
73
+ };
74
+ }
75
+ static get styleUrls() {
76
+ return {
77
+ "$": ["bonus-elevate-powerups-lobby.css"]
78
+ };
79
+ }
80
+ static get properties() {
81
+ return {
82
+ "mbSource": {
83
+ "type": "string",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "string",
87
+ "resolved": "string",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": ""
95
+ },
96
+ "attribute": "mb-source",
97
+ "reflect": true
98
+ },
99
+ "clientStyling": {
100
+ "type": "string",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "string",
104
+ "resolved": "string",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "attribute": "client-styling",
114
+ "reflect": true
115
+ },
116
+ "clientStylingUrl": {
117
+ "type": "string",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "string",
121
+ "resolved": "string",
122
+ "references": {}
123
+ },
124
+ "required": false,
125
+ "optional": false,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": ""
129
+ },
130
+ "attribute": "client-styling-url",
131
+ "reflect": true
132
+ },
133
+ "translationUrl": {
134
+ "type": "string",
135
+ "mutable": false,
136
+ "complexType": {
137
+ "original": "string",
138
+ "resolved": "string",
139
+ "references": {}
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": ""
146
+ },
147
+ "attribute": "translation-url",
148
+ "reflect": true
149
+ },
150
+ "language": {
151
+ "type": "string",
152
+ "mutable": false,
153
+ "complexType": {
154
+ "original": "string",
155
+ "resolved": "string",
156
+ "references": {}
157
+ },
158
+ "required": false,
159
+ "optional": false,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": ""
163
+ },
164
+ "attribute": "language",
165
+ "reflect": true,
166
+ "defaultValue": "'en'"
167
+ },
168
+ "endpoint": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": true,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": ""
181
+ },
182
+ "attribute": "endpoint",
183
+ "reflect": true
184
+ },
185
+ "session": {
186
+ "type": "string",
187
+ "mutable": false,
188
+ "complexType": {
189
+ "original": "string",
190
+ "resolved": "string",
191
+ "references": {}
192
+ },
193
+ "required": true,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": ""
198
+ },
199
+ "attribute": "session",
200
+ "reflect": true
201
+ },
202
+ "pageSize": {
203
+ "type": "number",
204
+ "mutable": false,
205
+ "complexType": {
206
+ "original": "number",
207
+ "resolved": "number",
208
+ "references": {}
209
+ },
210
+ "required": false,
211
+ "optional": false,
212
+ "docs": {
213
+ "tags": [],
214
+ "text": ""
215
+ },
216
+ "attribute": "page-size",
217
+ "reflect": true,
218
+ "defaultValue": "20"
219
+ }
220
+ };
221
+ }
222
+ static get states() {
223
+ return {
224
+ "activeTab": {}
225
+ };
226
+ }
227
+ static get watchers() {
228
+ return [{
229
+ "propName": "clientStyling",
230
+ "methodName": "handleClientStylingChange"
231
+ }, {
232
+ "propName": "clientStylingUrl",
233
+ "methodName": "handleClientStylingUrlChange"
234
+ }, {
235
+ "propName": "mbSource",
236
+ "methodName": "handleMbSourceChange"
237
+ }, {
238
+ "propName": "translationUrl",
239
+ "methodName": "handleNewTranslations"
240
+ }];
241
+ }
242
+ }
@@ -0,0 +1 @@
1
+ export { BonusElevatePowerupsLobby } from './bonus-elevate-powerups-lobby';
@@ -0,0 +1 @@
1
+ export * from './components/bonus-elevate-powerups-lobby';
@@ -0,0 +1,35 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ history: 'History',
5
+ available: 'Available',
6
+ }
7
+ };
8
+ export const getTranslations = (url) => {
9
+ return new Promise((resolve) => {
10
+ fetch(url)
11
+ .then((res) => res.json())
12
+ .then((data) => {
13
+ Object.keys(data).forEach((lang) => {
14
+ if (!TRANSLATIONS[lang]) {
15
+ TRANSLATIONS[lang] = {};
16
+ }
17
+ for (let key in data[lang]) {
18
+ TRANSLATIONS[lang][key] = data[lang][key];
19
+ }
20
+ });
21
+ resolve(true);
22
+ });
23
+ });
24
+ };
25
+ export const translate = (key, customLang, values) => {
26
+ const lang = customLang;
27
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
28
+ if (values !== undefined) {
29
+ for (const [key, value] of Object.entries(values.values)) {
30
+ const regex = new RegExp(`{${key}}`, 'g');
31
+ translation = translation.replace(regex, value);
32
+ }
33
+ }
34
+ return translation;
35
+ };
File without changes
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,251 @@
1
+ import { r as registerInstance, h } from './index-64ff3a3a.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
+ const DEFAULT_LANGUAGE = 'en';
122
+ const TRANSLATIONS = {
123
+ en: {
124
+ history: 'History',
125
+ available: 'Available',
126
+ }
127
+ };
128
+ const getTranslations = (url) => {
129
+ return new Promise((resolve) => {
130
+ fetch(url)
131
+ .then((res) => res.json())
132
+ .then((data) => {
133
+ Object.keys(data).forEach((lang) => {
134
+ if (!TRANSLATIONS[lang]) {
135
+ TRANSLATIONS[lang] = {};
136
+ }
137
+ for (let key in data[lang]) {
138
+ TRANSLATIONS[lang][key] = data[lang][key];
139
+ }
140
+ });
141
+ resolve(true);
142
+ });
143
+ });
144
+ };
145
+ const translate = (key, customLang, values) => {
146
+ const lang = customLang;
147
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
148
+ if (values !== undefined) {
149
+ for (const [key, value] of Object.entries(values.values)) {
150
+ const regex = new RegExp(`{${key}}`, 'g');
151
+ translation = translation.replace(regex, value);
152
+ }
153
+ }
154
+ return translation;
155
+ };
156
+
157
+ var MultiplierMode;
158
+ (function (MultiplierMode) {
159
+ MultiplierMode[MultiplierMode["COINS"] = 1] = "COINS";
160
+ MultiplierMode[MultiplierMode["XP"] = 2] = "XP";
161
+ })(MultiplierMode || (MultiplierMode = {}));
162
+ var BoostingPeriodMode;
163
+ (function (BoostingPeriodMode) {
164
+ BoostingPeriodMode[BoostingPeriodMode["TIME_PERIOD"] = 1] = "TIME_PERIOD";
165
+ BoostingPeriodMode[BoostingPeriodMode["NUMBER_OF_ROUNDS"] = 2] = "NUMBER_OF_ROUNDS";
166
+ })(BoostingPeriodMode || (BoostingPeriodMode = {}));
167
+ var PowerUpStatus;
168
+ (function (PowerUpStatus) {
169
+ PowerUpStatus[PowerUpStatus["ACTIVE"] = 0] = "ACTIVE";
170
+ PowerUpStatus[PowerUpStatus["ACTIVATED"] = 1] = "ACTIVATED";
171
+ PowerUpStatus[PowerUpStatus["EXPIRED"] = 2] = "EXPIRED";
172
+ PowerUpStatus[PowerUpStatus["CONSUMED"] = 3] = "CONSUMED";
173
+ PowerUpStatus[PowerUpStatus["DISABLED"] = 4] = "DISABLED";
174
+ PowerUpStatus[PowerUpStatus["ENABLED"] = 6] = "ENABLED";
175
+ })(PowerUpStatus || (PowerUpStatus = {}));
176
+
177
+ const bonusElevatePowerupsLobbyCss = ":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}";
178
+ const BonusElevatePowerupsLobbyStyle0 = bonusElevatePowerupsLobbyCss;
179
+
180
+ const BonusElevatePowerupsLobby = class {
181
+ constructor(hostRef) {
182
+ registerInstance(this, hostRef);
183
+ this.tabsInfo = {
184
+ 'available': { tabId: 'available', offset: 0, limit: this.pageSize },
185
+ 'history': { tabId: 'history', offset: 0, limit: this.pageSize
186
+ }
187
+ };
188
+ this.mbSource = undefined;
189
+ this.clientStyling = undefined;
190
+ this.clientStylingUrl = undefined;
191
+ this.translationUrl = undefined;
192
+ this.language = 'en';
193
+ this.endpoint = undefined;
194
+ this.session = undefined;
195
+ this.pageSize = 20;
196
+ this.activeTab = this.tabsInfo.available.tabId;
197
+ }
198
+ onTabClick(tab) {
199
+ this.activeTab = tab;
200
+ }
201
+ render() {
202
+ return h("div", { key: '28c29b3160d58b90e8d98f0375f2c51763872158', class: 'PowerUpsLobby', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'fa242490d51a5e38e2c600e57dadb9f2708e21f2', class: 'TabTitle' }, h("span", { key: '041edb872b4fa22a3822309918767e7f3de9aa3d', class: `Tab TabItem ${this.activeTab === 'available' ? 'Active' : ''}`, onClick: this.onTabClick.bind(this, 'available') }, translate('available', this.language)), h("span", { key: '8888c5d09305653b18e82d6ef3a1ae26aceca314', class: `Tab TabItem ${this.activeTab === 'history' ? 'Active' : ''}`, onClick: this.onTabClick.bind(this, 'history') }, translate('history', this.language))), h("div", { key: '82132c243f8cd3531c5ca0cb320c4723ffc0f0b4', class: 'Desc' }, " ", MultiplierMode.XP, " "), h("div", { key: '8b638cce7dfe2d0983c82874aef59b1e8ec474dc', class: 'TabContent' }, this.activeTab === 'available' &&
203
+ h("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 }), this.activeTab === 'history' &&
204
+ h("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 })));
205
+ }
206
+ handleClientStylingChange(newValue, oldValue) {
207
+ if (newValue != oldValue) {
208
+ setClientStyling(this.stylingContainer, this.clientStyling);
209
+ }
210
+ }
211
+ handleClientStylingUrlChange(newValue, oldValue) {
212
+ if (newValue != oldValue) {
213
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
214
+ }
215
+ }
216
+ handleMbSourceChange(newValue, oldValue) {
217
+ if (newValue != oldValue) {
218
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
219
+ }
220
+ }
221
+ handleNewTranslations() {
222
+ getTranslations(this.translationUrl);
223
+ }
224
+ async componentWillLoad() {
225
+ if (this.translationUrl) {
226
+ await getTranslations(this.translationUrl);
227
+ }
228
+ }
229
+ componentDidLoad() {
230
+ if (this.stylingContainer) {
231
+ if (this.mbSource)
232
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
233
+ if (this.clientStyling)
234
+ setClientStyling(this.stylingContainer, this.clientStyling);
235
+ if (this.clientStylingUrl)
236
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
237
+ }
238
+ }
239
+ disconnectedCallback() {
240
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
241
+ }
242
+ static get watchers() { return {
243
+ "clientStyling": ["handleClientStylingChange"],
244
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
245
+ "mbSource": ["handleMbSourceChange"],
246
+ "translationUrl": ["handleNewTranslations"]
247
+ }; }
248
+ };
249
+ BonusElevatePowerupsLobby.style = BonusElevatePowerupsLobbyStyle0;
250
+
251
+ export { BonusElevatePowerupsLobby as B, MultiplierMode as M, PowerUpStatus as P, BoostingPeriodMode as a, setClientStylingURL as b, setStreamStyling as c, setClientStyling as s };