@everymatrix/casino-challenges-container 0.0.16 → 0.0.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.
- package/dist/casino-challenges-container/casino-challenge-card_6.entry.js +1 -0
- package/dist/casino-challenges-container/casino-challenges-container-ea97765a.js +1 -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_5.cjs.entry.js → casino-challenge-card_6.cjs.entry.js} +182 -29
- package/dist/cjs/{casino-challenges-container-50aca824.js → casino-challenges-container-da454267.js} +17 -3
- package/dist/cjs/casino-challenges-container.cjs.js +1 -1
- package/dist/cjs/index-d5f8d1ee.js +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/check-circle.svg +3 -0
- package/dist/collection/assets/error-circle.svg +3 -0
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/casino-challenges-container/casino-challenges-container.css +41 -0
- package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +15 -2
- package/dist/collection/utils/locale.utils.js +2 -1
- package/dist/esm/{casino-challenge-card_5.entry.js → casino-challenge-card_6.entry.js} +183 -31
- package/dist/esm/{casino-challenges-container-677ffb33.js → casino-challenges-container-ea97765a.js} +17 -3
- package/dist/esm/casino-challenges-container.js +1 -1
- package/dist/esm/index-7720ad93.js +2 -2
- 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 +5 -1
- package/dist/types/utils/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/casino-challenges-container/casino-challenge-card_5.entry.js +0 -1
- package/dist/casino-challenges-container/casino-challenges-container-677ffb33.js +0 -1
package/dist/cjs/{casino-challenge-card_5.cjs.entry.js → casino-challenge-card_6.cjs.entry.js}
RENAMED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d5f8d1ee.js');
|
|
6
|
-
const casinoChallengesContainer = require('./casino-challenges-container-
|
|
6
|
+
const casinoChallengesContainer = require('./casino-challenges-container-da454267.js');
|
|
7
7
|
|
|
8
|
-
const DEFAULT_LANGUAGE$
|
|
8
|
+
const DEFAULT_LANGUAGE$2 = 'en';
|
|
9
9
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
10
|
-
const TRANSLATIONS$
|
|
10
|
+
const TRANSLATIONS$2 = {
|
|
11
11
|
en: {
|
|
12
12
|
totalLevels: 'Total levels:',
|
|
13
13
|
level1: 'Level 1:',
|
|
@@ -104,18 +104,18 @@ const TRANSLATIONS$1 = {
|
|
|
104
104
|
pause: 'Pauza'
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
-
const translate$
|
|
107
|
+
const translate$2 = (key, customLang) => {
|
|
108
108
|
const lang = customLang;
|
|
109
|
-
return TRANSLATIONS$
|
|
109
|
+
return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
110
110
|
};
|
|
111
|
-
const getTranslations$
|
|
111
|
+
const getTranslations$2 = (data) => {
|
|
112
112
|
Object.keys(data).forEach((item) => {
|
|
113
113
|
for (let key in data[item]) {
|
|
114
|
-
TRANSLATIONS$
|
|
114
|
+
TRANSLATIONS$2[item][key] = data[item][key];
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
const resolveTranslationUrl$
|
|
118
|
+
const resolveTranslationUrl$2 = async (translationUrl) => {
|
|
119
119
|
if (translationUrl) {
|
|
120
120
|
try {
|
|
121
121
|
const response = await fetch(translationUrl);
|
|
@@ -123,7 +123,7 @@ const resolveTranslationUrl$1 = async (translationUrl) => {
|
|
|
123
123
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
124
124
|
}
|
|
125
125
|
const translations = await response.json();
|
|
126
|
-
getTranslations$
|
|
126
|
+
getTranslations$2(translations);
|
|
127
127
|
}
|
|
128
128
|
catch (error) {
|
|
129
129
|
console.error('Failed to fetch or parse translations from URL:', error);
|
|
@@ -226,15 +226,15 @@ const CasinoChallengeCard = class {
|
|
|
226
226
|
if (!level)
|
|
227
227
|
return '';
|
|
228
228
|
const minbet = ((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet)
|
|
229
|
-
? `, ${translate$
|
|
229
|
+
? `, ${translate$2('minBet', this.language)} ${currencySymbol + level.BetRange.MinBet}`
|
|
230
230
|
: '';
|
|
231
231
|
switch (level.LevelTargetType) {
|
|
232
232
|
case EChallengeLevelTargetType.Accumulative:
|
|
233
|
-
return `${translate$
|
|
233
|
+
return `${translate$2('placeBetsOf', this.language)} ${currencySymbol + level.DisplayCurrencyTargetTurnover + minbet}`;
|
|
234
234
|
case EChallengeLevelTargetType.SingleBet:
|
|
235
|
-
return `${translate$
|
|
235
|
+
return `${translate$2('place', this.language)} ${currencySymbol + level.TargetTurnover} ${translate$2('bet', this.language)}`;
|
|
236
236
|
case EChallengeLevelTargetType.MultipleOneBetSize:
|
|
237
|
-
return `${translate$
|
|
237
|
+
return `${translate$2('place', this.language)} ${level.TargetBetCount} ${translate$2('bets', this.language) + minbet}`;
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
this.onMouseEnterHandler = (index, el) => {
|
|
@@ -248,17 +248,17 @@ const CasinoChallengeCard = class {
|
|
|
248
248
|
this.getBadgeContent = () => {
|
|
249
249
|
switch (this.challenge.Status) {
|
|
250
250
|
case EChallengeStatus.Expired:
|
|
251
|
-
return translate$
|
|
251
|
+
return translate$2('expired', this.language);
|
|
252
252
|
case EChallengeStatus.Forfeited:
|
|
253
|
-
return translate$
|
|
253
|
+
return translate$2('forfeited', this.language);
|
|
254
254
|
case EChallengeStatus.Completed:
|
|
255
|
-
return translate$
|
|
255
|
+
return translate$2('finished', this.language);
|
|
256
256
|
case EChallengeStatus.Paused:
|
|
257
|
-
return translate$
|
|
257
|
+
return translate$2('suspended', this.language);
|
|
258
258
|
default:
|
|
259
259
|
return this.timeLeft
|
|
260
|
-
? [translate$
|
|
261
|
-
: translate$
|
|
260
|
+
? [translate$2('endsIn', this.language), ' - ', index.h("span", null, this.timeLeft)]
|
|
261
|
+
: translate$2('expired', this.language);
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
this.goToDetailsPage = (challengeId) => () => {
|
|
@@ -298,15 +298,15 @@ const CasinoChallengeCard = class {
|
|
|
298
298
|
const rewardValue = (_c = level.Rewards) === null || _c === void 0 ? void 0 : _c.slice(0, 2).map((r) => r.RewardDescription).join(' + ');
|
|
299
299
|
return [
|
|
300
300
|
{
|
|
301
|
-
lable: translate$
|
|
301
|
+
lable: translate$2('totalLevels', this.language),
|
|
302
302
|
value: (_d = this.challenge.LevelProgresses) === null || _d === void 0 ? void 0 : _d.length
|
|
303
303
|
},
|
|
304
304
|
{
|
|
305
|
-
lable: translate$
|
|
305
|
+
lable: translate$2('level1', this.language),
|
|
306
306
|
value: this.calculateTargetValue(level, (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.CurrencySymbol)
|
|
307
307
|
},
|
|
308
308
|
{
|
|
309
|
-
lable: translate$
|
|
309
|
+
lable: translate$2('get', this.language),
|
|
310
310
|
value: rewardValue
|
|
311
311
|
}
|
|
312
312
|
];
|
|
@@ -335,7 +335,7 @@ const CasinoChallengeCard = class {
|
|
|
335
335
|
}
|
|
336
336
|
componentWillLoad() {
|
|
337
337
|
if (this.translationUrl) {
|
|
338
|
-
resolveTranslationUrl$
|
|
338
|
+
resolveTranslationUrl$2(this.translationUrl);
|
|
339
339
|
}
|
|
340
340
|
this.updateTime();
|
|
341
341
|
}
|
|
@@ -384,9 +384,9 @@ const CasinoChallengeCard = class {
|
|
|
384
384
|
return index.h("div", { class: "progress__placeholder" });
|
|
385
385
|
}
|
|
386
386
|
const barValue = Status === EChallengeStatus.Paused
|
|
387
|
-
? translate$
|
|
387
|
+
? translate$2('suspended', this.language)
|
|
388
388
|
: Status === EChallengeStatus.Completed
|
|
389
|
-
? translate$
|
|
389
|
+
? translate$2('finished', this.language)
|
|
390
390
|
: `${currLevel.ProgressPercentage}%`;
|
|
391
391
|
const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
|
|
392
392
|
const secondImgSrc = Status === EChallengeStatus.Completed ? trophySvg : isLastLevel ? finishSvg : '';
|
|
@@ -410,17 +410,17 @@ const CasinoChallengeCard = class {
|
|
|
410
410
|
get getCardButton() {
|
|
411
411
|
if (this.isUserAuthorized) {
|
|
412
412
|
if (this.challenge.Status === EChallengeStatus.Started) {
|
|
413
|
-
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$
|
|
413
|
+
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$2('start', this.language)));
|
|
414
414
|
}
|
|
415
415
|
if (this.challenge.Status === EChallengeStatus.Paused) {
|
|
416
|
-
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$
|
|
416
|
+
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$2('resume', this.language)));
|
|
417
417
|
}
|
|
418
418
|
if (this.challenge.Status === EChallengeStatus.InProgress ||
|
|
419
419
|
this.challenge.Status === EChallengeStatus.PendingLevelReward) {
|
|
420
|
-
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(false) }, translate$
|
|
420
|
+
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(false) }, translate$2('pause', this.language)));
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
return (index.h("button", { class: "card__button", onClick: this.goToDetailsPage(this.challenge.ChallengeId) }, translate$
|
|
423
|
+
return (index.h("button", { class: "card__button", onClick: this.goToDetailsPage(this.challenge.ChallengeId) }, translate$2('viewDetails', this.language)));
|
|
424
424
|
}
|
|
425
425
|
async joinUnjoinProgress(join) {
|
|
426
426
|
var _a;
|
|
@@ -452,6 +452,158 @@ const CasinoChallengeCard = class {
|
|
|
452
452
|
};
|
|
453
453
|
CasinoChallengeCard.style = CasinoChallengeCardStyle0;
|
|
454
454
|
|
|
455
|
+
const DEFAULT_LANGUAGE$1 = 'en';
|
|
456
|
+
const TRANSLATIONS$1 = {
|
|
457
|
+
en: {
|
|
458
|
+
title: 'Enter the secret code to unlock hidden quests and rewards.',
|
|
459
|
+
btnText: 'Apply code',
|
|
460
|
+
successMessage: 'The code was successfully applied.',
|
|
461
|
+
inputLabel: '3–30 characters, no spaces',
|
|
462
|
+
lengthMinError: 'Code must be at least 3 characters',
|
|
463
|
+
lengthMaxError: 'Too long — max 30 characters',
|
|
464
|
+
formatError: 'Invalid code format. Please use only Latin letters (case-sensitive), numbers, and special characters.',
|
|
465
|
+
genericError: 'Something went wrong, please retry'
|
|
466
|
+
},
|
|
467
|
+
ro: {},
|
|
468
|
+
fr: {},
|
|
469
|
+
ar: {},
|
|
470
|
+
hr: {}
|
|
471
|
+
};
|
|
472
|
+
const translate$1 = (key, customLang) => {
|
|
473
|
+
const lang = customLang;
|
|
474
|
+
return TRANSLATIONS$1[lang !== undefined && lang in TRANSLATIONS$1 ? lang : DEFAULT_LANGUAGE$1][key];
|
|
475
|
+
};
|
|
476
|
+
const getTranslations$1 = (data) => {
|
|
477
|
+
Object.keys(data).forEach((item) => {
|
|
478
|
+
for (let key in data[item]) {
|
|
479
|
+
TRANSLATIONS$1[item][key] = data[item][key];
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
const resolveTranslationUrl$1 = async (translationUrl) => {
|
|
484
|
+
if (translationUrl) {
|
|
485
|
+
try {
|
|
486
|
+
const response = await fetch(translationUrl);
|
|
487
|
+
if (!response.ok) {
|
|
488
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
489
|
+
}
|
|
490
|
+
const translations = await response.json();
|
|
491
|
+
getTranslations$1(translations);
|
|
492
|
+
}
|
|
493
|
+
catch (error) {
|
|
494
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
const casinoChallengesClaimCodeCss = ".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 80px 0;\n text-align: center;\n}\n.container__title {\n font-size: var(--emw--font-size-medium-plus, 18px);\n font-weight: var(--emw--font-weight-medium, 500);\n line-height: 22px;\n color: var(--emw--color-white, white);\n margin: 0 0 32px;\n}\n.container__button {\n margin-top: 45px;\n padding: 14px 20px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #083B17);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--button-background-color, #18CE51);\n cursor: pointer;\n}\n.container__button:hover {\n color: var(--emw--color-gray-300, #083B17);\n border-color: transparent;\n box-shadow: 0 0 4px 0 rgba(188, 252, 177, 0.2), 0 0 20px 0 rgba(0, 183, 79, 0.5);\n}\n.container__button:disabled, .container__button:disabled:hover {\n color: var(--emw--color-gray-50, #E2E2E2);\n border: 2px solid var(--emw--button-border-color, #083B17);\n opacity: 0.7;\n cursor: not-allowed;\n}\n@container challenges-container (max-width: 576px) {\n .container__button {\n width: calc(100% - 32px);\n position: absolute;\n bottom: 50px;\n }\n}\n\n.code-input {\n border: 1px solid var(--emw--button-border-color, #083B17);\n background: var(--emw--color-background-secondary, rgba(221, 255, 207, 0.1019607843));\n border-radius: 6px;\n padding: 12px 0;\n line-height: 24px;\n color: var(--emw--color-white, #FFFFFF);\n text-align: center;\n font-size: var(--emw--font-size-medium, 16px);\n min-width: 340px;\n}\n.code-input:focus {\n outline: 1px solid var(--emw--border-success-color, #00B74F);\n}\n.code-input:focus.errored {\n outline-color: var(--emw--color-error, #D6421E);\n}\n.code-input.errored {\n border-color: var(--emw--color-error, #D6421E);\n}\n.code-input__text {\n margin: 8px 0 0;\n line-height: 22px;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.code-input__text.errored {\n color: var(--emw--color-error, #D6421E);\n}\n@container challenges-container (max-width: 576px) {\n .code-input {\n min-width: 100%;\n }\n}";
|
|
500
|
+
const CasinoChallengesClaimCodeStyle0 = casinoChallengesClaimCodeCss;
|
|
501
|
+
|
|
502
|
+
const CasinoChallengesClaimCode = class {
|
|
503
|
+
constructor(hostRef) {
|
|
504
|
+
index.registerInstance(this, hostRef);
|
|
505
|
+
this.openNotification = index.createEvent(this, "openNotification", 7);
|
|
506
|
+
this.asciiPrintableRegex = /^[\x21-\x7E]+$/;
|
|
507
|
+
this.handleSubmit = async () => {
|
|
508
|
+
if (this.endpoint && this.session && this.domain) {
|
|
509
|
+
const response = await this.applyCode();
|
|
510
|
+
if (response.Success) {
|
|
511
|
+
this.openNotification.emit({ message: translate$1('successMessage', this.language) });
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
this.hasError = true;
|
|
515
|
+
const showTabLink = response.ErrorCode === 3002 || response.ErrorCode === 3023 || response.ErrorCode === 3003;
|
|
516
|
+
this.openNotification.emit({ message: response.ErrorMessage, errored: true, showTabLink });
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
this.applyCode = async () => {
|
|
521
|
+
this.loading = true;
|
|
522
|
+
const url = `${this.endpoint}/challenge/GrantChallengeByCode`;
|
|
523
|
+
const body = {
|
|
524
|
+
DomainId: this.domain,
|
|
525
|
+
PlayerSessionId: this.session,
|
|
526
|
+
ActivationCode: this.code
|
|
527
|
+
};
|
|
528
|
+
return fetch(url, {
|
|
529
|
+
method: 'POST',
|
|
530
|
+
headers: {
|
|
531
|
+
'Content-Type': 'application/json'
|
|
532
|
+
},
|
|
533
|
+
body: JSON.stringify(body)
|
|
534
|
+
})
|
|
535
|
+
.then((res) => res.json())
|
|
536
|
+
.finally(() => (this.loading = false));
|
|
537
|
+
};
|
|
538
|
+
this.handleInput = (event) => {
|
|
539
|
+
this.code = event.target.value;
|
|
540
|
+
if (this.debounceTime) {
|
|
541
|
+
clearTimeout(this.debounceTime);
|
|
542
|
+
}
|
|
543
|
+
this.debounceTime = setTimeout(() => {
|
|
544
|
+
this.hasError = !this.validate(this.code);
|
|
545
|
+
}, 200);
|
|
546
|
+
};
|
|
547
|
+
this.mbSource = undefined;
|
|
548
|
+
this.clientStyling = undefined;
|
|
549
|
+
this.clientStylingUrl = undefined;
|
|
550
|
+
this.translationUrl = '';
|
|
551
|
+
this.language = 'en';
|
|
552
|
+
this.endpoint = '';
|
|
553
|
+
this.domain = '';
|
|
554
|
+
this.session = '';
|
|
555
|
+
this.loading = false;
|
|
556
|
+
this.hasError = false;
|
|
557
|
+
this.code = '';
|
|
558
|
+
this.notificationMessage = '';
|
|
559
|
+
}
|
|
560
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
561
|
+
if (newValue != oldValue) {
|
|
562
|
+
casinoChallengesContainer.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
566
|
+
if (newValue != oldValue) {
|
|
567
|
+
casinoChallengesContainer.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
571
|
+
if (newValue != oldValue) {
|
|
572
|
+
casinoChallengesContainer.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
componentWillLoad() {
|
|
576
|
+
if (this.translationUrl) {
|
|
577
|
+
resolveTranslationUrl$1(this.translationUrl);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
componentDidLoad() {
|
|
581
|
+
if (this.stylingContainer) {
|
|
582
|
+
if (this.mbSource)
|
|
583
|
+
casinoChallengesContainer.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
584
|
+
if (this.clientStyling)
|
|
585
|
+
casinoChallengesContainer.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
586
|
+
if (this.clientStylingUrl)
|
|
587
|
+
casinoChallengesContainer.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
disconnectedCallback() {
|
|
591
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
592
|
+
}
|
|
593
|
+
validate(val) {
|
|
594
|
+
return val.length >= 3 && val.length <= 30 && this.asciiPrintableRegex.test(val);
|
|
595
|
+
}
|
|
596
|
+
render() {
|
|
597
|
+
return (index.h("div", { key: '241aeeb9f0f0984bbf0367a7c925e0b84ef15fa0', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'f20ec43253905cb0e9a356f65d1e51e695f784cf', class: "container" }, index.h("p", { key: 'a4c3b0ca894db101c192f7c62ff141ec51eaede1', class: "container__title" }, translate$1('title', this.language)), index.h("input", { key: 'c99bdd43659c9d2fc06702fe041eab8458bb0ee5', class: `code-input ${this.hasError ? 'errored' : ''}`, type: "text", placeholder: "e.g. SPRING24", onInput: this.handleInput }), index.h("p", { key: 'c2aacc2d4a23c7d222f895dce3a3a47b8f03f587', class: "code-input__text" }, translate$1('inputLabel', this.language)), index.h("button", { key: '51e79d07278368567026d31b0c70e8c9f0eb4840', class: "container__button", onClick: this.handleSubmit, disabled: this.loading || !this.code || this.hasError }, translate$1('btnText', this.language)))));
|
|
598
|
+
}
|
|
599
|
+
static get watchers() { return {
|
|
600
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
601
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
602
|
+
"mbSource": ["handleMbSourceChange"]
|
|
603
|
+
}; }
|
|
604
|
+
};
|
|
605
|
+
CasinoChallengesClaimCode.style = CasinoChallengesClaimCodeStyle0;
|
|
606
|
+
|
|
455
607
|
const casinoChallengesListCss = ".challenges-list {\n display: flex;\n flex-wrap: wrap;\n gap: 30px;\n width: 100%;\n}\n\n.loader {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenge-list (max-width: 576px) {\n .loader {\n width: 100%;\n }\n}\n.loader:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.loader .SkeletonRows .SkeletonContainer {\n padding: 0 20px 0 20px;\n}\n.loader .SkeletonButton .Skeleton.Text {\n margin: 0;\n height: 28px;\n margin: 0 20px 20px 20px;\n border-radius: var(--emw--button-border-radius, 99px);\n width: auto;\n}\n.loader .Skeleton.Image {\n border-radius: 16px 16px 0 0;\n}\n.loader .Skeleton.Text {\n margin: 20px 0;\n}";
|
|
456
608
|
const CasinoChallengesListStyle0 = casinoChallengesListCss;
|
|
457
609
|
|
|
@@ -3103,6 +3255,7 @@ UiSkeleton.style = UiSkeletonStyle0;
|
|
|
3103
3255
|
|
|
3104
3256
|
exports.casino_challenges_container = casinoChallengesContainer.CasinoChallengesContainer;
|
|
3105
3257
|
exports.casino_challenge_card = CasinoChallengeCard;
|
|
3258
|
+
exports.casino_challenges_claim_code = CasinoChallengesClaimCode;
|
|
3106
3259
|
exports.casino_challenges_list = CasinoChallengeList;
|
|
3107
3260
|
exports.casino_challenges_player_history = CasinoChallengesPlayerHistory;
|
|
3108
3261
|
exports.ui_skeleton = UiSkeleton;
|
package/dist/cjs/{casino-challenges-container-50aca824.js → casino-challenges-container-da454267.js}
RENAMED
|
@@ -63,7 +63,8 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
63
63
|
const TRANSLATIONS = {
|
|
64
64
|
en: {
|
|
65
65
|
title: 'Challenges',
|
|
66
|
-
empty: 'No Challenges'
|
|
66
|
+
empty: 'No Challenges',
|
|
67
|
+
activeTab: 'Active tab'
|
|
67
68
|
},
|
|
68
69
|
ro: {
|
|
69
70
|
title: 'Provocări',
|
|
@@ -113,7 +114,11 @@ const titleIconSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53
|
|
|
113
114
|
|
|
114
115
|
const notificationSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzgzOF8zMTApIj4KPHBhdGggZD0iTTcuNTAwNDYgMTIuOTk5OUM4LjQwNTk1IDEyLjk5OTkgOS4xNjM0MSAxMi4zNTQ0IDkuMzM3MzUgMTEuNUg1LjY2MzU3QzUuODM3NiAxMi4zNTQ0IDYuNTk1MDYgMTIuOTk5OSA3LjUwMDQ2IDEyLjk5OTlaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfODM4XzMxMCkiLz4KPHBhdGggZD0iTTExLjAwNTggNi45OTkxN0MxMS4wMDM3IDYuOTk5MTcgMTEuMDAxNyA2Ljk5OTYzIDEwLjk5OTcgNi45OTk2M0M5LjA3MDM2IDYuOTk5NjMgNy40OTk5NyA1LjQyOTcgNy40OTk5NyAzLjQ5OTlDNy40OTk5NyAyLjk2OTM5IDcuNjIyIDIuNDY3ODkgNy44MzQ0OCAyLjAxNjk0QzcuNzI0NDQgMi4wMDY1IDcuNjEyOTMgMiA3LjQ5OTk3IDJDNS41NjcxMyAyIDQuMDAwMjIgMy41NjY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AxNi4xMjQ0IDI1LjQ4NzggMTUuNTA2MSAyNC44Njk1TDEwLjc1NjEgMjAuMTE5NUMxMC4xMzc3IDE5LjUwMTIgMTAuMTM3NyAxOC40OTg3IDEwLjc1NjEgMTcuODgwM0MxMS4zNzQ0IDE3LjI2MiAxMi4zNzY5IDE3LjI2MiAxMi45OTUyIDE3Ljg4MDNMMTYuNjI1NyAyMS41MTA3TDI1LjAwNjEgMTMuMTMwM0MyNS42MjQ0IDEyLjUxMiAyNi42MjY5IDEyLjUxMiAyNy4yNDUyIDEzLjEzMDNaIiBmaWxsPSIjMDBCNzRGIi8+Cjwvc3ZnPgo=';
|
|
120
|
+
|
|
121
|
+
const casinoChallengesContainerCss = ".challenges {\n container-type: inline-size;\n container-name: challenges-container;\n background-color: var(--emw--color-background, #000);\n padding: 16px 12px;\n}\n.challenges__header {\n margin: 0 0 32px;\n display: flex;\n justify-content: space-between;\n}\n.challenges__title {\n margin: 0;\n display: flex;\n gap: 10px;\n align-items: center;\n font-size: var(--emw--font-size-x-large, 24px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-white, #ffffff);\n}\n.challenges__tabs {\n display: flex;\n gap: 12px;\n border-radius: 48px;\n padding: 6px;\n color: var(--emw--color-gray-150, #c8d6ce);\n background-color: var(--emw--color-background-secondary, #272727);\n}\n.challenges__tab {\n padding: 10px 16px;\n border-radius: 40px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n cursor: pointer;\n text-align: center;\n width: 95px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n}\n.challenges__tab.active {\n color: var(--emw--color-white, #ffffff);\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n}\n.challenges__tab:last-child {\n width: inherit;\n padding: 10px 16px;\n}\n.challenges__content {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 300px;\n overflow-y: auto;\n}\n.challenges__empty {\n color: var(--emw--color-white, #ffffff);\n}\n@container challenges-container (max-width: 800px) {\n .challenges__header {\n margin: 0 0 16px;\n flex-wrap: wrap;\n row-gap: 12px;\n }\n .challenges__title {\n width: 100%;\n font-size: var(--emw--font-size-large, 20px);\n }\n .challenges__title img {\n height: 32px;\n }\n .challenges__tabs {\n width: 100%;\n gap: 8px;\n }\n .challenges__tab {\n flex: 1;\n padding: 5px 0;\n font-size: var(--emw--font-size-x-small, 12px);\n }\n .challenges__tab:last-child {\n width: inherit;\n padding: 5px 0;\n }\n}\n\n.notification {\n display: flex;\n position: absolute;\n align-items: center;\n bottom: 90px;\n box-shadow: 0 0 20px 0 rgba(136, 143, 170, 0.15);\n border-radius: 8px;\n padding: 20px 16px;\n gap: 16px;\n right: 40px;\n max-width: 445px;\n box-sizing: border-box;\n background-color: var(--emw--background-success-color, #C9F0D7);\n border: 2px solid var(--emw--border-success-color, #00B74F);\n}\n.notification.errored {\n background: var(--emw--background-errored-color, #FFE1DF);\n border-color: var(--emw--color-error, #D6421E);\n}\n.notification__icon {\n width: 32px;\n height: 32px;\n}\n.notification__message {\n margin: 0;\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-bold, 700);\n}\n.notification__message .active-tab {\n color: var(--emw--border-success-color, #00B74F);\n text-decoration-line: underline;\n cursor: pointer;\n}\n@container challenges-container (max-width: 576px) {\n .notification {\n bottom: 60px;\n right: 12px;\n max-width: 290px;\n }\n}";
|
|
117
122
|
const CasinoChallengesContainerStyle0 = casinoChallengesContainerCss;
|
|
118
123
|
|
|
119
124
|
const CasinoChallengesContainer = class {
|
|
@@ -121,6 +126,10 @@ const CasinoChallengesContainer = class {
|
|
|
121
126
|
index.registerInstance(this, hostRef);
|
|
122
127
|
this.tabs = ['Active', 'Pending', 'Finished', 'Code'];
|
|
123
128
|
this.showNotification = 1;
|
|
129
|
+
this.onOpenNotification = (event) => {
|
|
130
|
+
this.notification = event.detail;
|
|
131
|
+
setTimeout(() => (this.notification = null), 10000);
|
|
132
|
+
};
|
|
124
133
|
this.checkAttrs = () => {
|
|
125
134
|
if (!this.endpoint) {
|
|
126
135
|
this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
|
|
@@ -142,12 +151,16 @@ const CasinoChallengesContainer = class {
|
|
|
142
151
|
});
|
|
143
152
|
};
|
|
144
153
|
this.handleTabClick = (index) => () => {
|
|
154
|
+
this.notification = null;
|
|
145
155
|
this.activeTabIndex = index;
|
|
146
156
|
this.challenges = [];
|
|
147
157
|
this.pageNumber = 0;
|
|
148
158
|
this.total = 0;
|
|
149
159
|
this.loadData();
|
|
150
160
|
};
|
|
161
|
+
this.renderNotification = () => {
|
|
162
|
+
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))))));
|
|
163
|
+
};
|
|
151
164
|
this.mbSource = undefined;
|
|
152
165
|
this.clientStyling = undefined;
|
|
153
166
|
this.clientStylingUrl = undefined;
|
|
@@ -166,6 +179,7 @@ const CasinoChallengesContainer = class {
|
|
|
166
179
|
this.pageNumber = 0;
|
|
167
180
|
this.total = 0;
|
|
168
181
|
this.pageSize = 20;
|
|
182
|
+
this.notification = null;
|
|
169
183
|
}
|
|
170
184
|
handleClientStylingChange(newValue, oldValue) {
|
|
171
185
|
if (newValue != oldValue) {
|
|
@@ -239,7 +253,7 @@ const CasinoChallengesContainer = class {
|
|
|
239
253
|
}
|
|
240
254
|
render() {
|
|
241
255
|
var _a, _b;
|
|
242
|
-
return (index.h("div", { key: '
|
|
256
|
+
return (index.h("div", { key: '18dbc05aa857b65262bfce730e1e410e478bd657', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '592c62d6d5334874112f9fcb88547b22f73e75ad', class: "challenges" }, index.h("div", { key: '4e96b468e8be71f2f2a785954dc3a473cc2e6cda', class: "challenges__header" }, index.h("h1", { key: '292d55fd2dcd2f23f02b3648657c696dbf2104e0', class: "challenges__title" }, index.h("img", { key: '6eb390eebfdffd29c6cc42cb6c8585617419561b', src: titleIconSvg, alt: "icon" }), translate('title', this.language)), this.session && (index.h("div", { key: '605ba6644169130cef63e675388a801124a8cbbd', class: "challenges__tabs" }, this.tabs.map((label, index$1) => (index.h("div", { class: `challenges__tab ${index$1 === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index$1) }, label, this.showNotification === index$1 && index.h("img", { src: notificationSvg }))))))), this.activeTabIndex < 2 && (index.h("div", { key: '2951e0f23a3de8fae3e1bbfd6eb1d607d2dc2275', class: "challenges__content" }, this.challenges.length === 0 && !this.loading && (index.h("div", { key: 'dc42b66dfb6f4fa42753123bdc07e00bfb716c3d', class: "empty" }, translate('empty', this.language))), index.h("casino-challenges-list", { key: '53eb947a6637400095e9c7b77c58b47b70b45afb', challenges: this.challenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, loading: this.loading, hasMore: ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: this.activeTabIndex }))), this.activeTabIndex === 2 && (index.h("casino-challenges-player-history", { key: '467ce910010a03e26c1ecfac3c14f35acbc307c9', translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: ((_b = this.playerHistory) === null || _b === void 0 ? void 0 : _b.length) < this.total })), this.activeTabIndex === 3 && (index.h("casino-challenges-claim-code", { key: '62a08e91c1d991cd53e4f7ed47fcd2da9b323dc7', endpoint: this.endpoint, session: this.session, domain: this.domain, onOpenNotification: this.onOpenNotification })), this.notification && this.renderNotification())));
|
|
243
257
|
}
|
|
244
258
|
static get watchers() { return {
|
|
245
259
|
"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-
|
|
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],"challenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[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"]},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"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[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;
|
|
@@ -71,10 +71,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
71
71
|
}
|
|
72
72
|
switch(bundleId) {
|
|
73
73
|
|
|
74
|
-
case 'casino-challenge-
|
|
74
|
+
case 'casino-challenge-card_6.cjs':
|
|
75
75
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
76
76
|
/* webpackMode: "lazy" */
|
|
77
|
-
'./casino-challenge-
|
|
77
|
+
'./casino-challenge-card_6.cjs.entry.js')); }).then(processMod, consoleError);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
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-da454267.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-
|
|
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],"challenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32],"notification":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[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"]},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"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.0007 4.74992C11.1306 4.74992 4.75065 11.1299 4.75065 18.9999C4.75065 26.87 11.1306 33.2499 19.0007 33.2499C26.8707 33.2499 33.2507 26.87 33.2507 18.9999C33.2507 11.1299 26.8707 4.74992 19.0007 4.74992ZM1.58398 18.9999C1.58398 9.38096 9.38169 1.58325 19.0007 1.58325C28.6196 1.58325 36.4173 9.38096 36.4173 18.9999C36.4173 28.6189 28.6196 36.4166 19.0007 36.4166C9.38169 36.4166 1.58398 28.6189 1.58398 18.9999ZM27.2452 13.1303C27.8636 13.7487 27.8636 14.7512 27.2452 15.3695L17.7452 24.8695C17.1269 25.4878 16.1244 25.4878 15.5061 24.8695L10.7561 20.1195C10.1377 19.5012 10.1377 18.4987 10.7561 17.8803C11.3744 17.262 12.3769 17.262 12.9952 17.8803L16.6257 21.5107L25.0061 13.1303C25.6244 12.512 26.6269 12.512 27.2452 13.1303Z" fill="#00B74F"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="38" height="39" viewBox="0 0 38 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M23.7493 14.7498L14.2493 24.2498M14.2493 14.7498L23.7493 24.2498M34.8327 19.4998C34.8327 28.2443 27.7438 35.3332 18.9993 35.3332C10.2548 35.3332 3.16602 28.2443 3.16602 19.4998C3.16602 10.7553 10.2548 3.6665 18.9993 3.6665C27.7438 3.6665 34.8327 10.7553 34.8327 19.4998Z" stroke="#D6421E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/collection/components/casino-challenges-container/casino-challenges-container.css
CHANGED
|
@@ -83,4 +83,45 @@
|
|
|
83
83
|
width: inherit;
|
|
84
84
|
padding: 5px 0;
|
|
85
85
|
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.notification {
|
|
89
|
+
display: flex;
|
|
90
|
+
position: absolute;
|
|
91
|
+
align-items: center;
|
|
92
|
+
bottom: 90px;
|
|
93
|
+
box-shadow: 0 0 20px 0 rgba(136, 143, 170, 0.15);
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
padding: 20px 16px;
|
|
96
|
+
gap: 16px;
|
|
97
|
+
right: 40px;
|
|
98
|
+
max-width: 445px;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
background-color: var(--emw--background-success-color, #C9F0D7);
|
|
101
|
+
border: 2px solid var(--emw--border-success-color, #00B74F);
|
|
102
|
+
}
|
|
103
|
+
.notification.errored {
|
|
104
|
+
background: var(--emw--background-errored-color, #FFE1DF);
|
|
105
|
+
border-color: var(--emw--color-error, #D6421E);
|
|
106
|
+
}
|
|
107
|
+
.notification__icon {
|
|
108
|
+
width: 32px;
|
|
109
|
+
height: 32px;
|
|
110
|
+
}
|
|
111
|
+
.notification__message {
|
|
112
|
+
margin: 0;
|
|
113
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
114
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
115
|
+
}
|
|
116
|
+
.notification__message .active-tab {
|
|
117
|
+
color: var(--emw--border-success-color, #00B74F);
|
|
118
|
+
text-decoration-line: underline;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
@container challenges-container (max-width: 576px) {
|
|
122
|
+
.notification {
|
|
123
|
+
bottom: 60px;
|
|
124
|
+
right: 12px;
|
|
125
|
+
max-width: 290px;
|
|
126
|
+
}
|
|
86
127
|
}
|
package/dist/collection/components/casino-challenges-container/casino-challenges-container.js
CHANGED
|
@@ -3,12 +3,19 @@ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../.
|
|
|
3
3
|
import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
|
|
4
4
|
import titleIcon from "../../assets/title-icon.svg";
|
|
5
5
|
import notificationIcon from "../../assets/notification.svg";
|
|
6
|
+
import errorIcon from "../../assets/error-circle.svg";
|
|
7
|
+
import checkIcon from "../../assets/check-circle.svg";
|
|
6
8
|
import "../../../../../casino-challenges-list/dist/types/index";
|
|
7
9
|
import "../../../../../casino-challenges-player-history/dist/types/index";
|
|
10
|
+
import "../../../../../casino-challenges-claim-code/dist/types/index";
|
|
8
11
|
export class CasinoChallengesContainer {
|
|
9
12
|
constructor() {
|
|
10
13
|
this.tabs = ['Active', 'Pending', 'Finished', 'Code'];
|
|
11
14
|
this.showNotification = 1;
|
|
15
|
+
this.onOpenNotification = (event) => {
|
|
16
|
+
this.notification = event.detail;
|
|
17
|
+
setTimeout(() => (this.notification = null), 10000);
|
|
18
|
+
};
|
|
12
19
|
this.checkAttrs = () => {
|
|
13
20
|
if (!this.endpoint) {
|
|
14
21
|
this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
|
|
@@ -30,12 +37,16 @@ export class CasinoChallengesContainer {
|
|
|
30
37
|
});
|
|
31
38
|
};
|
|
32
39
|
this.handleTabClick = (index) => () => {
|
|
40
|
+
this.notification = null;
|
|
33
41
|
this.activeTabIndex = index;
|
|
34
42
|
this.challenges = [];
|
|
35
43
|
this.pageNumber = 0;
|
|
36
44
|
this.total = 0;
|
|
37
45
|
this.loadData();
|
|
38
46
|
};
|
|
47
|
+
this.renderNotification = () => {
|
|
48
|
+
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))))));
|
|
49
|
+
};
|
|
39
50
|
this.mbSource = undefined;
|
|
40
51
|
this.clientStyling = undefined;
|
|
41
52
|
this.clientStylingUrl = undefined;
|
|
@@ -54,6 +65,7 @@ export class CasinoChallengesContainer {
|
|
|
54
65
|
this.pageNumber = 0;
|
|
55
66
|
this.total = 0;
|
|
56
67
|
this.pageSize = 20;
|
|
68
|
+
this.notification = null;
|
|
57
69
|
}
|
|
58
70
|
handleClientStylingChange(newValue, oldValue) {
|
|
59
71
|
if (newValue != oldValue) {
|
|
@@ -127,7 +139,7 @@ export class CasinoChallengesContainer {
|
|
|
127
139
|
}
|
|
128
140
|
render() {
|
|
129
141
|
var _a, _b;
|
|
130
|
-
return (h("div", { key: '
|
|
142
|
+
return (h("div", { key: '18dbc05aa857b65262bfce730e1e410e478bd657', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '592c62d6d5334874112f9fcb88547b22f73e75ad', class: "challenges" }, h("div", { key: '4e96b468e8be71f2f2a785954dc3a473cc2e6cda', class: "challenges__header" }, h("h1", { key: '292d55fd2dcd2f23f02b3648657c696dbf2104e0', class: "challenges__title" }, h("img", { key: '6eb390eebfdffd29c6cc42cb6c8585617419561b', src: titleIcon, alt: "icon" }), translate('title', this.language)), this.session && (h("div", { key: '605ba6644169130cef63e675388a801124a8cbbd', class: "challenges__tabs" }, this.tabs.map((label, index) => (h("div", { class: `challenges__tab ${index === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationIcon }))))))), this.activeTabIndex < 2 && (h("div", { key: '2951e0f23a3de8fae3e1bbfd6eb1d607d2dc2275', class: "challenges__content" }, this.challenges.length === 0 && !this.loading && (h("div", { key: 'dc42b66dfb6f4fa42753123bdc07e00bfb716c3d', class: "empty" }, translate('empty', this.language))), h("casino-challenges-list", { key: '53eb947a6637400095e9c7b77c58b47b70b45afb', challenges: this.challenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, loading: this.loading, hasMore: ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: this.activeTabIndex }))), this.activeTabIndex === 2 && (h("casino-challenges-player-history", { key: '467ce910010a03e26c1ecfac3c14f35acbc307c9', translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: ((_b = this.playerHistory) === null || _b === void 0 ? void 0 : _b.length) < this.total })), this.activeTabIndex === 3 && (h("casino-challenges-claim-code", { key: '62a08e91c1d991cd53e4f7ed47fcd2da9b323dc7', endpoint: this.endpoint, session: this.session, domain: this.domain, onOpenNotification: this.onOpenNotification })), this.notification && this.renderNotification())));
|
|
131
143
|
}
|
|
132
144
|
static get is() { return "casino-challenges-container"; }
|
|
133
145
|
static get encapsulation() { return "shadow"; }
|
|
@@ -314,7 +326,8 @@ export class CasinoChallengesContainer {
|
|
|
314
326
|
"loading": {},
|
|
315
327
|
"pageNumber": {},
|
|
316
328
|
"total": {},
|
|
317
|
-
"pageSize": {}
|
|
329
|
+
"pageSize": {},
|
|
330
|
+
"notification": {}
|
|
318
331
|
};
|
|
319
332
|
}
|
|
320
333
|
static get watchers() {
|