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