proto-daisy-db 0.0.2

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