@everymatrix/lottery-banner 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-4511b749.js → index-0a0cc64c.js} +18 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-banner-a5256c5a.js +3032 -0
- package/dist/cjs/lottery-banner.cjs.entry.js +2 -2
- package/dist/cjs/lottery-banner.cjs.js +2 -2
- package/dist/collection/components/lottery-banner/lottery-banner.css +7 -3
- package/dist/collection/components/lottery-banner/lottery-banner.js +76 -3
- package/dist/collection/utils/locale.utils.js +5 -2
- package/dist/collection/utils/utils.js +42 -1
- package/dist/esm/{index-0b45dd81.js → index-58dd14ef.js} +18 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-banner-925a2ddf.js +3030 -0
- package/dist/esm/lottery-banner.entry.js +2 -2
- package/dist/esm/lottery-banner.js +3 -3
- package/dist/lottery-banner/index-58dd14ef.js +2 -0
- package/dist/lottery-banner/index.esm.js +1 -1
- package/dist/lottery-banner/lottery-banner-925a2ddf.js +1 -0
- package/dist/lottery-banner/lottery-banner.entry.js +1 -1
- package/dist/lottery-banner/lottery-banner.esm.js +1 -1
- package/dist/types/components/lottery-banner/lottery-banner.d.ts +18 -1
- package/dist/types/components.d.ts +29 -2
- package/dist/types/utils/utils.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/lottery-banner-73236552.js +0 -252
- package/dist/esm/lottery-banner-89c08855.js +0 -250
- package/dist/lottery-banner/index-0b45dd81.js +0 -2
- package/dist/lottery-banner/lottery-banner-89c08855.js +0 -1
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-0b45dd81.js';
|
|
2
|
-
|
|
3
|
-
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @name setClientStyling
|
|
7
|
-
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
8
|
-
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
9
|
-
* @param {string} clientStyling The style content
|
|
10
|
-
*/
|
|
11
|
-
function setClientStyling(stylingContainer, clientStyling) {
|
|
12
|
-
if (stylingContainer) {
|
|
13
|
-
const sheet = document.createElement('style');
|
|
14
|
-
sheet.innerHTML = clientStyling;
|
|
15
|
-
stylingContainer.appendChild(sheet);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @name setClientStylingURL
|
|
21
|
-
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
22
|
-
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
23
|
-
* @param {string} clientStylingUrl The URL of the style content
|
|
24
|
-
*/
|
|
25
|
-
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
-
if (!stylingContainer || !clientStylingUrl) return;
|
|
27
|
-
|
|
28
|
-
const url = new URL(clientStylingUrl);
|
|
29
|
-
|
|
30
|
-
fetch(url.href)
|
|
31
|
-
.then((res) => res.text())
|
|
32
|
-
.then((data) => {
|
|
33
|
-
const cssFile = document.createElement('style');
|
|
34
|
-
cssFile.innerHTML = data;
|
|
35
|
-
if (stylingContainer) {
|
|
36
|
-
stylingContainer.appendChild(cssFile);
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.catch((err) => {
|
|
40
|
-
console.error('There was an error while trying to load client styling from URL', err);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @name setStreamLibrary
|
|
46
|
-
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
47
|
-
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
48
|
-
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
49
|
-
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
50
|
-
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
51
|
-
*/
|
|
52
|
-
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
53
|
-
if (!window.emMessageBus) return;
|
|
54
|
-
|
|
55
|
-
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
56
|
-
|
|
57
|
-
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
58
|
-
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
59
|
-
|
|
60
|
-
return subscription;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (!window[StyleCacheKey]) {
|
|
64
|
-
window[StyleCacheKey] = {};
|
|
65
|
-
}
|
|
66
|
-
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
67
|
-
|
|
68
|
-
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
69
|
-
const wrappedUnsubscribe = () => {
|
|
70
|
-
if (window[StyleCacheKey][domain]) {
|
|
71
|
-
const cachedObject = window[StyleCacheKey][domain];
|
|
72
|
-
cachedObject.refCount > 1
|
|
73
|
-
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
74
|
-
: delete window[StyleCacheKey][domain];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
originalUnsubscribe();
|
|
78
|
-
};
|
|
79
|
-
subscription.unsubscribe = wrappedUnsubscribe;
|
|
80
|
-
|
|
81
|
-
return subscription;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function getStyleTagSubscription(stylingContainer, domain) {
|
|
85
|
-
const sheet = document.createElement('style');
|
|
86
|
-
|
|
87
|
-
return window.emMessageBus.subscribe(domain, (data) => {
|
|
88
|
-
if (stylingContainer) {
|
|
89
|
-
sheet.innerHTML = data;
|
|
90
|
-
stylingContainer.appendChild(sheet);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
96
|
-
return window.emMessageBus.subscribe(domain, (data) => {
|
|
97
|
-
if (!stylingContainer) return;
|
|
98
|
-
|
|
99
|
-
const shadowRoot = stylingContainer.getRootNode();
|
|
100
|
-
const cacheStyleObject = window[StyleCacheKey];
|
|
101
|
-
let cachedStyle = cacheStyleObject[domain]?.sheet;
|
|
102
|
-
|
|
103
|
-
if (!cachedStyle) {
|
|
104
|
-
cachedStyle = new CSSStyleSheet();
|
|
105
|
-
cachedStyle.replaceSync(data);
|
|
106
|
-
cacheStyleObject[domain] = {
|
|
107
|
-
sheet: cachedStyle,
|
|
108
|
-
refCount: 1
|
|
109
|
-
};
|
|
110
|
-
} else {
|
|
111
|
-
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
115
|
-
if (!currentSheets.includes(cachedStyle)) {
|
|
116
|
-
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
122
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
123
|
-
const TRANSLATIONS = {
|
|
124
|
-
en: {
|
|
125
|
-
stopAt: 'Stop at',
|
|
126
|
-
turnover: 'Turnover: '
|
|
127
|
-
},
|
|
128
|
-
ro: {
|
|
129
|
-
stop: 'Oprește',
|
|
130
|
-
at: 'la'
|
|
131
|
-
},
|
|
132
|
-
fr: {
|
|
133
|
-
stop: 'Arrêtez',
|
|
134
|
-
at: 'à'
|
|
135
|
-
},
|
|
136
|
-
ar: {
|
|
137
|
-
stop: 'توقف',
|
|
138
|
-
at: 'في'
|
|
139
|
-
},
|
|
140
|
-
hr: {
|
|
141
|
-
stop: 'Stop',
|
|
142
|
-
at: 'u'
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const translate = (key, customLang) => {
|
|
146
|
-
const lang = customLang;
|
|
147
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
148
|
-
};
|
|
149
|
-
const getTranslations = (data) => {
|
|
150
|
-
Object.keys(data).forEach((item) => {
|
|
151
|
-
for (let key in data[item]) {
|
|
152
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
const resolveTranslationUrl = async (translationUrl) => {
|
|
157
|
-
if (translationUrl) {
|
|
158
|
-
try {
|
|
159
|
-
const response = await fetch(translationUrl);
|
|
160
|
-
if (!response.ok) {
|
|
161
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
162
|
-
}
|
|
163
|
-
const translations = await response.json();
|
|
164
|
-
getTranslations(translations);
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const lotteryBannerCss = ":host {\n display: block;\n}\n\n.lottery-banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--lottery-banner-gap, 0.5rem);\n padding: var(--lottery-banner-padding, 0px 20px);\n background: var(--lottery-banner-background, var(--emw--color-primary, #fed275));\n border-top: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-bottom: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-left: var(--lottery-banner-border-left, none);\n border-right: var(--lottery-banner-border-right, none);\n border-radius: var(--lottery-banner-border-radius, 0);\n white-space: nowrap;\n height: var(--lottery-banner-height, 50px);\n container-type: inline-size;\n position: relative;\n box-sizing: border-box;\n}\n\n.lottery-banner__logo-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.lottery-banner__logo-wrapper img {\n height: 100%;\n object-fit: var(--lottery-banner-logo-object-fit, contain);\n}\n\n.lottery-banner__item--center {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.lottery-banner__title {\n text-align: center;\n font-size: var(--lottery-banner-title-font-size, 1.5rem);\n font-weight: 800;\n font-style: italic;\n color: var(--emw--color-typography, #000);\n}\n\n.lottery-banner__info {\n display: flex;\n align-items: center;\n gap: var(--lottery-banner-info-gap, 0.75rem);\n}\n\n.lottery-banner__info-item {\n font-size: var(--lottery-banner-info-font-size, 0.9rem);\n color: var(--lottery-banner-info-color, var(--emw--color-typography, #000));\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n}\n\n.lottery-banner__info-item-label {\n font-weight: var(--lottery-banner-info-label-font-weight, 700);\n color: var(--lottery-banner-info-label-color, var(--emw--color-typography, #000));\n}\n\n.lottery-banner__info-item-value {\n font-weight: var(--lottery-banner-info-value-font-weight, inherit);\n color: var(--lottery-banner-info-value-color, var(--emw--color-typography, #000));\n}\n\n@container (max-width: 700px) {\n .lottery-banner {\n height: auto;\n padding: var(--lottery-banner-mobile-padding, 0.5rem 1rem);\n }\n .lottery-banner__title {\n flex-basis: 100%;\n text-align: var(--lottery-banner-mobile-title-text-align, left);\n }\n .lottery-banner__info {\n flex-wrap: wrap;\n gap: var(--lottery-banner-mobile-info-gap, 0.1rem);\n }\n}";
|
|
173
|
-
const LotteryBannerStyle0 = lotteryBannerCss;
|
|
174
|
-
|
|
175
|
-
const LotteryBanner = class {
|
|
176
|
-
constructor(hostRef) {
|
|
177
|
-
registerInstance(this, hostRef);
|
|
178
|
-
this.mbSource = undefined;
|
|
179
|
-
this.clientStyling = undefined;
|
|
180
|
-
this.clientStylingUrl = undefined;
|
|
181
|
-
this.translationUrl = '';
|
|
182
|
-
this.language = 'en';
|
|
183
|
-
this.logoUrl = undefined;
|
|
184
|
-
this.stopTime = '';
|
|
185
|
-
this.bannerTitle = undefined;
|
|
186
|
-
this.turnover = undefined;
|
|
187
|
-
this.layout = 'logo,title,info';
|
|
188
|
-
}
|
|
189
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
190
|
-
if (newValue !== oldValue) {
|
|
191
|
-
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
195
|
-
if (newValue !== oldValue) {
|
|
196
|
-
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
200
|
-
if (newValue !== oldValue) {
|
|
201
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
async componentWillLoad() {
|
|
205
|
-
if (this.translationUrl) {
|
|
206
|
-
resolveTranslationUrl(this.translationUrl);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
componentDidLoad() {
|
|
210
|
-
if (this.stylingContainer) {
|
|
211
|
-
if (this.mbSource)
|
|
212
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
213
|
-
if (this.clientStyling)
|
|
214
|
-
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
215
|
-
if (this.clientStylingUrl)
|
|
216
|
-
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
disconnectedCallback() {
|
|
220
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
221
|
-
}
|
|
222
|
-
renderElement(item, className = '') {
|
|
223
|
-
switch (item) {
|
|
224
|
-
case 'logo':
|
|
225
|
-
return (h("div", { class: `lottery-banner__logo-wrapper ${className}` }, this.logoUrl && h("img", { alt: "logo", src: this.logoUrl, class: "lottery-banner__logo" })));
|
|
226
|
-
case 'title':
|
|
227
|
-
return this.bannerTitle && h("div", { class: `lottery-banner__title ${className}` }, this.bannerTitle);
|
|
228
|
-
case 'info':
|
|
229
|
-
return (h("div", { class: `lottery-banner__info ${className}` }, this.stopTime && (h("div", { class: "lottery-banner__info-item" }, h("span", { class: "lottery-banner__info-item-label" }, translate('stopAt', this.language)), h("span", { class: "lottery-banner__info-item-value" }, this.stopTime))), (this.turnover !== null && this.turnover !== undefined) && (h("div", { class: "lottery-banner__info-item" }, h("span", { class: "lottery-banner__info-item-label" }, translate('turnover', this.language)), h("span", { class: "lottery-banner__info-item-value" }, this.turnover)))));
|
|
230
|
-
default:
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
render() {
|
|
235
|
-
const layoutItems = this.layout.split(',').map((item) => item.trim());
|
|
236
|
-
return (h("section", { key: 'd26c3cb4854c8fea2367df25b6e8cf11b23731e4', ref: (el) => (this.stylingContainer = el), class: "lottery-banner" }, layoutItems.map((item, index) => {
|
|
237
|
-
const isMiddle = layoutItems.length === 3 && index === 1;
|
|
238
|
-
const className = isMiddle ? 'lottery-banner__item--center' : '';
|
|
239
|
-
return this.renderElement(item, className);
|
|
240
|
-
})));
|
|
241
|
-
}
|
|
242
|
-
static get watchers() { return {
|
|
243
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
244
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
245
|
-
"mbSource": ["handleMbSourceChange"]
|
|
246
|
-
}; }
|
|
247
|
-
};
|
|
248
|
-
LotteryBanner.style = LotteryBannerStyle0;
|
|
249
|
-
|
|
250
|
-
export { LotteryBanner as L };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>(0,console.error)(e,t),s=new Map,r=new Map,i="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),d=!1,m=[],p=[],y=(e,t)=>n=>{e.push(n),d||(d=!0,t&&4&a.l?b(w):a.raf(w))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){o(e)}e.length=0},w=()=>{$(m),$(p),(d=m.length>0)&&a.raf(w)},b=e=>f().then(e),v=y(p,!0),S={},g=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>E,ok:()=>k,unwrap:()=>P,unwrapErr:()=>x});var k=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function E(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>k(e))):k(n)}if(e.isErr)return O(e.value);throw"should never get here"}var C,M,P=e=>{if(e.isOk)return e.value;throw e.value},x=e=>{if(e.isErr)return e.value;throw e.value},L=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!g(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},N=new WeakMap,R=e=>"sc-"+e.v,U=(e,t,n,l,o,s)=>{if(n!==l){let r=((e,t)=>t in e)(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,o=D(n),s=D(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else{const i=g(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&s||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},W=/\s/,D=e=>e?e.split(W):[],F=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of H(Object.keys(o)))e in s||U(l,e,o[e],void 0,n,t.l);for(const e of H(Object.keys(s)))U(l,e,o[e],s[e],n,t.l)};function H(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var q=!1,G=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=u.createTextNode(l.i);else if(o=l.$=u.createElement(l.p),F(null,l,q),null!=C&&o["s-si"]!==C&&o.classList.add(o["s-si"]=C),l.h)for(r=0;r<l.h.length;++r)s=G(e,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},V=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=G(null,n,o),r&&(l[o].$=r,J(i,r,t)))},_=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;I(t),e&&e.remove()}}},z=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),B=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(F(e,t,q),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(z(h,p,o))B(h,p,o),h=t[++i],p=l[++c];else if(z(d,y,o))B(d,y,o),d=t[--f],y=l[--m];else if(z(h,y,o))B(h,y,o),J(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(z(d,p,o))B(d,p,o),J(e,d.$,h.$),d=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=G(t&&t[c],n,u):(B(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=G(t&&t[c],n,c),p=l[++c]),s&&J(h.$.parentNode,s,h.$)}i>f?V(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&_(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),V(l,null,t,s,0,s.length-1)):null!==o&&_(o,0,o.length-1)):e.i!==r&&(l.data=r)},I=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(I)},J=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),K=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Q=(e,t)=>{if(e.l|=16,!(4&e.l))return K(e,e.j),v((()=>X(e,t)));e.l|=512},X=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=oe(n,"componentWillLoad")),Y(l,(()=>ee(e,n,t)))},Y=(e,t)=>Z(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),Z=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,ee=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=R(t),o=r.get(l);if(e=11===e.nodeType?e:u,o)if("string"==typeof o){let s,r=N.get(e=e.head||e);if(r||N.set(e,r=new Set),!r.has(l)){{s=u.createElement("style"),s.innerHTML=o;const t=null!=(n=a.O)?n:j(u);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=i),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);te(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ne(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},te=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||T(null,null),r=(e=>e&&e.p===A)(t)?t:L(null,null,t);if(M=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,C=l["s-sc"],B(s,r,n)})(e,t,l)}catch(t){o(t,e.$hostElement$)}return null},ne=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,se(t),oe(n,"componentDidLoad"),e.P(t),l||le()),e.S&&(e.S(),e.S=void 0),512&e.l&&b((()=>Q(e,!1))),e.l&=-517},le=()=>{se(u.documentElement),b((()=>(e=>{const t=a.ce("appload",{detail:{namespace:"lottery-banner"}});return e.dispatchEvent(t),t})(c)))},oe=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){o(e)}},se=e=>e.classList.add("hydrated"),re=(e,t,l)=>{var s,r;const i=e.prototype;if(t.L||t.T||e.watchers){e.watchers&&!t.T&&(t.T=e.watchers);const c=Object.entries(null!=(s=t.L)?s:{});if(c.map((([e,[s]])=>{(31&s||2&l&&32&s)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).A.get(t))(0,e)},set(l){((e,t,l,s)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.A.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||g(e)?e:1&t?e+"":e)(l,s.L[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.A.set(t,l),a)){if(s.T&&128&u){const e=s.T[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){o(e,i)}}))}2==(18&u)&&Q(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){a.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.T)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.T)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},ie=e=>{oe(e,"disconnectedCallback")},ce=(e,l={})=>{var f;const d=[],m=l.exclude||[],p=c.customElements,y=u.head,$=y.querySelector("meta[charset]"),w=u.createElement("style"),b=[];let v,S=!0;Object.assign(a,l),a.o=new URL(l.resourcesUrl||"./",u.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((l=>{var i;const c={l:l[0],v:l[1],L:l[2],N:l[3]};4&c.l&&(g=!0),c.L=l[2],c.M=[],c.T=null!=(i=l[4])?i:{};const u=c.v,f=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,A:new Map};l.R=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),S?b.push(this):a.jmp((()=>(e=>{if(!(1&a.l)){const t=n(e),l=t.k,i=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.R)&&t.R.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){K(t,t.j=n);break}}l.L&&Object.entries(l.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.U){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.U;if(!n)return;const l=s.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(s.set(n,e),e[t])),o)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.W}" was not found`);l.isProxied||(n.T=l.watchers,re(l,n,2),l.isProxied=!0);const r=()=>{};t.l|=8;try{new l(t)}catch(e){o(e)}t.l&=-9,t.l|=128,r()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=R(n);if(!r.has(t)){const l=()=>{};((e,t,n)=>{let l=r.get(e);h&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,r.set(e,l)})(t,e,!!(1&n.l)),l()}}}const i=t.j,c=()=>Q(t,!0);i&&i["s-rc"]?i["s-rc"].push(c):c()})(e,t,l)}i()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.l)){const e=n(this);(null==e?void 0:e.t)?ie(e.t):(null==e?void 0:e.R)&&e.R.then((()=>ie(e.t)))}})()))}componentOnReady(){return n(this).R}};c.U=e[0],m.includes(u)||p.get(u)||(d.push(u),p.define(u,re(f,c,1)))}))})),d.length>0&&(g&&(w.textContent+=i),w.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const e=null!=(f=a.O)?f:j(u);null!=e&&w.setAttribute("nonce",e),y.insertBefore(w,$?$.nextSibling:y.firstChild)}S=!1,b.length?b.map((e=>e.connectedCallback())):a.jmp((()=>v=setTimeout(le,30)))},ue=e=>a.O=e;export{ce as b,L as h,f as p,l as r,ue as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,h as t}from"./index-0b45dd81.js";const e="__WIDGET_GLOBAL_STYLE_CACHE__";function r(n,t){if(n){const e=document.createElement("style");e.innerHTML=t,n.appendChild(e)}}function o(n,t){if(!n||!t)return;const e=new URL(t);fetch(e.href).then((n=>n.text())).then((t=>{const e=document.createElement("style");e.innerHTML=t,n&&n.appendChild(e)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}function i(n,t,r,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return r=function(n,t){const e=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{n&&(e.innerHTML=t,n.appendChild(e))}))}(n,t),r;window[e]||(window[e]={}),r=function(n,t){return window.emMessageBus.subscribe(t,(r=>{if(!n)return;const o=n.getRootNode(),i=window[e];let a=i[t]?.sheet;a?i[t].refCount=i[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(r),i[t]={sheet:a,refCount:1});const l=o.adoptedStyleSheets||[];l.includes(a)||(o.adoptedStyleSheets=[...l,a])}))}(n,t);const i=r.unsubscribe.bind(r);return r.unsubscribe=()=>{if(window[e][t]){const n=window[e][t];n.refCount>1?n.refCount=n.refCount-1:delete window[e][t]}i()},r}const a=["ro","en","fr","ar","hr"],l={en:{stopAt:"Stop at",turnover:"Turnover: "},ro:{stop:"Oprește",at:"la"},fr:{stop:"Arrêtez",at:"à"},ar:{stop:"توقف",at:"في"},hr:{stop:"Stop",at:"u"}},s=(n,t)=>{const e=t;return l[void 0!==e&&a.includes(e)?e:"en"][n]},c=class{constructor(t){n(this,t),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.stopTime="",this.bannerTitle=void 0,this.turnover=void 0,this.layout="logo,title,info"}handleClientStylingChange(n,t){n!==t&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(n,t){n!==t&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(n,t){n!==t&&i(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){this.translationUrl&&(async n=>{if(n)try{const e=await fetch(n);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const r=await e.json();t=r,Object.keys(t).forEach((n=>{for(let e in t[n])l[n][e]=t[n][e]}))}catch(n){console.error("Failed to fetch or parse translations from URL:",n)}var t})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}renderElement(n,e=""){switch(n){case"logo":return t("div",{class:`lottery-banner__logo-wrapper ${e}`},this.logoUrl&&t("img",{alt:"logo",src:this.logoUrl,class:"lottery-banner__logo"}));case"title":return this.bannerTitle&&t("div",{class:`lottery-banner__title ${e}`},this.bannerTitle);case"info":return t("div",{class:`lottery-banner__info ${e}`},this.stopTime&&t("div",{class:"lottery-banner__info-item"},t("span",{class:"lottery-banner__info-item-label"},s("stopAt",this.language)),t("span",{class:"lottery-banner__info-item-value"},this.stopTime)),null!=this.turnover&&t("div",{class:"lottery-banner__info-item"},t("span",{class:"lottery-banner__info-item-label"},s("turnover",this.language)),t("span",{class:"lottery-banner__info-item-value"},this.turnover)));default:return null}}render(){const n=this.layout.split(",").map((n=>n.trim()));return t("section",{key:"d26c3cb4854c8fea2367df25b6e8cf11b23731e4",ref:n=>this.stylingContainer=n,class:"lottery-banner"},n.map(((t,e)=>this.renderElement(t,3===n.length&&1===e?"lottery-banner__item--center":""))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};c.style=":host {\n display: block;\n}\n\n.lottery-banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--lottery-banner-gap, 0.5rem);\n padding: var(--lottery-banner-padding, 0px 20px);\n background: var(--lottery-banner-background, var(--emw--color-primary, #fed275));\n border-top: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-bottom: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-left: var(--lottery-banner-border-left, none);\n border-right: var(--lottery-banner-border-right, none);\n border-radius: var(--lottery-banner-border-radius, 0);\n white-space: nowrap;\n height: var(--lottery-banner-height, 50px);\n container-type: inline-size;\n position: relative;\n box-sizing: border-box;\n}\n\n.lottery-banner__logo-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.lottery-banner__logo-wrapper img {\n height: 100%;\n object-fit: var(--lottery-banner-logo-object-fit, contain);\n}\n\n.lottery-banner__item--center {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.lottery-banner__title {\n text-align: center;\n font-size: var(--lottery-banner-title-font-size, 1.5rem);\n font-weight: 800;\n font-style: italic;\n color: var(--emw--color-typography, #000);\n}\n\n.lottery-banner__info {\n display: flex;\n align-items: center;\n gap: var(--lottery-banner-info-gap, 0.75rem);\n}\n\n.lottery-banner__info-item {\n font-size: var(--lottery-banner-info-font-size, 0.9rem);\n color: var(--lottery-banner-info-color, var(--emw--color-typography, #000));\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n}\n\n.lottery-banner__info-item-label {\n font-weight: var(--lottery-banner-info-label-font-weight, 700);\n color: var(--lottery-banner-info-label-color, var(--emw--color-typography, #000));\n}\n\n.lottery-banner__info-item-value {\n font-weight: var(--lottery-banner-info-value-font-weight, inherit);\n color: var(--lottery-banner-info-value-color, var(--emw--color-typography, #000));\n}\n\n@container (max-width: 700px) {\n .lottery-banner {\n height: auto;\n padding: var(--lottery-banner-mobile-padding, 0.5rem 1rem);\n }\n .lottery-banner__title {\n flex-basis: 100%;\n text-align: var(--lottery-banner-mobile-title-text-align, left);\n }\n .lottery-banner__info {\n flex-wrap: wrap;\n gap: var(--lottery-banner-mobile-info-gap, 0.1rem);\n }\n}";export{c as L}
|