@everymatrix/casino-challenges-container 0.13.16 → 0.13.18
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-0c0c6b32.js +7 -0
- package/dist/casino-challenges-container/casino-challenges-container.esm.js +1 -1
- package/dist/casino-challenges-container/index.esm.js +1 -1
- package/dist/cjs/casino-challenge-card_6.cjs.entry.js +126 -31
- package/dist/cjs/{casino-challenges-container-210b7c83.js → casino-challenges-container-eea36ec5.js} +67 -36
- package/dist/cjs/casino-challenges-container.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +58 -38
- package/dist/collection/utils/locale.utils.js +1 -0
- package/dist/collection/utils/types.js +11 -0
- package/dist/esm/casino-challenge-card_6.entry.js +127 -32
- package/dist/esm/{casino-challenges-container-aaaa71b2.js → casino-challenges-container-0c0c6b32.js} +67 -36
- package/dist/esm/casino-challenges-container.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/casino-challenges-container/casino-challenges-container.d.ts +4 -5
- package/dist/types/utils/types.d.ts +15 -1
- package/package.json +1 -1
- package/dist/casino-challenges-container/casino-challenges-container-aaaa71b2.js +0 -7
package/dist/cjs/{casino-challenges-container-210b7c83.js → casino-challenges-container-eea36ec5.js}
RENAMED
|
@@ -124,6 +124,7 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
124
124
|
const TRANSLATIONS = {
|
|
125
125
|
en: {
|
|
126
126
|
containerTitle: 'Challenges',
|
|
127
|
+
promoTab: 'Promo',
|
|
127
128
|
active: 'Active',
|
|
128
129
|
activeTab: 'Active tab',
|
|
129
130
|
pendingTab: 'Pending',
|
|
@@ -206,6 +207,9 @@ var EChallengeTriggerType;
|
|
|
206
207
|
EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
|
|
207
208
|
EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
|
|
208
209
|
EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
|
|
210
|
+
EChallengeTriggerType[EChallengeTriggerType["Claim"] = 3] = "Claim";
|
|
211
|
+
EChallengeTriggerType[EChallengeTriggerType["Event"] = 4] = "Event";
|
|
212
|
+
EChallengeTriggerType[EChallengeTriggerType["Deposit"] = 5] = "Deposit";
|
|
209
213
|
})(EChallengeTriggerType || (EChallengeTriggerType = {}));
|
|
210
214
|
var EChallengeValidityType;
|
|
211
215
|
(function (EChallengeValidityType) {
|
|
@@ -226,6 +230,14 @@ var EHistoryItemLevelStatus;
|
|
|
226
230
|
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
|
|
227
231
|
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
|
|
228
232
|
})(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
|
|
233
|
+
var EChallengesTabs;
|
|
234
|
+
(function (EChallengesTabs) {
|
|
235
|
+
EChallengesTabs[EChallengesTabs["Promo"] = 0] = "Promo";
|
|
236
|
+
EChallengesTabs[EChallengesTabs["Active"] = 1] = "Active";
|
|
237
|
+
EChallengesTabs[EChallengesTabs["Pending"] = 2] = "Pending";
|
|
238
|
+
EChallengesTabs[EChallengesTabs["Finished"] = 3] = "Finished";
|
|
239
|
+
EChallengesTabs[EChallengesTabs["Code"] = 4] = "Code";
|
|
240
|
+
})(EChallengesTabs || (EChallengesTabs = {}));
|
|
229
241
|
|
|
230
242
|
function updateInState(array, id, updates) {
|
|
231
243
|
return array.map((el) => (el.Id === id ? Object.assign(Object.assign({}, el), updates) : el));
|
|
@@ -1288,8 +1300,6 @@ const CasinoChallengesContainerStyle0 = casinoChallengesContainerCss;
|
|
|
1288
1300
|
const CasinoChallengesContainer = class {
|
|
1289
1301
|
constructor(hostRef) {
|
|
1290
1302
|
index.registerInstance(this, hostRef);
|
|
1291
|
-
this.activeProgressTabIndex = 0;
|
|
1292
|
-
this.pendingProgressTabIndex = 1;
|
|
1293
1303
|
this.onOpenNotification = (event) => {
|
|
1294
1304
|
this.notification = event.detail;
|
|
1295
1305
|
setTimeout(() => (this.notification = null), 10000);
|
|
@@ -1309,16 +1319,22 @@ const CasinoChallengesContainer = class {
|
|
|
1309
1319
|
this.onLoadMore = () => {
|
|
1310
1320
|
this.pageNumber += 1;
|
|
1311
1321
|
this.getChallenges(this.activeTabIndex).then((res) => {
|
|
1312
|
-
this.total = res.TotalCount;
|
|
1313
1322
|
switch (this.activeTabIndex) {
|
|
1314
|
-
case
|
|
1323
|
+
case EChallengesTabs.Promo:
|
|
1324
|
+
this.promoChallenges = [...this.promoChallenges, ...res.Data];
|
|
1325
|
+
this.hasMore = this.promoChallenges.length < res.TotalCount;
|
|
1326
|
+
break;
|
|
1327
|
+
case EChallengesTabs.Active:
|
|
1315
1328
|
this.activeChallenges = [...this.activeChallenges, ...res.Data];
|
|
1329
|
+
this.hasMore = this.activeChallenges.length < res.TotalCount;
|
|
1316
1330
|
break;
|
|
1317
|
-
case
|
|
1331
|
+
case EChallengesTabs.Pending:
|
|
1318
1332
|
this.pendingChallenges = [...this.pendingChallenges, ...res.Data];
|
|
1333
|
+
this.hasMore = this.pendingChallenges.length < res.TotalCount;
|
|
1319
1334
|
break;
|
|
1320
|
-
case
|
|
1335
|
+
case EChallengesTabs.Finished:
|
|
1321
1336
|
this.playerHistory = [...this.playerHistory, ...res.Data];
|
|
1337
|
+
this.hasMore = this.playerHistory.length < res.TotalItem;
|
|
1322
1338
|
break;
|
|
1323
1339
|
}
|
|
1324
1340
|
});
|
|
@@ -1328,17 +1344,19 @@ const CasinoChallengesContainer = class {
|
|
|
1328
1344
|
this.notification = null;
|
|
1329
1345
|
this.activeTabIndex = index;
|
|
1330
1346
|
this.pageNumber = 0;
|
|
1331
|
-
this.
|
|
1332
|
-
|
|
1347
|
+
this.hasMore = true;
|
|
1348
|
+
if (index !== EChallengesTabs.Code) {
|
|
1349
|
+
this.loadData(index);
|
|
1350
|
+
}
|
|
1333
1351
|
}
|
|
1334
1352
|
};
|
|
1335
1353
|
this.renderNotification = () => {
|
|
1336
|
-
return (index.h("div", { class: `notification ${this.notification.errored ? 'errored' : ''}` }, index.h("img", { src: this.notification.errored ? errorCircleSvg : checkCircleSvg, class: "notification__icon" }), index.h("p", { class: "notification__message" }, this.notification.message + ' ', this.notification.showTabLink && (index.h("span", { class: "active-tab", onClick: this.handleTabClick(
|
|
1354
|
+
return (index.h("div", { class: `notification ${this.notification.errored ? 'errored' : ''}` }, index.h("img", { src: this.notification.errored ? errorCircleSvg : checkCircleSvg, class: "notification__icon" }), index.h("p", { class: "notification__message" }, this.notification.message + ' ', this.notification.showTabLink && (index.h("span", { class: "active-tab", onClick: this.handleTabClick(EChallengesTabs.Active) }, translate('activeTab', this.language))))));
|
|
1337
1355
|
};
|
|
1338
1356
|
this.onTimerExpired = (e) => {
|
|
1339
1357
|
const currentTabIndex = this.activeTabIndex;
|
|
1340
1358
|
setTimeout(() => {
|
|
1341
|
-
if (currentTabIndex ===
|
|
1359
|
+
if (currentTabIndex === EChallengesTabs.Active) {
|
|
1342
1360
|
this.activeChallenges = this.activeChallenges.filter((challenge) => challenge.Id !== e.detail);
|
|
1343
1361
|
}
|
|
1344
1362
|
else {
|
|
@@ -1347,7 +1365,7 @@ const CasinoChallengesContainer = class {
|
|
|
1347
1365
|
}, 10000);
|
|
1348
1366
|
};
|
|
1349
1367
|
this.onItemViewed = (e) => {
|
|
1350
|
-
if (this.activeTabIndex ===
|
|
1368
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
1351
1369
|
this.activeChallenges = updateInState(this.activeChallenges, e.detail, { IsNew: false });
|
|
1352
1370
|
}
|
|
1353
1371
|
else {
|
|
@@ -1363,15 +1381,16 @@ const CasinoChallengesContainer = class {
|
|
|
1363
1381
|
this.domain = '';
|
|
1364
1382
|
this.session = '';
|
|
1365
1383
|
this.userId = '';
|
|
1366
|
-
this.activeTabIndex =
|
|
1384
|
+
this.activeTabIndex = EChallengesTabs.Active;
|
|
1367
1385
|
this.error = '';
|
|
1368
1386
|
this.hasError = false;
|
|
1387
|
+
this.promoChallenges = [];
|
|
1369
1388
|
this.activeChallenges = [];
|
|
1370
1389
|
this.pendingChallenges = [];
|
|
1371
1390
|
this.playerHistory = [];
|
|
1372
1391
|
this.loading = false;
|
|
1373
1392
|
this.pageNumber = 0;
|
|
1374
|
-
this.
|
|
1393
|
+
this.hasMore = false;
|
|
1375
1394
|
this.pageSize = 20;
|
|
1376
1395
|
this.notification = null;
|
|
1377
1396
|
this.sseConnection = undefined;
|
|
@@ -1379,6 +1398,7 @@ const CasinoChallengesContainer = class {
|
|
|
1379
1398
|
get tabs() {
|
|
1380
1399
|
var _a, _b;
|
|
1381
1400
|
return [
|
|
1401
|
+
{ label: translate('promoTab', this.language) },
|
|
1382
1402
|
{ label: translate('active', this.language), showNotification: (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.some((x) => x.IsNew) },
|
|
1383
1403
|
{ label: translate('pendingTab', this.language), showNotification: (_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.some((x) => x.IsNew) },
|
|
1384
1404
|
{ label: translate('finishedTab', this.language) },
|
|
@@ -1419,13 +1439,13 @@ const CasinoChallengesContainer = class {
|
|
|
1419
1439
|
break;
|
|
1420
1440
|
}
|
|
1421
1441
|
case 'disabledChallengeNotification': {
|
|
1422
|
-
if (this.activeTabIndex ===
|
|
1442
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
1423
1443
|
this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
1424
1444
|
StatusName: 'Paused',
|
|
1425
1445
|
ChallengeStatus: EChallengeStatus.Paused
|
|
1426
1446
|
});
|
|
1427
1447
|
}
|
|
1428
|
-
else if (this.activeTabIndex ===
|
|
1448
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
1429
1449
|
this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
1430
1450
|
StatusName: 'Paused',
|
|
1431
1451
|
ChallengeStatus: EChallengeStatus.Paused
|
|
@@ -1434,13 +1454,13 @@ const CasinoChallengesContainer = class {
|
|
|
1434
1454
|
break;
|
|
1435
1455
|
}
|
|
1436
1456
|
case 'enabledChallengeNotification': {
|
|
1437
|
-
if (this.activeTabIndex ===
|
|
1457
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
1438
1458
|
this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
1439
1459
|
StatusName: 'Enabled',
|
|
1440
1460
|
ChallengeStatus: EChallengeStatus.Enabled
|
|
1441
1461
|
});
|
|
1442
1462
|
}
|
|
1443
|
-
else if (this.activeTabIndex ===
|
|
1463
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
1444
1464
|
this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
1445
1465
|
StatusName: 'Enabled',
|
|
1446
1466
|
ChallengeStatus: EChallengeStatus.Enabled
|
|
@@ -1450,12 +1470,12 @@ const CasinoChallengesContainer = class {
|
|
|
1450
1470
|
}
|
|
1451
1471
|
case 'forfeitedChallengeProgressNotification': {
|
|
1452
1472
|
if (this.session) {
|
|
1453
|
-
if (this.activeTabIndex ===
|
|
1473
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
1454
1474
|
this.activeChallenges = updateInState(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
|
|
1455
1475
|
Status: EChallengeProgressStatus.Forfeited
|
|
1456
1476
|
});
|
|
1457
1477
|
}
|
|
1458
|
-
else if (this.activeTabIndex ===
|
|
1478
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
1459
1479
|
this.pendingChallenges = updateInState(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
|
|
1460
1480
|
Status: EChallengeProgressStatus.Forfeited
|
|
1461
1481
|
});
|
|
@@ -1491,9 +1511,9 @@ const CasinoChallengesContainer = class {
|
|
|
1491
1511
|
}
|
|
1492
1512
|
async getChallenges(tabIndex) {
|
|
1493
1513
|
if (!this.checkAttrs()) {
|
|
1494
|
-
const path = tabIndex ===
|
|
1514
|
+
const path = tabIndex === EChallengesTabs.Finished ? 'PlayerHistory' : 'GetChallengesInfo';
|
|
1495
1515
|
const url = `${this.endpoint}/challenge/${path}`;
|
|
1496
|
-
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 ===
|
|
1516
|
+
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 === EChallengesTabs.Finished && { UserId: this.userId })), (this.session && { IsFutureAvailable: tabIndex !== EChallengesTabs.Active }));
|
|
1497
1517
|
this.loading = true;
|
|
1498
1518
|
return fetch(url, {
|
|
1499
1519
|
method: 'POST',
|
|
@@ -1510,16 +1530,22 @@ const CasinoChallengesContainer = class {
|
|
|
1510
1530
|
this.getChallenges(tabIndex).then((res) => {
|
|
1511
1531
|
if (res === null || res === void 0 ? void 0 : res.Success) {
|
|
1512
1532
|
this.pageNumber = res.PageNumber;
|
|
1513
|
-
this.total = res.TotalCount;
|
|
1514
1533
|
switch (tabIndex) {
|
|
1515
|
-
case
|
|
1534
|
+
case EChallengesTabs.Promo:
|
|
1535
|
+
this.promoChallenges = res.Data;
|
|
1536
|
+
this.hasMore = this.promoChallenges.length < res.TotalCount;
|
|
1537
|
+
break;
|
|
1538
|
+
case EChallengesTabs.Active:
|
|
1516
1539
|
this.activeChallenges = res.Data;
|
|
1540
|
+
this.hasMore = this.activeChallenges.length < res.TotalCount;
|
|
1517
1541
|
break;
|
|
1518
|
-
case
|
|
1542
|
+
case EChallengesTabs.Pending:
|
|
1519
1543
|
this.pendingChallenges = res.Data;
|
|
1544
|
+
this.hasMore = this.pendingChallenges.length < res.TotalCount;
|
|
1520
1545
|
break;
|
|
1521
|
-
case
|
|
1546
|
+
case EChallengesTabs.Finished:
|
|
1522
1547
|
this.playerHistory = res.Data;
|
|
1548
|
+
this.hasMore = this.playerHistory.length < res.TotalItem;
|
|
1523
1549
|
break;
|
|
1524
1550
|
}
|
|
1525
1551
|
}
|
|
@@ -1534,8 +1560,8 @@ const CasinoChallengesContainer = class {
|
|
|
1534
1560
|
if (this.clientStylingUrl)
|
|
1535
1561
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
1536
1562
|
}
|
|
1537
|
-
this.loadData(
|
|
1538
|
-
this.loadData(
|
|
1563
|
+
this.loadData(EChallengesTabs.Active);
|
|
1564
|
+
this.loadData(EChallengesTabs.Pending);
|
|
1539
1565
|
}
|
|
1540
1566
|
disconnectedCallback() {
|
|
1541
1567
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
@@ -1548,20 +1574,25 @@ const CasinoChallengesContainer = class {
|
|
|
1548
1574
|
this.connectGameToLiveLobby();
|
|
1549
1575
|
}
|
|
1550
1576
|
renderChallengesContent() {
|
|
1551
|
-
var _a, _b, _c;
|
|
1552
1577
|
switch (this.activeTabIndex) {
|
|
1553
|
-
case
|
|
1554
|
-
return (index.h("casino-challenges-list", { challenges: this.
|
|
1555
|
-
case
|
|
1556
|
-
return (index.h("casino-challenges-list", { challenges: this.
|
|
1557
|
-
case
|
|
1558
|
-
return (index.h("casino-challenges-
|
|
1559
|
-
case
|
|
1578
|
+
case EChallengesTabs.Promo:
|
|
1579
|
+
return (index.h("casino-challenges-list", { challenges: this.promoChallenges, onLoadMore: this.onLoadMore, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
1580
|
+
case EChallengesTabs.Active:
|
|
1581
|
+
return (index.h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
1582
|
+
case EChallengesTabs.Pending:
|
|
1583
|
+
return (index.h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
1584
|
+
case EChallengesTabs.Finished:
|
|
1585
|
+
return (index.h("casino-challenges-player-history", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: this.hasMore }));
|
|
1586
|
+
case EChallengesTabs.Code:
|
|
1560
1587
|
return (index.h("casino-challenges-claim-code", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, endpoint: this.endpoint, session: this.session, domain: this.domain, onOpenNotification: this.onOpenNotification }));
|
|
1561
1588
|
}
|
|
1562
1589
|
}
|
|
1563
1590
|
render() {
|
|
1564
|
-
return (index.h("div", { key: '
|
|
1591
|
+
return (index.h("div", { key: '03a7623f9cf348307d5030ced7a880868c2b06de', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'a91e6a5f3622523c7a857bdf29c31fe4e34590d5', class: "challenges" }, index.h("div", { key: '119677b5ef89f229848bc151ab04b97367ca7760', class: "challenges__header" }, index.h("h1", { key: '16d7a2c6bd3817542d9c9abc0c9228af5dc668f6', class: "challenges__title" }, index.h("img", { key: 'aafc5be41e382027b85651239671eb5b4acaa6fb', src: titleIconSvg, alt: "icon" }), translate('containerTitle', this.language)), this.session && (index.h("div", { key: '53ce6e0def0dab0e59ea3e8aa30f50a006667589', class: "challenges__tabs" }, this.tabs.map((tab, index$1) => {
|
|
1592
|
+
if (tab.label === EChallengesTabs[0])
|
|
1593
|
+
return;
|
|
1594
|
+
return (index.h("div", { class: `challenges__tab ${index$1 === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index$1) }, tab.label, (tab === null || tab === void 0 ? void 0 : tab.showNotification) && index.h("img", { src: notificationSvg })));
|
|
1595
|
+
})))), this.renderChallengesContent(), this.notification && this.renderNotification())));
|
|
1565
1596
|
}
|
|
1566
1597
|
static get watchers() { return {
|
|
1567
1598
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -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],"
|
|
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],"promoChallenges":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"hasMore":[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"],"activeChallengesTabIndex":[514,"active-challenges-tab-index"],"isUserAuthorized":[516,"is-user-authorized"],"userId":[513,"user-id"],"endpoint":[513],"domain":[513],"session":[513]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenges":["handleChallengesChange"]}],[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"],"activeChallengesTabIndex":[514,"active-challenges-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;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengesContainer = require('./casino-challenges-container-
|
|
5
|
+
const casinoChallengesContainer = require('./casino-challenges-container-eea36ec5.js');
|
|
6
6
|
require('./index-d5f8d1ee.js');
|
|
7
7
|
|
|
8
8
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
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],"
|
|
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],"promoChallenges":[32],"activeChallenges":[32],"pendingChallenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"hasMore":[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"],"activeChallengesTabIndex":[514,"active-challenges-tab-index"],"isUserAuthorized":[516,"is-user-authorized"],"userId":[513,"user-id"],"endpoint":[513],"domain":[513],"session":[513]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenges":["handleChallengesChange"]}],[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"],"activeChallengesTabIndex":[514,"active-challenges-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
|
@@ -5,7 +5,7 @@ import titleIcon from "../../assets/title-icon.svg";
|
|
|
5
5
|
import notificationIcon from "../../assets/notification.svg";
|
|
6
6
|
import errorIcon from "../../assets/error-circle.svg";
|
|
7
7
|
import checkIcon from "../../assets/check-circle.svg";
|
|
8
|
-
import { EChallengeProgressStatus, EChallengeStatus } from "../../utils/types";
|
|
8
|
+
import { EChallengeProgressStatus, EChallengesTabs, EChallengeStatus } from "../../utils/types";
|
|
9
9
|
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";
|
|
@@ -13,8 +13,6 @@ import { updateInState, updateInStateByChallengeId } from "../../utils/utils";
|
|
|
13
13
|
import { EventSourcePolyfill } from "event-source-polyfill";
|
|
14
14
|
export class CasinoChallengesContainer {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.activeProgressTabIndex = 0;
|
|
17
|
-
this.pendingProgressTabIndex = 1;
|
|
18
16
|
this.onOpenNotification = (event) => {
|
|
19
17
|
this.notification = event.detail;
|
|
20
18
|
setTimeout(() => (this.notification = null), 10000);
|
|
@@ -34,16 +32,22 @@ export class CasinoChallengesContainer {
|
|
|
34
32
|
this.onLoadMore = () => {
|
|
35
33
|
this.pageNumber += 1;
|
|
36
34
|
this.getChallenges(this.activeTabIndex).then((res) => {
|
|
37
|
-
this.total = res.TotalCount;
|
|
38
35
|
switch (this.activeTabIndex) {
|
|
39
|
-
case
|
|
36
|
+
case EChallengesTabs.Promo:
|
|
37
|
+
this.promoChallenges = [...this.promoChallenges, ...res.Data];
|
|
38
|
+
this.hasMore = this.promoChallenges.length < res.TotalCount;
|
|
39
|
+
break;
|
|
40
|
+
case EChallengesTabs.Active:
|
|
40
41
|
this.activeChallenges = [...this.activeChallenges, ...res.Data];
|
|
42
|
+
this.hasMore = this.activeChallenges.length < res.TotalCount;
|
|
41
43
|
break;
|
|
42
|
-
case
|
|
44
|
+
case EChallengesTabs.Pending:
|
|
43
45
|
this.pendingChallenges = [...this.pendingChallenges, ...res.Data];
|
|
46
|
+
this.hasMore = this.pendingChallenges.length < res.TotalCount;
|
|
44
47
|
break;
|
|
45
|
-
case
|
|
48
|
+
case EChallengesTabs.Finished:
|
|
46
49
|
this.playerHistory = [...this.playerHistory, ...res.Data];
|
|
50
|
+
this.hasMore = this.playerHistory.length < res.TotalItem;
|
|
47
51
|
break;
|
|
48
52
|
}
|
|
49
53
|
});
|
|
@@ -53,17 +57,19 @@ export class CasinoChallengesContainer {
|
|
|
53
57
|
this.notification = null;
|
|
54
58
|
this.activeTabIndex = index;
|
|
55
59
|
this.pageNumber = 0;
|
|
56
|
-
this.
|
|
57
|
-
|
|
60
|
+
this.hasMore = true;
|
|
61
|
+
if (index !== EChallengesTabs.Code) {
|
|
62
|
+
this.loadData(index);
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
};
|
|
60
66
|
this.renderNotification = () => {
|
|
61
|
-
return (h("div", { class: `notification ${this.notification.errored ? 'errored' : ''}` }, h("img", { src: this.notification.errored ? errorIcon : checkIcon, class: "notification__icon" }), h("p", { class: "notification__message" }, this.notification.message + ' ', this.notification.showTabLink && (h("span", { class: "active-tab", onClick: this.handleTabClick(
|
|
67
|
+
return (h("div", { class: `notification ${this.notification.errored ? 'errored' : ''}` }, h("img", { src: this.notification.errored ? errorIcon : checkIcon, class: "notification__icon" }), h("p", { class: "notification__message" }, this.notification.message + ' ', this.notification.showTabLink && (h("span", { class: "active-tab", onClick: this.handleTabClick(EChallengesTabs.Active) }, translate('activeTab', this.language))))));
|
|
62
68
|
};
|
|
63
69
|
this.onTimerExpired = (e) => {
|
|
64
70
|
const currentTabIndex = this.activeTabIndex;
|
|
65
71
|
setTimeout(() => {
|
|
66
|
-
if (currentTabIndex ===
|
|
72
|
+
if (currentTabIndex === EChallengesTabs.Active) {
|
|
67
73
|
this.activeChallenges = this.activeChallenges.filter((challenge) => challenge.Id !== e.detail);
|
|
68
74
|
}
|
|
69
75
|
else {
|
|
@@ -72,7 +78,7 @@ export class CasinoChallengesContainer {
|
|
|
72
78
|
}, 10000);
|
|
73
79
|
};
|
|
74
80
|
this.onItemViewed = (e) => {
|
|
75
|
-
if (this.activeTabIndex ===
|
|
81
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
76
82
|
this.activeChallenges = updateInState(this.activeChallenges, e.detail, { IsNew: false });
|
|
77
83
|
}
|
|
78
84
|
else {
|
|
@@ -88,15 +94,16 @@ export class CasinoChallengesContainer {
|
|
|
88
94
|
this.domain = '';
|
|
89
95
|
this.session = '';
|
|
90
96
|
this.userId = '';
|
|
91
|
-
this.activeTabIndex =
|
|
97
|
+
this.activeTabIndex = EChallengesTabs.Active;
|
|
92
98
|
this.error = '';
|
|
93
99
|
this.hasError = false;
|
|
100
|
+
this.promoChallenges = [];
|
|
94
101
|
this.activeChallenges = [];
|
|
95
102
|
this.pendingChallenges = [];
|
|
96
103
|
this.playerHistory = [];
|
|
97
104
|
this.loading = false;
|
|
98
105
|
this.pageNumber = 0;
|
|
99
|
-
this.
|
|
106
|
+
this.hasMore = false;
|
|
100
107
|
this.pageSize = 20;
|
|
101
108
|
this.notification = null;
|
|
102
109
|
this.sseConnection = undefined;
|
|
@@ -104,6 +111,7 @@ export class CasinoChallengesContainer {
|
|
|
104
111
|
get tabs() {
|
|
105
112
|
var _a, _b;
|
|
106
113
|
return [
|
|
114
|
+
{ label: translate('promoTab', this.language) },
|
|
107
115
|
{ label: translate('active', this.language), showNotification: (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.some((x) => x.IsNew) },
|
|
108
116
|
{ label: translate('pendingTab', this.language), showNotification: (_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.some((x) => x.IsNew) },
|
|
109
117
|
{ label: translate('finishedTab', this.language) },
|
|
@@ -144,13 +152,13 @@ export class CasinoChallengesContainer {
|
|
|
144
152
|
break;
|
|
145
153
|
}
|
|
146
154
|
case 'disabledChallengeNotification': {
|
|
147
|
-
if (this.activeTabIndex ===
|
|
155
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
148
156
|
this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
149
157
|
StatusName: 'Paused',
|
|
150
158
|
ChallengeStatus: EChallengeStatus.Paused
|
|
151
159
|
});
|
|
152
160
|
}
|
|
153
|
-
else if (this.activeTabIndex ===
|
|
161
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
154
162
|
this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
155
163
|
StatusName: 'Paused',
|
|
156
164
|
ChallengeStatus: EChallengeStatus.Paused
|
|
@@ -159,13 +167,13 @@ export class CasinoChallengesContainer {
|
|
|
159
167
|
break;
|
|
160
168
|
}
|
|
161
169
|
case 'enabledChallengeNotification': {
|
|
162
|
-
if (this.activeTabIndex ===
|
|
170
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
163
171
|
this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
164
172
|
StatusName: 'Enabled',
|
|
165
173
|
ChallengeStatus: EChallengeStatus.Enabled
|
|
166
174
|
});
|
|
167
175
|
}
|
|
168
|
-
else if (this.activeTabIndex ===
|
|
176
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
169
177
|
this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
|
|
170
178
|
StatusName: 'Enabled',
|
|
171
179
|
ChallengeStatus: EChallengeStatus.Enabled
|
|
@@ -175,12 +183,12 @@ export class CasinoChallengesContainer {
|
|
|
175
183
|
}
|
|
176
184
|
case 'forfeitedChallengeProgressNotification': {
|
|
177
185
|
if (this.session) {
|
|
178
|
-
if (this.activeTabIndex ===
|
|
186
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
179
187
|
this.activeChallenges = updateInState(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
|
|
180
188
|
Status: EChallengeProgressStatus.Forfeited
|
|
181
189
|
});
|
|
182
190
|
}
|
|
183
|
-
else if (this.activeTabIndex ===
|
|
191
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
184
192
|
this.pendingChallenges = updateInState(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
|
|
185
193
|
Status: EChallengeProgressStatus.Forfeited
|
|
186
194
|
});
|
|
@@ -216,9 +224,9 @@ export class CasinoChallengesContainer {
|
|
|
216
224
|
}
|
|
217
225
|
async getChallenges(tabIndex) {
|
|
218
226
|
if (!this.checkAttrs()) {
|
|
219
|
-
const path = tabIndex ===
|
|
227
|
+
const path = tabIndex === EChallengesTabs.Finished ? 'PlayerHistory' : 'GetChallengesInfo';
|
|
220
228
|
const url = `${this.endpoint}/challenge/${path}`;
|
|
221
|
-
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 ===
|
|
229
|
+
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 === EChallengesTabs.Finished && { UserId: this.userId })), (this.session && { IsFutureAvailable: tabIndex !== EChallengesTabs.Active }));
|
|
222
230
|
this.loading = true;
|
|
223
231
|
return fetch(url, {
|
|
224
232
|
method: 'POST',
|
|
@@ -235,16 +243,22 @@ export class CasinoChallengesContainer {
|
|
|
235
243
|
this.getChallenges(tabIndex).then((res) => {
|
|
236
244
|
if (res === null || res === void 0 ? void 0 : res.Success) {
|
|
237
245
|
this.pageNumber = res.PageNumber;
|
|
238
|
-
this.total = res.TotalCount;
|
|
239
246
|
switch (tabIndex) {
|
|
240
|
-
case
|
|
247
|
+
case EChallengesTabs.Promo:
|
|
248
|
+
this.promoChallenges = res.Data;
|
|
249
|
+
this.hasMore = this.promoChallenges.length < res.TotalCount;
|
|
250
|
+
break;
|
|
251
|
+
case EChallengesTabs.Active:
|
|
241
252
|
this.activeChallenges = res.Data;
|
|
253
|
+
this.hasMore = this.activeChallenges.length < res.TotalCount;
|
|
242
254
|
break;
|
|
243
|
-
case
|
|
255
|
+
case EChallengesTabs.Pending:
|
|
244
256
|
this.pendingChallenges = res.Data;
|
|
257
|
+
this.hasMore = this.pendingChallenges.length < res.TotalCount;
|
|
245
258
|
break;
|
|
246
|
-
case
|
|
259
|
+
case EChallengesTabs.Finished:
|
|
247
260
|
this.playerHistory = res.Data;
|
|
261
|
+
this.hasMore = this.playerHistory.length < res.TotalItem;
|
|
248
262
|
break;
|
|
249
263
|
}
|
|
250
264
|
}
|
|
@@ -259,8 +273,8 @@ export class CasinoChallengesContainer {
|
|
|
259
273
|
if (this.clientStylingUrl)
|
|
260
274
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
261
275
|
}
|
|
262
|
-
this.loadData(
|
|
263
|
-
this.loadData(
|
|
276
|
+
this.loadData(EChallengesTabs.Active);
|
|
277
|
+
this.loadData(EChallengesTabs.Pending);
|
|
264
278
|
}
|
|
265
279
|
disconnectedCallback() {
|
|
266
280
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
@@ -273,20 +287,25 @@ export class CasinoChallengesContainer {
|
|
|
273
287
|
this.connectGameToLiveLobby();
|
|
274
288
|
}
|
|
275
289
|
renderChallengesContent() {
|
|
276
|
-
var _a, _b, _c;
|
|
277
290
|
switch (this.activeTabIndex) {
|
|
278
|
-
case
|
|
279
|
-
return (h("casino-challenges-list", { challenges: this.
|
|
280
|
-
case
|
|
281
|
-
return (h("casino-challenges-list", { challenges: this.
|
|
282
|
-
case
|
|
283
|
-
return (h("casino-challenges-
|
|
284
|
-
case
|
|
291
|
+
case EChallengesTabs.Promo:
|
|
292
|
+
return (h("casino-challenges-list", { challenges: this.promoChallenges, onLoadMore: this.onLoadMore, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
293
|
+
case EChallengesTabs.Active:
|
|
294
|
+
return (h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
295
|
+
case EChallengesTabs.Pending:
|
|
296
|
+
return (h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: this.hasMore, language: this.language, activeChallengesTabIndex: this.activeTabIndex, isUserAuthorized: !!this.session, userId: this.userId, translationUrl: this.translationUrl, endpoint: this.endpoint, domain: this.domain, session: this.session, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl }));
|
|
297
|
+
case EChallengesTabs.Finished:
|
|
298
|
+
return (h("casino-challenges-player-history", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: this.hasMore }));
|
|
299
|
+
case EChallengesTabs.Code:
|
|
285
300
|
return (h("casino-challenges-claim-code", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, endpoint: this.endpoint, session: this.session, domain: this.domain, onOpenNotification: this.onOpenNotification }));
|
|
286
301
|
}
|
|
287
302
|
}
|
|
288
303
|
render() {
|
|
289
|
-
return (h("div", { key: '
|
|
304
|
+
return (h("div", { key: '03a7623f9cf348307d5030ced7a880868c2b06de', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'a91e6a5f3622523c7a857bdf29c31fe4e34590d5', class: "challenges" }, h("div", { key: '119677b5ef89f229848bc151ab04b97367ca7760', class: "challenges__header" }, h("h1", { key: '16d7a2c6bd3817542d9c9abc0c9228af5dc668f6', class: "challenges__title" }, h("img", { key: 'aafc5be41e382027b85651239671eb5b4acaa6fb', src: titleIcon, alt: "icon" }), translate('containerTitle', this.language)), this.session && (h("div", { key: '53ce6e0def0dab0e59ea3e8aa30f50a006667589', class: "challenges__tabs" }, this.tabs.map((tab, index) => {
|
|
305
|
+
if (tab.label === EChallengesTabs[0])
|
|
306
|
+
return;
|
|
307
|
+
return (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 })));
|
|
308
|
+
})))), this.renderChallengesContent(), this.notification && this.renderNotification())));
|
|
290
309
|
}
|
|
291
310
|
static get is() { return "casino-challenges-container"; }
|
|
292
311
|
static get encapsulation() { return "shadow"; }
|
|
@@ -468,12 +487,13 @@ export class CasinoChallengesContainer {
|
|
|
468
487
|
"activeTabIndex": {},
|
|
469
488
|
"error": {},
|
|
470
489
|
"hasError": {},
|
|
490
|
+
"promoChallenges": {},
|
|
471
491
|
"activeChallenges": {},
|
|
472
492
|
"pendingChallenges": {},
|
|
473
493
|
"playerHistory": {},
|
|
474
494
|
"loading": {},
|
|
475
495
|
"pageNumber": {},
|
|
476
|
-
"
|
|
496
|
+
"hasMore": {},
|
|
477
497
|
"pageSize": {},
|
|
478
498
|
"notification": {},
|
|
479
499
|
"sseConnection": {}
|
|
@@ -35,6 +35,9 @@ export var EChallengeTriggerType;
|
|
|
35
35
|
EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
|
|
36
36
|
EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
|
|
37
37
|
EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
|
|
38
|
+
EChallengeTriggerType[EChallengeTriggerType["Claim"] = 3] = "Claim";
|
|
39
|
+
EChallengeTriggerType[EChallengeTriggerType["Event"] = 4] = "Event";
|
|
40
|
+
EChallengeTriggerType[EChallengeTriggerType["Deposit"] = 5] = "Deposit";
|
|
38
41
|
})(EChallengeTriggerType || (EChallengeTriggerType = {}));
|
|
39
42
|
export var EChallengeValidityType;
|
|
40
43
|
(function (EChallengeValidityType) {
|
|
@@ -56,3 +59,11 @@ export var EHistoryItemLevelStatus;
|
|
|
56
59
|
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
|
|
57
60
|
})(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
|
|
58
61
|
export const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
|
|
62
|
+
export var EChallengesTabs;
|
|
63
|
+
(function (EChallengesTabs) {
|
|
64
|
+
EChallengesTabs[EChallengesTabs["Promo"] = 0] = "Promo";
|
|
65
|
+
EChallengesTabs[EChallengesTabs["Active"] = 1] = "Active";
|
|
66
|
+
EChallengesTabs[EChallengesTabs["Pending"] = 2] = "Pending";
|
|
67
|
+
EChallengesTabs[EChallengesTabs["Finished"] = 3] = "Finished";
|
|
68
|
+
EChallengesTabs[EChallengesTabs["Code"] = 4] = "Code";
|
|
69
|
+
})(EChallengesTabs || (EChallengesTabs = {}));
|