@everymatrix/helper-tabs 0.0.3

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