@maggioli-design-system/mds-modal 3.0.0 → 3.1.0

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 (45) hide show
  1. package/dist/cjs/{index-6f89e656.js → index-90939077.js} +204 -59
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mds-modal.cjs.entry.js +3 -42
  4. package/dist/cjs/mds-modal.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/components/mds-modal/mds-modal.css +1 -1
  7. package/dist/collection/components/mds-modal/mds-modal.js +100 -91
  8. package/dist/collection/components/mds-modal/test/mds-modal.stories.js +2 -19
  9. package/dist/components/mds-modal.js +2 -41
  10. package/dist/esm/{index-7c9adc93.js → index-5dfae565.js} +204 -59
  11. package/dist/esm/loader.js +2 -2
  12. package/dist/esm/mds-modal.entry.js +3 -42
  13. package/dist/esm/mds-modal.js +2 -2
  14. package/dist/esm-es5/index-5dfae565.js +2 -0
  15. package/dist/esm-es5/loader.js +1 -1
  16. package/dist/esm-es5/mds-modal.entry.js +1 -1
  17. package/dist/esm-es5/mds-modal.js +1 -1
  18. package/dist/mds-modal/mds-modal.esm.js +1 -1
  19. package/dist/mds-modal/mds-modal.js +2 -1
  20. package/dist/mds-modal/p-19fa0f59.js +2 -0
  21. package/dist/mds-modal/p-4288d1a7.system.entry.js +1 -0
  22. package/dist/mds-modal/{p-bd6bb90a.system.js → p-5935b9a5.system.js} +1 -1
  23. package/dist/mds-modal/p-9c47a964.system.js +2 -0
  24. package/dist/mds-modal/p-f1135a2e.entry.js +1 -0
  25. package/dist/stats.json +32 -32
  26. package/loader/package.json +1 -0
  27. package/package.json +4 -4
  28. package/src/components/mds-modal/.gitlab-ci.yml +2 -2
  29. package/src/components/mds-modal/mds-modal.css +1 -1
  30. package/www/build/mds-modal.esm.js +1 -1
  31. package/www/build/mds-modal.js +2 -1
  32. package/www/build/p-19fa0f59.js +2 -0
  33. package/www/build/p-4288d1a7.system.entry.js +1 -0
  34. package/www/build/{p-bd6bb90a.system.js → p-5935b9a5.system.js} +1 -1
  35. package/www/build/p-9c47a964.system.js +2 -0
  36. package/www/build/p-f1135a2e.entry.js +1 -0
  37. package/dist/esm-es5/index-7c9adc93.js +0 -2
  38. package/dist/mds-modal/p-4e7d20d9.system.entry.js +0 -1
  39. package/dist/mds-modal/p-656f0e04.system.js +0 -2
  40. package/dist/mds-modal/p-b8cb7be9.js +0 -2
  41. package/dist/mds-modal/p-f8c5b0c2.entry.js +0 -1
  42. package/www/build/p-4e7d20d9.system.entry.js +0 -1
  43. package/www/build/p-656f0e04.system.js +0 -2
  44. package/www/build/p-b8cb7be9.js +0 -2
  45. package/www/build/p-f8c5b0c2.entry.js +0 -1
@@ -38,10 +38,10 @@ const plt = {
38
38
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
39
39
  };
40
40
  const promiseResolve = (v) => Promise.resolve(v);
41
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
41
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
42
42
  try {
43
43
  new CSSStyleSheet();
44
- return typeof new CSSStyleSheet().replace === 'function';
44
+ return typeof new CSSStyleSheet().replaceSync === 'function';
45
45
  }
46
46
  catch (e) { }
47
47
  return false;
@@ -61,7 +61,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
61
61
  const hostListenerProxy = (hostRef, methodName) => (ev) => {
62
62
  try {
63
63
  {
64
- if (hostRef.$flags$ & 256 /* isListenReady */) {
64
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
65
65
  // instance is ready, let's call it's member method for this event
66
66
  hostRef.$lazyInstance$[methodName](ev);
67
67
  }
@@ -75,12 +75,12 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
75
75
  }
76
76
  };
77
77
  const getHostListenerTarget = (elm, flags) => {
78
- if (flags & 4 /* TargetDocument */)
78
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
79
79
  return doc;
80
80
  return elm;
81
81
  };
82
82
  // prettier-ignore
83
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
83
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
84
84
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
85
85
  const createTime = (fnName, tagName = '') => {
86
86
  {
@@ -96,12 +96,17 @@ const uniqueTime = (key, measureText) => {
96
96
  };
97
97
  }
98
98
  };
99
- const rootAppliedStyles = new WeakMap();
99
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
100
100
  const registerStyle = (scopeId, cssText, allowCS) => {
101
101
  let style = styles.get(scopeId);
102
- if (supportsConstructibleStylesheets && allowCS) {
102
+ if (supportsConstructableStylesheets && allowCS) {
103
103
  style = (style || new CSSStyleSheet());
104
- style.replace(cssText);
104
+ if (typeof style === 'string') {
105
+ style = cssText;
106
+ }
107
+ else {
108
+ style.replaceSync(cssText);
109
+ }
105
110
  }
106
111
  else {
107
112
  style = cssText;
@@ -113,7 +118,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
113
118
  const style = styles.get(scopeId);
114
119
  // if an element is NOT connected then getRootNode() will return the wrong root node
115
120
  // so the fallback is to always use the document for the root node in those cases
116
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
121
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
117
122
  if (style) {
118
123
  if (typeof style === 'string') {
119
124
  styleContainerNode = styleContainerNode.head || styleContainerNode;
@@ -147,7 +152,7 @@ const attachStyles = (hostRef) => {
147
152
  const flags = cmpMeta.$flags$;
148
153
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
149
154
  const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
150
- if (flags & 10 /* needsScopedEncapsulation */) {
155
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
151
156
  // only required when we're NOT using native shadow dom (slot)
152
157
  // or this browser doesn't support native shadow dom
153
158
  // and this host element was NOT created with SSR
@@ -335,7 +340,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
335
340
  }
336
341
  }
337
342
  }
338
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
343
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
339
344
  newValue = newValue === true ? '' : newValue;
340
345
  {
341
346
  elm.setAttribute(memberName, newValue);
@@ -350,7 +355,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
350
355
  // if the element passed in is a shadow root, which is a document fragment
351
356
  // then we want to be adding attrs/props to the shadow root's "host" element
352
357
  // if it's not a shadow root, then we add attrs/props to the same element
353
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
358
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
354
359
  ? newVnode.$elm$.host
355
360
  : newVnode.$elm$;
356
361
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -368,6 +373,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
368
373
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
369
374
  }
370
375
  };
376
+ /**
377
+ * Create a DOM Node corresponding to one of the children of a given VNode.
378
+ *
379
+ * @param oldParentVNode the parent VNode from the previous render
380
+ * @param newParentVNode the parent VNode from the current render
381
+ * @param childIndex the index of the VNode, in the _new_ parent node's
382
+ * children, for which we will create a new DOM node
383
+ * @param parentElm the parent DOM node which our new node will be a child of
384
+ * @returns the newly created node
385
+ */
371
386
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
372
387
  // tslint:disable-next-line: prefer-const
373
388
  const newVNode = newParentVNode.$children$[childIndex];
@@ -429,6 +444,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
429
444
  }
430
445
  }
431
446
  };
447
+ /**
448
+ * Reconcile the children of a new VNode with the children of an old VNode by
449
+ * traversing the two collections of children, identifying nodes that are
450
+ * conserved or changed, calling out to `patch` to make any necessary
451
+ * updates to the DOM, and rearranging DOM nodes as needed.
452
+ *
453
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
454
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
455
+ * 'windows' by storing start and end indices and references to the
456
+ * corresponding array entries. Initially the two 'windows' are basically equal
457
+ * to the entire array, but we progressively narrow the windows until there are
458
+ * no children left to update by doing the following:
459
+ *
460
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
461
+ * that if we have an initial array like the following we'll end up dealing
462
+ * only with a window bounded by the highlighted elements:
463
+ *
464
+ * [null, null, VNode1 , ... , VNode2, null, null]
465
+ * ^^^^^^ ^^^^^^
466
+ *
467
+ * 2. Check to see if the elements at the head and tail positions are equal
468
+ * across the windows. This will basically detect elements which haven't
469
+ * been added, removed, or changed position, i.e. if you had the following
470
+ * VNode elements (represented as HTML):
471
+ *
472
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
473
+ * newVNode: `<div><p><span>THERE</span></p></div>`
474
+ *
475
+ * Then when comparing the children of the `<div>` tag we check the equality
476
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
477
+ * same tag in the same position, we'd be able to avoid completely
478
+ * re-rendering the subtree under them with a new DOM element and would just
479
+ * call out to `patch` to handle reconciling their children and so on.
480
+ *
481
+ * 3. Check, for both windows, to see if the element at the beginning of the
482
+ * window corresponds to the element at the end of the other window. This is
483
+ * a heuristic which will let us identify _some_ situations in which
484
+ * elements have changed position, for instance it _should_ detect that the
485
+ * children nodes themselves have not changed but merely moved in the
486
+ * following example:
487
+ *
488
+ * oldVNode: `<div><element-one /><element-two /></div>`
489
+ * newVNode: `<div><element-two /><element-one /></div>`
490
+ *
491
+ * If we find cases like this then we also need to move the concrete DOM
492
+ * elements corresponding to the moved children to write the re-order to the
493
+ * DOM.
494
+ *
495
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
496
+ * nodes in the old children which have the same key as the first element in
497
+ * our window on the new children. If we find such a node we handle calling
498
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
499
+ * what we find.
500
+ *
501
+ * Finally, once we've narrowed our 'windows' to the point that either of them
502
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
503
+ * insertion or deletion that needs to happen to get a DOM state that correctly
504
+ * reflects the new child VNodes. If, for instance, after our window on the old
505
+ * children has collapsed we still have more nodes on the new children that
506
+ * we haven't dealt with yet then we need to add them, or if the new children
507
+ * collapse but we still have unhandled _old_ children then we need to make
508
+ * sure the corresponding DOM nodes are removed.
509
+ *
510
+ * @param parentElm the node into which the parent VNode is rendered
511
+ * @param oldCh the old children of the parent node
512
+ * @param newVNode the new VNode which will replace the parent
513
+ * @param newCh the new children of the parent node
514
+ */
432
515
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
433
516
  let oldStartIdx = 0;
434
517
  let newStartIdx = 0;
@@ -441,7 +524,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
441
524
  let node;
442
525
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
443
526
  if (oldStartVnode == null) {
444
- // Vnode might have been moved left
527
+ // VNode might have been moved left
445
528
  oldStartVnode = oldCh[++oldStartIdx];
446
529
  }
447
530
  else if (oldEndVnode == null) {
@@ -454,34 +537,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
454
537
  newEndVnode = newCh[--newEndIdx];
455
538
  }
456
539
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
540
+ // if the start nodes are the same then we should patch the new VNode
541
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
542
+ // indices to reflect that. We don't need to move any DOM Nodes around
543
+ // since things are matched up in order.
457
544
  patch(oldStartVnode, newStartVnode);
458
545
  oldStartVnode = oldCh[++oldStartIdx];
459
546
  newStartVnode = newCh[++newStartIdx];
460
547
  }
461
548
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
549
+ // likewise, if the end nodes are the same we patch new onto old and
550
+ // decrement our end indices, and also likewise in this case we don't
551
+ // need to move any DOM Nodes.
462
552
  patch(oldEndVnode, newEndVnode);
463
553
  oldEndVnode = oldCh[--oldEndIdx];
464
554
  newEndVnode = newCh[--newEndIdx];
465
555
  }
466
556
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
467
557
  patch(oldStartVnode, newEndVnode);
558
+ // We need to move the element for `oldStartVnode` into a position which
559
+ // will be appropriate for `newEndVnode`. For this we can use
560
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
561
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
562
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
563
+ //
564
+ // <old-start-node />
565
+ // <some-intervening-node />
566
+ // <old-end-node />
567
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
568
+ // <next-sibling />
569
+ //
570
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
571
+ // the node for `oldStartVnode` at the end of the children of
572
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
573
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
574
+ // append it to the children of the parent element.
468
575
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
469
576
  oldStartVnode = oldCh[++oldStartIdx];
470
577
  newEndVnode = newCh[--newEndIdx];
471
578
  }
472
579
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
473
580
  patch(oldEndVnode, newStartVnode);
581
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
582
+ // the same node, so since we're here we know that they are not. Thus we
583
+ // can move the element for `oldEndVnode` _before_ the element for
584
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
585
+ // future.
474
586
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
475
587
  oldEndVnode = oldCh[--oldEndIdx];
476
588
  newStartVnode = newCh[++newStartIdx];
477
589
  }
478
590
  else {
479
591
  {
480
- // new element
592
+ // We either didn't find an element in the old children that matches
593
+ // the key of the first new child OR the build is not using `key`
594
+ // attributes at all. In either case we need to create a new element
595
+ // for the new node.
481
596
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
482
597
  newStartVnode = newCh[++newStartIdx];
483
598
  }
484
599
  if (node) {
600
+ // if we created a new node then handle inserting it to the DOM
485
601
  {
486
602
  oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
487
603
  }
@@ -489,20 +605,49 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
489
605
  }
490
606
  }
491
607
  if (oldStartIdx > oldEndIdx) {
608
+ // we have some more new nodes to add which don't match up with old nodes
492
609
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
493
610
  }
494
611
  else if (newStartIdx > newEndIdx) {
612
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
613
+ // in the new array, so lets remove them (which entails cleaning up the
614
+ // relevant DOM nodes)
495
615
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
496
616
  }
497
617
  };
498
- const isSameVnode = (vnode1, vnode2) => {
618
+ /**
619
+ * Compare two VNodes to determine if they are the same
620
+ *
621
+ * **NB**: This function is an equality _heuristic_ based on the available
622
+ * information set on the two VNodes and can be misleading under certain
623
+ * circumstances. In particular, if the two nodes do not have `key` attrs
624
+ * (available under `$key$` on VNodes) then the function falls back on merely
625
+ * checking that they have the same tag.
626
+ *
627
+ * So, in other words, if `key` attrs are not set on VNodes which may be
628
+ * changing order within a `children` array or something along those lines then
629
+ * we could obtain a false positive and then have to do needless re-rendering.
630
+ *
631
+ * @param leftVNode the first VNode to check
632
+ * @param rightVNode the second VNode to check
633
+ * @returns whether they're equal or not
634
+ */
635
+ const isSameVnode = (leftVNode, rightVNode) => {
499
636
  // compare if two vnode to see if they're "technically" the same
500
637
  // need to have the same element tag, and same key to be the same
501
- if (vnode1.$tag$ === vnode2.$tag$) {
638
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
502
639
  return true;
503
640
  }
504
641
  return false;
505
642
  };
643
+ /**
644
+ * Handle reconciling an outdated VNode with a new one which corresponds to
645
+ * it. This function handles flushing updates to the DOM and reconciling the
646
+ * children of the two nodes (if any).
647
+ *
648
+ * @param oldVNode an old VNode whose DOM element and children we want to update
649
+ * @param newVNode a new VNode representing an updated version of the old one
650
+ */
506
651
  const patch = (oldVNode, newVNode) => {
507
652
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
508
653
  const oldChildren = oldVNode.$children$;
@@ -510,7 +655,6 @@ const patch = (oldVNode, newVNode) => {
510
655
  const tag = newVNode.$tag$;
511
656
  const text = newVNode.$text$;
512
657
  if (text === null) {
513
- // element node
514
658
  {
515
659
  if (tag === 'slot')
516
660
  ;
@@ -523,6 +667,7 @@ const patch = (oldVNode, newVNode) => {
523
667
  }
524
668
  if (oldChildren !== null && newChildren !== null) {
525
669
  // looks like there's child vnodes for both the old and new vnodes
670
+ // so we need to call `updateChildren` to reconcile them
526
671
  updateChildren(elm, oldChildren, newVNode, newChildren);
527
672
  }
528
673
  else if (newChildren !== null) {
@@ -556,7 +701,7 @@ const renderVdom = (hostRef, renderFnResults) => {
556
701
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
557
702
  }
558
703
  rootVnode.$tag$ = null;
559
- rootVnode.$flags$ |= 4 /* isHost */;
704
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
560
705
  hostRef.$vnode$ = rootVnode;
561
706
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
562
707
  {
@@ -571,9 +716,9 @@ const createEvent = (ref, name, flags) => {
571
716
  return {
572
717
  emit: (detail) => {
573
718
  return emitEvent(elm, name, {
574
- bubbles: !!(flags & 4 /* Bubbles */),
575
- composed: !!(flags & 2 /* Composed */),
576
- cancelable: !!(flags & 1 /* Cancellable */),
719
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
720
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
721
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
577
722
  detail,
578
723
  });
579
724
  },
@@ -598,10 +743,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
598
743
  };
599
744
  const scheduleUpdate = (hostRef, isInitialLoad) => {
600
745
  {
601
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
746
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
602
747
  }
603
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
604
- hostRef.$flags$ |= 512 /* needsRerender */;
748
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
749
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
605
750
  return;
606
751
  }
607
752
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -617,7 +762,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
617
762
  let promise;
618
763
  if (isInitialLoad) {
619
764
  {
620
- hostRef.$flags$ |= 256 /* isListenReady */;
765
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
621
766
  if (hostRef.$queuedListeners$) {
622
767
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
623
768
  hostRef.$queuedListeners$ = null;
@@ -663,7 +808,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
663
808
  }
664
809
  else {
665
810
  Promise.all(childrenPromises).then(postUpdate);
666
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
811
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
667
812
  childrenPromises.length = 0;
668
813
  }
669
814
  }
@@ -672,10 +817,10 @@ const callRender = (hostRef, instance, elm) => {
672
817
  try {
673
818
  instance = instance.render() ;
674
819
  {
675
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
820
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
676
821
  }
677
822
  {
678
- hostRef.$flags$ |= 2 /* hasRendered */;
823
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
679
824
  }
680
825
  {
681
826
  {
@@ -702,8 +847,8 @@ const postUpdateComponent = (hostRef) => {
702
847
  {
703
848
  safeCall(instance, 'componentDidRender');
704
849
  }
705
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
706
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
850
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
851
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
707
852
  {
708
853
  // DOM WRITE!
709
854
  addHydratedFlag(elm);
@@ -726,10 +871,10 @@ const postUpdateComponent = (hostRef) => {
726
871
  hostRef.$onRenderResolve$();
727
872
  hostRef.$onRenderResolve$ = undefined;
728
873
  }
729
- if (hostRef.$flags$ & 512 /* needsRerender */) {
874
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
730
875
  nextTick(() => scheduleUpdate(hostRef, false));
731
876
  }
732
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
877
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
733
878
  }
734
879
  // ( •_•)
735
880
  // ( •_•)>⌐■-■
@@ -785,12 +930,12 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
785
930
  const parsePropertyValue = (propValue, propType) => {
786
931
  // ensure this value is of the correct prop type
787
932
  if (propValue != null && !isComplexType(propValue)) {
788
- if (propType & 4 /* Boolean */) {
933
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
789
934
  // per the HTML spec, any string value means it is a boolean true value
790
935
  // but we'll cheat here and say that the string "false" is the boolean false
791
936
  return propValue === 'false' ? false : propValue === '' || !!propValue;
792
937
  }
793
- if (propType & 1 /* String */) {
938
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
794
939
  // could have been passed as a number or boolean
795
940
  // but we still want it as a string
796
941
  return String(propValue);
@@ -814,13 +959,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
814
959
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
815
960
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
816
961
  const didValueChange = newVal !== oldVal && !areBothNaN;
817
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
962
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
818
963
  // gadzooks! the property's value has changed!!
819
964
  // set our new value!
820
965
  hostRef.$instanceValues$.set(propName, newVal);
821
966
  if (instance) {
822
967
  // get an array of method names of watch functions to call
823
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
968
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
824
969
  const watchMethods = cmpMeta.$watchers$[propName];
825
970
  if (watchMethods) {
826
971
  // this instance is watching for when this property changed
@@ -835,7 +980,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
835
980
  });
836
981
  }
837
982
  }
838
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
983
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
839
984
  // looks like this value actually changed, so we've got work to do!
840
985
  // but only if we've already rendered, otherwise just chill out
841
986
  // queue that we need to do an update, but don't worry about queuing
@@ -854,8 +999,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
854
999
  const members = Object.entries(cmpMeta.$members$);
855
1000
  const prototype = Cstr.prototype;
856
1001
  members.map(([memberName, [memberFlags]]) => {
857
- if ((memberFlags & 31 /* Prop */ ||
858
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1002
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1003
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
859
1004
  // proxyComponent - prop
860
1005
  Object.defineProperty(prototype, memberName, {
861
1006
  get() {
@@ -871,7 +1016,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
871
1016
  });
872
1017
  }
873
1018
  });
874
- if ((flags & 1 /* isElementConstructor */)) {
1019
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
875
1020
  const attrNameToPropName = new Map();
876
1021
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
877
1022
  plt.jmp(() => {
@@ -927,11 +1072,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
927
1072
  // create an array of attributes to observe
928
1073
  // and also create a map of html attribute name to js property name
929
1074
  Cstr.observedAttributes = members
930
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1075
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
931
1076
  .map(([propName, m]) => {
932
1077
  const attrName = m[1] || propName;
933
1078
  attrNameToPropName.set(attrName, propName);
934
- if (m[0] & 512 /* ReflectAttr */) {
1079
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
935
1080
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
936
1081
  }
937
1082
  return attrName;
@@ -942,10 +1087,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
942
1087
  };
943
1088
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
944
1089
  // initializeComponent
945
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1090
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
946
1091
  {
947
1092
  // we haven't initialized this element yet
948
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1093
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
949
1094
  // lazy loaded components
950
1095
  // request the component's implementation to be
951
1096
  // wired up with the host element
@@ -963,7 +1108,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
963
1108
  {
964
1109
  cmpMeta.$watchers$ = Cstr.watchers;
965
1110
  }
966
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1111
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
967
1112
  Cstr.isProxied = true;
968
1113
  }
969
1114
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -971,7 +1116,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
971
1116
  // but let's keep track of when we start and stop
972
1117
  // so that the getters/setters don't incorrectly step on data
973
1118
  {
974
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1119
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
975
1120
  }
976
1121
  // construct the lazy-loaded component implementation
977
1122
  // passing the hostRef is very important during
@@ -984,10 +1129,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
984
1129
  consoleError(e);
985
1130
  }
986
1131
  {
987
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1132
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
988
1133
  }
989
1134
  {
990
- hostRef.$flags$ |= 128 /* isWatchReady */;
1135
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
991
1136
  }
992
1137
  endNewInstance();
993
1138
  }
@@ -997,7 +1142,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
997
1142
  const scopeId = getScopeId(cmpMeta);
998
1143
  if (!styles.has(scopeId)) {
999
1144
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1000
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1145
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1001
1146
  endRegisterStyles();
1002
1147
  }
1003
1148
  }
@@ -1019,13 +1164,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1019
1164
  }
1020
1165
  };
1021
1166
  const connectedCallback = (elm) => {
1022
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1167
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1023
1168
  const hostRef = getHostRef(elm);
1024
1169
  const cmpMeta = hostRef.$cmpMeta$;
1025
1170
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1026
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1171
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1027
1172
  // first time this component has connected
1028
- hostRef.$flags$ |= 1 /* hasConnected */;
1173
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1029
1174
  {
1030
1175
  // find the first ancestor component (if there is one) and register
1031
1176
  // this component as one of the actively loading child components for its ancestor
@@ -1045,7 +1190,7 @@ const connectedCallback = (elm) => {
1045
1190
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1046
1191
  if (cmpMeta.$members$) {
1047
1192
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1048
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1193
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1049
1194
  const value = elm[memberName];
1050
1195
  delete elm[memberName];
1051
1196
  elm[memberName] = value;
@@ -1066,7 +1211,7 @@ const connectedCallback = (elm) => {
1066
1211
  }
1067
1212
  };
1068
1213
  const disconnectedCallback = (elm) => {
1069
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1214
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1070
1215
  const hostRef = getHostRef(elm);
1071
1216
  {
1072
1217
  if (hostRef.$rmListeners$) {
@@ -1117,7 +1262,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1117
1262
  super(self);
1118
1263
  self = this;
1119
1264
  registerHost(self, cmpMeta);
1120
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1265
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1121
1266
  // this component is using shadow dom
1122
1267
  // and this browser supports shadow dom
1123
1268
  // add the read-only property "shadowRoot" to the host element
@@ -1152,7 +1297,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1152
1297
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1153
1298
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1154
1299
  cmpTags.push(tagName);
1155
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1300
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1156
1301
  }
1157
1302
  });
1158
1303
  });
@@ -1174,7 +1319,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1174
1319
  // Fallback appLoad event
1175
1320
  endBootstrap();
1176
1321
  };
1177
- const hostRefs = new WeakMap();
1322
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1178
1323
  const getHostRef = (ref) => hostRefs.get(ref);
1179
1324
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1180
1325
  const registerHost = (elm, cmpMeta) => {
@@ -1216,14 +1361,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1216
1361
  return importedModule[exportName];
1217
1362
  }, consoleError);
1218
1363
  };
1219
- const styles = new Map();
1364
+ const styles = /*@__PURE__*/ new Map();
1220
1365
  const queueDomReads = [];
1221
1366
  const queueDomWrites = [];
1222
1367
  const queueTask = (queue, write) => (cb) => {
1223
1368
  queue.push(cb);
1224
1369
  if (!queuePending) {
1225
1370
  queuePending = true;
1226
- if (write && plt.$flags$ & 4 /* queueSync */) {
1371
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1227
1372
  nextTick(flush);
1228
1373
  }
1229
1374
  else {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6f89e656.js');
5
+ const index = require('./index-90939077.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();