@everymatrix/casino-engagement-suite-container 1.35.0
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/casino-engagement-suite-container/casino-engagement-suite-container.esm.js +1 -0
- package/dist/casino-engagement-suite-container/index.esm.js +0 -0
- package/dist/casino-engagement-suite-container/p-94a35541.js +1 -0
- package/dist/casino-engagement-suite-container/p-fbddcb5b.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-bar_2.cjs.entry.js +246 -0
- package/dist/cjs/casino-engagement-suite-container.cjs.js +19 -0
- package/dist/cjs/index-e8d404e4.js +1242 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-engagement-suite-container/casino-engagement-suite-container.css +36 -0
- package/dist/collection/components/casino-engagement-suite-container/casino-engagement-suite-container.js +218 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/casino-engagement-suite-config.js +15 -0
- package/dist/collection/utils/utils.js +24 -0
- package/dist/components/casino-engagement-suite-bar.js +6 -0
- package/dist/components/casino-engagement-suite-bar2.js +99 -0
- package/dist/components/casino-engagement-suite-container.d.ts +11 -0
- package/dist/components/casino-engagement-suite-container.js +202 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-bar_2.entry.js +241 -0
- package/dist/esm/casino-engagement-suite-container.js +17 -0
- package/dist/esm/index-fef3ac09.js +1216 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-container/.stencil/packages/casino-engagement-suite-container/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-container/casino-engagement-suite-container.d.ts +38 -0
- package/dist/types/components.d.ts +59 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/casino-engagement-suite-config.d.ts +65 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* CasinoEngagementSuiteContainer custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-fef3ac09.js';
|
|
2
|
+
import '@everymatrix/casino-engagement-suite-challenges-list';
|
|
3
|
+
|
|
4
|
+
const casinoEngagementSuiteBarCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap\"); :host{display:block}*{box-sizing:border-box}.CasinoEngagementSuiteBar{height:100vh;background-color:var(--emw--color-background, #1E1638);color:var(--emw--color-typography, #FFF)}.CasinoEngagementSuiteBar .EngagementSuiteContainer{display:flex;align-items:center;gap:4px}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{background-color:var(--emw--color-primary, #251D3E);border-radius:var(--emw--border-radius-medium, 4px);display:flex;flex-direction:row;align-items:center;justify-content:center;position:relative;font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-x-small, 12px);font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFF)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--border-radius-medium, 4px);padding:1px;background:linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 100%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpots,.CasinoEngagementSuiteBar .EngagementSuiteContainer .Rewards{display:flex;flex-direction:column;gap:4px}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{padding:14px 8px}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpots .Mega{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:var(--emw--font-weight-bold, 800)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{justify-content:space-between;padding:8px;cursor:pointer;border:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward.Active::before{background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #2D2545 82.77%)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .RewardIcon{width:24px;height:24px;background-size:100%;background-position:center}.Tile.Leaderboard .RewardIcon{background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\")}.Tile.Leaderboard.Active .RewardIcon{background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard-pressed.svg\")}.Tile.Challenges .RewardIcon{background:center 100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge.svg\")}.Tile.Challenges.Active .RewardIcon{background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge-pressed.svg\")}.Tile.Luckywheel .RewardIcon{background:center 100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel.svg\")}.Tile.Luckywheel.Active .RewardIcon{background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel-pressed.svg\")}.Tile.Freespins .RewardIcon{background:center 100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins.svg\")}.Tile.Freespins.Active .RewardIcon{background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins-pressed.svg\")}.Landscape.CasinoEngagementSuiteBar{width:152px;padding-top:16px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer{flex-direction:column}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{width:120px;height:40px}.Portrait.CasinoEngagementSuiteBar{border-radius:0 0 var(--emw--border-radius-medium, 4px) var(--emw--border-radius-medium, 4px);height:auto;padding:10px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer{gap:8px;flex-wrap:wrap}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpots,.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Rewards{width:100%;flex-direction:row;gap:8px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{flex:1 1 0px;height:32px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{padding:10px 8px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{padding:4px 8px}";
|
|
5
|
+
|
|
6
|
+
const CasinoEngagementSuiteBar = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
/**
|
|
10
|
+
* Client custom styling via string
|
|
11
|
+
*/
|
|
12
|
+
this.clientStyling = '';
|
|
13
|
+
/**
|
|
14
|
+
* Client custom styling via url
|
|
15
|
+
*/
|
|
16
|
+
this.clientStylingUrl = '';
|
|
17
|
+
/**
|
|
18
|
+
* Orientation of the widget
|
|
19
|
+
*/
|
|
20
|
+
this.orientation = 'Landscape';
|
|
21
|
+
this.limitStylingAppends = false;
|
|
22
|
+
this.handleTileClick = (ev) => {
|
|
23
|
+
const application = ev.target.getAttribute('data-app');
|
|
24
|
+
window.postMessage({ type: `Bar${application}Click` });
|
|
25
|
+
this.activeWidget = application;
|
|
26
|
+
};
|
|
27
|
+
this.setClientStyling = () => {
|
|
28
|
+
let sheet = document.createElement('style');
|
|
29
|
+
sheet.innerHTML = this.clientStyling;
|
|
30
|
+
this.engagementSuiteBar.prepend(sheet);
|
|
31
|
+
};
|
|
32
|
+
this.setClientStylingURL = () => {
|
|
33
|
+
let url = new URL(this.clientStylingUrl);
|
|
34
|
+
let cssFile = document.createElement('style');
|
|
35
|
+
fetch(url.href)
|
|
36
|
+
.then((res) => res.text())
|
|
37
|
+
.then((data) => {
|
|
38
|
+
cssFile.innerHTML = data;
|
|
39
|
+
setTimeout(() => { this.engagementSuiteBar.prepend(cssFile); }, 1);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
console.log('Error ', err);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
componentDidRender() {
|
|
47
|
+
// start custom styling area
|
|
48
|
+
if (!this.limitStylingAppends && this.engagementSuiteBar) {
|
|
49
|
+
if (this.clientStyling)
|
|
50
|
+
this.setClientStyling();
|
|
51
|
+
if (this.clientStylingUrl)
|
|
52
|
+
this.setClientStylingURL();
|
|
53
|
+
this.limitStylingAppends = true;
|
|
54
|
+
}
|
|
55
|
+
// end custom styling area
|
|
56
|
+
}
|
|
57
|
+
getChallengeTile() {
|
|
58
|
+
return this.challengePercent
|
|
59
|
+
? (h("button", { class: `Tile Reward Challenges ${this.activeWidget === 'Challenges' ? 'Active' : ''}`, "data-app": "Challenges", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, this.challengePercent)))
|
|
60
|
+
: '';
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
/**
|
|
64
|
+
* These constants are used only to verify the correct rendering of our widget.
|
|
65
|
+
* In future development, all of this data will be fetched from the backend.
|
|
66
|
+
*/
|
|
67
|
+
const megaItem = '$ 988,900,000';
|
|
68
|
+
const majorItem = '$ 77,900,000';
|
|
69
|
+
const minorItem = '$ 3,900,000';
|
|
70
|
+
const leaderboardItem = '4 / 120';
|
|
71
|
+
const luckywheelItem = '5';
|
|
72
|
+
const freespinsItem = '17';
|
|
73
|
+
return h("div", { class: `CasinoEngagementSuiteBar ${this.orientation}`, ref: (el) => (this.engagementSuiteBar = el) }, h("div", { class: "EngagementSuiteContainer" }, h("div", { class: "Jackpots" }, h("div", { class: "Tile Jackpot" }, h("span", { class: "Mega" }, megaItem)), h("div", { class: "Tile Jackpot" }, h("span", { class: "Major" }, majorItem)), h("div", { class: "Tile Jackpot" }, h("span", { class: "Minor" }, minorItem))), h("div", { class: "Rewards" }, h("button", { class: `Tile Reward Leaderboard ${this.activeWidget === 'Leaderboard' ? 'Active' : ''}`, "data-app": "Leaderboard", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, leaderboardItem)), h("button", { class: `Tile Reward Luckywheel ${this.activeWidget === 'Luckywheel' ? 'Active' : ''}`, "data-app": "Luckywheel", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, luckywheelItem)), this.getChallengeTile(), h("button", { class: `Tile Reward Freespins ${this.activeWidget === 'Freespins' ? 'Active' : ''}`, "data-app": "Freespins", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, freespinsItem)))));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
CasinoEngagementSuiteBar.style = casinoEngagementSuiteBarCss;
|
|
77
|
+
|
|
78
|
+
var ChallengeLevelProgressStatus;
|
|
79
|
+
(function (ChallengeLevelProgressStatus) {
|
|
80
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
81
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
82
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
83
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
84
|
+
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
85
|
+
var ChallengeProgressStatus;
|
|
86
|
+
(function (ChallengeProgressStatus) {
|
|
87
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
88
|
+
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
89
|
+
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
90
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
91
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
92
|
+
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
93
|
+
|
|
94
|
+
function getDeviceType() {
|
|
95
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
96
|
+
const width = screen.availWidth;
|
|
97
|
+
const height = screen.availHeight;
|
|
98
|
+
if (userAgent.includes('iphone')) {
|
|
99
|
+
return 'Mobile';
|
|
100
|
+
}
|
|
101
|
+
if (userAgent.includes('ipad')) {
|
|
102
|
+
return 'Tablet';
|
|
103
|
+
}
|
|
104
|
+
if (userAgent.includes('android')) {
|
|
105
|
+
if (height > width && width < 800) {
|
|
106
|
+
return 'Mobile';
|
|
107
|
+
}
|
|
108
|
+
if (width > height && height < 800) {
|
|
109
|
+
return 'Tablet';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return 'Desktop';
|
|
113
|
+
}
|
|
114
|
+
function getScreenOrientation() {
|
|
115
|
+
const orientation = window.screen.orientation.type;
|
|
116
|
+
return orientation.includes('portrait') ? 'Portrait' : 'Landscape';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const casinoEngagementSuiteContainerCss = ":host{display:inline-block;font-family:inherit}.Backdrop{padding:20px 20px 20px 172px;display:none;position:fixed;inset:0;height:100dvh;width:100vw}.Backdrop.Opened{display:block}.Backdrop .CasinoEngagementSuiteDialog{height:calc(100dvh - 40px);max-width:600px}.CasinoEngagementSuiteContainer.Portrait{width:100vw}.CasinoEngagementSuiteContainer.Portrait .Backdrop{padding:104px 0 20px}.CasinoEngagementSuiteContainer.Portrait .Backdrop .CasinoEngagementSuiteDialog{max-width:initial;padding:0 4px;margin:0 auto;height:calc(100dvh - 124px)}.CasinoEngagementSuiteContainer.Landscape.Mobile .CasinoEngagementSuiteDialog{max-width:366px}";
|
|
120
|
+
|
|
121
|
+
const CasinoEngagementSuiteContainer = class {
|
|
122
|
+
constructor(hostRef) {
|
|
123
|
+
registerInstance(this, hostRef);
|
|
124
|
+
/**
|
|
125
|
+
* Client custom styling via string
|
|
126
|
+
*/
|
|
127
|
+
this.clientStyling = '';
|
|
128
|
+
/**
|
|
129
|
+
* Client custom styling via url
|
|
130
|
+
*/
|
|
131
|
+
this.clientStylingUrl = '';
|
|
132
|
+
this.orientation = 'Landscape';
|
|
133
|
+
this.device = 'Mobile';
|
|
134
|
+
this.showChallengesList = false;
|
|
135
|
+
this.limitStylingAppends = false;
|
|
136
|
+
this.handleChallengeListClose = () => {
|
|
137
|
+
this.showChallengesList = false;
|
|
138
|
+
this.activeWidget = '';
|
|
139
|
+
};
|
|
140
|
+
this.orientationChangeHandler = () => {
|
|
141
|
+
this.orientation = getScreenOrientation();
|
|
142
|
+
};
|
|
143
|
+
this.setClientStyling = () => {
|
|
144
|
+
let sheet = document.createElement('style');
|
|
145
|
+
sheet.innerHTML = this.clientStyling;
|
|
146
|
+
this.host.prepend(sheet);
|
|
147
|
+
};
|
|
148
|
+
this.setClientStylingURL = () => {
|
|
149
|
+
let url = new URL(this.clientStylingUrl);
|
|
150
|
+
let cssFile = document.createElement('style');
|
|
151
|
+
fetch(url.href)
|
|
152
|
+
.then((res) => res.text())
|
|
153
|
+
.then((data) => {
|
|
154
|
+
cssFile.innerHTML = data;
|
|
155
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
156
|
+
})
|
|
157
|
+
.catch((err) => {
|
|
158
|
+
console.log('Error ', err);
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
handleEvent(e) {
|
|
163
|
+
const type = e.data.type;
|
|
164
|
+
switch (type) {
|
|
165
|
+
case 'ChallengeHasExpired': {
|
|
166
|
+
this.setChallengePercent();
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case 'BarChallengesClick': {
|
|
170
|
+
this.showChallengesList = true;
|
|
171
|
+
this.activeWidget = 'Challenges';
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case 'UpdateChallengeProgress': {
|
|
175
|
+
this.updateChallengeProgress(e.data.data);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
componentDidLoad() {
|
|
180
|
+
this.orientation = getScreenOrientation();
|
|
181
|
+
this.device = getDeviceType();
|
|
182
|
+
window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
|
|
183
|
+
}
|
|
184
|
+
componentDidRender() {
|
|
185
|
+
// start custom styling area
|
|
186
|
+
if (!this.limitStylingAppends && this.host) {
|
|
187
|
+
if (this.clientStyling)
|
|
188
|
+
this.setClientStyling();
|
|
189
|
+
if (this.clientStylingUrl)
|
|
190
|
+
this.setClientStylingURL();
|
|
191
|
+
this.limitStylingAppends = true;
|
|
192
|
+
}
|
|
193
|
+
// end custom styling area
|
|
194
|
+
}
|
|
195
|
+
disconnectedCallback() {
|
|
196
|
+
window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Called to initialize widget
|
|
200
|
+
* @param config
|
|
201
|
+
*/
|
|
202
|
+
async init(config) {
|
|
203
|
+
this.challenges = config.challenges;
|
|
204
|
+
this.setChallengePercent();
|
|
205
|
+
}
|
|
206
|
+
setChallengePercent() {
|
|
207
|
+
if (!this.challenges)
|
|
208
|
+
return;
|
|
209
|
+
const activeChallenge = this.challenges
|
|
210
|
+
.find(challenge => challenge.Status === ChallengeProgressStatus.InProgress);
|
|
211
|
+
if (activeChallenge) {
|
|
212
|
+
const activeLevel = activeChallenge.LevelProgresses
|
|
213
|
+
.find(progress => progress.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
214
|
+
if (activeLevel) {
|
|
215
|
+
this.challengePercent = `${activeLevel.ProgressPercentage}%`;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
this.challengePercent = '—';
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
updateChallengeProgress(data) {
|
|
223
|
+
var _a;
|
|
224
|
+
const challenge = (_a = this.challenges) === null || _a === void 0 ? void 0 : _a.find(challenge => challenge.Id === data.ChallengeId);
|
|
225
|
+
if (challenge) {
|
|
226
|
+
challenge.LevelProgresses = data.LevelProgresses;
|
|
227
|
+
this.challenges = [...this.challenges];
|
|
228
|
+
}
|
|
229
|
+
this.setChallengePercent();
|
|
230
|
+
}
|
|
231
|
+
getChallengesWidgets() {
|
|
232
|
+
return h("div", { class: this.showChallengesList ? 'Backdrop Opened' : 'Backdrop' }, h("casino-engagement-suite-challenges-list", { device: this.device, class: "CasinoEngagementSuiteDialog", onClose: this.handleChallengeListClose, challenges: this.challenges }));
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
return h("div", { class: `CasinoEngagementSuiteContainer ${this.device} ${this.orientation}` }, h("casino-engagement-suite-bar", { orientation: this.orientation, "active-widget": this.activeWidget, "challenge-percent": this.challengePercent }), this.challenges && this.getChallengesWidgets());
|
|
236
|
+
}
|
|
237
|
+
get host() { return getElement(this); }
|
|
238
|
+
};
|
|
239
|
+
CasinoEngagementSuiteContainer.style = casinoEngagementSuiteContainerCss;
|
|
240
|
+
|
|
241
|
+
export { CasinoEngagementSuiteBar as casino_engagement_suite_bar, CasinoEngagementSuiteContainer as casino_engagement_suite_container };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-fef3ac09.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
+
*/
|
|
6
|
+
const patchBrowser = () => {
|
|
7
|
+
const importMeta = import.meta.url;
|
|
8
|
+
const opts = {};
|
|
9
|
+
if (importMeta !== '') {
|
|
10
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
+
}
|
|
12
|
+
return promiseResolve(opts);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
patchBrowser().then(options => {
|
|
16
|
+
return bootstrapLazy([["casino-engagement-suite-bar_2",[[1,"casino-engagement-suite-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"orientation":[32],"device":[32],"showChallengesList":[32],"challengePercent":[32],"limitStylingAppends":[32],"activeWidget":[32],"challenges":[32],"init":[64]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-bar",{"activeWidget":[1537,"active-widget"],"challengePercent":[1,"challenge-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"orientation":[1],"limitStylingAppends":[32]}]]]], options);
|
|
17
|
+
});
|