@everymatrix/general-stories 1.55.0 → 1.56.2
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/{general-stories-caa7546c.js → general-stories-bbb81cca.js} +87 -26
- package/dist/cjs/general-stories.cjs.entry.js +2 -2
- package/dist/cjs/general-stories.cjs.js +3 -3
- package/dist/cjs/{index-bfe9e0e7.js → index-5b8c1770.js} +19 -44
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/general-stories/general-stories.js +47 -25
- package/dist/esm/{general-stories-2b03e517.js → general-stories-09d4f95e.js} +87 -26
- package/dist/esm/general-stories.entry.js +2 -2
- package/dist/esm/general-stories.js +4 -4
- package/dist/esm/{index-eb27780b.js → index-b4964764.js} +19 -44
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/general-stories/general-stories.esm.js +1 -1
- package/dist/general-stories/index.esm.js +1 -1
- package/dist/general-stories/p-34426db6.js +1 -0
- package/dist/general-stories/p-c85b316a.js +2 -0
- package/dist/general-stories/p-e1076ee3.entry.js +1 -0
- package/dist/types/components/general-stories/general-stories.d.ts +9 -3
- package/dist/types/components.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -6
- package/package.json +1 -1
- package/dist/general-stories/p-33a823ba.js +0 -2
- package/dist/general-stories/p-7421aeac.entry.js +0 -1
- package/dist/general-stories/p-8492d966.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-5b8c1770.js');
|
|
4
4
|
|
|
5
5
|
const getDevice = () => {
|
|
6
6
|
let userAgent = window.navigator.userAgent;
|
|
@@ -85,6 +85,63 @@ const translate = (key, customLang) => {
|
|
|
85
85
|
return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @name setClientStyling
|
|
90
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
91
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
92
|
+
* @param {string} clientStyling The style content
|
|
93
|
+
*/
|
|
94
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
95
|
+
if (stylingContainer) {
|
|
96
|
+
const sheet = document.createElement('style');
|
|
97
|
+
sheet.innerHTML = clientStyling;
|
|
98
|
+
stylingContainer.appendChild(sheet);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @name setClientStylingURL
|
|
104
|
+
* @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
|
|
105
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
106
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
107
|
+
*/
|
|
108
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
109
|
+
const url = new URL(clientStylingUrl);
|
|
110
|
+
|
|
111
|
+
fetch(url.href)
|
|
112
|
+
.then((res) => res.text())
|
|
113
|
+
.then((data) => {
|
|
114
|
+
const cssFile = document.createElement('style');
|
|
115
|
+
cssFile.innerHTML = data;
|
|
116
|
+
if (stylingContainer) {
|
|
117
|
+
stylingContainer.appendChild(cssFile);
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
.catch((err) => {
|
|
121
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @name setStreamLibrary
|
|
127
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
128
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
129
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
130
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
131
|
+
*/
|
|
132
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
133
|
+
if (window.emMessageBus) {
|
|
134
|
+
const sheet = document.createElement('style');
|
|
135
|
+
|
|
136
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
137
|
+
sheet.innerHTML = data;
|
|
138
|
+
if (stylingContainer) {
|
|
139
|
+
stylingContainer.appendChild(sheet);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
88
145
|
const generalStoriesCss = ".ImageContainer{display:flex;flex-direction:row;background-color:var(--emw--color-background, #0E1511);overflow:auto}.StoryThumbnailContainer{margin:5px;position:relative;display:inline-block;border-radius:50%}.StoryThumbnailContainer.Highlighted::before{content:\"\";position:absolute;border-radius:50%;background:linear-gradient(to bottom, var(--emw--color-primary, #22B04E), var(--emw--color-secondary, #E1A749));top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailContainer.Viewed::before{content:\"\";position:absolute;border-radius:50%;height:50px;width:50px;background:var(--emw--color-grey-150, #828282);top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailImage{height:50px;width:50px;border-radius:50%;position:relative;z-index:1}.StoryThumbnailImage.Highlighted,.StoryThumbnailImage.Viewed{border:2px solid var(--emw--color-white, #ffffff)}.FullScreenHeader{position:fixed;top:0;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));top:0px;width:100%;display:flex;flex-direction:column;padding:10px 0;z-index:5;height:30px}.FullScreenHeader .CloseStoryButton{position:absolute;right:0;width:20px;margin-right:20px;margin-top:8px;z-index:50}.FullScreenHeader .ProgressBarContainer{width:90%;height:2px;position:relative;top:0;background-color:var(--emw--color-grey-150, #828282);border-radius:10px;overflow:hidden;margin:0 auto}.FullScreenHeader .ProgressBarContainer .ProgressBar{height:100%;background:var(--emw--color-white, #ffffff);width:0%;transition:width 0.1s linear}.FullScreenStory{position:fixed;top:0;width:100%;height:100%;background-color:var(--emw--color-grey-400, #24211f);display:flex;align-items:center;justify-content:center;overflow:hidden;z-index:300}.FullScreenStory video{height:100vh;width:100vw}.FullScreenStory img{width:100%;height:100%;object-fit:contain}.FullScreenStory .LoadMoreButtonBackground{width:100%;height:15%;background:linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));position:absolute;bottom:0;display:flex;justify-content:center}.FullScreenStory .LoadMoreButtonBackground .LoadMoreButton{width:auto;font-size:var(--emw--font-size-small, 14px);font-family:inherit;background-color:var(--emw--color-grey-50, #F9F8F8);box-shadow:0px 0px 7px 1px var(--emw--color-grey-400, #24211f);color:var(--emw--color-black, #000000);border-radius:50px;position:absolute;bottom:15px;padding:10px 20px}";
|
|
89
146
|
const GeneralStoriesStyle0 = generalStoriesCss;
|
|
90
147
|
|
|
@@ -118,24 +175,6 @@ const GeneralStories = class {
|
|
|
118
175
|
});
|
|
119
176
|
});
|
|
120
177
|
};
|
|
121
|
-
this.setClientStyling = () => {
|
|
122
|
-
let sheet = document.createElement('style');
|
|
123
|
-
sheet.innerHTML = this.clientStyling;
|
|
124
|
-
this.stylingContainer.prepend(sheet);
|
|
125
|
-
};
|
|
126
|
-
this.setClientStylingURL = () => {
|
|
127
|
-
let url = new URL(this.clientStylingUrl);
|
|
128
|
-
let cssFile = document.createElement('style');
|
|
129
|
-
fetch(url.href)
|
|
130
|
-
.then((res) => res.text())
|
|
131
|
-
.then((data) => {
|
|
132
|
-
cssFile.innerHTML = data;
|
|
133
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
134
|
-
})
|
|
135
|
-
.catch((err) => {
|
|
136
|
-
console.log('error ', err);
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
178
|
this.navigateToExternalStoryLink = () => {
|
|
140
179
|
window.postMessage({ type: 'OpenStoryLink', url: this.currentStory.storyUrl }, window.location.href);
|
|
141
180
|
};
|
|
@@ -192,6 +231,7 @@ const GeneralStories = class {
|
|
|
192
231
|
this.cmsEndpoint = undefined;
|
|
193
232
|
this.language = 'en';
|
|
194
233
|
this.cmsEnv = 'stage';
|
|
234
|
+
this.mbSource = undefined;
|
|
195
235
|
this.clientStyling = '';
|
|
196
236
|
this.clientStylingUrl = '';
|
|
197
237
|
this.translationUrl = '';
|
|
@@ -202,11 +242,16 @@ const GeneralStories = class {
|
|
|
202
242
|
this.touchPosStart = undefined;
|
|
203
243
|
this.touchPosEnd = undefined;
|
|
204
244
|
}
|
|
205
|
-
|
|
206
|
-
if (
|
|
207
|
-
this.
|
|
208
|
-
|
|
209
|
-
|
|
245
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
246
|
+
if (newValue != oldValue) {
|
|
247
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
251
|
+
if (newValue != oldValue) {
|
|
252
|
+
if (this.clientStylingUrl)
|
|
253
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
254
|
+
}
|
|
210
255
|
}
|
|
211
256
|
handleNewTranslations() {
|
|
212
257
|
this.isLoading = true;
|
|
@@ -227,6 +272,22 @@ const GeneralStories = class {
|
|
|
227
272
|
await getTranslations(this.translationUrl);
|
|
228
273
|
}
|
|
229
274
|
}
|
|
275
|
+
componentDidLoad() {
|
|
276
|
+
if (this.stylingContainer) {
|
|
277
|
+
if (window.emMessageBus != undefined) {
|
|
278
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
if (this.clientStyling)
|
|
282
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
283
|
+
if (this.clientStylingUrl)
|
|
284
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
disconnectedCallback() {
|
|
289
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
290
|
+
}
|
|
230
291
|
onTouchStart(e) {
|
|
231
292
|
this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
|
|
232
293
|
}
|
|
@@ -279,8 +340,8 @@ const GeneralStories = class {
|
|
|
279
340
|
}
|
|
280
341
|
}
|
|
281
342
|
static get watchers() { return {
|
|
282
|
-
"clientStyling": ["
|
|
283
|
-
"clientStylingUrl": ["
|
|
343
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
344
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"],
|
|
284
345
|
"translationUrl": ["handleNewTranslations"],
|
|
285
346
|
"progress": ["handleTimeEnds"]
|
|
286
347
|
}; }
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const generalStories = require('./general-stories-
|
|
6
|
-
require('./index-
|
|
5
|
+
const generalStories = require('./general-stories-bbb81cca.js');
|
|
6
|
+
require('./index-5b8c1770.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-5b8c1770.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v4.
|
|
9
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
var patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('general-stories.cjs.js', document.baseURI).href));
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["general-stories.cjs",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["
|
|
22
|
+
return index.bootstrapLazy([["general-stories.cjs",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"],"progress":["handleTimeEnds"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -21,10 +21,10 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'general-stories';
|
|
24
|
-
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad:
|
|
24
|
+
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
@@ -391,31 +391,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
391
391
|
if (nonce != null) {
|
|
392
392
|
styleElm.setAttribute("nonce", nonce);
|
|
393
393
|
}
|
|
394
|
-
|
|
395
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
396
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
397
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
398
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
399
|
-
} else if ("host" in styleContainerNode) {
|
|
400
|
-
if (supportsConstructableStylesheets) {
|
|
401
|
-
const stylesheet = new CSSStyleSheet();
|
|
402
|
-
stylesheet.replaceSync(style);
|
|
403
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
404
|
-
} else {
|
|
405
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
406
|
-
if (existingStyleContainer) {
|
|
407
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
408
|
-
} else {
|
|
409
|
-
styleContainerNode.prepend(styleElm);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
} else {
|
|
413
|
-
styleContainerNode.append(styleElm);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
417
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
418
|
-
}
|
|
394
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
|
|
419
395
|
}
|
|
420
396
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
421
397
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -438,7 +414,7 @@ var attachStyles = (hostRef) => {
|
|
|
438
414
|
const scopeId2 = addStyle(
|
|
439
415
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
440
416
|
cmpMeta);
|
|
441
|
-
if (flags & 10 /* needsScopedEncapsulation */
|
|
417
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
442
418
|
elm["s-sc"] = scopeId2;
|
|
443
419
|
elm.classList.add(scopeId2 + "-h");
|
|
444
420
|
}
|
|
@@ -507,11 +483,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
507
483
|
if (memberName === "list") {
|
|
508
484
|
isProp = false;
|
|
509
485
|
} else if (oldValue == null || elm[memberName] != n) {
|
|
510
|
-
|
|
511
|
-
elm[memberName] = n;
|
|
512
|
-
} else {
|
|
513
|
-
elm.setAttribute(memberName, n);
|
|
514
|
-
}
|
|
486
|
+
elm[memberName] = n;
|
|
515
487
|
}
|
|
516
488
|
} else {
|
|
517
489
|
elm[memberName] = newValue;
|
|
@@ -591,9 +563,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
591
563
|
{
|
|
592
564
|
updateElement(null, newVNode2, isSvgMode);
|
|
593
565
|
}
|
|
594
|
-
|
|
595
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
596
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
566
|
+
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
597
567
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
598
568
|
}
|
|
599
569
|
if (newVNode2.$children$) {
|
|
@@ -733,10 +703,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
733
703
|
elm.textContent = "";
|
|
734
704
|
}
|
|
735
705
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
736
|
-
} else if (
|
|
737
|
-
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
738
|
-
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
739
|
-
) {
|
|
706
|
+
} else if (oldChildren !== null) {
|
|
740
707
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
741
708
|
}
|
|
742
709
|
if (isSvgMode && tag === "svg") {
|
|
@@ -889,12 +856,16 @@ var postUpdateComponent = (hostRef) => {
|
|
|
889
856
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
890
857
|
const elm = hostRef.$hostElement$;
|
|
891
858
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
859
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
892
860
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
893
861
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
894
862
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
895
863
|
{
|
|
896
864
|
addHydratedFlag(elm);
|
|
897
865
|
}
|
|
866
|
+
{
|
|
867
|
+
safeCall(instance, "componentDidLoad");
|
|
868
|
+
}
|
|
898
869
|
endPostUpdate();
|
|
899
870
|
{
|
|
900
871
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1007,8 +978,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1007
978
|
if (this.hasOwnProperty(propName)) {
|
|
1008
979
|
newValue = this[propName];
|
|
1009
980
|
delete this[propName];
|
|
1010
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
1011
|
-
this[propName] == newValue) {
|
|
981
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
|
|
1012
982
|
return;
|
|
1013
983
|
} else if (propName == null) {
|
|
1014
984
|
const hostRef = getHostRef(this);
|
|
@@ -1155,6 +1125,9 @@ var connectedCallback = (elm) => {
|
|
|
1155
1125
|
}
|
|
1156
1126
|
};
|
|
1157
1127
|
var disconnectInstance = (instance) => {
|
|
1128
|
+
{
|
|
1129
|
+
safeCall(instance, "disconnectedCallback");
|
|
1130
|
+
}
|
|
1158
1131
|
};
|
|
1159
1132
|
var disconnectedCallback = async (elm) => {
|
|
1160
1133
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1165,8 +1138,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
1165
1138
|
hostRef.$rmListeners$ = void 0;
|
|
1166
1139
|
}
|
|
1167
1140
|
}
|
|
1168
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1169
|
-
hostRef.$
|
|
1141
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1142
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1143
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1144
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1170
1145
|
}
|
|
1171
1146
|
}
|
|
1172
1147
|
};
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const generalStories = require('./general-stories-
|
|
6
|
-
require('./index-
|
|
5
|
+
const generalStories = require('./general-stories-bbb81cca.js');
|
|
6
|
+
require('./index-5b8c1770.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-5b8c1770.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["general-stories.cjs",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["
|
|
11
|
+
return index.bootstrapLazy([["general-stories.cjs",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"],"progress":["handleTimeEnds"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { getDevicePlatform } from "../../utils/utils";
|
|
3
3
|
import { translate, getTranslations } from "../../utils/locale.utils";
|
|
4
|
+
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
5
|
export class GeneralStories {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.hasErrors = false;
|
|
@@ -30,24 +31,6 @@ export class GeneralStories {
|
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
33
|
};
|
|
33
|
-
this.setClientStyling = () => {
|
|
34
|
-
let sheet = document.createElement('style');
|
|
35
|
-
sheet.innerHTML = this.clientStyling;
|
|
36
|
-
this.stylingContainer.prepend(sheet);
|
|
37
|
-
};
|
|
38
|
-
this.setClientStylingURL = () => {
|
|
39
|
-
let url = new URL(this.clientStylingUrl);
|
|
40
|
-
let cssFile = document.createElement('style');
|
|
41
|
-
fetch(url.href)
|
|
42
|
-
.then((res) => res.text())
|
|
43
|
-
.then((data) => {
|
|
44
|
-
cssFile.innerHTML = data;
|
|
45
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
46
|
-
})
|
|
47
|
-
.catch((err) => {
|
|
48
|
-
console.log('error ', err);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
34
|
this.navigateToExternalStoryLink = () => {
|
|
52
35
|
window.postMessage({ type: 'OpenStoryLink', url: this.currentStory.storyUrl }, window.location.href);
|
|
53
36
|
};
|
|
@@ -104,6 +87,7 @@ export class GeneralStories {
|
|
|
104
87
|
this.cmsEndpoint = undefined;
|
|
105
88
|
this.language = 'en';
|
|
106
89
|
this.cmsEnv = 'stage';
|
|
90
|
+
this.mbSource = undefined;
|
|
107
91
|
this.clientStyling = '';
|
|
108
92
|
this.clientStylingUrl = '';
|
|
109
93
|
this.translationUrl = '';
|
|
@@ -114,11 +98,16 @@ export class GeneralStories {
|
|
|
114
98
|
this.touchPosStart = undefined;
|
|
115
99
|
this.touchPosEnd = undefined;
|
|
116
100
|
}
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
this.
|
|
120
|
-
|
|
121
|
-
|
|
101
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
102
|
+
if (newValue != oldValue) {
|
|
103
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
107
|
+
if (newValue != oldValue) {
|
|
108
|
+
if (this.clientStylingUrl)
|
|
109
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
110
|
+
}
|
|
122
111
|
}
|
|
123
112
|
handleNewTranslations() {
|
|
124
113
|
this.isLoading = true;
|
|
@@ -139,6 +128,22 @@ export class GeneralStories {
|
|
|
139
128
|
await getTranslations(this.translationUrl);
|
|
140
129
|
}
|
|
141
130
|
}
|
|
131
|
+
componentDidLoad() {
|
|
132
|
+
if (this.stylingContainer) {
|
|
133
|
+
if (window.emMessageBus != undefined) {
|
|
134
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
if (this.clientStyling)
|
|
138
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
139
|
+
if (this.clientStylingUrl)
|
|
140
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
disconnectedCallback() {
|
|
145
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
146
|
+
}
|
|
142
147
|
onTouchStart(e) {
|
|
143
148
|
this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
|
|
144
149
|
}
|
|
@@ -257,6 +262,23 @@ export class GeneralStories {
|
|
|
257
262
|
"reflect": true,
|
|
258
263
|
"defaultValue": "'stage'"
|
|
259
264
|
},
|
|
265
|
+
"mbSource": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"mutable": false,
|
|
268
|
+
"complexType": {
|
|
269
|
+
"original": "string",
|
|
270
|
+
"resolved": "string",
|
|
271
|
+
"references": {}
|
|
272
|
+
},
|
|
273
|
+
"required": false,
|
|
274
|
+
"optional": false,
|
|
275
|
+
"docs": {
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": "Client custom styling via streamStyling"
|
|
278
|
+
},
|
|
279
|
+
"attribute": "mb-source",
|
|
280
|
+
"reflect": false
|
|
281
|
+
},
|
|
260
282
|
"clientStyling": {
|
|
261
283
|
"type": "string",
|
|
262
284
|
"mutable": false,
|
|
@@ -343,10 +365,10 @@ export class GeneralStories {
|
|
|
343
365
|
static get watchers() {
|
|
344
366
|
return [{
|
|
345
367
|
"propName": "clientStyling",
|
|
346
|
-
"methodName": "
|
|
368
|
+
"methodName": "handleClientStylingChange"
|
|
347
369
|
}, {
|
|
348
370
|
"propName": "clientStylingUrl",
|
|
349
|
-
"methodName": "
|
|
371
|
+
"methodName": "handleClientStylingChangeURL"
|
|
350
372
|
}, {
|
|
351
373
|
"propName": "translationUrl",
|
|
352
374
|
"methodName": "handleNewTranslations"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-b4964764.js';
|
|
2
2
|
|
|
3
3
|
const getDevice = () => {
|
|
4
4
|
let userAgent = window.navigator.userAgent;
|
|
@@ -83,6 +83,63 @@ const translate = (key, customLang) => {
|
|
|
83
83
|
return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* @name setClientStyling
|
|
88
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
89
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
90
|
+
* @param {string} clientStyling The style content
|
|
91
|
+
*/
|
|
92
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
93
|
+
if (stylingContainer) {
|
|
94
|
+
const sheet = document.createElement('style');
|
|
95
|
+
sheet.innerHTML = clientStyling;
|
|
96
|
+
stylingContainer.appendChild(sheet);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @name setClientStylingURL
|
|
102
|
+
* @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
|
|
103
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
104
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
105
|
+
*/
|
|
106
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
107
|
+
const url = new URL(clientStylingUrl);
|
|
108
|
+
|
|
109
|
+
fetch(url.href)
|
|
110
|
+
.then((res) => res.text())
|
|
111
|
+
.then((data) => {
|
|
112
|
+
const cssFile = document.createElement('style');
|
|
113
|
+
cssFile.innerHTML = data;
|
|
114
|
+
if (stylingContainer) {
|
|
115
|
+
stylingContainer.appendChild(cssFile);
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
.catch((err) => {
|
|
119
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @name setStreamLibrary
|
|
125
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
126
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
127
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
128
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
129
|
+
*/
|
|
130
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
131
|
+
if (window.emMessageBus) {
|
|
132
|
+
const sheet = document.createElement('style');
|
|
133
|
+
|
|
134
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
135
|
+
sheet.innerHTML = data;
|
|
136
|
+
if (stylingContainer) {
|
|
137
|
+
stylingContainer.appendChild(sheet);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
86
143
|
const generalStoriesCss = ".ImageContainer{display:flex;flex-direction:row;background-color:var(--emw--color-background, #0E1511);overflow:auto}.StoryThumbnailContainer{margin:5px;position:relative;display:inline-block;border-radius:50%}.StoryThumbnailContainer.Highlighted::before{content:\"\";position:absolute;border-radius:50%;background:linear-gradient(to bottom, var(--emw--color-primary, #22B04E), var(--emw--color-secondary, #E1A749));top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailContainer.Viewed::before{content:\"\";position:absolute;border-radius:50%;height:50px;width:50px;background:var(--emw--color-grey-150, #828282);top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailImage{height:50px;width:50px;border-radius:50%;position:relative;z-index:1}.StoryThumbnailImage.Highlighted,.StoryThumbnailImage.Viewed{border:2px solid var(--emw--color-white, #ffffff)}.FullScreenHeader{position:fixed;top:0;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));top:0px;width:100%;display:flex;flex-direction:column;padding:10px 0;z-index:5;height:30px}.FullScreenHeader .CloseStoryButton{position:absolute;right:0;width:20px;margin-right:20px;margin-top:8px;z-index:50}.FullScreenHeader .ProgressBarContainer{width:90%;height:2px;position:relative;top:0;background-color:var(--emw--color-grey-150, #828282);border-radius:10px;overflow:hidden;margin:0 auto}.FullScreenHeader .ProgressBarContainer .ProgressBar{height:100%;background:var(--emw--color-white, #ffffff);width:0%;transition:width 0.1s linear}.FullScreenStory{position:fixed;top:0;width:100%;height:100%;background-color:var(--emw--color-grey-400, #24211f);display:flex;align-items:center;justify-content:center;overflow:hidden;z-index:300}.FullScreenStory video{height:100vh;width:100vw}.FullScreenStory img{width:100%;height:100%;object-fit:contain}.FullScreenStory .LoadMoreButtonBackground{width:100%;height:15%;background:linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));position:absolute;bottom:0;display:flex;justify-content:center}.FullScreenStory .LoadMoreButtonBackground .LoadMoreButton{width:auto;font-size:var(--emw--font-size-small, 14px);font-family:inherit;background-color:var(--emw--color-grey-50, #F9F8F8);box-shadow:0px 0px 7px 1px var(--emw--color-grey-400, #24211f);color:var(--emw--color-black, #000000);border-radius:50px;position:absolute;bottom:15px;padding:10px 20px}";
|
|
87
144
|
const GeneralStoriesStyle0 = generalStoriesCss;
|
|
88
145
|
|
|
@@ -116,24 +173,6 @@ const GeneralStories = class {
|
|
|
116
173
|
});
|
|
117
174
|
});
|
|
118
175
|
};
|
|
119
|
-
this.setClientStyling = () => {
|
|
120
|
-
let sheet = document.createElement('style');
|
|
121
|
-
sheet.innerHTML = this.clientStyling;
|
|
122
|
-
this.stylingContainer.prepend(sheet);
|
|
123
|
-
};
|
|
124
|
-
this.setClientStylingURL = () => {
|
|
125
|
-
let url = new URL(this.clientStylingUrl);
|
|
126
|
-
let cssFile = document.createElement('style');
|
|
127
|
-
fetch(url.href)
|
|
128
|
-
.then((res) => res.text())
|
|
129
|
-
.then((data) => {
|
|
130
|
-
cssFile.innerHTML = data;
|
|
131
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
132
|
-
})
|
|
133
|
-
.catch((err) => {
|
|
134
|
-
console.log('error ', err);
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
176
|
this.navigateToExternalStoryLink = () => {
|
|
138
177
|
window.postMessage({ type: 'OpenStoryLink', url: this.currentStory.storyUrl }, window.location.href);
|
|
139
178
|
};
|
|
@@ -190,6 +229,7 @@ const GeneralStories = class {
|
|
|
190
229
|
this.cmsEndpoint = undefined;
|
|
191
230
|
this.language = 'en';
|
|
192
231
|
this.cmsEnv = 'stage';
|
|
232
|
+
this.mbSource = undefined;
|
|
193
233
|
this.clientStyling = '';
|
|
194
234
|
this.clientStylingUrl = '';
|
|
195
235
|
this.translationUrl = '';
|
|
@@ -200,11 +240,16 @@ const GeneralStories = class {
|
|
|
200
240
|
this.touchPosStart = undefined;
|
|
201
241
|
this.touchPosEnd = undefined;
|
|
202
242
|
}
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
this.
|
|
206
|
-
|
|
207
|
-
|
|
243
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
244
|
+
if (newValue != oldValue) {
|
|
245
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
249
|
+
if (newValue != oldValue) {
|
|
250
|
+
if (this.clientStylingUrl)
|
|
251
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
252
|
+
}
|
|
208
253
|
}
|
|
209
254
|
handleNewTranslations() {
|
|
210
255
|
this.isLoading = true;
|
|
@@ -225,6 +270,22 @@ const GeneralStories = class {
|
|
|
225
270
|
await getTranslations(this.translationUrl);
|
|
226
271
|
}
|
|
227
272
|
}
|
|
273
|
+
componentDidLoad() {
|
|
274
|
+
if (this.stylingContainer) {
|
|
275
|
+
if (window.emMessageBus != undefined) {
|
|
276
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
if (this.clientStyling)
|
|
280
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
281
|
+
if (this.clientStylingUrl)
|
|
282
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
disconnectedCallback() {
|
|
287
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
288
|
+
}
|
|
228
289
|
onTouchStart(e) {
|
|
229
290
|
this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
|
|
230
291
|
}
|
|
@@ -277,8 +338,8 @@ const GeneralStories = class {
|
|
|
277
338
|
}
|
|
278
339
|
}
|
|
279
340
|
static get watchers() { return {
|
|
280
|
-
"clientStyling": ["
|
|
281
|
-
"clientStylingUrl": ["
|
|
341
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
342
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"],
|
|
282
343
|
"translationUrl": ["handleNewTranslations"],
|
|
283
344
|
"progress": ["handleTimeEnds"]
|
|
284
345
|
}; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { G as general_stories } from './general-stories-
|
|
2
|
-
import './index-
|
|
1
|
+
export { G as general_stories } from './general-stories-09d4f95e.js';
|
|
2
|
+
import './index-b4964764.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-b4964764.js';
|
|
2
|
+
export { s as setNonce } from './index-b4964764.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
var patchBrowser = () => {
|
|
9
9
|
const importMeta = import.meta.url;
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["general-stories",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["
|
|
19
|
+
return bootstrapLazy([["general-stories",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"],"progress":["handleTimeEnds"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const NAMESPACE = 'general-stories';
|
|
2
|
-
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad:
|
|
2
|
+
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -369,31 +369,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
369
369
|
if (nonce != null) {
|
|
370
370
|
styleElm.setAttribute("nonce", nonce);
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
374
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
375
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
376
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
377
|
-
} else if ("host" in styleContainerNode) {
|
|
378
|
-
if (supportsConstructableStylesheets) {
|
|
379
|
-
const stylesheet = new CSSStyleSheet();
|
|
380
|
-
stylesheet.replaceSync(style);
|
|
381
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
382
|
-
} else {
|
|
383
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
384
|
-
if (existingStyleContainer) {
|
|
385
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
386
|
-
} else {
|
|
387
|
-
styleContainerNode.prepend(styleElm);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
} else {
|
|
391
|
-
styleContainerNode.append(styleElm);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
395
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
396
|
-
}
|
|
372
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
|
|
397
373
|
}
|
|
398
374
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
399
375
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -416,7 +392,7 @@ var attachStyles = (hostRef) => {
|
|
|
416
392
|
const scopeId2 = addStyle(
|
|
417
393
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
418
394
|
cmpMeta);
|
|
419
|
-
if (flags & 10 /* needsScopedEncapsulation */
|
|
395
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
420
396
|
elm["s-sc"] = scopeId2;
|
|
421
397
|
elm.classList.add(scopeId2 + "-h");
|
|
422
398
|
}
|
|
@@ -485,11 +461,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
485
461
|
if (memberName === "list") {
|
|
486
462
|
isProp = false;
|
|
487
463
|
} else if (oldValue == null || elm[memberName] != n) {
|
|
488
|
-
|
|
489
|
-
elm[memberName] = n;
|
|
490
|
-
} else {
|
|
491
|
-
elm.setAttribute(memberName, n);
|
|
492
|
-
}
|
|
464
|
+
elm[memberName] = n;
|
|
493
465
|
}
|
|
494
466
|
} else {
|
|
495
467
|
elm[memberName] = newValue;
|
|
@@ -569,9 +541,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
569
541
|
{
|
|
570
542
|
updateElement(null, newVNode2, isSvgMode);
|
|
571
543
|
}
|
|
572
|
-
|
|
573
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
574
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
544
|
+
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
575
545
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
576
546
|
}
|
|
577
547
|
if (newVNode2.$children$) {
|
|
@@ -711,10 +681,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
711
681
|
elm.textContent = "";
|
|
712
682
|
}
|
|
713
683
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
714
|
-
} else if (
|
|
715
|
-
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
716
|
-
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
717
|
-
) {
|
|
684
|
+
} else if (oldChildren !== null) {
|
|
718
685
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
719
686
|
}
|
|
720
687
|
if (isSvgMode && tag === "svg") {
|
|
@@ -867,12 +834,16 @@ var postUpdateComponent = (hostRef) => {
|
|
|
867
834
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
868
835
|
const elm = hostRef.$hostElement$;
|
|
869
836
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
837
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
870
838
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
871
839
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
872
840
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
873
841
|
{
|
|
874
842
|
addHydratedFlag(elm);
|
|
875
843
|
}
|
|
844
|
+
{
|
|
845
|
+
safeCall(instance, "componentDidLoad");
|
|
846
|
+
}
|
|
876
847
|
endPostUpdate();
|
|
877
848
|
{
|
|
878
849
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -985,8 +956,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
985
956
|
if (this.hasOwnProperty(propName)) {
|
|
986
957
|
newValue = this[propName];
|
|
987
958
|
delete this[propName];
|
|
988
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
989
|
-
this[propName] == newValue) {
|
|
959
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
|
|
990
960
|
return;
|
|
991
961
|
} else if (propName == null) {
|
|
992
962
|
const hostRef = getHostRef(this);
|
|
@@ -1133,6 +1103,9 @@ var connectedCallback = (elm) => {
|
|
|
1133
1103
|
}
|
|
1134
1104
|
};
|
|
1135
1105
|
var disconnectInstance = (instance) => {
|
|
1106
|
+
{
|
|
1107
|
+
safeCall(instance, "disconnectedCallback");
|
|
1108
|
+
}
|
|
1136
1109
|
};
|
|
1137
1110
|
var disconnectedCallback = async (elm) => {
|
|
1138
1111
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1143,8 +1116,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
1143
1116
|
hostRef.$rmListeners$ = void 0;
|
|
1144
1117
|
}
|
|
1145
1118
|
}
|
|
1146
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1147
|
-
hostRef.$
|
|
1119
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1120
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1121
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1122
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1148
1123
|
}
|
|
1149
1124
|
}
|
|
1150
1125
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { G as GeneralStories } from './general-stories-
|
|
2
|
-
import './index-
|
|
1
|
+
export { G as GeneralStories } from './general-stories-09d4f95e.js';
|
|
2
|
+
import './index-b4964764.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-b4964764.js';
|
|
2
|
+
export { s as setNonce } from './index-b4964764.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["general-stories",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["
|
|
8
|
+
return bootstrapLazy([["general-stories",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"],"progress":["handleTimeEnds"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as n,b as t}from"./p-c85b316a.js";export{s as setNonce}from"./p-c85b316a.js";import{g as r}from"./p-e1255160.js";(()=>{const t=import.meta.url,r={};return""!==t&&(r.resourcesUrl=new URL(".",t).href),n(r)})().then((async n=>(await r(),t([["p-e1076ee3",[[1,"general-stories",{cmsEndpoint:[513,"cms-endpoint"],language:[513],cmsEnv:[513,"cms-env"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],progressBarDuration:[514,"progress-bar-duration"],currentStory:[32],currentStoryId:[32],progress:[32],touchPosStart:[32],touchPosEnd:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"],progress:["handleTimeEnds"]}]]]],n))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{G as GeneralStories}from"./p-
|
|
1
|
+
export{G as GeneralStories}from"./p-34426db6.js";import"./p-c85b316a.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i}from"./p-c85b316a.js";const e={en:{error:"Error",generalStoriesLoading:"Loading, please wait ...",loadMore:"Load More"},hu:{error:"Hiba",generalStoriesLoading:"Betöltés, kérjük várjon ...",loadMore:"Továbbiak betöltése"},ro:{error:"Eroare",generalStoriesLoading:"Se încarcă, vă rugăm așteptați ...",loadMore:"Încarcă mai multe"},fr:{error:"Erreur",generalStoriesLoading:"Chargement, veuillez patienter ...",loadMore:"Charger plus"},ar:{error:"خطأ",generalStoriesLoading:"جار التحميل، يرجى الانتظار ...",loadMore:"تحميل المزيد"},hr:{error:"Greška",generalStoriesLoading:"Učitavanje, molimo pričekajte ...",loadMore:"Učitaj više"}},o=t=>new Promise((i=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((i=>{e[i]||(e[i]={});for(let o in t[i])e[i][o]=t[i][o]})),i(!0)}))})),r=(t,i)=>e[void 0!==i&&i in e?i:"en"][t];function s(t,i){if(t){const e=document.createElement("style");e.innerHTML=i,t.appendChild(e)}}function n(t,i){const e=new URL(i);fetch(e.href).then((t=>t.text())).then((i=>{const e=document.createElement("style");e.innerHTML=i,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}const a=class{constructor(e){t(this,e),this.hasErrors=!1,this.isLoading=!0,this.isSwipe=!1,this.getStories=()=>{let t=new URL(`${this.cmsEndpoint}/${this.language}/stories`);return t.searchParams.append("env",this.cmsEnv),t.searchParams.append("device",(()=>{const t=(()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(t)return"PC"===t?"dk":"mtWeb"})()),t.searchParams.append("language",this.language),new Promise(((i,e)=>{this.isLoading=!0,fetch(t.href).then((t=>t.json())).then((t=>{this.stories=t,this.stories.forEach((t=>{t.viewed=!1})),this.isLoading=!1,i(!0)})).catch((t=>{console.log(t),this.isLoading=!1,this.hasErrors=!0,e(t)}))}))},this.navigateToExternalStoryLink=()=>{window.postMessage({type:"OpenStoryLink",url:this.currentStory.storyUrl},window.location.href)},this.openFullScreenStory=t=>{this.currentStoryId=t,this.currentStory=this.stories.find((i=>i.id===t)),this.markStoryAsViewed(t),this.startProgress()},this.closeFullScreenView=()=>{this.markStoryAsViewed(this.currentStoryId.toString()),this.currentStoryId=null,this.progress=0,clearInterval(this.intervalId)},this.markStoryAsViewed=t=>{const i=this.stories.findIndex((i=>i.id===t));if(i>-1){const[t]=this.stories.splice(i,1);t.viewed=!0,this.stories=[...this.stories,t]}},this.changeStory=(t,i)=>{const e="next"===i?Number(t.index)+1:Number(t.index)-1;if(e>this.stories.length-1||e<0)this.markStoryAsViewed(t.index),this.closeFullScreenView();else{const t=this.stories.find((t=>t.index===e));this.currentStory=t,this.currentStoryId=t.id,this.progress=0,this.markStoryAsViewed(t.id)}},this.startProgress=()=>{const t=100/(1e3*this.progressBarDuration)*100;this.intervalId=setInterval((()=>{this.progress>=100?clearInterval(this.intervalId):this.progress+=t}),100)},this.Thumbnail=({props:t})=>i("div",{class:"StoryThumbnailContainer "+(t.viewed?"Viewed":"Highlighted"),onTouchStart:()=>this.openFullScreenStory(t.id)},i("img",{class:"StoryThumbnailImage "+(t.viewed?"Viewed":"Highlighted"),src:t.icon,alt:"story-icon"})),this.cmsEndpoint=void 0,this.language="en",this.cmsEnv="stage",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.progressBarDuration=10,this.currentStory=void 0,this.currentStoryId=null,this.progress=0,this.touchPosStart=void 0,this.touchPosEnd=void 0}handleClientStylingChange(t,i){t!=i&&s(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,i){t!=i&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}handleTimeEnds(t){t>=100&&this.changeStory(this.currentStory,"next")}async componentWillLoad(){this.cmsEndpoint&&this.language&&await this.getStories(),this.translationUrl.length>2&&await o(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(t,i){if(window.emMessageBus){const e=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{e.innerHTML=i,t&&t.appendChild(e)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}onTouchStart(t){this.touchPosStart={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}}onTouchMove(t){this.touchPosEnd={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},Math.abs(this.touchPosEnd.clientX-this.touchPosStart.clientX)>50&&(this.isSwipe=!0)}onTouchEnd(t){if(this.isSwipe)this.touchPosEnd={clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},this.changeStory(this.currentStory,this.touchPosEnd.clientX-this.touchPosStart.clientX>0?"previous":"next");else{const i=window.innerWidth;this.changeStory(this.currentStory,t.changedTouches[0].clientX>i/2?"next":"previous")}}render(){return this.hasErrors?i("div",{class:"GeneralStoriesError"},i("div",{class:"Title"},r("error",this.language))):this.isLoading?i("div",{class:"GeneralStoriesLoading"},i("div",{class:"Title"},r("generalStoriesLoading",this.language))):this.isLoading?void 0:i("div",{ref:t=>this.stylingContainer=t},this.currentStoryId?i("div",{class:"FullScreenStory"},i("div",{class:"FullScreenHeader"},i("div",{class:"ProgressBarContainer"},i("div",{class:"ProgressBar",style:{width:`${this.progress}%`}})),i("div",{id:"close",class:"CloseStoryButton",onTouchStart:this.closeFullScreenView},i("svg",{fill:"none",stroke:"#ffffff",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})))),"video"===this.currentStory.type?i("video",{autoPlay:!0},i("source",{src:this.currentStory.url,type:"video/mp4"})):i("img",{src:this.currentStory.url,alt:"story-image"}),this.currentStory.storyUrl&&i("div",{class:"LoadMoreButtonBackground"},i("button",{onTouchStart:this.navigateToExternalStoryLink,class:"LoadMoreButton"},r("loadMore",this.language)))):i("div",{class:"ImageContainer"},this.stories.map((t=>i(this.Thumbnail,{props:t})))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"],progress:["handleTimeEnds"]}}};a.style='.ImageContainer{display:flex;flex-direction:row;background-color:var(--emw--color-background, #0E1511);overflow:auto}.StoryThumbnailContainer{margin:5px;position:relative;display:inline-block;border-radius:50%}.StoryThumbnailContainer.Highlighted::before{content:"";position:absolute;border-radius:50%;background:linear-gradient(to bottom, var(--emw--color-primary, #22B04E), var(--emw--color-secondary, #E1A749));top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailContainer.Viewed::before{content:"";position:absolute;border-radius:50%;height:50px;width:50px;background:var(--emw--color-grey-150, #828282);top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailImage{height:50px;width:50px;border-radius:50%;position:relative;z-index:1}.StoryThumbnailImage.Highlighted,.StoryThumbnailImage.Viewed{border:2px solid var(--emw--color-white, #ffffff)}.FullScreenHeader{position:fixed;top:0;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));top:0px;width:100%;display:flex;flex-direction:column;padding:10px 0;z-index:5;height:30px}.FullScreenHeader .CloseStoryButton{position:absolute;right:0;width:20px;margin-right:20px;margin-top:8px;z-index:50}.FullScreenHeader .ProgressBarContainer{width:90%;height:2px;position:relative;top:0;background-color:var(--emw--color-grey-150, #828282);border-radius:10px;overflow:hidden;margin:0 auto}.FullScreenHeader .ProgressBarContainer .ProgressBar{height:100%;background:var(--emw--color-white, #ffffff);width:0%;transition:width 0.1s linear}.FullScreenStory{position:fixed;top:0;width:100%;height:100%;background-color:var(--emw--color-grey-400, #24211f);display:flex;align-items:center;justify-content:center;overflow:hidden;z-index:300}.FullScreenStory video{height:100vh;width:100vw}.FullScreenStory img{width:100%;height:100%;object-fit:contain}.FullScreenStory .LoadMoreButtonBackground{width:100%;height:15%;background:linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));position:absolute;bottom:0;display:flex;justify-content:center}.FullScreenStory .LoadMoreButtonBackground .LoadMoreButton{width:auto;font-size:var(--emw--font-size-small, 14px);font-family:inherit;background-color:var(--emw--color-grey-50, #F9F8F8);box-shadow:0px 0px 7px 1px var(--emw--color-grey-400, #24211f);color:var(--emw--color-black, #000000);border-radius:50px;position:absolute;bottom:15px;padding:10px 20px}';export{a as G}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>e.set(n.t=t,n),l=(t,e)=>e in t,r=(t,e)=>(0,console.error)(t,e),s=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),d=!1,m=[],v=[],y=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.o?b($):f.raf($))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){r(t)}t.length=0},$=()=>{w(m),w(v),(d=m.length>0)&&f.raf($)},b=t=>h().then(t),g=y(v,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function O(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>k,unwrap:()=>P,unwrapErr:()=>L});var k=t=>({isOk:!0,isErr:!1,value:t}),E=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>k(t))):k(n)}if(t.isErr)return E(t.value);throw"should never get here"}var M,x,P=t=>{if(t.isOk)return t.value;throw t.value},L=t=>{if(t.isErr)return t.value;throw t.value},R=(t,e,...n)=>{let o=null,l=!1,r=!1;const s=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&r?s[s.length-1].i+=o:s.push(l?T(null,o):o),r=l)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}if("function"==typeof t)return t(null===e?{}:e,s,F);const c=T(t,null);return c.u=e,s.length>0&&(c.h=s),c},T=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),A={},F={forEach:(t,e)=>t.map(N).forEach(e),map:(t,e)=>t.map(N).map(e).map(U)},N=t=>({vattrs:t.u,vchildren:t.h,vkey:t.v,vname:t.$,vtag:t.p,vtext:t.i}),U=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),R(t.vtag,e,...t.vchildren||[])}const e=T(t.vtag,t.vtext);return e.u=t.vattrs,e.h=t.vchildren,e.v=t.vkey,e.$=t.vname,e},W=new WeakMap,D=t=>"sc-"+t.S,H=(t,e,n,o,r,s)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=G(n),r=G(o);e.remove(...l.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("ref"===e)o&&o(t);else if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!r)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&s||r)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(V);e=e.replace(_,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},q=/\s/,G=t=>t?t.split(q):[],V="Capture",_=RegExp(V+"$"),z=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,r=e.u||S;for(const t of B(Object.keys(l)))t in r||H(o,t,l[t],void 0,n,e.o);for(const t of B(Object.keys(r)))H(o,t,l[t],r[t],n,e.o)};function B(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var I=!1,J=(t,e,n)=>{const o=e.h[n];let l,r,s=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else{if(I||(I="svg"===o.p),l=o.m=a.createElementNS(I?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.p),I&&"foreignObject"===o.p&&(I=!1),z(null,o,I),null!=M&&l["s-si"]!==M&&l.classList.add(l["s-si"]=M),o.h)for(s=0;s<o.h.length;++s)r=J(t,o,s),r&&l.appendChild(r);"svg"===o.p?I=!1:"foreignObject"===l.tagName&&(I=!0)}return l["s-hn"]=x,l},K=(t,e,n,o,l,r)=>{let s,i=t;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);l<=r;++l)o[l]&&(s=J(null,n,l),s&&(o[l].m=s,tt(i,s,e)))},Q=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;Z(e),t&&t.remove()}}},X=(t,e)=>t.p===e.p,Y=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,r=e.h,s=e.p,i=e.i;null===i?(z(t,e,I="svg"===s||"foreignObject"!==s&&I),null!==l&&null!==r?((t,e,n,o,l=!1)=>{let r,s=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;s<=c&&i<=f;)null==u?u=e[++s]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:X(u,h)?(Y(u,h,l),u=e[++s],h=o[++i]):X(a,p)?(Y(a,p,l),a=e[--c],p=o[--f]):X(u,p)?(Y(u,p,l),tt(t,u.m,a.m.nextSibling),u=e[++s],p=o[--f]):X(a,h)?(Y(a,h,l),tt(t,a.m,u.m),a=e[--c],h=o[++i]):(r=J(e&&e[i],n,i),h=o[++i],r&&tt(u.m.parentNode,r,u.m));s>c?K(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&Q(e,s,c)})(o,l,e,r,n):null!==r?(null!==t.i&&(o.textContent=""),K(o,null,e,r,0,r.length-1)):null!==l&&Q(l,0,l.length-1),I&&"svg"===s&&(I=!1)):t.i!==i&&(o.data=i)},Z=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(Z)},tt=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),et=(t,e)=>{e&&!t.j&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.j=e)))},nt=(t,e)=>{if(t.o|=16,!(4&t.o))return et(t,t.O),g((()=>ot(t,e)));t.o|=512},ot=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$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 o;return e&&(t.o|=256,t.k&&(t.k.map((([t,e])=>at(n,t,e))),t.k=void 0),o=at(n,"componentWillLoad")),lt(o,(()=>st(t,n,e)))},lt=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,st=async(t,e,n)=>{var o;const l=t.$hostElement$,r=l["s-rc"];n&&(t=>{const e=t.C,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=D(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let r,s=W.get(t=t.head||t);if(s||W.set(t,s=new Set),!s.has(o)){{r=a.createElement("style"),r.innerHTML=l;const e=null!=(n=f.M)?n:O(a);null!=e&&r.setAttribute("nonce",e),t.insertBefore(r,t.querySelector("link"))}4&e.o&&(r.innerHTML+=c),s&&s.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);it(t,e,l,n),r&&(r.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ct(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},it=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.C,r=t.P||T(null,null),s=(t=>t&&t.p===A)(e)?e:R(null,null,e);if(x=o.tagName,l.L&&(s.u=s.u||{},l.L.map((([t,e])=>s.u[e]=o[t]))),n&&s.u)for(const t of Object.keys(s.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.u[t]=o[t]);s.p=null,s.o|=4,t.P=s,s.m=r.m=o.shadowRoot||o,M=o["s-sc"],Y(r,s,n)})(t,e,o)}catch(e){r(e,t.$hostElement$)}return null},ct=t=>{const e=t.$hostElement$,n=t.t,o=t.O;64&t.o||(t.o|=64,ft(e),at(n,"componentDidLoad"),t.R(e),o||ut()),t.j&&(t.j(),t.j=void 0),512&t.o&&b((()=>nt(t,!1))),t.o&=-517},ut=()=>{ft(a.documentElement),b((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"general-stories"}});return t.dispatchEvent(e),e})(u)))},at=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){r(t)}},ft=t=>t.classList.add("hydrated"),ht=(t,e,o)=>{var l,s;const i=t.prototype;if(e.T||e.A||t.watchers){t.watchers&&!e.A&&(e.A=t.watchers);const c=Object.entries(null!=(l=e.T)?l:{});if(c.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).F.get(e))(0,t)},set(o){((t,e,o,l)=>{const s=n(t);if(!s)throw Error(`Couldn't find host element for "${l.S}" 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=s.$hostElement$,c=s.F.get(e),u=s.o,a=s.t;if(o=((t,e)=>null==t||j(t)?t:2&e?parseFloat(t):1&e?t+"":t)(o,l.T[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(s.F.set(e,o),a)){if(l.A&&128&u){const t=l.A[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){r(t,i)}}))}2==(18&u)&&nt(s,!1)}})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,r){f.jmp((()=>{var s;const c=o.get(t);if(this.hasOwnProperty(c))r=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==r)return;if(null==c){const o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&r!==l){const n=o.t,i=null==(s=e.A)?void 0:s[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,r,l,t)}))}return}}this[c]=(null!==r||"boolean"!=typeof this[c])&&r}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.A)?s:{}),...c.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const r=n[1]||t;return o.set(r,t),512&n[0]&&(null==(l=e.L)||l.push([t,r])),r}))]))}}return t},pt=t=>{at(t,"disconnectedCallback")},dt=(t,o={})=>{var l;const h=[],d=o.exclude||[],m=u.customElements,v=a.head,y=v.querySelector("meta[charset]"),w=a.createElement("style"),$=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((o=>{var l;const c={o:o[0],S:o[1],T:o[2],N:o[3]};4&c.o&&(S=!0),c.T=o[2],c.N=o[3],c.L=[],c.A=null!=(l=o[4])?l:{};const u=c.S,a=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,C:n,F:new Map};o.U=new Promise((t=>o.R=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,c),1&c.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.S}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,mt(this,t,c.N)),b&&(clearTimeout(b),b=null),g?$.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.C,l=()=>{};if(1&e.o)mt(t,e,o.N),(null==e?void 0:e.t)||(null==e?void 0:e.U)&&e.U.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){et(e,e.O=n);break}}o.T&&Object.entries(o.T).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.W){const t=(t=>{const e=t.S.replace(/-/g,"_"),n=t.W;if(!n)return;const o=s.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(s.set(n,t),t[e])),r)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.S}#${e.D}" was not found`);o.isProxied||(n.A=o.watchers,ht(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){r(t)}e.o&=-9,e.o|=128,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=D(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const l=e.O,c=()=>nt(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);t.H&&(t.H.map((t=>t())),t.H=void 0),(null==t?void 0:t.t)?pt(t.t):(null==t?void 0:t.U)&&t.U.then((()=>pt(t.t)))}})()))}componentOnReady(){return n(this).U}};c.W=t[0],d.includes(u)||m.get(u)||(h.push(u),m.define(u,ht(a,c,1)))}))})),h.length>0&&(S&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const t=null!=(l=f.M)?l:O(a);null!=t&&w.setAttribute("nonce",t),v.insertBefore(w,y?y.nextSibling:v.firstChild)}g=!1,$.length?$.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(ut,30)))},mt=(t,e,n)=>{n&&n.map((([n,o,l])=>{const r=t,s=vt(e,l),i=yt(n);f.ael(r,o,s,i),(e.H=e.H||[]).push((()=>f.rel(r,o,s,i)))}))},vt=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.k=t.k||[]).push([e,n])}catch(t){r(t)}},yt=t=>({passive:!!(1&t),capture:!!(2&t)}),wt=t=>f.M=t;export{dt as b,R as h,h as p,o as r,wt as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{G as general_stories}from"./p-34426db6.js";import"./p-c85b316a.js";
|
|
@@ -12,6 +12,10 @@ export declare class GeneralStories {
|
|
|
12
12
|
* CMS Endpoint stage
|
|
13
13
|
*/
|
|
14
14
|
cmsEnv: string;
|
|
15
|
+
/**
|
|
16
|
+
* Client custom styling via streamStyling
|
|
17
|
+
*/
|
|
18
|
+
mbSource: string;
|
|
15
19
|
/**
|
|
16
20
|
* Client custom styling via string
|
|
17
21
|
*/
|
|
@@ -29,6 +33,7 @@ export declare class GeneralStories {
|
|
|
29
33
|
*/
|
|
30
34
|
progressBarDuration: number;
|
|
31
35
|
private stylingContainer;
|
|
36
|
+
private stylingSubscription;
|
|
32
37
|
private stories;
|
|
33
38
|
intervalId: ReturnType<typeof setInterval>;
|
|
34
39
|
hasErrors: boolean;
|
|
@@ -45,13 +50,14 @@ export declare class GeneralStories {
|
|
|
45
50
|
clientX: number;
|
|
46
51
|
clientY: number;
|
|
47
52
|
};
|
|
48
|
-
|
|
53
|
+
handleClientStylingChange(newValue: any, oldValue: any): void;
|
|
54
|
+
handleClientStylingChangeURL(newValue: any, oldValue: any): void;
|
|
49
55
|
handleNewTranslations(): void;
|
|
50
56
|
handleTimeEnds(newValue: number): void;
|
|
51
57
|
componentWillLoad(): Promise<void>;
|
|
52
58
|
getStories: () => Promise<any>;
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
componentDidLoad(): void;
|
|
60
|
+
disconnectedCallback(): void;
|
|
55
61
|
navigateToExternalStoryLink: () => void;
|
|
56
62
|
openFullScreenStory: (id: any) => void;
|
|
57
63
|
closeFullScreenView: () => void;
|
|
@@ -27,6 +27,10 @@ export namespace Components {
|
|
|
27
27
|
* Language of the widget
|
|
28
28
|
*/
|
|
29
29
|
"language": string;
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via streamStyling
|
|
32
|
+
*/
|
|
33
|
+
"mbSource": string;
|
|
30
34
|
/**
|
|
31
35
|
* Duration of progress bar
|
|
32
36
|
*/
|
|
@@ -70,6 +74,10 @@ declare namespace LocalJSX {
|
|
|
70
74
|
* Language of the widget
|
|
71
75
|
*/
|
|
72
76
|
"language"?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Client custom styling via streamStyling
|
|
79
|
+
*/
|
|
80
|
+
"mbSource"?: string;
|
|
73
81
|
/**
|
|
74
82
|
* Duration of progress bar
|
|
75
83
|
*/
|
|
@@ -1015,8 +1015,6 @@ export declare namespace JSXBase {
|
|
|
1015
1015
|
autoPlay?: boolean;
|
|
1016
1016
|
autoplay?: boolean | string;
|
|
1017
1017
|
controls?: boolean;
|
|
1018
|
-
controlslist?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
|
|
1019
|
-
controlsList?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
|
|
1020
1018
|
crossOrigin?: string;
|
|
1021
1019
|
crossorigin?: string;
|
|
1022
1020
|
loop?: boolean;
|
|
@@ -1566,10 +1564,6 @@ export declare namespace JSXBase {
|
|
|
1566
1564
|
onSubmitCapture?: (event: Event) => void;
|
|
1567
1565
|
onInvalid?: (event: Event) => void;
|
|
1568
1566
|
onInvalidCapture?: (event: Event) => void;
|
|
1569
|
-
onBeforeToggle?: (event: Event) => void;
|
|
1570
|
-
onBeforeToggleCapture?: (event: Event) => void;
|
|
1571
|
-
onToggle?: (event: Event) => void;
|
|
1572
|
-
onToggleCapture?: (event: Event) => void;
|
|
1573
1567
|
onLoad?: (event: Event) => void;
|
|
1574
1568
|
onLoadCapture?: (event: Event) => void;
|
|
1575
1569
|
onError?: (event: Event) => void;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>e.set(n.t=t,n),l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,d=[],y=[],v=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&f.o?b($):f.raf($))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},$=()=>{w(d),w(y),(m=d.length>0)&&f.raf($)},b=t=>h().then(t),g=v(y,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function O(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>k,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=t=>({isOk:!0,isErr:!1,value:t}),k=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>E(t))):E(n)}if(t.isErr)return k(t.value);throw"should never get here"}var M,x=t=>{if(t.isOk)return t.value;throw t.value},P=t=>{if(t.isErr)return t.value;throw t.value},A=(t,e,...n)=>{let o=null,l=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&s?r[r.length-1].i+=o:r.push(l?H(null,o):o),s=l)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}if("function"==typeof t)return t(null===e?{}:e,r,T);const c=H(t,null);return c.u=e,r.length>0&&(c.h=r),c},H=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),R={},T={forEach:(t,e)=>t.map(D).forEach(e),map:(t,e)=>t.map(D).map(e).map(F)},D=t=>({vattrs:t.u,vchildren:t.h,vkey:t.v,vname:t.$,vtag:t.p,vtext:t.i}),F=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),A(t.vtag,e,...t.vchildren||[])}const e=H(t.vtag,t.vtext);return e.u=t.vattrs,e.h=t.vchildren,e.v=t.vkey,e.$=t.vname,e},L=new WeakMap,N=t=>"sc-"+t.S,U=(t,e,n,o,s,r)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=q(n),s=q(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("ref"===e)o&&o(t);else if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&r||s)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(G);e=e.replace(V,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},W=/\s/,q=t=>t?t.split(W):[],G="Capture",V=RegExp(G+"$"),_=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,s=e.u||S;for(const t of z(Object.keys(l)))t in s||U(o,t,l[t],void 0,n,e.o);for(const t of z(Object.keys(s)))U(o,t,l[t],s[t],n,e.o)};function z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var B=!1,I=(t,e,n)=>{const o=e.h[n];let l,s,r=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else{if(B||(B="svg"===o.p),l=o.m=a.createElementNS(B?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.p),B&&"foreignObject"===o.p&&(B=!1),_(null,o,B),l.getRootNode().querySelector("body"),o.h)for(r=0;r<o.h.length;++r)s=I(t,o,r),s&&l.appendChild(s);"svg"===o.p?B=!1:"foreignObject"===l.tagName&&(B=!0)}return l["s-hn"]=M,l},J=(t,e,n,o,l,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=I(null,n,l),r&&(o[l].m=r,Z(i,r,e)))},K=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;Y(e),t&&t.remove()}}},Q=(t,e)=>t.p===e.p,X=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,r=e.p,i=e.i;null===i?(_(t,e,B="svg"===r||"foreignObject"!==r&&B),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:Q(u,h)?(X(u,h,l),u=e[++r],h=o[++i]):Q(a,p)?(X(a,p,l),a=e[--c],p=o[--f]):Q(u,p)?(X(u,p,l),Z(t,u.m,a.m.nextSibling),u=e[++r],p=o[--f]):Q(a,h)?(X(a,h,l),Z(t,a.m,u.m),a=e[--c],h=o[++i]):(s=I(e&&e[i],n,i),h=o[++i],s&&Z(u.m.parentNode,s,u.m));r>c?J(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&K(e,r,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),J(o,null,e,s,0,s.length-1)):!n&&null!==l&&K(l,0,l.length-1),B&&"svg"===r&&(B=!1)):t.i!==i&&(o.data=i)},Y=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(Y)},Z=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),tt=(t,e)=>{e&&!t.j&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.j=e)))},et=(t,e)=>{if(t.o|=16,!(4&t.o))return tt(t,t.O),g((()=>nt(t,e)));t.o|=512},nt=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$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 o;return e&&(t.o|=256,t.k&&(t.k.map((([t,e])=>ut(n,t,e))),t.k=void 0),o=ut(n,"componentWillLoad")),ot(o,(()=>st(t,n,e)))},ot=(t,e)=>lt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),lt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,st=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.C,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=N(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let s,r=L.get(t=t.head||t);if(r||L.set(t,r=new Set),!r.has(o)){{s=a.createElement("style"),s.innerHTML=l;const o=null!=(n=f.M)?n:O(a);if(null!=o&&s.setAttribute("nonce",o),!(1&e.o))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,n)}else if("host"in t)if(p){const e=new CSSStyleSheet;e.replaceSync(l),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=l+e.innerHTML:t.prepend(s)}else t.append(s);1&e.o&&"HEAD"!==t.nodeName&&t.insertBefore(s,null)}4&e.o&&(s.innerHTML+=c),r&&r.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);rt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>it(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},rt=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.C,s=t.P||H(null,null),r=(t=>t&&t.p===R)(e)?e:A(null,null,e);if(M=o.tagName,l.A&&(r.u=r.u||{},l.A.map((([t,e])=>r.u[e]=o[t]))),n&&r.u)for(const t of Object.keys(r.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=o[t]);r.p=null,r.o|=4,t.P=r,r.m=s.m=o.shadowRoot||o,X(s,r,n)})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},it=t=>{const e=t.$hostElement$,n=t.O;64&t.o||(t.o|=64,at(e),t.H(e),n||ct()),t.j&&(t.j(),t.j=void 0),512&t.o&&b((()=>et(t,!1))),t.o&=-517},ct=()=>{at(a.documentElement),b((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"general-stories"}});return t.dispatchEvent(e),e})(u)))},ut=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t)}},at=t=>t.classList.add("hydrated"),ft=(t,e,o)=>{var l,r;const i=t.prototype;if(e.R||e.T||t.watchers){t.watchers&&!e.T&&(e.T=t.watchers);const c=Object.entries(null!=(l=e.R)?l:{});if(c.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).D.get(e))(0,t)},set(o){((t,e,o,l)=>{const r=n(t);if(!r)throw Error(`Couldn't find host element for "${l.S}" 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.D.get(e),u=r.o,a=r.t;if(o=((t,e)=>null==t||j(t)?t:2&e?parseFloat(t):1&e?t+"":t)(o,l.R[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(r.D.set(e,o),a)){if(l.T&&128&u){const t=l.T[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){s(t,i)}}))}2==(18&u)&&et(r,!1)}})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,s){f.jmp((()=>{var r;const c=o.get(t);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 o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&s!==l){const n=o.t,i=null==(r=e.T)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,l,t)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.T)?r:{}),...c.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const s=n[1]||t;return o.set(s,t),512&n[0]&&(null==(l=e.A)||l.push([t,s])),s}))]))}}return t},ht=(t,o={})=>{var l;const h=[],m=o.exclude||[],d=u.customElements,y=a.head,v=y.querySelector("meta[charset]"),w=a.createElement("style"),$=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((o=>{var l;const c={o:o[0],S:o[1],R:o[2],F:o[3]};4&c.o&&(S=!0),c.R=o[2],c.F=o[3],c.A=[],c.T=null!=(l=o[4])?l:{};const u=c.S,a=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,C:n,D:new Map};o.L=new Promise((t=>o.H=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,c),1&c.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.S}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,pt(this,t,c.F)),b&&(clearTimeout(b),b=null),g?$.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.C,l=()=>{};if(1&e.o)pt(t,e,o.F),(null==e?void 0:e.t)||(null==e?void 0:e.L)&&e.L.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){tt(e,e.O=n);break}}o.R&&Object.entries(o.R).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.N){const t=(t=>{const e=t.S.replace(/-/g,"_"),n=t.N;if(!n)return;const o=r.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(r.set(n,t),t[e])),s)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.S}#${e.U}" was not found`);o.isProxied||(n.T=o.watchers,ft(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){s(t)}e.o&=-9,e.o|=128,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=N(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const l=e.O,c=()=>et(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);t.W&&(t.W.map((t=>t())),t.W=void 0),(null==t?void 0:t.t)||(null==t?void 0:t.L)&&t.L.then((()=>{}))}})()))}componentOnReady(){return n(this).L}};c.N=t[0],m.includes(u)||d.get(u)||(h.push(u),d.define(u,ft(a,c,1)))}))})),h.length>0&&(S&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const t=null!=(l=f.M)?l:O(a);null!=t&&w.setAttribute("nonce",t),y.insertBefore(w,v?v.nextSibling:y.firstChild)}g=!1,$.length?$.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(ct,30)))},pt=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=t,r=mt(e,l),i=dt(n);f.ael(s,o,r,i),(e.W=e.W||[]).push((()=>f.rel(s,o,r,i)))}))},mt=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.k=t.k||[]).push([e,n])}catch(t){s(t)}},dt=t=>({passive:!!(1&t),capture:!!(2&t)}),yt=t=>f.M=t;export{ht as b,A as h,h as p,o as r,yt as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{G as general_stories}from"./p-8492d966.js";import"./p-33a823ba.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i}from"./p-33a823ba.js";const e={en:{error:"Error",generalStoriesLoading:"Loading, please wait ...",loadMore:"Load More"},hu:{error:"Hiba",generalStoriesLoading:"Betöltés, kérjük várjon ...",loadMore:"Továbbiak betöltése"},ro:{error:"Eroare",generalStoriesLoading:"Se încarcă, vă rugăm așteptați ...",loadMore:"Încarcă mai multe"},fr:{error:"Erreur",generalStoriesLoading:"Chargement, veuillez patienter ...",loadMore:"Charger plus"},ar:{error:"خطأ",generalStoriesLoading:"جار التحميل، يرجى الانتظار ...",loadMore:"تحميل المزيد"},hr:{error:"Greška",generalStoriesLoading:"Učitavanje, molimo pričekajte ...",loadMore:"Učitaj više"}},o=t=>new Promise((i=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((i=>{e[i]||(e[i]={});for(let o in t[i])e[i][o]=t[i][o]})),i(!0)}))})),r=(t,i)=>e[void 0!==i&&i in e?i:"en"][t],s=class{constructor(e){t(this,e),this.hasErrors=!1,this.isLoading=!0,this.isSwipe=!1,this.getStories=()=>{let t=new URL(`${this.cmsEndpoint}/${this.language}/stories`);return t.searchParams.append("env",this.cmsEnv),t.searchParams.append("device",(()=>{const t=(()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(t)return"PC"===t?"dk":"mtWeb"})()),t.searchParams.append("language",this.language),new Promise(((i,e)=>{this.isLoading=!0,fetch(t.href).then((t=>t.json())).then((t=>{this.stories=t,this.stories.forEach((t=>{t.viewed=!1})),this.isLoading=!1,i(!0)})).catch((t=>{console.log(t),this.isLoading=!1,this.hasErrors=!0,e(t)}))}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("error ",t)}))},this.navigateToExternalStoryLink=()=>{window.postMessage({type:"OpenStoryLink",url:this.currentStory.storyUrl},window.location.href)},this.openFullScreenStory=t=>{this.currentStoryId=t,this.currentStory=this.stories.find((i=>i.id===t)),this.markStoryAsViewed(t),this.startProgress()},this.closeFullScreenView=()=>{this.markStoryAsViewed(this.currentStoryId.toString()),this.currentStoryId=null,this.progress=0,clearInterval(this.intervalId)},this.markStoryAsViewed=t=>{const i=this.stories.findIndex((i=>i.id===t));if(i>-1){const[t]=this.stories.splice(i,1);t.viewed=!0,this.stories=[...this.stories,t]}},this.changeStory=(t,i)=>{const e="next"===i?Number(t.index)+1:Number(t.index)-1;if(e>this.stories.length-1||e<0)this.markStoryAsViewed(t.index),this.closeFullScreenView();else{const t=this.stories.find((t=>t.index===e));this.currentStory=t,this.currentStoryId=t.id,this.progress=0,this.markStoryAsViewed(t.id)}},this.startProgress=()=>{const t=100/(1e3*this.progressBarDuration)*100;this.intervalId=setInterval((()=>{this.progress>=100?clearInterval(this.intervalId):this.progress+=t}),100)},this.Thumbnail=({props:t})=>i("div",{class:"StoryThumbnailContainer "+(t.viewed?"Viewed":"Highlighted"),onTouchStart:()=>this.openFullScreenStory(t.id)},i("img",{class:"StoryThumbnailImage "+(t.viewed?"Viewed":"Highlighted"),src:t.icon,alt:"story-icon"})),this.cmsEndpoint=void 0,this.language="en",this.cmsEnv="stage",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.progressBarDuration=10,this.currentStory=void 0,this.currentStoryId=null,this.progress=0,this.touchPosStart=void 0,this.touchPosEnd=void 0}handleStylingUpdate(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}handleTimeEnds(t){t>=100&&this.changeStory(this.currentStory,"next")}async componentWillLoad(){this.cmsEndpoint&&this.language&&await this.getStories(),this.translationUrl.length>2&&await o(this.translationUrl)}onTouchStart(t){this.touchPosStart={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}}onTouchMove(t){this.touchPosEnd={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},Math.abs(this.touchPosEnd.clientX-this.touchPosStart.clientX)>50&&(this.isSwipe=!0)}onTouchEnd(t){if(this.isSwipe)this.touchPosEnd={clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},this.changeStory(this.currentStory,this.touchPosEnd.clientX-this.touchPosStart.clientX>0?"previous":"next");else{const i=window.innerWidth;this.changeStory(this.currentStory,t.changedTouches[0].clientX>i/2?"next":"previous")}}render(){return this.hasErrors?i("div",{class:"GeneralStoriesError"},i("div",{class:"Title"},r("error",this.language))):this.isLoading?i("div",{class:"GeneralStoriesLoading"},i("div",{class:"Title"},r("generalStoriesLoading",this.language))):this.isLoading?void 0:i("div",{ref:t=>this.stylingContainer=t},this.currentStoryId?i("div",{class:"FullScreenStory"},i("div",{class:"FullScreenHeader"},i("div",{class:"ProgressBarContainer"},i("div",{class:"ProgressBar",style:{width:`${this.progress}%`}})),i("div",{id:"close",class:"CloseStoryButton",onTouchStart:this.closeFullScreenView},i("svg",{fill:"none",stroke:"#ffffff",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})))),"video"===this.currentStory.type?i("video",{autoPlay:!0},i("source",{src:this.currentStory.url,type:"video/mp4"})):i("img",{src:this.currentStory.url,alt:"story-image"}),this.currentStory.storyUrl&&i("div",{class:"LoadMoreButtonBackground"},i("button",{onTouchStart:this.navigateToExternalStoryLink,class:"LoadMoreButton"},r("loadMore",this.language)))):i("div",{class:"ImageContainer"},this.stories.map((t=>i(this.Thumbnail,{props:t})))))}static get watchers(){return{clientStyling:["handleStylingUpdate"],clientStylingUrl:["handleStylingUpdate"],translationUrl:["handleNewTranslations"],progress:["handleTimeEnds"]}}};s.style='.ImageContainer{display:flex;flex-direction:row;background-color:var(--emw--color-background, #0E1511);overflow:auto}.StoryThumbnailContainer{margin:5px;position:relative;display:inline-block;border-radius:50%}.StoryThumbnailContainer.Highlighted::before{content:"";position:absolute;border-radius:50%;background:linear-gradient(to bottom, var(--emw--color-primary, #22B04E), var(--emw--color-secondary, #E1A749));top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailContainer.Viewed::before{content:"";position:absolute;border-radius:50%;height:50px;width:50px;background:var(--emw--color-grey-150, #828282);top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailImage{height:50px;width:50px;border-radius:50%;position:relative;z-index:1}.StoryThumbnailImage.Highlighted,.StoryThumbnailImage.Viewed{border:2px solid var(--emw--color-white, #ffffff)}.FullScreenHeader{position:fixed;top:0;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));top:0px;width:100%;display:flex;flex-direction:column;padding:10px 0;z-index:5;height:30px}.FullScreenHeader .CloseStoryButton{position:absolute;right:0;width:20px;margin-right:20px;margin-top:8px;z-index:50}.FullScreenHeader .ProgressBarContainer{width:90%;height:2px;position:relative;top:0;background-color:var(--emw--color-grey-150, #828282);border-radius:10px;overflow:hidden;margin:0 auto}.FullScreenHeader .ProgressBarContainer .ProgressBar{height:100%;background:var(--emw--color-white, #ffffff);width:0%;transition:width 0.1s linear}.FullScreenStory{position:fixed;top:0;width:100%;height:100%;background-color:var(--emw--color-grey-400, #24211f);display:flex;align-items:center;justify-content:center;overflow:hidden;z-index:300}.FullScreenStory video{height:100vh;width:100vw}.FullScreenStory img{width:100%;height:100%;object-fit:contain}.FullScreenStory .LoadMoreButtonBackground{width:100%;height:15%;background:linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));position:absolute;bottom:0;display:flex;justify-content:center}.FullScreenStory .LoadMoreButtonBackground .LoadMoreButton{width:auto;font-size:var(--emw--font-size-small, 14px);font-family:inherit;background-color:var(--emw--color-grey-50, #F9F8F8);box-shadow:0px 0px 7px 1px var(--emw--color-grey-400, #24211f);color:var(--emw--color-black, #000000);border-radius:50px;position:absolute;bottom:15px;padding:10px 20px}';export{s as G}
|