@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.
Files changed (25) hide show
  1. package/dist/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js +1 -1
  2. package/dist/casino-engagement-suite-modal-container/p-3cfb21d1.entry.js +1 -0
  3. package/dist/cjs/casino-engagement-suite-modal-container.cjs.js +1 -1
  4. package/dist/cjs/casino-engagement-suite-modal_2.cjs.entry.js +211 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.css +40 -0
  7. package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js +63 -20
  8. package/dist/collection/utils/locale.utils.js +6 -1
  9. package/dist/collection/utils/utils.js +3 -2
  10. package/dist/components/casino-engagement-suite-modal-container.js +42 -18
  11. package/dist/components/casino-engagement-suite-modal2.js +11 -9
  12. package/dist/esm/casino-engagement-suite-modal-container.js +1 -1
  13. package/dist/esm/casino-engagement-suite-modal_2.entry.js +206 -0
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/types/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.d.ts +11 -2
  16. package/dist/types/components.d.ts +8 -0
  17. package/dist/types/models/index.d.ts +7 -2
  18. package/dist/types/utils/utils.d.ts +1 -1
  19. package/package.json +1 -1
  20. package/dist/casino-engagement-suite-modal-container/p-0f126ad9.entry.js +0 -1
  21. package/dist/casino-engagement-suite-modal-container/p-8aa9bb7a.entry.js +0 -1
  22. package/dist/cjs/casino-engagement-suite-modal-container.cjs.entry.js +0 -127
  23. package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +0 -68
  24. package/dist/esm/casino-engagement-suite-modal-container.entry.js +0 -123
  25. package/dist/esm/casino-engagement-suite-modal.entry.js +0 -64
@@ -17,10 +17,15 @@ const TRANSLATIONS = {
17
17
  join: 'Unjoin',
18
18
  unJoin: 'Unjoin',
19
19
  continue: 'Continue',
20
+ okContinue: 'Ok, continue',
20
21
  won: 'You won',
22
+ supportInfo: 'However, some rewards cannot be issued. Please, contact support.',
23
+ noReward: 'Reward cannot be issued',
24
+ contactSupport: 'Please contact support',
21
25
  noChallenges: 'No Challenges yet',
22
26
  tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
23
- tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
27
+ tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward',
28
+ jackpotWin: 'Total Jackpot Win!'
24
29
  }
25
30
  };
26
31
  const translate = (key, customLang) => {
@@ -28,7 +33,12 @@ const translate = (key, customLang) => {
28
33
  return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
29
34
  };
30
35
 
31
- 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}";
36
+ function formatBalance(amount, currency) {
37
+ return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
38
+ .format(amount)}`;
39
+ }
40
+
41
+ const casinoEngagementSuiteModalContainerCss = ":host{display:block;font-family:inherit}.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}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.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}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}";
32
42
 
33
43
  const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
34
44
  constructor() {
@@ -51,16 +61,18 @@ const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(c
51
61
  this.device = 'Mobile';
52
62
  this.limitStylingAppends = false;
53
63
  this.openModals = [];
54
- this.rewards = [];
64
+ this.rewardMessage = '';
65
+ this.hasError = false;
55
66
  this.confirmationData = null;
67
+ this.winAmount = { amount: 0, currency: '' };
56
68
  this.handleCloseClick = (e) => {
57
- const type = +e.currentTarget.getAttribute('data-type');
69
+ const type = e.currentTarget.getAttribute('data-type');
58
70
  this.closeModal.emit(type);
59
71
  };
60
72
  this.handleChallengeAttendance = () => {
61
73
  window.postMessage({
62
- type: 'ChallengeAttendance',
63
- confirmationData: this.confirmationData,
74
+ type: 'ChallengeJoinRequest',
75
+ data: this.confirmationData,
64
76
  });
65
77
  };
66
78
  this.setClientStyling = () => {
@@ -86,11 +98,20 @@ const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(c
86
98
  };
87
99
  }
88
100
  openModalHandler(event) {
89
- const { modalType, rewards, confirmationData } = event.detail;
90
- this.openModals = [...this.openModals, modalType];
91
- if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
92
- this.rewards = [...rewards];
101
+ const { modalType, rewardMessage, hasError, confirmationData, winAmount } = event.detail;
102
+ if (winAmount) {
103
+ // If jackpot win modal is already opened
104
+ // add won amount to the previous amount
105
+ if (this.isModalOpen('JACKPOT_REWARD_MODAL')) {
106
+ this.winAmount = { amount: this.winAmount.amount + winAmount.amount, currency: winAmount.currency };
107
+ }
108
+ else {
109
+ this.winAmount = winAmount;
110
+ }
93
111
  }
112
+ this.openModals = [...this.openModals, modalType];
113
+ this.rewardMessage = rewardMessage;
114
+ this.hasError = hasError;
94
115
  if (confirmationData) {
95
116
  this.confirmationData = confirmationData;
96
117
  }
@@ -108,16 +129,16 @@ const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(c
108
129
  }
109
130
  }
110
131
  render() {
111
- const { prevId } = this.confirmationData || {};
112
- 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 ?
132
+ const { ProgressToActivate } = this.confirmationData || {};
133
+ return (h("div", { class: `ModalContainer ${this.device}` }, h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", "show-animation": true, device: this.device }, h("div", { slot: "body" }, h("p", null, translate('won', this.language), " ", h("span", { class: 'ModalReward' }, this.rewardMessage)), this.hasError && (h("p", { class: "SupportInfo" }, translate('supportInfo', this.language)))), 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("JACKPOT_REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", "show-animation": true, modalType: "JACKPOT_REWARD_MODAL", device: this.device }, h("div", { slot: "body" }, h("div", { class: "JackpotWinText" }, translate('jackpotWin', this.language)), h("div", { class: "JackpotWinAmount" }, formatBalance(this.winAmount.amount, this.winAmount.currency))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'JACKPOT_REWARD_MODAL' }, translate('continue', this.language)))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: ProgressToActivate ?
113
134
  translate('joinHeader', this.language) :
114
- 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 ?
135
+ translate('unJoinHeader', this.language), modalType: "TARGET_MODAL", device: this.device, isLoading: this.isJoiningToChallenge }, h("div", { slot: "body" }, h("p", { class: 'LeftAlign' }, translate('desc', this.language)), h("p", { class: 'LeftAlign' }, ProgressToActivate ?
115
136
  translate('joinQuestion', this.language) :
116
- translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
137
+ translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: `ModalFooterButton ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleChallengeAttendance }, ProgressToActivate ?
117
138
  translate('joinConfirm', this.language) :
118
- translate('unJoinConfirm', this.language)), h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, prevId ?
139
+ translate('unJoinConfirm', this.language)), h("button", { class: `ModalFooterButtonOutlined ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, ProgressToActivate ?
119
140
  translate('joinReject', this.language) :
120
- translate('unJoinReject', this.language)))))));
141
+ translate('unJoinReject', this.language))))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("SUPPORT_MODAL"), header: translate('noReward', this.language), contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/alert.svg", modalType: "SUPPORT_MODAL", device: this.device }, h("div", { slot: "body" }, h("span", null, translate('contactSupport', this.language))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'SUPPORT_MODAL' }, translate('okContinue', this.language))))));
121
142
  }
122
143
  get host() { return this; }
123
144
  static get style() { return casinoEngagementSuiteModalContainerCss; }
@@ -125,11 +146,14 @@ const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(c
125
146
  "clientStyling": [513, "client-styling"],
126
147
  "clientStylingUrl": [513, "client-styling-url"],
127
148
  "language": [1],
149
+ "isJoiningToChallenge": [1028, "is-joining-to-challenge"],
128
150
  "device": [1],
129
151
  "limitStylingAppends": [32],
130
152
  "openModals": [32],
131
- "rewards": [32],
132
- "confirmationData": [32]
153
+ "rewardMessage": [32],
154
+ "hasError": [32],
155
+ "confirmationData": [32],
156
+ "winAmount": [32]
133
157
  }, [[16, "openModal", "openModalHandler"], [16, "closeModal", "closeModalHandler"]]]);
134
158
  function defineCustomElement$1() {
135
159
  if (typeof customElements === "undefined") {
@@ -1,11 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
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}";
3
+ const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{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 h1{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;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%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
9
4
 
10
5
  const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
6
  constructor() {
@@ -22,8 +17,14 @@ const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extend
22
17
  */
23
18
  this.clientStylingUrl = '';
24
19
  this.device = 'Mobile';
20
+ /**
21
+ * Show win animation
22
+ */
23
+ this.showAnimation = false;
25
24
  this.limitStylingAppends = false;
26
25
  this.handleCloseClick = () => {
26
+ if (this.isLoading)
27
+ return;
27
28
  this.closeModal.emit(this.modalType);
28
29
  };
29
30
  this.setClientStyling = () => {
@@ -55,9 +56,9 @@ const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extend
55
56
  }
56
57
  }
57
58
  render() {
58
- 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: {
59
+ return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, h("div", { class: "ModalWinAnimation" }), h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
59
60
  background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
60
- } })) : 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" })))));
61
+ } })) : 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" })))));
61
62
  }
62
63
  get host() { return this; }
63
64
  static get style() { return casinoEngagementSuiteModalCss; }
@@ -65,11 +66,12 @@ const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extend
65
66
  "clientStyling": [513, "client-styling"],
66
67
  "clientStylingUrl": [513, "client-styling-url"],
67
68
  "isOpen": [4, "is-open"],
69
+ "isLoading": [1028, "is-loading"],
68
70
  "header": [1],
69
- "icon": [1],
70
71
  "contentIcon": [1, "content-icon"],
71
72
  "modalType": [1, "modal-type"],
72
73
  "device": [1],
74
+ "showAnimation": [4, "show-animation"],
73
75
  "limitStylingAppends": [32]
74
76
  }]);
75
77
  function defineCustomElement() {
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["casino-engagement-suite-modal",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]],["casino-engagement-suite-modal-container",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewards":[32],"confirmationData":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
16
+ return bootstrapLazy([["casino-engagement-suite-modal_2",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
17
17
  });
@@ -0,0 +1,206 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
2
+
3
+ const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{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 h1{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;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%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
4
+
5
+ const CasinoEngagementSuiteModal = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.closeModal = createEvent(this, "closeModal", 7);
9
+ /**
10
+ * Client custom styling via string
11
+ */
12
+ this.clientStyling = '';
13
+ /**
14
+ * Client custom styling via url
15
+ */
16
+ this.clientStylingUrl = '';
17
+ this.device = 'Mobile';
18
+ /**
19
+ * Show win animation
20
+ */
21
+ this.showAnimation = false;
22
+ this.limitStylingAppends = false;
23
+ this.handleCloseClick = () => {
24
+ if (this.isLoading)
25
+ return;
26
+ this.closeModal.emit(this.modalType);
27
+ };
28
+ this.setClientStyling = () => {
29
+ let sheet = document.createElement('style');
30
+ sheet.innerHTML = this.clientStyling;
31
+ this.host.prepend(sheet);
32
+ };
33
+ this.setClientStylingURL = () => {
34
+ let url = new URL(this.clientStylingUrl);
35
+ let cssFile = document.createElement('style');
36
+ fetch(url.href)
37
+ .then((res) => res.text())
38
+ .then((data) => {
39
+ cssFile.innerHTML = data;
40
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
41
+ })
42
+ .catch((err) => {
43
+ console.log('Error ', err);
44
+ });
45
+ };
46
+ }
47
+ componentDidRender() {
48
+ if (!this.limitStylingAppends && this.host) {
49
+ if (this.clientStyling)
50
+ this.setClientStyling();
51
+ if (this.clientStylingUrl)
52
+ this.setClientStylingURL();
53
+ this.limitStylingAppends = true;
54
+ }
55
+ }
56
+ render() {
57
+ return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, h("div", { class: "ModalWinAnimation" }), h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
58
+ background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
59
+ } })) : 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" })))));
60
+ }
61
+ get host() { return getElement(this); }
62
+ };
63
+ CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
64
+
65
+ const DEFAULT_LANGUAGE = 'en';
66
+ const SUPPORTED_LANGUAGES = ['en'];
67
+ const TRANSLATIONS = {
68
+ en: {
69
+ joinHeader: 'Choose another challenge?',
70
+ desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
71
+ joinQuestion: 'Would you still like to join another challenge?',
72
+ joinConfirm: 'Yes, join another challenge',
73
+ joinReject: 'No, stay at the current challenge',
74
+ unJoinHeader: 'Quit Challenge?',
75
+ unJoinQuestion: 'Would you still like to quit the challenge?',
76
+ unJoinConfirm: 'Yes, I want to quit challenge',
77
+ unJoinReject: 'No, stay at challenge',
78
+ join: 'Unjoin',
79
+ unJoin: 'Unjoin',
80
+ continue: 'Continue',
81
+ okContinue: 'Ok, continue',
82
+ won: 'You won',
83
+ supportInfo: 'However, some rewards cannot be issued. Please, contact support.',
84
+ noReward: 'Reward cannot be issued',
85
+ contactSupport: 'Please contact support',
86
+ noChallenges: 'No Challenges yet',
87
+ tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
88
+ tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward',
89
+ jackpotWin: 'Total Jackpot Win!'
90
+ }
91
+ };
92
+ const translate = (key, customLang) => {
93
+ const lang = customLang;
94
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
95
+ };
96
+
97
+ function formatBalance(amount, currency) {
98
+ return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
99
+ .format(amount)}`;
100
+ }
101
+
102
+ const casinoEngagementSuiteModalContainerCss = ":host{display:block;font-family:inherit}.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}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.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}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}";
103
+
104
+ const CasinoEngagementSuiteModalContainer = class {
105
+ constructor(hostRef) {
106
+ registerInstance(this, hostRef);
107
+ this.closeModal = createEvent(this, "closeModal", 7);
108
+ /**
109
+ * Client custom styling via string
110
+ */
111
+ this.clientStyling = '';
112
+ /**
113
+ * Client custom styling via url
114
+ */
115
+ this.clientStylingUrl = '';
116
+ /**
117
+ * Language of the widget
118
+ */
119
+ this.language = 'en';
120
+ this.device = 'Mobile';
121
+ this.limitStylingAppends = false;
122
+ this.openModals = [];
123
+ this.rewardMessage = '';
124
+ this.hasError = false;
125
+ this.confirmationData = null;
126
+ this.winAmount = { amount: 0, currency: '' };
127
+ this.handleCloseClick = (e) => {
128
+ const type = e.currentTarget.getAttribute('data-type');
129
+ this.closeModal.emit(type);
130
+ };
131
+ this.handleChallengeAttendance = () => {
132
+ window.postMessage({
133
+ type: 'ChallengeJoinRequest',
134
+ data: this.confirmationData,
135
+ });
136
+ };
137
+ this.setClientStyling = () => {
138
+ let sheet = document.createElement('style');
139
+ sheet.innerHTML = this.clientStyling;
140
+ this.host.prepend(sheet);
141
+ };
142
+ this.setClientStylingURL = () => {
143
+ let url = new URL(this.clientStylingUrl);
144
+ let cssFile = document.createElement('style');
145
+ fetch(url.href)
146
+ .then((res) => res.text())
147
+ .then((data) => {
148
+ cssFile.innerHTML = data;
149
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
150
+ })
151
+ .catch((err) => {
152
+ console.log('Error ', err);
153
+ });
154
+ };
155
+ this.isModalOpen = (type) => {
156
+ return Boolean(this.openModals.find(el => el === type));
157
+ };
158
+ }
159
+ openModalHandler(event) {
160
+ const { modalType, rewardMessage, hasError, confirmationData, winAmount } = event.detail;
161
+ if (winAmount) {
162
+ // If jackpot win modal is already opened
163
+ // add won amount to the previous amount
164
+ if (this.isModalOpen('JACKPOT_REWARD_MODAL')) {
165
+ this.winAmount = { amount: this.winAmount.amount + winAmount.amount, currency: winAmount.currency };
166
+ }
167
+ else {
168
+ this.winAmount = winAmount;
169
+ }
170
+ }
171
+ this.openModals = [...this.openModals, modalType];
172
+ this.rewardMessage = rewardMessage;
173
+ this.hasError = hasError;
174
+ if (confirmationData) {
175
+ this.confirmationData = confirmationData;
176
+ }
177
+ }
178
+ closeModalHandler(event) {
179
+ this.openModals = this.openModals.filter(el => el !== event.detail);
180
+ }
181
+ componentDidRender() {
182
+ if (!this.limitStylingAppends && this.host) {
183
+ if (this.clientStyling)
184
+ this.setClientStyling();
185
+ if (this.clientStylingUrl)
186
+ this.setClientStylingURL();
187
+ this.limitStylingAppends = true;
188
+ }
189
+ }
190
+ render() {
191
+ const { ProgressToActivate } = this.confirmationData || {};
192
+ return (h("div", { class: `ModalContainer ${this.device}` }, h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", "show-animation": true, device: this.device }, h("div", { slot: "body" }, h("p", null, translate('won', this.language), " ", h("span", { class: 'ModalReward' }, this.rewardMessage)), this.hasError && (h("p", { class: "SupportInfo" }, translate('supportInfo', this.language)))), 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("JACKPOT_REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", "show-animation": true, modalType: "JACKPOT_REWARD_MODAL", device: this.device }, h("div", { slot: "body" }, h("div", { class: "JackpotWinText" }, translate('jackpotWin', this.language)), h("div", { class: "JackpotWinAmount" }, formatBalance(this.winAmount.amount, this.winAmount.currency))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'JACKPOT_REWARD_MODAL' }, translate('continue', this.language)))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: ProgressToActivate ?
193
+ translate('joinHeader', this.language) :
194
+ translate('unJoinHeader', this.language), modalType: "TARGET_MODAL", device: this.device, isLoading: this.isJoiningToChallenge }, h("div", { slot: "body" }, h("p", { class: 'LeftAlign' }, translate('desc', this.language)), h("p", { class: 'LeftAlign' }, ProgressToActivate ?
195
+ translate('joinQuestion', this.language) :
196
+ translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: `ModalFooterButton ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleChallengeAttendance }, ProgressToActivate ?
197
+ translate('joinConfirm', this.language) :
198
+ translate('unJoinConfirm', this.language)), h("button", { class: `ModalFooterButtonOutlined ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, ProgressToActivate ?
199
+ translate('joinReject', this.language) :
200
+ translate('unJoinReject', this.language))))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("SUPPORT_MODAL"), header: translate('noReward', this.language), contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/alert.svg", modalType: "SUPPORT_MODAL", device: this.device }, h("div", { slot: "body" }, h("span", null, translate('contactSupport', this.language))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'SUPPORT_MODAL' }, translate('okContinue', this.language))))));
201
+ }
202
+ get host() { return getElement(this); }
203
+ };
204
+ CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
205
+
206
+ export { CasinoEngagementSuiteModal as casino_engagement_suite_modal, CasinoEngagementSuiteModalContainer as casino_engagement_suite_modal_container };
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-engagement-suite-modal",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]],["casino-engagement-suite-modal-container",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewards":[32],"confirmationData":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
13
+ return bootstrapLazy([["casino-engagement-suite-modal_2",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -14,11 +14,20 @@ export declare class CasinoEngagementSuiteModalContainer {
14
14
  * Language of the widget
15
15
  */
16
16
  language: string;
17
+ /**
18
+ *Is joining to challenge
19
+ */
20
+ isJoiningToChallenge: boolean;
17
21
  device: "Mobile" | "Tablet" | "Desktop";
18
22
  private limitStylingAppends;
19
23
  openModals: Array<string>;
20
- rewards: Array<string>;
21
- confirmationData: Record<string, string | number> | null;
24
+ rewardMessage: string;
25
+ hasError: boolean;
26
+ confirmationData: Record<string, number> | null;
27
+ winAmount: {
28
+ amount: number;
29
+ currency: string;
30
+ };
22
31
  host: HTMLElement;
23
32
  openModalHandler(event: {
24
33
  detail: OpenModalEvent;
@@ -16,6 +16,10 @@ export namespace Components {
16
16
  */
17
17
  "clientStylingUrl": string;
18
18
  "device": "Mobile" | "Tablet" | "Desktop";
19
+ /**
20
+ * Is joining to challenge
21
+ */
22
+ "isJoiningToChallenge": boolean;
19
23
  /**
20
24
  * Language of the widget
21
25
  */
@@ -44,6 +48,10 @@ declare namespace LocalJSX {
44
48
  */
45
49
  "clientStylingUrl"?: string;
46
50
  "device"?: "Mobile" | "Tablet" | "Desktop";
51
+ /**
52
+ * Is joining to challenge
53
+ */
54
+ "isJoiningToChallenge"?: boolean;
47
55
  /**
48
56
  * Language of the widget
49
57
  */
@@ -1,5 +1,10 @@
1
1
  export interface OpenModalEvent {
2
2
  modalType: string;
3
- rewards?: Array<string>;
4
- confirmationData?: Record<string, string | number>;
3
+ rewardMessage?: string;
4
+ hasError?: boolean;
5
+ confirmationData?: Record<string, number>;
6
+ winAmount?: {
7
+ amount: number;
8
+ currency: string;
9
+ };
5
10
  }
@@ -1 +1 @@
1
- export declare function format(first: string, middle: string, last: string): string;
1
+ export declare function formatBalance(amount: number, currency: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-modal-container",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as o,c as t,h as e,g as i}from"./p-b944b831.js";const n=class{constructor(e){o(this,e),this.closeModal=t(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.closeModal.emit(this.modalType)},this.setClientStyling=()=>{let o=document.createElement("style");o.innerHTML=this.clientStyling,this.host.prepend(o)},this.setClientStylingURL=()=>{let o=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(o.href).then((o=>o.text())).then((o=>{t.innerHTML=o,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((o=>{console.log("Error ",o)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return e("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device}`},e("div",{class:"ModalContent GradientBorder"},e("div",{class:"IconCloseContainer"},e("button",{class:"IconCloseButton",onClick:this.handleCloseClick},e("img",{src:this.icon,alt:"Сlose modal"}))),this.contentIcon?e("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):"REWARD_MODAL"===this.modalType?e("div",{class:"ModalIcon"}):null,e("div",{class:"ModalHeader"},e("h1",null,this.header)),e("div",{class:"ModalBody"},e("slot",{name:"body"})),e("div",{class:"ModalFooter"},e("slot",{name:"footer"}))))}get host(){return i(this)}};n.style=':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}';export{n as casino_engagement_suite_modal}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as o,g as n}from"./p-b944b831.js";const i=["en"],a={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",won:"You won",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},s=(t,e)=>{const o=e;return a[void 0!==o&&i.includes(o)?o:"en"][t]},l=class{constructor(o){t(this,o),this.closeModal=e(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewards=[],this.confirmationData=null,this.handleCloseClick=t=>{const e=+t.currentTarget.getAttribute("data-type");this.closeModal.emit(e)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeAttendance",confirmationData:this.confirmationData})},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.host.prepend(e)}),1)})).catch((t=>{console.log("Error ",t)}))},this.isModalOpen=t=>Boolean(this.openModals.find((e=>e===t)))}openModalHandler(t){const{modalType:e,rewards:o,confirmationData:n}=t.detail;this.openModals=[...this.openModals,e],(null==o?void 0:o.length)&&(this.rewards=[...o]),n&&(this.confirmationData=n)}closeModalHandler(t){this.openModals=this.openModals.filter((e=>e!==t.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{prevId:t}=this.confirmationData||{};return o("div",{class:`ModalContainer ${this.device}`},o("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},o("div",{slot:"body"},o("p",null,s("won",this.language)," ",o("span",{class:"ModalReward"},this.rewards))),o("div",{slot:"footer"},o("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},s("continue",this.language)))),o("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:s(t?"joinHeader":"unJoinHeader",this.language),icon:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",modalType:"TARGET_MODAL",device:this.device},o("div",{slot:"body"},o("p",{class:"LeftAlign"},s("desc",this.language)),o("p",{class:"LeftAlign"},s(t?"joinQuestion":"unJoinQuestion",this.language))),o("div",{slot:"footer",class:"ManyActions"},o("button",{class:"ModalFooterButton",onClick:this.handleChallengeAttendance},s(t?"joinConfirm":"unJoinConfirm",this.language)),o("button",{class:"ModalFooterButtonOutlined",onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},o("div",{class:"GradientText"},s(t?"joinReject":"unJoinReject",this.language))))))}get host(){return n(this)}};l.style=':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}';export{l as casino_engagement_suite_modal_container}