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