@everymatrix/lottery-game-page 0.0.6 → 0.0.7

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