@everymatrix/casino-challenges-container 0.13.16 → 0.13.17

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.
@@ -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,8 @@ 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;
1303
+ this.activeProgressTabIndex = EChallengesTabs.Active;
1304
+ this.pendingProgressTabIndex = EChallengesTabs.Pending;
1293
1305
  this.onOpenNotification = (event) => {
1294
1306
  this.notification = event.detail;
1295
1307
  setTimeout(() => (this.notification = null), 10000);
@@ -1311,13 +1323,16 @@ const CasinoChallengesContainer = class {
1311
1323
  this.getChallenges(this.activeTabIndex).then((res) => {
1312
1324
  this.total = res.TotalCount;
1313
1325
  switch (this.activeTabIndex) {
1314
- case 0:
1326
+ case EChallengesTabs.Promo:
1327
+ this.promoChallenges = [...this.promoChallenges, ...res.Data];
1328
+ break;
1329
+ case EChallengesTabs.Active:
1315
1330
  this.activeChallenges = [...this.activeChallenges, ...res.Data];
1316
1331
  break;
1317
- case 1:
1332
+ case EChallengesTabs.Pending:
1318
1333
  this.pendingChallenges = [...this.pendingChallenges, ...res.Data];
1319
1334
  break;
1320
- case 2:
1335
+ case EChallengesTabs.Finished:
1321
1336
  this.playerHistory = [...this.playerHistory, ...res.Data];
1322
1337
  break;
1323
1338
  }
@@ -1333,12 +1348,12 @@ const CasinoChallengesContainer = class {
1333
1348
  }
1334
1349
  };
1335
1350
  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(0) }, translate('activeTab', this.language))))));
1351
+ 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
1352
  };
1338
1353
  this.onTimerExpired = (e) => {
1339
1354
  const currentTabIndex = this.activeTabIndex;
1340
1355
  setTimeout(() => {
1341
- if (currentTabIndex === 0) {
1356
+ if (currentTabIndex === EChallengesTabs.Active) {
1342
1357
  this.activeChallenges = this.activeChallenges.filter((challenge) => challenge.Id !== e.detail);
1343
1358
  }
1344
1359
  else {
@@ -1347,7 +1362,7 @@ const CasinoChallengesContainer = class {
1347
1362
  }, 10000);
1348
1363
  };
1349
1364
  this.onItemViewed = (e) => {
1350
- if (this.activeTabIndex === 0) {
1365
+ if (this.activeTabIndex === EChallengesTabs.Active) {
1351
1366
  this.activeChallenges = updateInState(this.activeChallenges, e.detail, { IsNew: false });
1352
1367
  }
1353
1368
  else {
@@ -1363,9 +1378,10 @@ const CasinoChallengesContainer = class {
1363
1378
  this.domain = '';
1364
1379
  this.session = '';
1365
1380
  this.userId = '';
1366
- this.activeTabIndex = 0;
1381
+ this.activeTabIndex = EChallengesTabs.Active;
1367
1382
  this.error = '';
1368
1383
  this.hasError = false;
1384
+ this.promoChallenges = [];
1369
1385
  this.activeChallenges = [];
1370
1386
  this.pendingChallenges = [];
1371
1387
  this.playerHistory = [];
@@ -1379,6 +1395,7 @@ const CasinoChallengesContainer = class {
1379
1395
  get tabs() {
1380
1396
  var _a, _b;
1381
1397
  return [
1398
+ { label: translate('promoTab', this.language) },
1382
1399
  { label: translate('active', this.language), showNotification: (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.some((x) => x.IsNew) },
1383
1400
  { label: translate('pendingTab', this.language), showNotification: (_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.some((x) => x.IsNew) },
1384
1401
  { label: translate('finishedTab', this.language) },
@@ -1419,13 +1436,13 @@ const CasinoChallengesContainer = class {
1419
1436
  break;
1420
1437
  }
1421
1438
  case 'disabledChallengeNotification': {
1422
- if (this.activeTabIndex === 0) {
1439
+ if (this.activeTabIndex === EChallengesTabs.Active) {
1423
1440
  this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
1424
1441
  StatusName: 'Paused',
1425
1442
  ChallengeStatus: EChallengeStatus.Paused
1426
1443
  });
1427
1444
  }
1428
- else if (this.activeTabIndex === 1) {
1445
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
1429
1446
  this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
1430
1447
  StatusName: 'Paused',
1431
1448
  ChallengeStatus: EChallengeStatus.Paused
@@ -1434,13 +1451,13 @@ const CasinoChallengesContainer = class {
1434
1451
  break;
1435
1452
  }
1436
1453
  case 'enabledChallengeNotification': {
1437
- if (this.activeTabIndex === 0) {
1454
+ if (this.activeTabIndex === EChallengesTabs.Active) {
1438
1455
  this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
1439
1456
  StatusName: 'Enabled',
1440
1457
  ChallengeStatus: EChallengeStatus.Enabled
1441
1458
  });
1442
1459
  }
1443
- else if (this.activeTabIndex === 1) {
1460
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
1444
1461
  this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
1445
1462
  StatusName: 'Enabled',
1446
1463
  ChallengeStatus: EChallengeStatus.Enabled
@@ -1450,12 +1467,12 @@ const CasinoChallengesContainer = class {
1450
1467
  }
1451
1468
  case 'forfeitedChallengeProgressNotification': {
1452
1469
  if (this.session) {
1453
- if (this.activeTabIndex === 0) {
1470
+ if (this.activeTabIndex === EChallengesTabs.Active) {
1454
1471
  this.activeChallenges = updateInState(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
1455
1472
  Status: EChallengeProgressStatus.Forfeited
1456
1473
  });
1457
1474
  }
1458
- else if (this.activeTabIndex === 1) {
1475
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
1459
1476
  this.pendingChallenges = updateInState(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
1460
1477
  Status: EChallengeProgressStatus.Forfeited
1461
1478
  });
@@ -1491,9 +1508,9 @@ const CasinoChallengesContainer = class {
1491
1508
  }
1492
1509
  async getChallenges(tabIndex) {
1493
1510
  if (!this.checkAttrs()) {
1494
- const path = tabIndex === 2 ? 'PlayerHistory' : 'GetChallengesInfo';
1511
+ const path = tabIndex === EChallengesTabs.Finished ? 'PlayerHistory' : 'GetChallengesInfo';
1495
1512
  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 === 2 && { UserId: this.userId })), (this.session && { IsFutureAvailable: tabIndex === 0 ? false : true }));
1513
+ 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 ? false : true }));
1497
1514
  this.loading = true;
1498
1515
  return fetch(url, {
1499
1516
  method: 'POST',
@@ -1512,13 +1529,16 @@ const CasinoChallengesContainer = class {
1512
1529
  this.pageNumber = res.PageNumber;
1513
1530
  this.total = res.TotalCount;
1514
1531
  switch (tabIndex) {
1515
- case 0:
1532
+ case EChallengesTabs.Promo:
1533
+ this.promoChallenges = res.Data;
1534
+ break;
1535
+ case EChallengesTabs.Active:
1516
1536
  this.activeChallenges = res.Data;
1517
1537
  break;
1518
- case 1:
1538
+ case EChallengesTabs.Pending:
1519
1539
  this.pendingChallenges = res.Data;
1520
1540
  break;
1521
- case 2:
1541
+ case EChallengesTabs.Finished:
1522
1542
  this.playerHistory = res.Data;
1523
1543
  break;
1524
1544
  }
@@ -1548,20 +1568,26 @@ const CasinoChallengesContainer = class {
1548
1568
  this.connectGameToLiveLobby();
1549
1569
  }
1550
1570
  renderChallengesContent() {
1551
- var _a, _b, _c;
1571
+ var _a, _b, _c, _d;
1552
1572
  switch (this.activeTabIndex) {
1553
- case 0:
1554
- return (index.h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: 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 }));
1555
- case 1:
1556
- return (index.h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.length) < this.total, language: this.language, activeTabIndex: 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 }));
1557
- case 2:
1558
- 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: ((_c = this.playerHistory) === null || _c === void 0 ? void 0 : _c.length) < this.total }));
1559
- case 3:
1573
+ case EChallengesTabs.Promo:
1574
+ return (index.h("casino-challenges-list", { challenges: this.promoChallenges, onLoadMore: this.onLoadMore, loading: this.loading, hasMore: ((_a = this.promoChallenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, 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 }));
1575
+ case EChallengesTabs.Active:
1576
+ return (index.h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_b = this.activeChallenges) === null || _b === void 0 ? void 0 : _b.length) < this.total, 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 }));
1577
+ case EChallengesTabs.Pending:
1578
+ return (index.h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_c = this.pendingChallenges) === null || _c === void 0 ? void 0 : _c.length) < this.total, 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 }));
1579
+ case EChallengesTabs.Finished:
1580
+ 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: ((_d = this.playerHistory) === null || _d === void 0 ? void 0 : _d.length) < this.total }));
1581
+ case EChallengesTabs.Code:
1560
1582
  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
1583
  }
1562
1584
  }
1563
1585
  render() {
1564
- return (index.h("div", { key: 'b6fda48f84b3a8834353802e24eebe202a1a8e0b', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'e5af55bca06b97466eb3794f969a0bf12d678c0b', class: "challenges" }, index.h("div", { key: '1667101cb52c52cd77a5f9e31f0e3b5123f17219', class: "challenges__header" }, index.h("h1", { key: 'd9ed8d16524e00a68edd0674a248e23df5870100', class: "challenges__title" }, index.h("img", { key: '2a498599b4cc64eb834785d09198554c435210d9', src: titleIconSvg, alt: "icon" }), translate('containerTitle', this.language)), this.session && (index.h("div", { key: '05ac59db8f9180f64a4af0c89990aec024e9ab2f', class: "challenges__tabs" }, this.tabs.map((tab, index$1) => (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 }))))))), this.renderChallengesContent(), this.notification && this.renderNotification())));
1586
+ return (index.h("div", { key: '47e72f3c0219689d0d8e17a152f9738de106d347', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'f6e150aa38dacfe0bea7fa12e1a45c00e7c76010', class: "challenges" }, index.h("div", { key: '3832b0971f6533af2f71be300c6cd4396e7e7dc7', class: "challenges__header" }, index.h("h1", { key: '1e9042e38fc0fa19363cfe9702147739cc339e7a', class: "challenges__title" }, index.h("img", { key: '919ac7789096afa6e63d085f80592bab52cc679b', src: titleIconSvg, alt: "icon" }), translate('containerTitle', this.language)), this.session && (index.h("div", { key: '46c3c6e862b922d06ee62d7021f206d11f19f474', class: "challenges__tabs" }, this.tabs.map((tab, index$1) => {
1587
+ if (tab.label === EChallengesTabs[0])
1588
+ return;
1589
+ 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 })));
1590
+ })))), this.renderChallengesContent(), this.notification && this.renderNotification())));
1565
1591
  }
1566
1592
  static get watchers() { return {
1567
1593
  "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],"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);
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],"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"],"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"]}],[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;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoChallengesContainer = require('./casino-challenges-container-210b7c83.js');
5
+ const casinoChallengesContainer = require('./casino-challenges-container-56802166.js');
6
6
  require('./index-d5f8d1ee.js');
7
7
 
8
8
 
@@ -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],"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);
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],"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"],"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"]}],[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;
@@ -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,8 @@ 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;
16
+ this.activeProgressTabIndex = EChallengesTabs.Active;
17
+ this.pendingProgressTabIndex = EChallengesTabs.Pending;
18
18
  this.onOpenNotification = (event) => {
19
19
  this.notification = event.detail;
20
20
  setTimeout(() => (this.notification = null), 10000);
@@ -36,13 +36,16 @@ export class CasinoChallengesContainer {
36
36
  this.getChallenges(this.activeTabIndex).then((res) => {
37
37
  this.total = res.TotalCount;
38
38
  switch (this.activeTabIndex) {
39
- case 0:
39
+ case EChallengesTabs.Promo:
40
+ this.promoChallenges = [...this.promoChallenges, ...res.Data];
41
+ break;
42
+ case EChallengesTabs.Active:
40
43
  this.activeChallenges = [...this.activeChallenges, ...res.Data];
41
44
  break;
42
- case 1:
45
+ case EChallengesTabs.Pending:
43
46
  this.pendingChallenges = [...this.pendingChallenges, ...res.Data];
44
47
  break;
45
- case 2:
48
+ case EChallengesTabs.Finished:
46
49
  this.playerHistory = [...this.playerHistory, ...res.Data];
47
50
  break;
48
51
  }
@@ -58,12 +61,12 @@ export class CasinoChallengesContainer {
58
61
  }
59
62
  };
60
63
  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(0) }, translate('activeTab', this.language))))));
64
+ 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
65
  };
63
66
  this.onTimerExpired = (e) => {
64
67
  const currentTabIndex = this.activeTabIndex;
65
68
  setTimeout(() => {
66
- if (currentTabIndex === 0) {
69
+ if (currentTabIndex === EChallengesTabs.Active) {
67
70
  this.activeChallenges = this.activeChallenges.filter((challenge) => challenge.Id !== e.detail);
68
71
  }
69
72
  else {
@@ -72,7 +75,7 @@ export class CasinoChallengesContainer {
72
75
  }, 10000);
73
76
  };
74
77
  this.onItemViewed = (e) => {
75
- if (this.activeTabIndex === 0) {
78
+ if (this.activeTabIndex === EChallengesTabs.Active) {
76
79
  this.activeChallenges = updateInState(this.activeChallenges, e.detail, { IsNew: false });
77
80
  }
78
81
  else {
@@ -88,9 +91,10 @@ export class CasinoChallengesContainer {
88
91
  this.domain = '';
89
92
  this.session = '';
90
93
  this.userId = '';
91
- this.activeTabIndex = 0;
94
+ this.activeTabIndex = EChallengesTabs.Active;
92
95
  this.error = '';
93
96
  this.hasError = false;
97
+ this.promoChallenges = [];
94
98
  this.activeChallenges = [];
95
99
  this.pendingChallenges = [];
96
100
  this.playerHistory = [];
@@ -104,6 +108,7 @@ export class CasinoChallengesContainer {
104
108
  get tabs() {
105
109
  var _a, _b;
106
110
  return [
111
+ { label: translate('promoTab', this.language) },
107
112
  { label: translate('active', this.language), showNotification: (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.some((x) => x.IsNew) },
108
113
  { label: translate('pendingTab', this.language), showNotification: (_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.some((x) => x.IsNew) },
109
114
  { label: translate('finishedTab', this.language) },
@@ -144,13 +149,13 @@ export class CasinoChallengesContainer {
144
149
  break;
145
150
  }
146
151
  case 'disabledChallengeNotification': {
147
- if (this.activeTabIndex === 0) {
152
+ if (this.activeTabIndex === EChallengesTabs.Active) {
148
153
  this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
149
154
  StatusName: 'Paused',
150
155
  ChallengeStatus: EChallengeStatus.Paused
151
156
  });
152
157
  }
153
- else if (this.activeTabIndex === 1) {
158
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
154
159
  this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
155
160
  StatusName: 'Paused',
156
161
  ChallengeStatus: EChallengeStatus.Paused
@@ -159,13 +164,13 @@ export class CasinoChallengesContainer {
159
164
  break;
160
165
  }
161
166
  case 'enabledChallengeNotification': {
162
- if (this.activeTabIndex === 0) {
167
+ if (this.activeTabIndex === EChallengesTabs.Active) {
163
168
  this.activeChallenges = updateInStateByChallengeId(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
164
169
  StatusName: 'Enabled',
165
170
  ChallengeStatus: EChallengeStatus.Enabled
166
171
  });
167
172
  }
168
- else if (this.activeTabIndex === 1) {
173
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
169
174
  this.pendingChallenges = updateInStateByChallengeId(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeId}`, {
170
175
  StatusName: 'Enabled',
171
176
  ChallengeStatus: EChallengeStatus.Enabled
@@ -175,12 +180,12 @@ export class CasinoChallengesContainer {
175
180
  }
176
181
  case 'forfeitedChallengeProgressNotification': {
177
182
  if (this.session) {
178
- if (this.activeTabIndex === 0) {
183
+ if (this.activeTabIndex === EChallengesTabs.Active) {
179
184
  this.activeChallenges = updateInState(this.activeChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
180
185
  Status: EChallengeProgressStatus.Forfeited
181
186
  });
182
187
  }
183
- else if (this.activeTabIndex === 1) {
188
+ else if (this.activeTabIndex === EChallengesTabs.Pending) {
184
189
  this.pendingChallenges = updateInState(this.pendingChallenges, `${data === null || data === void 0 ? void 0 : data.challengeProgressId}`, {
185
190
  Status: EChallengeProgressStatus.Forfeited
186
191
  });
@@ -216,9 +221,9 @@ export class CasinoChallengesContainer {
216
221
  }
217
222
  async getChallenges(tabIndex) {
218
223
  if (!this.checkAttrs()) {
219
- const path = tabIndex === 2 ? 'PlayerHistory' : 'GetChallengesInfo';
224
+ const path = tabIndex === EChallengesTabs.Finished ? 'PlayerHistory' : 'GetChallengesInfo';
220
225
  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 === 2 && { UserId: this.userId })), (this.session && { IsFutureAvailable: tabIndex === 0 ? false : true }));
226
+ 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 ? false : true }));
222
227
  this.loading = true;
223
228
  return fetch(url, {
224
229
  method: 'POST',
@@ -237,13 +242,16 @@ export class CasinoChallengesContainer {
237
242
  this.pageNumber = res.PageNumber;
238
243
  this.total = res.TotalCount;
239
244
  switch (tabIndex) {
240
- case 0:
245
+ case EChallengesTabs.Promo:
246
+ this.promoChallenges = res.Data;
247
+ break;
248
+ case EChallengesTabs.Active:
241
249
  this.activeChallenges = res.Data;
242
250
  break;
243
- case 1:
251
+ case EChallengesTabs.Pending:
244
252
  this.pendingChallenges = res.Data;
245
253
  break;
246
- case 2:
254
+ case EChallengesTabs.Finished:
247
255
  this.playerHistory = res.Data;
248
256
  break;
249
257
  }
@@ -273,20 +281,26 @@ export class CasinoChallengesContainer {
273
281
  this.connectGameToLiveLobby();
274
282
  }
275
283
  renderChallengesContent() {
276
- var _a, _b, _c;
284
+ var _a, _b, _c, _d;
277
285
  switch (this.activeTabIndex) {
278
- case 0:
279
- return (h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: 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 }));
280
- case 1:
281
- return (h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.length) < this.total, language: this.language, activeTabIndex: 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 }));
282
- case 2:
283
- 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: ((_c = this.playerHistory) === null || _c === void 0 ? void 0 : _c.length) < this.total }));
284
- case 3:
286
+ case EChallengesTabs.Promo:
287
+ return (h("casino-challenges-list", { challenges: this.promoChallenges, onLoadMore: this.onLoadMore, loading: this.loading, hasMore: ((_a = this.promoChallenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, 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 }));
288
+ case EChallengesTabs.Active:
289
+ return (h("casino-challenges-list", { challenges: this.activeChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_b = this.activeChallenges) === null || _b === void 0 ? void 0 : _b.length) < this.total, 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 }));
290
+ case EChallengesTabs.Pending:
291
+ return (h("casino-challenges-list", { challenges: this.pendingChallenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, onItemViewed: this.onItemViewed, loading: this.loading, hasMore: ((_c = this.pendingChallenges) === null || _c === void 0 ? void 0 : _c.length) < this.total, 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 }));
292
+ case EChallengesTabs.Finished:
293
+ 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: ((_d = this.playerHistory) === null || _d === void 0 ? void 0 : _d.length) < this.total }));
294
+ case EChallengesTabs.Code:
285
295
  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
296
  }
287
297
  }
288
298
  render() {
289
- return (h("div", { key: 'b6fda48f84b3a8834353802e24eebe202a1a8e0b', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'e5af55bca06b97466eb3794f969a0bf12d678c0b', class: "challenges" }, h("div", { key: '1667101cb52c52cd77a5f9e31f0e3b5123f17219', class: "challenges__header" }, h("h1", { key: 'd9ed8d16524e00a68edd0674a248e23df5870100', class: "challenges__title" }, h("img", { key: '2a498599b4cc64eb834785d09198554c435210d9', src: titleIcon, alt: "icon" }), translate('containerTitle', this.language)), this.session && (h("div", { key: '05ac59db8f9180f64a4af0c89990aec024e9ab2f', 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())));
299
+ return (h("div", { key: '47e72f3c0219689d0d8e17a152f9738de106d347', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'f6e150aa38dacfe0bea7fa12e1a45c00e7c76010', class: "challenges" }, h("div", { key: '3832b0971f6533af2f71be300c6cd4396e7e7dc7', class: "challenges__header" }, h("h1", { key: '1e9042e38fc0fa19363cfe9702147739cc339e7a', class: "challenges__title" }, h("img", { key: '919ac7789096afa6e63d085f80592bab52cc679b', src: titleIcon, alt: "icon" }), translate('containerTitle', this.language)), this.session && (h("div", { key: '46c3c6e862b922d06ee62d7021f206d11f19f474', class: "challenges__tabs" }, this.tabs.map((tab, index) => {
300
+ if (tab.label === EChallengesTabs[0])
301
+ return;
302
+ 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 })));
303
+ })))), this.renderChallengesContent(), this.notification && this.renderNotification())));
290
304
  }
291
305
  static get is() { return "casino-challenges-container"; }
292
306
  static get encapsulation() { return "shadow"; }
@@ -468,6 +482,7 @@ export class CasinoChallengesContainer {
468
482
  "activeTabIndex": {},
469
483
  "error": {},
470
484
  "hasError": {},
485
+ "promoChallenges": {},
471
486
  "activeChallenges": {},
472
487
  "pendingChallenges": {},
473
488
  "playerHistory": {},
@@ -2,6 +2,7 @@ const DEFAULT_LANGUAGE = 'en';
2
2
  export const TRANSLATIONS = {
3
3
  en: {
4
4
  containerTitle: 'Challenges',
5
+ promoTab: 'Promo',
5
6
  active: 'Active',
6
7
  activeTab: 'Active tab',
7
8
  pendingTab: 'Pending',
@@ -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 = {}));