@everymatrix/casino-engagement-suite-modal 1.44.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/casino-engagement-suite-modal/casino-engagement-suite-modal.esm.js +1 -1
  2. package/dist/casino-engagement-suite-modal/p-08e4f8fa.entry.js +1 -0
  3. package/dist/casino-engagement-suite-modal/p-7b038275.js +2 -0
  4. package/dist/casino-engagement-suite-modal/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +55 -58
  7. package/dist/cjs/casino-engagement-suite-modal.cjs.js +16 -10
  8. package/dist/cjs/index-63e7fad0.js +1210 -0
  9. package/dist/cjs/loader.cjs.js +6 -12
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.css +19 -17
  12. package/dist/collection/components/casino-engagement-suite-modal/casino-engagement-suite-modal.js +245 -252
  13. package/dist/collection/components/casino-engagement-suite-modal/index.js +1 -0
  14. package/dist/collection/utils/constants.js +2 -2
  15. package/dist/collection/utils/utils.js +1 -1
  16. package/dist/esm/app-globals-0f993ce5.js +3 -0
  17. package/dist/esm/casino-engagement-suite-modal.entry.js +55 -58
  18. package/dist/esm/casino-engagement-suite-modal.js +13 -10
  19. package/dist/esm/index-9157b8d6.js +1182 -0
  20. package/dist/esm/loader.js +6 -12
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-modal/.stencil/packages/stencil/casino-engagement-suite-modal/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-modal/.stencil/packages/stencil/casino-engagement-suite-modal/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/casino-engagement-suite-modal/casino-engagement-suite-modal.d.ts +26 -26
  26. package/dist/types/components/casino-engagement-suite-modal/index.d.ts +1 -0
  27. package/dist/types/components.d.ts +16 -1
  28. package/dist/types/stencil-public-runtime.d.ts +142 -33
  29. package/dist/types/utils/constants.d.ts +2 -2
  30. package/loader/cdn.js +1 -3
  31. package/loader/index.cjs.js +1 -3
  32. package/loader/index.d.ts +13 -1
  33. package/loader/index.es2017.js +1 -3
  34. package/loader/index.js +1 -3
  35. package/loader/package.json +1 -0
  36. package/package.json +9 -2
  37. package/dist/casino-engagement-suite-modal/p-172f1972.entry.js +0 -1
  38. package/dist/casino-engagement-suite-modal/p-d68e9c79.js +0 -1
  39. package/dist/cjs/index-f0b55429.js +0 -1194
  40. package/dist/components/casino-engagement-suite-modal.d.ts +0 -11
  41. package/dist/components/casino-engagement-suite-modal.js +0 -94
  42. package/dist/components/index.d.ts +0 -26
  43. package/dist/components/index.js +0 -1
  44. package/dist/esm/index-263f8cbc.js +0 -1167
  45. package/dist/esm/polyfills/core-js.js +0 -11
  46. package/dist/esm/polyfills/css-shim.js +0 -1
  47. package/dist/esm/polyfills/dom.js +0 -79
  48. package/dist/esm/polyfills/es5-html-element.js +0 -1
  49. package/dist/esm/polyfills/index.js +0 -34
  50. package/dist/esm/polyfills/system.js +0 -6
  51. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-modal/.stencil/packages/casino-engagement-suite-modal/stencil.config.d.ts +0 -2
@@ -1,1167 +0,0 @@
1
- const NAMESPACE = 'casino-engagement-suite-modal';
2
-
3
- let scopeId;
4
- let hostTagName;
5
- let isSvgMode = false;
6
- let queuePending = false;
7
- const win = typeof window !== 'undefined' ? window : {};
8
- const doc = win.document || { head: {} };
9
- const plt = {
10
- $flags$: 0,
11
- $resourcesUrl$: '',
12
- jmp: (h) => h(),
13
- raf: (h) => requestAnimationFrame(h),
14
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
- };
18
- const promiseResolve = (v) => Promise.resolve(v);
19
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
- try {
21
- new CSSStyleSheet();
22
- return typeof new CSSStyleSheet().replace === 'function';
23
- }
24
- catch (e) { }
25
- return false;
26
- })()
27
- ;
28
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
29
- const createTime = (fnName, tagName = '') => {
30
- {
31
- return () => {
32
- return;
33
- };
34
- }
35
- };
36
- const uniqueTime = (key, measureText) => {
37
- {
38
- return () => {
39
- return;
40
- };
41
- }
42
- };
43
- const rootAppliedStyles = new WeakMap();
44
- const registerStyle = (scopeId, cssText, allowCS) => {
45
- let style = styles.get(scopeId);
46
- if (supportsConstructibleStylesheets && allowCS) {
47
- style = (style || new CSSStyleSheet());
48
- style.replace(cssText);
49
- }
50
- else {
51
- style = cssText;
52
- }
53
- styles.set(scopeId, style);
54
- };
55
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
- let scopeId = getScopeId(cmpMeta);
57
- let style = styles.get(scopeId);
58
- // if an element is NOT connected then getRootNode() will return the wrong root node
59
- // so the fallback is to always use the document for the root node in those cases
60
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
61
- if (style) {
62
- if (typeof style === 'string') {
63
- styleContainerNode = styleContainerNode.head || styleContainerNode;
64
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
65
- let styleElm;
66
- if (!appliedStyles) {
67
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
68
- }
69
- if (!appliedStyles.has(scopeId)) {
70
- {
71
- {
72
- styleElm = doc.createElement('style');
73
- styleElm.innerHTML = style;
74
- }
75
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
76
- }
77
- if (appliedStyles) {
78
- appliedStyles.add(scopeId);
79
- }
80
- }
81
- }
82
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
83
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
84
- }
85
- }
86
- return scopeId;
87
- };
88
- const attachStyles = (hostRef) => {
89
- const cmpMeta = hostRef.$cmpMeta$;
90
- const elm = hostRef.$hostElement$;
91
- const flags = cmpMeta.$flags$;
92
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
93
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
94
- if (flags & 10 /* needsScopedEncapsulation */) {
95
- // only required when we're NOT using native shadow dom (slot)
96
- // or this browser doesn't support native shadow dom
97
- // and this host element was NOT created with SSR
98
- // let's pick out the inner content for slot projection
99
- // create a node to represent where the original
100
- // content was first placed, which is useful later on
101
- // DOM WRITE!!
102
- elm['s-sc'] = scopeId;
103
- elm.classList.add(scopeId + '-h');
104
- }
105
- endAttachStyles();
106
- };
107
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
108
- /**
109
- * Default style mode id
110
- */
111
- /**
112
- * Reusable empty obj/array
113
- * Don't add values to these!!
114
- */
115
- const EMPTY_OBJ = {};
116
- const isDef = (v) => v != null;
117
- const isComplexType = (o) => {
118
- // https://jsperf.com/typeof-fn-object/5
119
- o = typeof o;
120
- return o === 'object' || o === 'function';
121
- };
122
- /**
123
- * Production h() function based on Preact by
124
- * Jason Miller (@developit)
125
- * Licensed under the MIT License
126
- * https://github.com/developit/preact/blob/master/LICENSE
127
- *
128
- * Modified for Stencil's compiler and vdom
129
- */
130
- // const stack: any[] = [];
131
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
132
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
133
- const h = (nodeName, vnodeData, ...children) => {
134
- let child = null;
135
- let simple = false;
136
- let lastSimple = false;
137
- let vNodeChildren = [];
138
- const walk = (c) => {
139
- for (let i = 0; i < c.length; i++) {
140
- child = c[i];
141
- if (Array.isArray(child)) {
142
- walk(child);
143
- }
144
- else if (child != null && typeof child !== 'boolean') {
145
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
146
- child = String(child);
147
- }
148
- if (simple && lastSimple) {
149
- // If the previous child was simple (string), we merge both
150
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
151
- }
152
- else {
153
- // Append a new vNode, if it's text, we create a text vNode
154
- vNodeChildren.push(simple ? newVNode(null, child) : child);
155
- }
156
- lastSimple = simple;
157
- }
158
- }
159
- };
160
- walk(children);
161
- if (vnodeData) {
162
- {
163
- const classData = vnodeData.className || vnodeData.class;
164
- if (classData) {
165
- vnodeData.class =
166
- typeof classData !== 'object'
167
- ? classData
168
- : Object.keys(classData)
169
- .filter((k) => classData[k])
170
- .join(' ');
171
- }
172
- }
173
- }
174
- const vnode = newVNode(nodeName, null);
175
- vnode.$attrs$ = vnodeData;
176
- if (vNodeChildren.length > 0) {
177
- vnode.$children$ = vNodeChildren;
178
- }
179
- return vnode;
180
- };
181
- const newVNode = (tag, text) => {
182
- const vnode = {
183
- $flags$: 0,
184
- $tag$: tag,
185
- $text$: text,
186
- $elm$: null,
187
- $children$: null,
188
- };
189
- {
190
- vnode.$attrs$ = null;
191
- }
192
- return vnode;
193
- };
194
- const Host = {};
195
- const isHost = (node) => node && node.$tag$ === Host;
196
- /**
197
- * Production setAccessor() function based on Preact by
198
- * Jason Miller (@developit)
199
- * Licensed under the MIT License
200
- * https://github.com/developit/preact/blob/master/LICENSE
201
- *
202
- * Modified for Stencil's compiler and vdom
203
- */
204
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
205
- if (oldValue !== newValue) {
206
- let isProp = isMemberInElement(elm, memberName);
207
- let ln = memberName.toLowerCase();
208
- if (memberName === 'class') {
209
- const classList = elm.classList;
210
- const oldClasses = parseClassList(oldValue);
211
- const newClasses = parseClassList(newValue);
212
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
213
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
214
- }
215
- else if (memberName === 'style') {
216
- // update style attribute, css properties and values
217
- {
218
- for (const prop in oldValue) {
219
- if (!newValue || newValue[prop] == null) {
220
- if (prop.includes('-')) {
221
- elm.style.removeProperty(prop);
222
- }
223
- else {
224
- elm.style[prop] = '';
225
- }
226
- }
227
- }
228
- }
229
- for (const prop in newValue) {
230
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
231
- if (prop.includes('-')) {
232
- elm.style.setProperty(prop, newValue[prop]);
233
- }
234
- else {
235
- elm.style[prop] = newValue[prop];
236
- }
237
- }
238
- }
239
- }
240
- else if ((!isProp ) &&
241
- memberName[0] === 'o' &&
242
- memberName[1] === 'n') {
243
- // Event Handlers
244
- // so if the member name starts with "on" and the 3rd characters is
245
- // a capital letter, and it's not already a member on the element,
246
- // then we're assuming it's an event listener
247
- if (memberName[2] === '-') {
248
- // on- prefixed events
249
- // allows to be explicit about the dom event to listen without any magic
250
- // under the hood:
251
- // <my-cmp on-click> // listens for "click"
252
- // <my-cmp on-Click> // listens for "Click"
253
- // <my-cmp on-ionChange> // listens for "ionChange"
254
- // <my-cmp on-EVENTS> // listens for "EVENTS"
255
- memberName = memberName.slice(3);
256
- }
257
- else if (isMemberInElement(win, ln)) {
258
- // standard event
259
- // the JSX attribute could have been "onMouseOver" and the
260
- // member name "onmouseover" is on the window's prototype
261
- // so let's add the listener "mouseover", which is all lowercased
262
- memberName = ln.slice(2);
263
- }
264
- else {
265
- // custom event
266
- // the JSX attribute could have been "onMyCustomEvent"
267
- // so let's trim off the "on" prefix and lowercase the first character
268
- // and add the listener "myCustomEvent"
269
- // except for the first character, we keep the event name case
270
- memberName = ln[2] + memberName.slice(3);
271
- }
272
- if (oldValue) {
273
- plt.rel(elm, memberName, oldValue, false);
274
- }
275
- if (newValue) {
276
- plt.ael(elm, memberName, newValue, false);
277
- }
278
- }
279
- else {
280
- // Set property if it exists and it's not a SVG
281
- const isComplex = isComplexType(newValue);
282
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
283
- try {
284
- if (!elm.tagName.includes('-')) {
285
- let n = newValue == null ? '' : newValue;
286
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
287
- if (memberName === 'list') {
288
- isProp = false;
289
- }
290
- else if (oldValue == null || elm[memberName] != n) {
291
- elm[memberName] = n;
292
- }
293
- }
294
- else {
295
- elm[memberName] = newValue;
296
- }
297
- }
298
- catch (e) { }
299
- }
300
- if (newValue == null || newValue === false) {
301
- if (newValue !== false || elm.getAttribute(memberName) === '') {
302
- {
303
- elm.removeAttribute(memberName);
304
- }
305
- }
306
- }
307
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
308
- newValue = newValue === true ? '' : newValue;
309
- {
310
- elm.setAttribute(memberName, newValue);
311
- }
312
- }
313
- }
314
- }
315
- };
316
- const parseClassListRegex = /\s/;
317
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
318
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
319
- // if the element passed in is a shadow root, which is a document fragment
320
- // then we want to be adding attrs/props to the shadow root's "host" element
321
- // if it's not a shadow root, then we add attrs/props to the same element
322
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
323
- ? newVnode.$elm$.host
324
- : newVnode.$elm$;
325
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
326
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
327
- {
328
- // remove attributes no longer present on the vnode by setting them to undefined
329
- for (memberName in oldVnodeAttrs) {
330
- if (!(memberName in newVnodeAttrs)) {
331
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
332
- }
333
- }
334
- }
335
- // add new & update changed attributes
336
- for (memberName in newVnodeAttrs) {
337
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
338
- }
339
- };
340
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
341
- // tslint:disable-next-line: prefer-const
342
- let newVNode = newParentVNode.$children$[childIndex];
343
- let i = 0;
344
- let elm;
345
- let childNode;
346
- if (newVNode.$text$ !== null) {
347
- // create text node
348
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
349
- }
350
- else {
351
- // create element
352
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
353
- // add css classes, attrs, props, listeners, etc.
354
- {
355
- updateElement(null, newVNode, isSvgMode);
356
- }
357
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
358
- // if there is a scopeId and this is the initial render
359
- // then let's add the scopeId as a css class
360
- elm.classList.add((elm['s-si'] = scopeId));
361
- }
362
- if (newVNode.$children$) {
363
- for (i = 0; i < newVNode.$children$.length; ++i) {
364
- // create the node
365
- childNode = createElm(oldParentVNode, newVNode, i);
366
- // return node could have been null
367
- if (childNode) {
368
- // append our new node
369
- elm.appendChild(childNode);
370
- }
371
- }
372
- }
373
- }
374
- return elm;
375
- };
376
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
377
- let containerElm = (parentElm);
378
- let childNode;
379
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
380
- containerElm = containerElm.shadowRoot;
381
- }
382
- for (; startIdx <= endIdx; ++startIdx) {
383
- if (vnodes[startIdx]) {
384
- childNode = createElm(null, parentVNode, startIdx);
385
- if (childNode) {
386
- vnodes[startIdx].$elm$ = childNode;
387
- containerElm.insertBefore(childNode, before);
388
- }
389
- }
390
- }
391
- };
392
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
393
- for (; startIdx <= endIdx; ++startIdx) {
394
- if ((vnode = vnodes[startIdx])) {
395
- elm = vnode.$elm$;
396
- // remove the vnode's element from the dom
397
- elm.remove();
398
- }
399
- }
400
- };
401
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
402
- let oldStartIdx = 0;
403
- let newStartIdx = 0;
404
- let oldEndIdx = oldCh.length - 1;
405
- let oldStartVnode = oldCh[0];
406
- let oldEndVnode = oldCh[oldEndIdx];
407
- let newEndIdx = newCh.length - 1;
408
- let newStartVnode = newCh[0];
409
- let newEndVnode = newCh[newEndIdx];
410
- let node;
411
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
412
- if (oldStartVnode == null) {
413
- // Vnode might have been moved left
414
- oldStartVnode = oldCh[++oldStartIdx];
415
- }
416
- else if (oldEndVnode == null) {
417
- oldEndVnode = oldCh[--oldEndIdx];
418
- }
419
- else if (newStartVnode == null) {
420
- newStartVnode = newCh[++newStartIdx];
421
- }
422
- else if (newEndVnode == null) {
423
- newEndVnode = newCh[--newEndIdx];
424
- }
425
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
426
- patch(oldStartVnode, newStartVnode);
427
- oldStartVnode = oldCh[++oldStartIdx];
428
- newStartVnode = newCh[++newStartIdx];
429
- }
430
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
431
- patch(oldEndVnode, newEndVnode);
432
- oldEndVnode = oldCh[--oldEndIdx];
433
- newEndVnode = newCh[--newEndIdx];
434
- }
435
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
436
- patch(oldStartVnode, newEndVnode);
437
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
438
- oldStartVnode = oldCh[++oldStartIdx];
439
- newEndVnode = newCh[--newEndIdx];
440
- }
441
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
442
- patch(oldEndVnode, newStartVnode);
443
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
444
- oldEndVnode = oldCh[--oldEndIdx];
445
- newStartVnode = newCh[++newStartIdx];
446
- }
447
- else {
448
- {
449
- // new element
450
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
451
- newStartVnode = newCh[++newStartIdx];
452
- }
453
- if (node) {
454
- {
455
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
456
- }
457
- }
458
- }
459
- }
460
- if (oldStartIdx > oldEndIdx) {
461
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
462
- }
463
- else if (newStartIdx > newEndIdx) {
464
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
465
- }
466
- };
467
- const isSameVnode = (vnode1, vnode2) => {
468
- // compare if two vnode to see if they're "technically" the same
469
- // need to have the same element tag, and same key to be the same
470
- if (vnode1.$tag$ === vnode2.$tag$) {
471
- return true;
472
- }
473
- return false;
474
- };
475
- const patch = (oldVNode, newVNode) => {
476
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
477
- const oldChildren = oldVNode.$children$;
478
- const newChildren = newVNode.$children$;
479
- const tag = newVNode.$tag$;
480
- const text = newVNode.$text$;
481
- if (text === null) {
482
- // element node
483
- {
484
- if (tag === 'slot')
485
- ;
486
- else {
487
- // either this is the first render of an element OR it's an update
488
- // AND we already know it's possible it could have changed
489
- // this updates the element's css classes, attrs, props, listeners, etc.
490
- updateElement(oldVNode, newVNode, isSvgMode);
491
- }
492
- }
493
- if (oldChildren !== null && newChildren !== null) {
494
- // looks like there's child vnodes for both the old and new vnodes
495
- updateChildren(elm, oldChildren, newVNode, newChildren);
496
- }
497
- else if (newChildren !== null) {
498
- // no old child vnodes, but there are new child vnodes to add
499
- if (oldVNode.$text$ !== null) {
500
- // the old vnode was text, so be sure to clear it out
501
- elm.textContent = '';
502
- }
503
- // add the new vnode children
504
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
505
- }
506
- else if (oldChildren !== null) {
507
- // no new child vnodes, but there are old child vnodes to remove
508
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
509
- }
510
- }
511
- else if (oldVNode.$text$ !== text) {
512
- // update the text content for the text only vnode
513
- // and also only if the text is different than before
514
- elm.data = text;
515
- }
516
- };
517
- const renderVdom = (hostRef, renderFnResults) => {
518
- const hostElm = hostRef.$hostElement$;
519
- const cmpMeta = hostRef.$cmpMeta$;
520
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
521
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
522
- hostTagName = hostElm.tagName;
523
- if (cmpMeta.$attrsToReflect$) {
524
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
525
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
526
- }
527
- rootVnode.$tag$ = null;
528
- rootVnode.$flags$ |= 4 /* isHost */;
529
- hostRef.$vnode$ = rootVnode;
530
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
531
- {
532
- scopeId = hostElm['s-sc'];
533
- }
534
- // synchronous patch
535
- patch(oldVNode, rootVnode);
536
- };
537
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
538
- const createEvent = (ref, name, flags) => {
539
- const elm = getElement(ref);
540
- return {
541
- emit: (detail) => {
542
- return emitEvent(elm, name, {
543
- bubbles: !!(flags & 4 /* Bubbles */),
544
- composed: !!(flags & 2 /* Composed */),
545
- cancelable: !!(flags & 1 /* Cancellable */),
546
- detail,
547
- });
548
- },
549
- };
550
- };
551
- /**
552
- * Helper function to create & dispatch a custom Event on a provided target
553
- * @param elm the target of the Event
554
- * @param name the name to give the custom Event
555
- * @param opts options for configuring a custom Event
556
- * @returns the custom Event
557
- */
558
- const emitEvent = (elm, name, opts) => {
559
- const ev = plt.ce(name, opts);
560
- elm.dispatchEvent(ev);
561
- return ev;
562
- };
563
- const attachToAncestor = (hostRef, ancestorComponent) => {
564
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
565
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
566
- }
567
- };
568
- const scheduleUpdate = (hostRef, isInitialLoad) => {
569
- {
570
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
571
- }
572
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
573
- hostRef.$flags$ |= 512 /* needsRerender */;
574
- return;
575
- }
576
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
577
- // there is no ancestor component or the ancestor component
578
- // has already fired off its lifecycle update then
579
- // fire off the initial update
580
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
581
- return writeTask(dispatch) ;
582
- };
583
- const dispatchHooks = (hostRef, isInitialLoad) => {
584
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
585
- const instance = hostRef.$lazyInstance$ ;
586
- let promise;
587
- endSchedule();
588
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
589
- };
590
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
591
- // updateComponent
592
- const elm = hostRef.$hostElement$;
593
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
594
- const rc = elm['s-rc'];
595
- if (isInitialLoad) {
596
- // DOM WRITE!
597
- attachStyles(hostRef);
598
- }
599
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
600
- {
601
- callRender(hostRef, instance);
602
- }
603
- if (rc) {
604
- // ok, so turns out there are some child host elements
605
- // waiting on this parent element to load
606
- // let's fire off all update callbacks waiting
607
- rc.map((cb) => cb());
608
- elm['s-rc'] = undefined;
609
- }
610
- endRender();
611
- endUpdate();
612
- {
613
- const childrenPromises = elm['s-p'];
614
- const postUpdate = () => postUpdateComponent(hostRef);
615
- if (childrenPromises.length === 0) {
616
- postUpdate();
617
- }
618
- else {
619
- Promise.all(childrenPromises).then(postUpdate);
620
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
621
- childrenPromises.length = 0;
622
- }
623
- }
624
- };
625
- const callRender = (hostRef, instance, elm) => {
626
- try {
627
- instance = instance.render() ;
628
- {
629
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
630
- }
631
- {
632
- hostRef.$flags$ |= 2 /* hasRendered */;
633
- }
634
- {
635
- {
636
- // looks like we've got child nodes to render into this host element
637
- // or we need to update the css class/attrs on the host element
638
- // DOM WRITE!
639
- {
640
- renderVdom(hostRef, instance);
641
- }
642
- }
643
- }
644
- }
645
- catch (e) {
646
- consoleError(e, hostRef.$hostElement$);
647
- }
648
- return null;
649
- };
650
- const postUpdateComponent = (hostRef) => {
651
- const tagName = hostRef.$cmpMeta$.$tagName$;
652
- const elm = hostRef.$hostElement$;
653
- const endPostUpdate = createTime('postUpdate', tagName);
654
- const instance = hostRef.$lazyInstance$ ;
655
- const ancestorComponent = hostRef.$ancestorComponent$;
656
- {
657
- safeCall(instance, 'componentDidRender');
658
- }
659
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
660
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
661
- {
662
- // DOM WRITE!
663
- addHydratedFlag(elm);
664
- }
665
- endPostUpdate();
666
- {
667
- hostRef.$onReadyResolve$(elm);
668
- if (!ancestorComponent) {
669
- appDidLoad();
670
- }
671
- }
672
- }
673
- else {
674
- endPostUpdate();
675
- }
676
- // load events fire from bottom to top
677
- // the deepest elements load first then bubbles up
678
- {
679
- if (hostRef.$onRenderResolve$) {
680
- hostRef.$onRenderResolve$();
681
- hostRef.$onRenderResolve$ = undefined;
682
- }
683
- if (hostRef.$flags$ & 512 /* needsRerender */) {
684
- nextTick(() => scheduleUpdate(hostRef, false));
685
- }
686
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
687
- }
688
- // ( •_•)
689
- // ( •_•)>⌐■-■
690
- // (⌐■_■)
691
- };
692
- const appDidLoad = (who) => {
693
- // on appload
694
- // we have finish the first big initial render
695
- {
696
- addHydratedFlag(doc.documentElement);
697
- }
698
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
699
- };
700
- const safeCall = (instance, method, arg) => {
701
- if (instance && instance[method]) {
702
- try {
703
- return instance[method](arg);
704
- }
705
- catch (e) {
706
- consoleError(e);
707
- }
708
- }
709
- return undefined;
710
- };
711
- const then = (promise, thenFn) => {
712
- return promise && promise.then ? promise.then(thenFn) : thenFn();
713
- };
714
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
715
- ;
716
- /**
717
- * Parse a new property value for a given property type.
718
- *
719
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
720
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
721
- * 1. `any`, the type given to `propValue` in the function signature
722
- * 2. the type stored from `propType`.
723
- *
724
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
725
- *
726
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
727
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
728
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
729
- * ```tsx
730
- * <my-cmp prop-val={0}></my-cmp>
731
- * ```
732
- *
733
- * HTML prop values on the other hand, will always a string
734
- *
735
- * @param propValue the new value to coerce to some type
736
- * @param propType the type of the prop, expressed as a binary number
737
- * @returns the parsed/coerced value
738
- */
739
- const parsePropertyValue = (propValue, propType) => {
740
- // ensure this value is of the correct prop type
741
- if (propValue != null && !isComplexType(propValue)) {
742
- if (propType & 4 /* Boolean */) {
743
- // per the HTML spec, any string value means it is a boolean true value
744
- // but we'll cheat here and say that the string "false" is the boolean false
745
- return propValue === 'false' ? false : propValue === '' || !!propValue;
746
- }
747
- if (propType & 1 /* String */) {
748
- // could have been passed as a number or boolean
749
- // but we still want it as a string
750
- return String(propValue);
751
- }
752
- // redundant return here for better minification
753
- return propValue;
754
- }
755
- // not sure exactly what type we want
756
- // so no need to change to a different type
757
- return propValue;
758
- };
759
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
760
- const setValue = (ref, propName, newVal, cmpMeta) => {
761
- // check our new property value against our internal value
762
- const hostRef = getHostRef(ref);
763
- const oldVal = hostRef.$instanceValues$.get(propName);
764
- const flags = hostRef.$flags$;
765
- const instance = hostRef.$lazyInstance$ ;
766
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
767
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
768
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
769
- const didValueChange = newVal !== oldVal && !areBothNaN;
770
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
771
- // gadzooks! the property's value has changed!!
772
- // set our new value!
773
- hostRef.$instanceValues$.set(propName, newVal);
774
- if (instance) {
775
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
776
- // looks like this value actually changed, so we've got work to do!
777
- // but only if we've already rendered, otherwise just chill out
778
- // queue that we need to do an update, but don't worry about queuing
779
- // up millions cuz this function ensures it only runs once
780
- scheduleUpdate(hostRef, false);
781
- }
782
- }
783
- }
784
- };
785
- const proxyComponent = (Cstr, cmpMeta, flags) => {
786
- if (cmpMeta.$members$) {
787
- // It's better to have a const than two Object.entries()
788
- const members = Object.entries(cmpMeta.$members$);
789
- const prototype = Cstr.prototype;
790
- members.map(([memberName, [memberFlags]]) => {
791
- if ((memberFlags & 31 /* Prop */ ||
792
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
793
- // proxyComponent - prop
794
- Object.defineProperty(prototype, memberName, {
795
- get() {
796
- // proxyComponent, get value
797
- return getValue(this, memberName);
798
- },
799
- set(newValue) {
800
- // proxyComponent, set value
801
- setValue(this, memberName, newValue, cmpMeta);
802
- },
803
- configurable: true,
804
- enumerable: true,
805
- });
806
- }
807
- });
808
- if ((flags & 1 /* isElementConstructor */)) {
809
- const attrNameToPropName = new Map();
810
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
811
- plt.jmp(() => {
812
- const propName = attrNameToPropName.get(attrName);
813
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
814
- // in the case where an attribute was set inline.
815
- // ```html
816
- // <my-component some-attribute="some-value"></my-component>
817
- // ```
818
- //
819
- // There is an edge case where a developer sets the attribute inline on a custom element and then
820
- // programmatically changes it before it has been upgraded as shown below:
821
- //
822
- // ```html
823
- // <!-- this component has _not_ been upgraded yet -->
824
- // <my-component id="test" some-attribute="some-value"></my-component>
825
- // <script>
826
- // // grab non-upgraded component
827
- // el = document.querySelector("#test");
828
- // el.someAttribute = "another-value";
829
- // // upgrade component
830
- // customElements.define('my-component', MyComponent);
831
- // </script>
832
- // ```
833
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
834
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
835
- // to the value that was set inline i.e. "some-value" from above example. When
836
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
837
- //
838
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
839
- // by connectedCallback as this attributeChangedCallback will not fire.
840
- //
841
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
842
- //
843
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
844
- // properties here given that this goes against best practices outlined here
845
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
846
- if (this.hasOwnProperty(propName)) {
847
- newValue = this[propName];
848
- delete this[propName];
849
- }
850
- else if (prototype.hasOwnProperty(propName) &&
851
- typeof this[propName] === 'number' &&
852
- this[propName] == newValue) {
853
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
854
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
855
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
856
- return;
857
- }
858
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
859
- });
860
- };
861
- // create an array of attributes to observe
862
- // and also create a map of html attribute name to js property name
863
- Cstr.observedAttributes = members
864
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
865
- .map(([propName, m]) => {
866
- const attrName = m[1] || propName;
867
- attrNameToPropName.set(attrName, propName);
868
- if (m[0] & 512 /* ReflectAttr */) {
869
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
870
- }
871
- return attrName;
872
- });
873
- }
874
- }
875
- return Cstr;
876
- };
877
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
878
- // initializeComponent
879
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
880
- {
881
- // we haven't initialized this element yet
882
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
883
- // lazy loaded components
884
- // request the component's implementation to be
885
- // wired up with the host element
886
- Cstr = loadModule(cmpMeta);
887
- if (Cstr.then) {
888
- // Await creates a micro-task avoid if possible
889
- const endLoad = uniqueTime();
890
- Cstr = await Cstr;
891
- endLoad();
892
- }
893
- if (!Cstr.isProxied) {
894
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
895
- Cstr.isProxied = true;
896
- }
897
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
898
- // ok, time to construct the instance
899
- // but let's keep track of when we start and stop
900
- // so that the getters/setters don't incorrectly step on data
901
- {
902
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
903
- }
904
- // construct the lazy-loaded component implementation
905
- // passing the hostRef is very important during
906
- // construction in order to directly wire together the
907
- // host element and the lazy-loaded instance
908
- try {
909
- new Cstr(hostRef);
910
- }
911
- catch (e) {
912
- consoleError(e);
913
- }
914
- {
915
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
916
- }
917
- endNewInstance();
918
- }
919
- if (Cstr.style) {
920
- // this component has styles but we haven't registered them yet
921
- let style = Cstr.style;
922
- const scopeId = getScopeId(cmpMeta);
923
- if (!styles.has(scopeId)) {
924
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
925
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
926
- endRegisterStyles();
927
- }
928
- }
929
- }
930
- // we've successfully created a lazy instance
931
- const ancestorComponent = hostRef.$ancestorComponent$;
932
- const schedule = () => scheduleUpdate(hostRef, true);
933
- if (ancestorComponent && ancestorComponent['s-rc']) {
934
- // this is the initial load and this component it has an ancestor component
935
- // but the ancestor component has NOT fired its will update lifecycle yet
936
- // so let's just cool our jets and wait for the ancestor to continue first
937
- // this will get fired off when the ancestor component
938
- // finally gets around to rendering its lazy self
939
- // fire off the initial update
940
- ancestorComponent['s-rc'].push(schedule);
941
- }
942
- else {
943
- schedule();
944
- }
945
- };
946
- const connectedCallback = (elm) => {
947
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
948
- const hostRef = getHostRef(elm);
949
- const cmpMeta = hostRef.$cmpMeta$;
950
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
951
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
952
- // first time this component has connected
953
- hostRef.$flags$ |= 1 /* hasConnected */;
954
- {
955
- // find the first ancestor component (if there is one) and register
956
- // this component as one of the actively loading child components for its ancestor
957
- let ancestorComponent = elm;
958
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
959
- // climb up the ancestors looking for the first
960
- // component that hasn't finished its lifecycle update yet
961
- if (ancestorComponent['s-p']) {
962
- // we found this components first ancestor component
963
- // keep a reference to this component's ancestor component
964
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
965
- break;
966
- }
967
- }
968
- }
969
- // Lazy properties
970
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
971
- if (cmpMeta.$members$) {
972
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
973
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
974
- const value = elm[memberName];
975
- delete elm[memberName];
976
- elm[memberName] = value;
977
- }
978
- });
979
- }
980
- {
981
- initializeComponent(elm, hostRef, cmpMeta);
982
- }
983
- }
984
- endConnected();
985
- }
986
- };
987
- const disconnectedCallback = (elm) => {
988
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
989
- getHostRef(elm);
990
- }
991
- };
992
- const bootstrapLazy = (lazyBundles, options = {}) => {
993
- const endBootstrap = createTime();
994
- const cmpTags = [];
995
- const exclude = options.exclude || [];
996
- const customElements = win.customElements;
997
- const head = doc.head;
998
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
999
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1000
- const deferredConnectedCallbacks = [];
1001
- let appLoadFallback;
1002
- let isBootstrapping = true;
1003
- Object.assign(plt, options);
1004
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1005
- lazyBundles.map((lazyBundle) => {
1006
- lazyBundle[1].map((compactMeta) => {
1007
- const cmpMeta = {
1008
- $flags$: compactMeta[0],
1009
- $tagName$: compactMeta[1],
1010
- $members$: compactMeta[2],
1011
- $listeners$: compactMeta[3],
1012
- };
1013
- {
1014
- cmpMeta.$members$ = compactMeta[2];
1015
- }
1016
- {
1017
- cmpMeta.$attrsToReflect$ = [];
1018
- }
1019
- const tagName = cmpMeta.$tagName$;
1020
- const HostElement = class extends HTMLElement {
1021
- // StencilLazyHost
1022
- constructor(self) {
1023
- // @ts-ignore
1024
- super(self);
1025
- self = this;
1026
- registerHost(self, cmpMeta);
1027
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1028
- // this component is using shadow dom
1029
- // and this browser supports shadow dom
1030
- // add the read-only property "shadowRoot" to the host element
1031
- // adding the shadow root build conditionals to minimize runtime
1032
- {
1033
- {
1034
- self.attachShadow({ mode: 'open' });
1035
- }
1036
- }
1037
- }
1038
- }
1039
- connectedCallback() {
1040
- if (appLoadFallback) {
1041
- clearTimeout(appLoadFallback);
1042
- appLoadFallback = null;
1043
- }
1044
- if (isBootstrapping) {
1045
- // connectedCallback will be processed once all components have been registered
1046
- deferredConnectedCallbacks.push(this);
1047
- }
1048
- else {
1049
- plt.jmp(() => connectedCallback(this));
1050
- }
1051
- }
1052
- disconnectedCallback() {
1053
- plt.jmp(() => disconnectedCallback(this));
1054
- }
1055
- componentOnReady() {
1056
- return getHostRef(this).$onReadyPromise$;
1057
- }
1058
- };
1059
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1060
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1061
- cmpTags.push(tagName);
1062
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1063
- }
1064
- });
1065
- });
1066
- {
1067
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1068
- visibilityStyle.setAttribute('data-styles', '');
1069
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1070
- }
1071
- // Process deferred connectedCallbacks now all components have been registered
1072
- isBootstrapping = false;
1073
- if (deferredConnectedCallbacks.length) {
1074
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1075
- }
1076
- else {
1077
- {
1078
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1079
- }
1080
- }
1081
- // Fallback appLoad event
1082
- endBootstrap();
1083
- };
1084
- const hostRefs = new WeakMap();
1085
- const getHostRef = (ref) => hostRefs.get(ref);
1086
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1087
- const registerHost = (elm, cmpMeta) => {
1088
- const hostRef = {
1089
- $flags$: 0,
1090
- $hostElement$: elm,
1091
- $cmpMeta$: cmpMeta,
1092
- $instanceValues$: new Map(),
1093
- };
1094
- {
1095
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1096
- elm['s-p'] = [];
1097
- elm['s-rc'] = [];
1098
- }
1099
- return hostRefs.set(elm, hostRef);
1100
- };
1101
- const isMemberInElement = (elm, memberName) => memberName in elm;
1102
- const consoleError = (e, el) => (0, console.error)(e, el);
1103
- const cmpModules = /*@__PURE__*/ new Map();
1104
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1105
- // loadModuleImport
1106
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1107
- const bundleId = cmpMeta.$lazyBundleId$;
1108
- const module = cmpModules.get(bundleId) ;
1109
- if (module) {
1110
- return module[exportName];
1111
- }
1112
- return import(
1113
- /* webpackInclude: /\.entry\.js$/ */
1114
- /* webpackExclude: /\.system\.entry\.js$/ */
1115
- /* webpackMode: "lazy" */
1116
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
1117
- {
1118
- cmpModules.set(bundleId, importedModule);
1119
- }
1120
- return importedModule[exportName];
1121
- }, consoleError);
1122
- };
1123
- const styles = new Map();
1124
- const queueDomReads = [];
1125
- const queueDomWrites = [];
1126
- const queueTask = (queue, write) => (cb) => {
1127
- queue.push(cb);
1128
- if (!queuePending) {
1129
- queuePending = true;
1130
- if (write && plt.$flags$ & 4 /* queueSync */) {
1131
- nextTick(flush);
1132
- }
1133
- else {
1134
- plt.raf(flush);
1135
- }
1136
- }
1137
- };
1138
- const consume = (queue) => {
1139
- for (let i = 0; i < queue.length; i++) {
1140
- try {
1141
- queue[i](performance.now());
1142
- }
1143
- catch (e) {
1144
- consoleError(e);
1145
- }
1146
- }
1147
- queue.length = 0;
1148
- };
1149
- const flush = () => {
1150
- // always force a bunch of medium callbacks to run, but still have
1151
- // a throttle on how many can run in a certain time
1152
- // DOM READS!!!
1153
- consume(queueDomReads);
1154
- // DOM WRITES!!!
1155
- {
1156
- consume(queueDomWrites);
1157
- if ((queuePending = queueDomReads.length > 0)) {
1158
- // still more to do yet, but we've run out of time
1159
- // let's let this thing cool off and try again in the next tick
1160
- plt.raf(flush);
1161
- }
1162
- }
1163
- };
1164
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1165
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1166
-
1167
- export { bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };