@everymatrix/casino-engagement-suite-modal-container 1.36.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js +1 -1
- package/dist/casino-engagement-suite-modal-container/p-3cfb21d1.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.js +1 -1
- package/dist/cjs/casino-engagement-suite-modal_2.cjs.entry.js +211 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.css +40 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js +63 -20
- package/dist/collection/utils/locale.utils.js +6 -1
- package/dist/collection/utils/utils.js +3 -2
- package/dist/components/casino-engagement-suite-modal-container.js +42 -18
- package/dist/components/casino-engagement-suite-modal2.js +11 -9
- package/dist/esm/casino-engagement-suite-modal-container.js +1 -1
- package/dist/esm/casino-engagement-suite-modal_2.entry.js +206 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.d.ts +11 -2
- package/dist/types/components.d.ts +8 -0
- package/dist/types/models/index.d.ts +7 -2
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/casino-engagement-suite-modal-container/p-0f126ad9.entry.js +0 -1
- package/dist/casino-engagement-suite-modal-container/p-8aa9bb7a.entry.js +0 -1
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.entry.js +0 -127
- package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +0 -68
- package/dist/esm/casino-engagement-suite-modal-container.entry.js +0 -123
- package/dist/esm/casino-engagement-suite-modal.entry.js +0 -64
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-2394967b.js');
|
|
6
|
-
|
|
7
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['en'];
|
|
9
|
-
const TRANSLATIONS = {
|
|
10
|
-
en: {
|
|
11
|
-
joinHeader: 'Choose another challenge?',
|
|
12
|
-
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
13
|
-
joinQuestion: 'Would you still like to join another challenge?',
|
|
14
|
-
joinConfirm: 'Yes, join another challenge',
|
|
15
|
-
joinReject: 'No, stay at the current challenge',
|
|
16
|
-
unJoinHeader: 'Quit Challenge?',
|
|
17
|
-
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
18
|
-
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
19
|
-
unJoinReject: 'No, stay at challenge',
|
|
20
|
-
join: 'Unjoin',
|
|
21
|
-
unJoin: 'Unjoin',
|
|
22
|
-
continue: 'Continue',
|
|
23
|
-
won: 'You won',
|
|
24
|
-
noChallenges: 'No Challenges yet',
|
|
25
|
-
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
26
|
-
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const translate = (key, customLang) => {
|
|
30
|
-
const lang = customLang;
|
|
31
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const casinoEngagementSuiteModalContainerCss = ":host{display:block}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.LeftAlign{text-align:left;line-height:1.2}";
|
|
35
|
-
|
|
36
|
-
const CasinoEngagementSuiteModalContainer = class {
|
|
37
|
-
constructor(hostRef) {
|
|
38
|
-
index.registerInstance(this, hostRef);
|
|
39
|
-
this.closeModal = index.createEvent(this, "closeModal", 7);
|
|
40
|
-
/**
|
|
41
|
-
* Client custom styling via string
|
|
42
|
-
*/
|
|
43
|
-
this.clientStyling = '';
|
|
44
|
-
/**
|
|
45
|
-
* Client custom styling via url
|
|
46
|
-
*/
|
|
47
|
-
this.clientStylingUrl = '';
|
|
48
|
-
/**
|
|
49
|
-
* Language of the widget
|
|
50
|
-
*/
|
|
51
|
-
this.language = 'en';
|
|
52
|
-
this.device = 'Mobile';
|
|
53
|
-
this.limitStylingAppends = false;
|
|
54
|
-
this.openModals = [];
|
|
55
|
-
this.rewards = [];
|
|
56
|
-
this.confirmationData = null;
|
|
57
|
-
this.handleCloseClick = (e) => {
|
|
58
|
-
const type = +e.currentTarget.getAttribute('data-type');
|
|
59
|
-
this.closeModal.emit(type);
|
|
60
|
-
};
|
|
61
|
-
this.handleChallengeAttendance = () => {
|
|
62
|
-
window.postMessage({
|
|
63
|
-
type: 'ChallengeAttendance',
|
|
64
|
-
confirmationData: this.confirmationData,
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
this.setClientStyling = () => {
|
|
68
|
-
let sheet = document.createElement('style');
|
|
69
|
-
sheet.innerHTML = this.clientStyling;
|
|
70
|
-
this.host.prepend(sheet);
|
|
71
|
-
};
|
|
72
|
-
this.setClientStylingURL = () => {
|
|
73
|
-
let url = new URL(this.clientStylingUrl);
|
|
74
|
-
let cssFile = document.createElement('style');
|
|
75
|
-
fetch(url.href)
|
|
76
|
-
.then((res) => res.text())
|
|
77
|
-
.then((data) => {
|
|
78
|
-
cssFile.innerHTML = data;
|
|
79
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
80
|
-
})
|
|
81
|
-
.catch((err) => {
|
|
82
|
-
console.log('Error ', err);
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
this.isModalOpen = (type) => {
|
|
86
|
-
return Boolean(this.openModals.find(el => el === type));
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
openModalHandler(event) {
|
|
90
|
-
const { modalType, rewards, confirmationData } = event.detail;
|
|
91
|
-
this.openModals = [...this.openModals, modalType];
|
|
92
|
-
if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
|
|
93
|
-
this.rewards = [...rewards];
|
|
94
|
-
}
|
|
95
|
-
if (confirmationData) {
|
|
96
|
-
this.confirmationData = confirmationData;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
closeModalHandler(event) {
|
|
100
|
-
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
101
|
-
}
|
|
102
|
-
componentDidRender() {
|
|
103
|
-
if (!this.limitStylingAppends && this.host) {
|
|
104
|
-
if (this.clientStyling)
|
|
105
|
-
this.setClientStyling();
|
|
106
|
-
if (this.clientStylingUrl)
|
|
107
|
-
this.setClientStylingURL();
|
|
108
|
-
this.limitStylingAppends = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
render() {
|
|
112
|
-
const { prevId } = this.confirmationData || {};
|
|
113
|
-
return (index.h("div", { class: `ModalContainer ${this.device}` }, index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", device: this.device }, index.h("div", { slot: "body" }, index.h("p", null, translate('won', this.language), " ", index.h("span", { class: 'ModalReward' }, this.rewards))), index.h("div", { slot: "footer" }, index.h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))), index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: prevId ?
|
|
114
|
-
translate('joinHeader', this.language) :
|
|
115
|
-
translate('unJoinHeader', this.language), icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", modalType: "TARGET_MODAL", device: this.device }, index.h("div", { slot: "body" }, index.h("p", { class: 'LeftAlign' }, translate('desc', this.language)), index.h("p", { class: 'LeftAlign' }, prevId ?
|
|
116
|
-
translate('joinQuestion', this.language) :
|
|
117
|
-
translate('unJoinQuestion', this.language))), index.h("div", { slot: "footer", class: 'ManyActions' }, index.h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
|
|
118
|
-
translate('joinConfirm', this.language) :
|
|
119
|
-
translate('unJoinConfirm', this.language)), index.h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, index.h("div", { class: 'GradientText' }, prevId ?
|
|
120
|
-
translate('joinReject', this.language) :
|
|
121
|
-
translate('unJoinReject', this.language)))))));
|
|
122
|
-
}
|
|
123
|
-
get host() { return index.getElement(this); }
|
|
124
|
-
};
|
|
125
|
-
CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
|
|
126
|
-
|
|
127
|
-
exports.casino_engagement_suite_modal_container = CasinoEngagementSuiteModalContainer;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-2394967b.js');
|
|
6
|
-
|
|
7
|
-
const MODAL_TYPES = {
|
|
8
|
-
REWARD_MODAL: 'REWARD_MODAL',
|
|
9
|
-
TARGET_MODAL: 'TARGET_MODAL'
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
13
|
-
|
|
14
|
-
const CasinoEngagementSuiteModal = class {
|
|
15
|
-
constructor(hostRef) {
|
|
16
|
-
index.registerInstance(this, hostRef);
|
|
17
|
-
this.closeModal = index.createEvent(this, "closeModal", 7);
|
|
18
|
-
/**
|
|
19
|
-
* Client custom styling via string
|
|
20
|
-
*/
|
|
21
|
-
this.clientStyling = '';
|
|
22
|
-
/**
|
|
23
|
-
* Client custom styling via url
|
|
24
|
-
*/
|
|
25
|
-
this.clientStylingUrl = '';
|
|
26
|
-
this.device = 'Mobile';
|
|
27
|
-
this.limitStylingAppends = false;
|
|
28
|
-
this.handleCloseClick = () => {
|
|
29
|
-
this.closeModal.emit(this.modalType);
|
|
30
|
-
};
|
|
31
|
-
this.setClientStyling = () => {
|
|
32
|
-
let sheet = document.createElement('style');
|
|
33
|
-
sheet.innerHTML = this.clientStyling;
|
|
34
|
-
this.host.prepend(sheet);
|
|
35
|
-
};
|
|
36
|
-
this.setClientStylingURL = () => {
|
|
37
|
-
let url = new URL(this.clientStylingUrl);
|
|
38
|
-
let cssFile = document.createElement('style');
|
|
39
|
-
fetch(url.href)
|
|
40
|
-
.then((res) => res.text())
|
|
41
|
-
.then((data) => {
|
|
42
|
-
cssFile.innerHTML = data;
|
|
43
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
44
|
-
})
|
|
45
|
-
.catch((err) => {
|
|
46
|
-
console.log('Error ', err);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
componentDidRender() {
|
|
51
|
-
if (!this.limitStylingAppends && this.host) {
|
|
52
|
-
if (this.clientStyling)
|
|
53
|
-
this.setClientStyling();
|
|
54
|
-
if (this.clientStylingUrl)
|
|
55
|
-
this.setClientStylingURL();
|
|
56
|
-
this.limitStylingAppends = true;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
return (index.h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, index.h("div", { class: "ModalContent GradientBorder" }, index.h("div", { class: 'IconCloseContainer' }, index.h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, index.h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (index.h("div", { class: "ModalIcon", style: {
|
|
61
|
-
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
62
|
-
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (index.h("div", { class: "ModalIcon" })) : null, index.h("div", { class: "ModalHeader" }, index.h("h1", null, this.header)), index.h("div", { class: "ModalBody" }, index.h("slot", { name: "body" })), index.h("div", { class: "ModalFooter" }, index.h("slot", { name: "footer" })))));
|
|
63
|
-
}
|
|
64
|
-
get host() { return index.getElement(this); }
|
|
65
|
-
};
|
|
66
|
-
CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
|
|
67
|
-
|
|
68
|
-
exports.casino_engagement_suite_modal = CasinoEngagementSuiteModal;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['en'];
|
|
5
|
-
const TRANSLATIONS = {
|
|
6
|
-
en: {
|
|
7
|
-
joinHeader: 'Choose another challenge?',
|
|
8
|
-
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
9
|
-
joinQuestion: 'Would you still like to join another challenge?',
|
|
10
|
-
joinConfirm: 'Yes, join another challenge',
|
|
11
|
-
joinReject: 'No, stay at the current challenge',
|
|
12
|
-
unJoinHeader: 'Quit Challenge?',
|
|
13
|
-
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
14
|
-
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
15
|
-
unJoinReject: 'No, stay at challenge',
|
|
16
|
-
join: 'Unjoin',
|
|
17
|
-
unJoin: 'Unjoin',
|
|
18
|
-
continue: 'Continue',
|
|
19
|
-
won: 'You won',
|
|
20
|
-
noChallenges: 'No Challenges yet',
|
|
21
|
-
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
22
|
-
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const translate = (key, customLang) => {
|
|
26
|
-
const lang = customLang;
|
|
27
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const casinoEngagementSuiteModalContainerCss = ":host{display:block}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.LeftAlign{text-align:left;line-height:1.2}";
|
|
31
|
-
|
|
32
|
-
const CasinoEngagementSuiteModalContainer = class {
|
|
33
|
-
constructor(hostRef) {
|
|
34
|
-
registerInstance(this, hostRef);
|
|
35
|
-
this.closeModal = createEvent(this, "closeModal", 7);
|
|
36
|
-
/**
|
|
37
|
-
* Client custom styling via string
|
|
38
|
-
*/
|
|
39
|
-
this.clientStyling = '';
|
|
40
|
-
/**
|
|
41
|
-
* Client custom styling via url
|
|
42
|
-
*/
|
|
43
|
-
this.clientStylingUrl = '';
|
|
44
|
-
/**
|
|
45
|
-
* Language of the widget
|
|
46
|
-
*/
|
|
47
|
-
this.language = 'en';
|
|
48
|
-
this.device = 'Mobile';
|
|
49
|
-
this.limitStylingAppends = false;
|
|
50
|
-
this.openModals = [];
|
|
51
|
-
this.rewards = [];
|
|
52
|
-
this.confirmationData = null;
|
|
53
|
-
this.handleCloseClick = (e) => {
|
|
54
|
-
const type = +e.currentTarget.getAttribute('data-type');
|
|
55
|
-
this.closeModal.emit(type);
|
|
56
|
-
};
|
|
57
|
-
this.handleChallengeAttendance = () => {
|
|
58
|
-
window.postMessage({
|
|
59
|
-
type: 'ChallengeAttendance',
|
|
60
|
-
confirmationData: this.confirmationData,
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
this.setClientStyling = () => {
|
|
64
|
-
let sheet = document.createElement('style');
|
|
65
|
-
sheet.innerHTML = this.clientStyling;
|
|
66
|
-
this.host.prepend(sheet);
|
|
67
|
-
};
|
|
68
|
-
this.setClientStylingURL = () => {
|
|
69
|
-
let url = new URL(this.clientStylingUrl);
|
|
70
|
-
let cssFile = document.createElement('style');
|
|
71
|
-
fetch(url.href)
|
|
72
|
-
.then((res) => res.text())
|
|
73
|
-
.then((data) => {
|
|
74
|
-
cssFile.innerHTML = data;
|
|
75
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
76
|
-
})
|
|
77
|
-
.catch((err) => {
|
|
78
|
-
console.log('Error ', err);
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
this.isModalOpen = (type) => {
|
|
82
|
-
return Boolean(this.openModals.find(el => el === type));
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
openModalHandler(event) {
|
|
86
|
-
const { modalType, rewards, confirmationData } = event.detail;
|
|
87
|
-
this.openModals = [...this.openModals, modalType];
|
|
88
|
-
if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
|
|
89
|
-
this.rewards = [...rewards];
|
|
90
|
-
}
|
|
91
|
-
if (confirmationData) {
|
|
92
|
-
this.confirmationData = confirmationData;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
closeModalHandler(event) {
|
|
96
|
-
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
97
|
-
}
|
|
98
|
-
componentDidRender() {
|
|
99
|
-
if (!this.limitStylingAppends && this.host) {
|
|
100
|
-
if (this.clientStyling)
|
|
101
|
-
this.setClientStyling();
|
|
102
|
-
if (this.clientStylingUrl)
|
|
103
|
-
this.setClientStylingURL();
|
|
104
|
-
this.limitStylingAppends = true;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
render() {
|
|
108
|
-
const { prevId } = this.confirmationData || {};
|
|
109
|
-
return (h("div", { class: `ModalContainer ${this.device}` }, h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", null, translate('won', this.language), " ", h("span", { class: 'ModalReward' }, this.rewards))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: prevId ?
|
|
110
|
-
translate('joinHeader', this.language) :
|
|
111
|
-
translate('unJoinHeader', this.language), icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", modalType: "TARGET_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", { class: 'LeftAlign' }, translate('desc', this.language)), h("p", { class: 'LeftAlign' }, prevId ?
|
|
112
|
-
translate('joinQuestion', this.language) :
|
|
113
|
-
translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
|
|
114
|
-
translate('joinConfirm', this.language) :
|
|
115
|
-
translate('unJoinConfirm', this.language)), h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, prevId ?
|
|
116
|
-
translate('joinReject', this.language) :
|
|
117
|
-
translate('unJoinReject', this.language)))))));
|
|
118
|
-
}
|
|
119
|
-
get host() { return getElement(this); }
|
|
120
|
-
};
|
|
121
|
-
CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
|
|
122
|
-
|
|
123
|
-
export { CasinoEngagementSuiteModalContainer as casino_engagement_suite_modal_container };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
|
|
2
|
-
|
|
3
|
-
const MODAL_TYPES = {
|
|
4
|
-
REWARD_MODAL: 'REWARD_MODAL',
|
|
5
|
-
TARGET_MODAL: 'TARGET_MODAL'
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
9
|
-
|
|
10
|
-
const CasinoEngagementSuiteModal = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
registerInstance(this, hostRef);
|
|
13
|
-
this.closeModal = createEvent(this, "closeModal", 7);
|
|
14
|
-
/**
|
|
15
|
-
* Client custom styling via string
|
|
16
|
-
*/
|
|
17
|
-
this.clientStyling = '';
|
|
18
|
-
/**
|
|
19
|
-
* Client custom styling via url
|
|
20
|
-
*/
|
|
21
|
-
this.clientStylingUrl = '';
|
|
22
|
-
this.device = 'Mobile';
|
|
23
|
-
this.limitStylingAppends = false;
|
|
24
|
-
this.handleCloseClick = () => {
|
|
25
|
-
this.closeModal.emit(this.modalType);
|
|
26
|
-
};
|
|
27
|
-
this.setClientStyling = () => {
|
|
28
|
-
let sheet = document.createElement('style');
|
|
29
|
-
sheet.innerHTML = this.clientStyling;
|
|
30
|
-
this.host.prepend(sheet);
|
|
31
|
-
};
|
|
32
|
-
this.setClientStylingURL = () => {
|
|
33
|
-
let url = new URL(this.clientStylingUrl);
|
|
34
|
-
let cssFile = document.createElement('style');
|
|
35
|
-
fetch(url.href)
|
|
36
|
-
.then((res) => res.text())
|
|
37
|
-
.then((data) => {
|
|
38
|
-
cssFile.innerHTML = data;
|
|
39
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
40
|
-
})
|
|
41
|
-
.catch((err) => {
|
|
42
|
-
console.log('Error ', err);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
componentDidRender() {
|
|
47
|
-
if (!this.limitStylingAppends && this.host) {
|
|
48
|
-
if (this.clientStyling)
|
|
49
|
-
this.setClientStyling();
|
|
50
|
-
if (this.clientStylingUrl)
|
|
51
|
-
this.setClientStylingURL();
|
|
52
|
-
this.limitStylingAppends = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
57
|
-
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
58
|
-
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
|
|
59
|
-
}
|
|
60
|
-
get host() { return getElement(this); }
|
|
61
|
-
};
|
|
62
|
-
CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
|
|
63
|
-
|
|
64
|
-
export { CasinoEngagementSuiteModal as casino_engagement_suite_modal };
|