@everymatrix/casino-challenges-container 0.6.10 → 0.6.12
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-challenges-container/casino-challenge-card_6.entry.js +1 -1
- package/dist/casino-challenges-container/casino-challenges-container-dbb852af.js +7 -0
- package/dist/casino-challenges-container/casino-challenges-container.esm.js +1 -1
- package/dist/casino-challenges-container/index-7720ad93.js +2 -0
- package/dist/casino-challenges-container/index.esm.js +1 -1
- package/dist/cjs/casino-challenge-card_6.cjs.entry.js +11 -5
- package/dist/cjs/{casino-challenges-container-259a8575.js → casino-challenges-container-a067bdf7.js} +1082 -14
- package/dist/cjs/casino-challenges-container.cjs.js +2 -2
- package/dist/cjs/{index-076c8c1d.js → index-d5f8d1ee.js} +2 -69
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +36 -23
- package/dist/esm/casino-challenge-card_6.entry.js +12 -6
- package/dist/esm/{casino-challenges-container-7a8a2af6.js → casino-challenges-container-dbb852af.js} +1082 -14
- package/dist/esm/casino-challenges-container.js +3 -3
- package/dist/esm/{index-889cb07d.js → index-7720ad93.js} +2 -69
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/casino-challenges-container/casino-challenges-container.d.ts +8 -2
- package/package.json +1 -1
- package/dist/casino-challenges-container/casino-challenges-container-7a8a2af6.js +0 -1
- package/dist/casino-challenges-container/index-889cb07d.js +0 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-d5f8d1ee.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["casino-challenge-card_6.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32]
|
|
22
|
+
return index.bootstrapLazy([["casino-challenge-card_6.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32],"sseConnection":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"userId":["handleSessionChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"],"activeTabIndex":[514,"active-tab-index"],"isUserAuthorized":[516,"is-user-authorized"],"userId":[513,"user-id"],"endpoint":[513],"domain":[513],"session":[513]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-player-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"playerHistory":[16],"loading":[516],"hasMore":[516,"has-more"],"openItems":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"playerHistory":["handlePlayerHistoryChange"]}],[1,"casino-challenges-claim-code",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"loading":[32],"hasError":[32],"code":[32],"notificationMessage":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"challenge":[16],"isUserAuthorized":[516,"is-user-authorized"],"activeTabIndex":[514,"active-tab-index"],"userId":[513,"user-id"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32],"isChallengePaused":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenge":["handleChallengeChange"]}],[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);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'casino-challenges-container';
|
|
24
|
-
const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener:
|
|
24
|
+
const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -106,22 +106,6 @@ var plt = {
|
|
|
106
106
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
107
107
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
108
108
|
};
|
|
109
|
-
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
110
|
-
let supportsListenerOptions2 = false;
|
|
111
|
-
try {
|
|
112
|
-
doc.addEventListener(
|
|
113
|
-
"e",
|
|
114
|
-
null,
|
|
115
|
-
Object.defineProperty({}, "passive", {
|
|
116
|
-
get() {
|
|
117
|
-
supportsListenerOptions2 = true;
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
);
|
|
121
|
-
} catch (e) {
|
|
122
|
-
}
|
|
123
|
-
return supportsListenerOptions2;
|
|
124
|
-
})();
|
|
125
109
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
126
110
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
127
111
|
try {
|
|
@@ -776,13 +760,6 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
776
760
|
}
|
|
777
761
|
let maybePromise;
|
|
778
762
|
if (isInitialLoad) {
|
|
779
|
-
{
|
|
780
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
781
|
-
if (hostRef.$queuedListeners$) {
|
|
782
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
783
|
-
hostRef.$queuedListeners$ = void 0;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
763
|
{
|
|
787
764
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
788
765
|
}
|
|
@@ -1117,7 +1094,6 @@ var connectedCallback = (elm) => {
|
|
|
1117
1094
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1118
1095
|
}
|
|
1119
1096
|
} else {
|
|
1120
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1121
1097
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1122
1098
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1123
1099
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1135,12 +1111,6 @@ var disconnectInstance = (instance) => {
|
|
|
1135
1111
|
var disconnectedCallback = async (elm) => {
|
|
1136
1112
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1137
1113
|
const hostRef = getHostRef(elm);
|
|
1138
|
-
{
|
|
1139
|
-
if (hostRef.$rmListeners$) {
|
|
1140
|
-
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1141
|
-
hostRef.$rmListeners$ = void 0;
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
1114
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1145
1115
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
1146
1116
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1180,9 +1150,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1180
1150
|
{
|
|
1181
1151
|
cmpMeta.$members$ = compactMeta[2];
|
|
1182
1152
|
}
|
|
1183
|
-
{
|
|
1184
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1185
|
-
}
|
|
1186
1153
|
{
|
|
1187
1154
|
cmpMeta.$attrsToReflect$ = [];
|
|
1188
1155
|
}
|
|
@@ -1214,10 +1181,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1214
1181
|
}
|
|
1215
1182
|
}
|
|
1216
1183
|
connectedCallback() {
|
|
1217
|
-
|
|
1184
|
+
getHostRef(this);
|
|
1218
1185
|
if (!this.hasRegisteredEventListeners) {
|
|
1219
1186
|
this.hasRegisteredEventListeners = true;
|
|
1220
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1221
1187
|
}
|
|
1222
1188
|
if (appLoadFallback) {
|
|
1223
1189
|
clearTimeout(appLoadFallback);
|
|
@@ -1272,39 +1238,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1272
1238
|
}
|
|
1273
1239
|
endBootstrap();
|
|
1274
1240
|
};
|
|
1275
|
-
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1276
|
-
if (listeners) {
|
|
1277
|
-
listeners.map(([flags, name, method]) => {
|
|
1278
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
1279
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1280
|
-
const opts = hostListenerOpts(flags);
|
|
1281
|
-
plt.ael(target, name, handler, opts);
|
|
1282
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1283
|
-
});
|
|
1284
|
-
}
|
|
1285
|
-
};
|
|
1286
|
-
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1287
|
-
var _a;
|
|
1288
|
-
try {
|
|
1289
|
-
{
|
|
1290
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1291
|
-
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1292
|
-
} else {
|
|
1293
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
} catch (e) {
|
|
1297
|
-
consoleError(e);
|
|
1298
|
-
}
|
|
1299
|
-
};
|
|
1300
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1301
|
-
if (flags & 8 /* TargetWindow */) return win;
|
|
1302
|
-
return elm;
|
|
1303
|
-
};
|
|
1304
|
-
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1305
|
-
passive: (flags & 1 /* Passive */) !== 0,
|
|
1306
|
-
capture: (flags & 2 /* Capture */) !== 0
|
|
1307
|
-
} : (flags & 2 /* Capture */) !== 0;
|
|
1308
1241
|
|
|
1309
1242
|
// src/runtime/nonce.ts
|
|
1310
1243
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengesContainer = require('./casino-challenges-container-
|
|
6
|
-
require('./index-
|
|
5
|
+
const casinoChallengesContainer = require('./casino-challenges-container-a067bdf7.js');
|
|
6
|
+
require('./index-d5f8d1ee.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-d5f8d1ee.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["casino-challenge-card_6.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32]
|
|
11
|
+
return index.bootstrapLazy([["casino-challenge-card_6.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32],"sseConnection":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"userId":["handleSessionChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"],"activeTabIndex":[514,"active-tab-index"],"isUserAuthorized":[516,"is-user-authorized"],"userId":[513,"user-id"],"endpoint":[513],"domain":[513],"session":[513]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-player-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"playerHistory":[16],"loading":[516],"hasMore":[516,"has-more"],"openItems":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"playerHistory":["handlePlayerHistoryChange"]}],[1,"casino-challenges-claim-code",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"loading":[32],"hasError":[32],"code":[32],"notificationMessage":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"challenge":[16],"isUserAuthorized":[516,"is-user-authorized"],"activeTabIndex":[514,"active-tab-index"],"userId":[513,"user-id"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32],"isChallengePaused":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenge":["handleChallengeChange"]}],[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
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
package/dist/collection/components/casino-challenges-container/casino-challenges-container.js
CHANGED
|
@@ -10,8 +10,11 @@ import "../../../../../casino-challenges-list/dist/types/index";
|
|
|
10
10
|
import "../../../../../casino-challenges-player-history/dist/types/index";
|
|
11
11
|
import "../../../../../casino-challenges-claim-code/dist/types/index";
|
|
12
12
|
import { updateInState, updateInStateByChallengeId } from "../../utils/utils";
|
|
13
|
+
import { EventSourcePolyfill } from "event-source-polyfill";
|
|
13
14
|
export class CasinoChallengesContainer {
|
|
14
15
|
constructor() {
|
|
16
|
+
this.activeProgressTabIndex = 0;
|
|
17
|
+
this.pendingProgressTabIndex = 1;
|
|
15
18
|
this.onOpenNotification = (event) => {
|
|
16
19
|
this.notification = event.detail;
|
|
17
20
|
setTimeout(() => (this.notification = null), 10000);
|
|
@@ -30,7 +33,7 @@ export class CasinoChallengesContainer {
|
|
|
30
33
|
};
|
|
31
34
|
this.onLoadMore = () => {
|
|
32
35
|
this.pageNumber += 1;
|
|
33
|
-
this.getChallenges().then((res) => {
|
|
36
|
+
this.getChallenges(this.activeTabIndex).then((res) => {
|
|
34
37
|
this.total = res.TotalCount;
|
|
35
38
|
switch (this.activeTabIndex) {
|
|
36
39
|
case 0:
|
|
@@ -51,7 +54,7 @@ export class CasinoChallengesContainer {
|
|
|
51
54
|
this.activeTabIndex = index;
|
|
52
55
|
this.pageNumber = 0;
|
|
53
56
|
this.total = 0;
|
|
54
|
-
this.loadData();
|
|
57
|
+
this.loadData(index);
|
|
55
58
|
}
|
|
56
59
|
};
|
|
57
60
|
this.renderNotification = () => {
|
|
@@ -96,6 +99,7 @@ export class CasinoChallengesContainer {
|
|
|
96
99
|
this.total = 0;
|
|
97
100
|
this.pageSize = 20;
|
|
98
101
|
this.notification = null;
|
|
102
|
+
this.sseConnection = undefined;
|
|
99
103
|
}
|
|
100
104
|
get tabs() {
|
|
101
105
|
var _a, _b;
|
|
@@ -106,15 +110,29 @@ export class CasinoChallengesContainer {
|
|
|
106
110
|
{ label: translate('code', this.language) }
|
|
107
111
|
];
|
|
108
112
|
}
|
|
113
|
+
connectGameToLiveLobby() {
|
|
114
|
+
if (EventSource && !this.sseConnection) {
|
|
115
|
+
const updateUrl = `${this.endpoint}/v1/encoder/challenges/*/update`;
|
|
116
|
+
this.sseConnection = new EventSourcePolyfill(updateUrl);
|
|
117
|
+
this.sseConnection.addEventListener('message', this.handleEvent);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
disconnectGameFromLiveLobby() {
|
|
121
|
+
if (this.sseConnection) {
|
|
122
|
+
this.sseConnection.removeEventListener('message');
|
|
123
|
+
this.sseConnection.close();
|
|
124
|
+
this.sseConnection = undefined;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
109
127
|
handleEvent(e) {
|
|
110
128
|
const { data } = e === null || e === void 0 ? void 0 : e.data;
|
|
111
129
|
switch (data === null || data === void 0 ? void 0 : data.messageType) {
|
|
112
130
|
case 'newProgressNotification': {
|
|
113
131
|
const newChallengeProgress = data === null || data === void 0 ? void 0 : data.challengeProgress;
|
|
114
|
-
if (
|
|
132
|
+
if (newChallengeProgress.Status === EChallengeProgressStatus.Started) {
|
|
115
133
|
this.activeChallenges = [newChallengeProgress, ...this.activeChallenges];
|
|
116
134
|
}
|
|
117
|
-
else if (
|
|
135
|
+
else if (newChallengeProgress.Status === EChallengeProgressStatus.Awaiting) {
|
|
118
136
|
this.pendingChallenges = [newChallengeProgress, ...this.pendingChallenges];
|
|
119
137
|
}
|
|
120
138
|
break;
|
|
@@ -181,14 +199,14 @@ export class CasinoChallengesContainer {
|
|
|
181
199
|
}
|
|
182
200
|
handleSessionChange(newValue, oldValue) {
|
|
183
201
|
if (newValue != oldValue) {
|
|
184
|
-
this.loadData();
|
|
202
|
+
this.loadData(this.activeTabIndex);
|
|
185
203
|
}
|
|
186
204
|
}
|
|
187
|
-
async getChallenges() {
|
|
205
|
+
async getChallenges(tabIndex) {
|
|
188
206
|
if (!this.checkAttrs()) {
|
|
189
|
-
const path =
|
|
207
|
+
const path = tabIndex === 2 ? 'PlayerHistory' : 'GetChallengesInfo';
|
|
190
208
|
const url = `${this.endpoint}/challenge/${path}`;
|
|
191
|
-
const body = Object.assign(Object.assign(Object.assign({ DomainId: this.domain, PlayerLanguage: this.language, PageNumber: this.pageNumber, PageSize: this.pageSize }, (this.session && { PlayerSession: this.session })), (this.userId &&
|
|
209
|
+
const body = Object.assign(Object.assign(Object.assign({ DomainId: this.domain, PlayerLanguage: this.language, PageNumber: this.pageNumber, PageSize: this.pageSize }, (this.session && { PlayerSession: this.session })), (this.userId && tabIndex === 2 && { UserId: this.userId })), (this.session && { IsFutureAvailable: tabIndex === 0 ? false : true }));
|
|
192
210
|
this.loading = true;
|
|
193
211
|
return fetch(url, {
|
|
194
212
|
method: 'POST',
|
|
@@ -201,12 +219,12 @@ export class CasinoChallengesContainer {
|
|
|
201
219
|
.finally(() => (this.loading = false));
|
|
202
220
|
}
|
|
203
221
|
}
|
|
204
|
-
loadData() {
|
|
205
|
-
this.getChallenges().then((res) => {
|
|
222
|
+
loadData(tabIndex) {
|
|
223
|
+
this.getChallenges(tabIndex).then((res) => {
|
|
206
224
|
if (res === null || res === void 0 ? void 0 : res.Success) {
|
|
207
225
|
this.pageNumber = res.PageNumber;
|
|
208
226
|
this.total = res.TotalCount;
|
|
209
|
-
switch (
|
|
227
|
+
switch (tabIndex) {
|
|
210
228
|
case 0:
|
|
211
229
|
this.activeChallenges = res.Data;
|
|
212
230
|
break;
|
|
@@ -229,15 +247,18 @@ export class CasinoChallengesContainer {
|
|
|
229
247
|
if (this.clientStylingUrl)
|
|
230
248
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
231
249
|
}
|
|
232
|
-
this.loadData();
|
|
250
|
+
this.loadData(this.activeProgressTabIndex);
|
|
251
|
+
this.loadData(this.pendingProgressTabIndex);
|
|
233
252
|
}
|
|
234
253
|
disconnectedCallback() {
|
|
235
254
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
255
|
+
this.disconnectGameFromLiveLobby();
|
|
236
256
|
}
|
|
237
257
|
componentWillLoad() {
|
|
238
258
|
if (this.translationUrl) {
|
|
239
259
|
resolveTranslationUrl(this.translationUrl);
|
|
240
260
|
}
|
|
261
|
+
this.connectGameToLiveLobby();
|
|
241
262
|
}
|
|
242
263
|
renderChallengesContent() {
|
|
243
264
|
var _a, _b, _c;
|
|
@@ -253,7 +274,7 @@ export class CasinoChallengesContainer {
|
|
|
253
274
|
}
|
|
254
275
|
}
|
|
255
276
|
render() {
|
|
256
|
-
return (h("div", { key: '
|
|
277
|
+
return (h("div", { key: '36461cd1f1f59990657e39d336140f09ae7438cb', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '4669ebf93f74cd0d656aca08c3f9e0d326db4c3b', class: "challenges" }, h("div", { key: '995286f02b8270df171bdee774fd0fe5a308f617', class: "challenges__header" }, h("h1", { key: 'a8314d3f965fbf76e9d2b74605b5f1ab540147fe', class: "challenges__title" }, h("img", { key: '9a86217ff12d13c25455f8488767a42b0cc0ad15', src: titleIcon, alt: "icon" }), translate('title', this.language)), this.session && (h("div", { key: '94ce45066f951413fccceb22178396e1ab60dd4a', class: "challenges__tabs" }, this.tabs.map((tab, index) => (h("div", { class: `challenges__tab ${index === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index) }, tab.label, (tab === null || tab === void 0 ? void 0 : tab.showNotification) && h("img", { src: notificationIcon }))))))), this.renderChallengesContent(), this.notification && this.renderNotification())));
|
|
257
278
|
}
|
|
258
279
|
static get is() { return "casino-challenges-container"; }
|
|
259
280
|
static get encapsulation() { return "shadow"; }
|
|
@@ -442,7 +463,8 @@ export class CasinoChallengesContainer {
|
|
|
442
463
|
"pageNumber": {},
|
|
443
464
|
"total": {},
|
|
444
465
|
"pageSize": {},
|
|
445
|
-
"notification": {}
|
|
466
|
+
"notification": {},
|
|
467
|
+
"sseConnection": {}
|
|
446
468
|
};
|
|
447
469
|
}
|
|
448
470
|
static get watchers() {
|
|
@@ -460,13 +482,4 @@ export class CasinoChallengesContainer {
|
|
|
460
482
|
"methodName": "handleSessionChange"
|
|
461
483
|
}];
|
|
462
484
|
}
|
|
463
|
-
static get listeners() {
|
|
464
|
-
return [{
|
|
465
|
-
"name": "message",
|
|
466
|
-
"method": "handleEvent",
|
|
467
|
-
"target": "window",
|
|
468
|
-
"capture": false,
|
|
469
|
-
"passive": false
|
|
470
|
-
}];
|
|
471
|
-
}
|
|
472
485
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
2
|
-
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-container-
|
|
3
|
-
export { C as casino_challenges_container } from './casino-challenges-container-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7720ad93.js';
|
|
2
|
+
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-container-dbb852af.js';
|
|
3
|
+
export { C as casino_challenges_container } from './casino-challenges-container-dbb852af.js';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_LANGUAGE$3 = 'en';
|
|
6
6
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
@@ -420,7 +420,10 @@ const CasinoChallengeCard = class {
|
|
|
420
420
|
get getChallengeProgress() {
|
|
421
421
|
var _a;
|
|
422
422
|
const currLevel = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.ProgressStatus === EChallengeProgressLevelStatus.InProgress);
|
|
423
|
-
if (this.
|
|
423
|
+
if (this.challenge.Status === EChallengeProgressStatus.Awaiting ||
|
|
424
|
+
this.isChallengePaused ||
|
|
425
|
+
!this.isUserAuthorized ||
|
|
426
|
+
!currLevel)
|
|
424
427
|
return null;
|
|
425
428
|
const { Status, LevelProgresses } = this.challenge;
|
|
426
429
|
if (Status === EChallengeProgressStatus.Expired || Status === EChallengeProgressStatus.Started) {
|
|
@@ -430,7 +433,7 @@ const CasinoChallengeCard = class {
|
|
|
430
433
|
? translate$3('suspended', this.language)
|
|
431
434
|
: Status === EChallengeProgressStatus.Completed
|
|
432
435
|
? translate$3('finished', this.language)
|
|
433
|
-
: `${currLevel.ProgressPercentage}%`;
|
|
436
|
+
: `${Math.floor(currLevel.ProgressPercentage)}%`;
|
|
434
437
|
const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
|
|
435
438
|
const secondImgSrc = Status === EChallengeProgressStatus.Completed ? trophySvg : isLastLevel ? finishSvg : '';
|
|
436
439
|
return (h("div", { class: {
|
|
@@ -486,7 +489,10 @@ const CasinoChallengeCard = class {
|
|
|
486
489
|
}
|
|
487
490
|
render() {
|
|
488
491
|
var _a, _b, _c, _d;
|
|
489
|
-
return (h("div", { key: '
|
|
492
|
+
return (h("div", { key: 'a8b468aad3cb631bb0ceeb7abf98a631ca9e82a3', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'd46bebe148e42f472bdb80d10927a610002d4a21', class: "card", onClick: this.goToDetailsPage }, h("img", { key: 'ee25cbee3f2c66c613efdd569d0a4c59ae1e9a5c', class: {
|
|
493
|
+
card__image: true,
|
|
494
|
+
grayed: !!this.isChallengeGrayed || this.challenge.Status === EChallengeProgressStatus.Awaiting
|
|
495
|
+
}, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.BannerUrl }), this.getCardBadge, this.challenge.IsNew && this.renderNewLabel(), h("div", { key: '1a94d3d49b3f99c1aecac603374320443fe331b9', class: "card__content" }, h("h1", { key: '4baa18915102c69b471575279e4b4b0d52d33fc9', class: "card__title" }, (_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 : _d.PresentationName), this.getChallengeProgress, this.infoItems.map((x, index) => this.renderInfoItem(x, index)), this.getCardButton))));
|
|
490
496
|
}
|
|
491
497
|
static get watchers() { return {
|
|
492
498
|
"clientStyling": ["handleClientStylingChange"],
|