@siemens/ix-aggrid 1.1.0-beta.3 → 1.1.0-beta.4

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