@stencil/core 4.22.3 → 4.23.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.
@@ -460,102 +460,20 @@ var unwrapErr = (result) => {
460
460
  };
461
461
 
462
462
  // src/runtime/connected-callback.ts
463
- var import_app_data15 = require("@stencil/core/internal/app-data");
463
+ var import_app_data16 = require("@stencil/core/internal/app-data");
464
464
 
465
465
  // src/runtime/client-hydrate.ts
466
- var import_app_data3 = require("@stencil/core/internal/app-data");
466
+ var import_app_data7 = require("@stencil/core/internal/app-data");
467
467
 
468
- // src/runtime/profile.ts
469
- var import_app_data = require("@stencil/core/internal/app-data");
470
- var i = 0;
471
- var createTime = (fnName, tagName = "") => {
472
- if (import_app_data.BUILD.profile && performance.mark) {
473
- const key = `st:${fnName}:${tagName}:${i++}`;
474
- performance.mark(key);
475
- return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
476
- } else {
477
- return () => {
478
- return;
479
- };
480
- }
481
- };
482
- var uniqueTime = (key, measureText) => {
483
- if (import_app_data.BUILD.profile && performance.mark) {
484
- if (performance.getEntriesByName(key, "mark").length === 0) {
485
- performance.mark(key);
486
- }
487
- return () => {
488
- if (performance.getEntriesByName(measureText, "measure").length === 0) {
489
- performance.measure(measureText, key);
490
- }
491
- };
492
- } else {
493
- return () => {
494
- return;
495
- };
496
- }
497
- };
498
- var inspect = (ref) => {
499
- const hostRef = getHostRef(ref);
500
- if (!hostRef) {
501
- return void 0;
502
- }
503
- const flags = hostRef.$flags$;
504
- const hostElement = hostRef.$hostElement$;
505
- return {
506
- renderCount: hostRef.$renderCount$,
507
- flags: {
508
- hasRendered: !!(flags & 2 /* hasRendered */),
509
- hasConnected: !!(flags & 1 /* hasConnected */),
510
- isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
511
- isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
512
- isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
513
- hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
514
- hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
515
- isWatchReady: !!(flags & 128 /* isWatchReady */),
516
- isListenReady: !!(flags & 256 /* isListenReady */),
517
- needsRerender: !!(flags & 512 /* needsRerender */)
518
- },
519
- instanceValues: hostRef.$instanceValues$,
520
- ancestorComponent: hostRef.$ancestorComponent$,
521
- hostElement,
522
- lazyInstance: hostRef.$lazyInstance$,
523
- vnode: hostRef.$vnode$,
524
- modeName: hostRef.$modeName$,
525
- onReadyPromise: hostRef.$onReadyPromise$,
526
- onReadyResolve: hostRef.$onReadyResolve$,
527
- onInstancePromise: hostRef.$onInstancePromise$,
528
- onInstanceResolve: hostRef.$onInstanceResolve$,
529
- onRenderResolve: hostRef.$onRenderResolve$,
530
- queuedListeners: hostRef.$queuedListeners$,
531
- rmListeners: hostRef.$rmListeners$,
532
- ["s-id"]: hostElement["s-id"],
533
- ["s-cr"]: hostElement["s-cr"],
534
- ["s-lr"]: hostElement["s-lr"],
535
- ["s-p"]: hostElement["s-p"],
536
- ["s-rc"]: hostElement["s-rc"],
537
- ["s-sc"]: hostElement["s-sc"]
538
- };
539
- };
540
- var installDevTools = () => {
541
- if (import_app_data.BUILD.devTools) {
542
- const stencil = win.stencil = win.stencil || {};
543
- const originalInspect = stencil.inspect;
544
- stencil.inspect = (ref) => {
545
- let result = inspect(ref);
546
- if (!result && typeof originalInspect === "function") {
547
- result = originalInspect(ref);
548
- }
549
- return result;
550
- };
551
- }
552
- };
468
+ // src/runtime/dom-extras.ts
469
+ var import_app_data5 = require("@stencil/core/internal/app-data");
553
470
 
554
471
  // src/runtime/runtime-constants.ts
555
472
  var CONTENT_REF_ID = "r";
556
473
  var ORG_LOCATION_ID = "o";
557
474
  var SLOT_NODE_ID = "s";
558
475
  var TEXT_NODE_ID = "t";
476
+ var COMMENT_NODE_ID = "c";
559
477
  var HYDRATE_ID = "s-id";
560
478
  var HYDRATED_STYLE_ID = "sty-id";
561
479
  var HYDRATE_CHILD_ID = "c-id";
@@ -575,8 +493,11 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
575
493
  "formStateRestoreCallback"
576
494
  ];
577
495
 
496
+ // src/runtime/vdom/vdom-render.ts
497
+ var import_app_data4 = require("@stencil/core/internal/app-data");
498
+
578
499
  // src/runtime/vdom/h.ts
579
- var import_app_data2 = require("@stencil/core/internal/app-data");
500
+ var import_app_data = require("@stencil/core/internal/app-data");
580
501
  var h = (nodeName, vnodeData, ...children) => {
581
502
  let child = null;
582
503
  let key = null;
@@ -592,7 +513,7 @@ var h = (nodeName, vnodeData, ...children) => {
592
513
  } else if (child != null && typeof child !== "boolean") {
593
514
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
594
515
  child = String(child);
595
- } else if (import_app_data2.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
516
+ } else if (import_app_data.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
596
517
  consoleDevError(`vNode passed as children has unexpected type.
597
518
  Make sure it's using the correct h() function.
598
519
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -608,28 +529,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
608
529
  };
609
530
  walk(children);
610
531
  if (vnodeData) {
611
- if (import_app_data2.BUILD.isDev && nodeName === "input") {
532
+ if (import_app_data.BUILD.isDev && nodeName === "input") {
612
533
  validateInputProperties(vnodeData);
613
534
  }
614
- if (import_app_data2.BUILD.vdomKey && vnodeData.key) {
535
+ if (import_app_data.BUILD.vdomKey && vnodeData.key) {
615
536
  key = vnodeData.key;
616
537
  }
617
- if (import_app_data2.BUILD.slotRelocation && vnodeData.name) {
538
+ if (import_app_data.BUILD.slotRelocation && vnodeData.name) {
618
539
  slotName = vnodeData.name;
619
540
  }
620
- if (import_app_data2.BUILD.vdomClass) {
541
+ if (import_app_data.BUILD.vdomClass) {
621
542
  const classData = vnodeData.className || vnodeData.class;
622
543
  if (classData) {
623
544
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
624
545
  }
625
546
  }
626
547
  }
627
- if (import_app_data2.BUILD.isDev && vNodeChildren.some(isHost)) {
548
+ if (import_app_data.BUILD.isDev && vNodeChildren.some(isHost)) {
628
549
  consoleDevError(`The <Host> must be the single root component. Make sure:
629
550
  - You are NOT using hostData() and <Host> in the same component.
630
551
  - <Host> is used once, and it's the single root component of the render() function.`);
631
552
  }
632
- if (import_app_data2.BUILD.vdomFunctional && typeof nodeName === "function") {
553
+ if (import_app_data.BUILD.vdomFunctional && typeof nodeName === "function") {
633
554
  return nodeName(
634
555
  vnodeData === null ? {} : vnodeData,
635
556
  vNodeChildren,
@@ -641,10 +562,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
641
562
  if (vNodeChildren.length > 0) {
642
563
  vnode.$children$ = vNodeChildren;
643
564
  }
644
- if (import_app_data2.BUILD.vdomKey) {
565
+ if (import_app_data.BUILD.vdomKey) {
645
566
  vnode.$key$ = key;
646
567
  }
647
- if (import_app_data2.BUILD.slotRelocation) {
568
+ if (import_app_data.BUILD.slotRelocation) {
648
569
  vnode.$name$ = slotName;
649
570
  }
650
571
  return vnode;
@@ -657,13 +578,13 @@ var newVNode = (tag, text) => {
657
578
  $elm$: null,
658
579
  $children$: null
659
580
  };
660
- if (import_app_data2.BUILD.vdomAttribute) {
581
+ if (import_app_data.BUILD.vdomAttribute) {
661
582
  vnode.$attrs$ = null;
662
583
  }
663
- if (import_app_data2.BUILD.vdomKey) {
584
+ if (import_app_data.BUILD.vdomKey) {
664
585
  vnode.$key$ = null;
665
586
  }
666
- if (import_app_data2.BUILD.slotRelocation) {
587
+ if (import_app_data.BUILD.slotRelocation) {
667
588
  vnode.$name$ = null;
668
589
  }
669
590
  return vnode;
@@ -715,416 +636,51 @@ var validateInputProperties = (inputElm) => {
715
636
  }
716
637
  };
717
638
 
718
- // src/runtime/client-hydrate.ts
719
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
720
- const endHydrate = createTime("hydrateClient", tagName);
721
- const shadowRoot = hostElm.shadowRoot;
722
- const childRenderNodes = [];
723
- const slotNodes = [];
724
- const shadowRootNodes = import_app_data3.BUILD.shadowDom && shadowRoot ? [] : null;
725
- const vnode = hostRef.$vnode$ = newVNode(tagName, null);
726
- if (!plt.$orgLocNodes$) {
727
- initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
728
- }
729
- hostElm[HYDRATE_ID] = hostId;
730
- hostElm.removeAttribute(HYDRATE_ID);
731
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
732
- childRenderNodes.map((c) => {
733
- const orgLocationId = c.$hostId$ + "." + c.$nodeId$;
734
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
735
- const node = c.$elm$;
736
- if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") {
737
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
738
- }
739
- if (!shadowRoot) {
740
- node["s-hn"] = tagName;
741
- if (orgLocationNode) {
742
- node["s-ol"] = orgLocationNode;
743
- node["s-ol"]["s-nr"] = node;
744
- }
745
- }
746
- plt.$orgLocNodes$.delete(orgLocationId);
747
- });
748
- if (import_app_data3.BUILD.shadowDom && shadowRoot) {
749
- shadowRootNodes.map((shadowRootNode) => {
750
- if (shadowRootNode) {
751
- shadowRoot.appendChild(shadowRootNode);
752
- }
753
- });
754
- }
755
- endHydrate();
756
- };
757
- var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
758
- let childNodeType;
759
- let childIdSplt;
760
- let childVNode;
761
- let i2;
762
- if (node.nodeType === 1 /* ElementNode */) {
763
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
764
- if (childNodeType) {
765
- childIdSplt = childNodeType.split(".");
766
- if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
767
- childVNode = {
768
- $flags$: 0,
769
- $hostId$: childIdSplt[0],
770
- $nodeId$: childIdSplt[1],
771
- $depth$: childIdSplt[2],
772
- $index$: childIdSplt[3],
773
- $tag$: node.tagName.toLowerCase(),
774
- $elm$: node,
775
- $attrs$: null,
776
- $children$: null,
777
- $key$: null,
778
- $name$: null,
779
- $text$: null
780
- };
781
- childRenderNodes.push(childVNode);
782
- node.removeAttribute(HYDRATE_CHILD_ID);
783
- if (!parentVNode.$children$) {
784
- parentVNode.$children$ = [];
785
- }
786
- parentVNode.$children$[childVNode.$index$] = childVNode;
787
- parentVNode = childVNode;
788
- if (shadowRootNodes && childVNode.$depth$ === "0") {
789
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
790
- }
791
- }
792
- }
793
- if (node.shadowRoot) {
794
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
795
- clientHydrate(
796
- parentVNode,
797
- childRenderNodes,
798
- slotNodes,
799
- shadowRootNodes,
800
- hostElm,
801
- node.shadowRoot.childNodes[i2],
802
- hostId
803
- );
639
+ // src/runtime/vdom/update-element.ts
640
+ var import_app_data3 = require("@stencil/core/internal/app-data");
641
+
642
+ // src/runtime/vdom/set-accessor.ts
643
+ var import_app_data2 = require("@stencil/core/internal/app-data");
644
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
645
+ if (oldValue !== newValue) {
646
+ let isProp = isMemberInElement(elm, memberName);
647
+ let ln = memberName.toLowerCase();
648
+ if (import_app_data2.BUILD.vdomClass && memberName === "class") {
649
+ const classList = elm.classList;
650
+ const oldClasses = parseClassList(oldValue);
651
+ const newClasses = parseClassList(newValue);
652
+ if (elm["s-si"] && newClasses.indexOf(elm["s-si"]) < 0) {
653
+ newClasses.push(elm["s-si"]);
804
654
  }
805
- }
806
- for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
807
- clientHydrate(
808
- parentVNode,
809
- childRenderNodes,
810
- slotNodes,
811
- shadowRootNodes,
812
- hostElm,
813
- node.childNodes[i2],
814
- hostId
815
- );
816
- }
817
- } else if (node.nodeType === 8 /* CommentNode */) {
818
- childIdSplt = node.nodeValue.split(".");
819
- if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
820
- childNodeType = childIdSplt[0];
821
- childVNode = {
822
- $flags$: 0,
823
- $hostId$: childIdSplt[1],
824
- $nodeId$: childIdSplt[2],
825
- $depth$: childIdSplt[3],
826
- $index$: childIdSplt[4],
827
- $elm$: node,
828
- $attrs$: null,
829
- $children$: null,
830
- $key$: null,
831
- $name$: null,
832
- $tag$: null,
833
- $text$: null
834
- };
835
- if (childNodeType === TEXT_NODE_ID) {
836
- childVNode.$elm$ = node.nextSibling;
837
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
838
- childVNode.$text$ = childVNode.$elm$.textContent;
839
- childRenderNodes.push(childVNode);
840
- node.remove();
841
- if (!parentVNode.$children$) {
842
- parentVNode.$children$ = [];
843
- }
844
- parentVNode.$children$[childVNode.$index$] = childVNode;
845
- if (shadowRootNodes && childVNode.$depth$ === "0") {
846
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
655
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
656
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
657
+ } else if (import_app_data2.BUILD.vdomStyle && memberName === "style") {
658
+ if (import_app_data2.BUILD.updatable) {
659
+ for (const prop in oldValue) {
660
+ if (!newValue || newValue[prop] == null) {
661
+ if (!import_app_data2.BUILD.hydrateServerSide && prop.includes("-")) {
662
+ elm.style.removeProperty(prop);
663
+ } else {
664
+ elm.style[prop] = "";
665
+ }
847
666
  }
848
667
  }
849
- } else if (childVNode.$hostId$ === hostId) {
850
- if (childNodeType === SLOT_NODE_ID) {
851
- childVNode.$tag$ = "slot";
852
- if (childIdSplt[5]) {
853
- node["s-sn"] = childVNode.$name$ = childIdSplt[5];
668
+ }
669
+ for (const prop in newValue) {
670
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
671
+ if (!import_app_data2.BUILD.hydrateServerSide && prop.includes("-")) {
672
+ elm.style.setProperty(prop, newValue[prop]);
854
673
  } else {
855
- node["s-sn"] = "";
856
- }
857
- node["s-sr"] = true;
858
- if (import_app_data3.BUILD.shadowDom && shadowRootNodes) {
859
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
860
- if (childVNode.$name$) {
861
- childVNode.$elm$.setAttribute("name", childVNode.$name$);
862
- }
863
- node.parentNode.insertBefore(childVNode.$elm$, node);
864
- node.remove();
865
- if (childVNode.$depth$ === "0") {
866
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
867
- }
868
- }
869
- slotNodes.push(childVNode);
870
- if (!parentVNode.$children$) {
871
- parentVNode.$children$ = [];
872
- }
873
- parentVNode.$children$[childVNode.$index$] = childVNode;
874
- } else if (childNodeType === CONTENT_REF_ID) {
875
- if (import_app_data3.BUILD.shadowDom && shadowRootNodes) {
876
- node.remove();
877
- } else if (import_app_data3.BUILD.slotRelocation) {
878
- hostElm["s-cr"] = node;
879
- node["s-cn"] = true;
674
+ elm.style[prop] = newValue[prop];
880
675
  }
881
676
  }
882
677
  }
883
- }
884
- } else if (parentVNode && parentVNode.$tag$ === "style") {
885
- const vnode = newVNode(null, node.textContent);
886
- vnode.$elm$ = node;
887
- vnode.$index$ = "0";
888
- parentVNode.$children$ = [vnode];
889
- }
890
- };
891
- var initializeDocumentHydrate = (node, orgLocNodes) => {
892
- if (node.nodeType === 1 /* ElementNode */) {
893
- let i2 = 0;
894
- if (node.shadowRoot) {
895
- for (; i2 < node.shadowRoot.childNodes.length; i2++) {
896
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
678
+ } else if (import_app_data2.BUILD.vdomKey && memberName === "key") {
679
+ } else if (import_app_data2.BUILD.vdomRef && memberName === "ref") {
680
+ if (newValue) {
681
+ newValue(elm);
897
682
  }
898
- }
899
- for (i2 = 0; i2 < node.childNodes.length; i2++) {
900
- initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
901
- }
902
- } else if (node.nodeType === 8 /* CommentNode */) {
903
- const childIdSplt = node.nodeValue.split(".");
904
- if (childIdSplt[0] === ORG_LOCATION_ID) {
905
- orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
906
- node.nodeValue = "";
907
- node["s-en"] = childIdSplt[3];
908
- }
909
- }
910
- };
911
-
912
- // src/runtime/initialize-component.ts
913
- var import_app_data14 = require("@stencil/core/internal/app-data");
914
-
915
- // src/runtime/mode.ts
916
- var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
917
- var setMode = (handler) => modeResolutionChain.push(handler);
918
- var getMode = (ref) => getHostRef(ref).$modeName$;
919
-
920
- // src/runtime/proxy-component.ts
921
- var import_app_data13 = require("@stencil/core/internal/app-data");
922
-
923
- // src/runtime/set-value.ts
924
- var import_app_data12 = require("@stencil/core/internal/app-data");
925
-
926
- // src/runtime/parse-property-value.ts
927
- var import_app_data4 = require("@stencil/core/internal/app-data");
928
- var parsePropertyValue = (propValue, propType) => {
929
- if (propValue != null && !isComplexType(propValue)) {
930
- if (import_app_data4.BUILD.propBoolean && propType & 4 /* Boolean */) {
931
- return propValue === "false" ? false : propValue === "" || !!propValue;
932
- }
933
- if (import_app_data4.BUILD.propNumber && propType & 2 /* Number */) {
934
- return parseFloat(propValue);
935
- }
936
- if (import_app_data4.BUILD.propString && propType & 1 /* String */) {
937
- return String(propValue);
938
- }
939
- return propValue;
940
- }
941
- return propValue;
942
- };
943
-
944
- // src/runtime/update-component.ts
945
- var import_app_data11 = require("@stencil/core/internal/app-data");
946
-
947
- // src/runtime/event-emitter.ts
948
- var import_app_data6 = require("@stencil/core/internal/app-data");
949
-
950
- // src/runtime/element.ts
951
- var import_app_data5 = require("@stencil/core/internal/app-data");
952
- var getElement = (ref) => import_app_data5.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
953
-
954
- // src/runtime/event-emitter.ts
955
- var createEvent = (ref, name, flags) => {
956
- const elm = getElement(ref);
957
- return {
958
- emit: (detail) => {
959
- if (import_app_data6.BUILD.isDev && !elm.isConnected) {
960
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
961
- }
962
- return emitEvent(elm, name, {
963
- bubbles: !!(flags & 4 /* Bubbles */),
964
- composed: !!(flags & 2 /* Composed */),
965
- cancelable: !!(flags & 1 /* Cancellable */),
966
- detail
967
- });
968
- }
969
- };
970
- };
971
- var emitEvent = (elm, name, opts) => {
972
- const ev = plt.ce(name, opts);
973
- elm.dispatchEvent(ev);
974
- return ev;
975
- };
976
-
977
- // src/runtime/styles.ts
978
- var import_app_data7 = require("@stencil/core/internal/app-data");
979
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
980
- var registerStyle = (scopeId2, cssText, allowCS) => {
981
- let style = styles.get(scopeId2);
982
- if (supportsConstructableStylesheets && allowCS) {
983
- style = style || new CSSStyleSheet();
984
- if (typeof style === "string") {
985
- style = cssText;
986
- } else {
987
- style.replaceSync(cssText);
988
- }
989
- } else {
990
- style = cssText;
991
- }
992
- styles.set(scopeId2, style);
993
- };
994
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
995
- var _a;
996
- const scopeId2 = getScopeId(cmpMeta, mode);
997
- const style = styles.get(scopeId2);
998
- if (!import_app_data7.BUILD.attachStyles) {
999
- return scopeId2;
1000
- }
1001
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
1002
- if (style) {
1003
- if (typeof style === "string") {
1004
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1005
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1006
- let styleElm;
1007
- if (!appliedStyles) {
1008
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1009
- }
1010
- if (!appliedStyles.has(scopeId2)) {
1011
- if (import_app_data7.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1012
- styleElm.innerHTML = style;
1013
- } else {
1014
- styleElm = doc.createElement("style");
1015
- styleElm.innerHTML = style;
1016
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1017
- if (nonce != null) {
1018
- styleElm.setAttribute("nonce", nonce);
1019
- }
1020
- if ((import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1021
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1022
- }
1023
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1024
- if (styleContainerNode.nodeName === "HEAD") {
1025
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1026
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1027
- styleContainerNode.insertBefore(styleElm, referenceNode2);
1028
- } else if ("host" in styleContainerNode) {
1029
- if (supportsConstructableStylesheets) {
1030
- const stylesheet = new CSSStyleSheet();
1031
- stylesheet.replaceSync(style);
1032
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1033
- } else {
1034
- const existingStyleContainer = styleContainerNode.querySelector("style");
1035
- if (existingStyleContainer) {
1036
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1037
- } else {
1038
- styleContainerNode.prepend(styleElm);
1039
- }
1040
- }
1041
- } else {
1042
- styleContainerNode.append(styleElm);
1043
- }
1044
- }
1045
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
1046
- styleContainerNode.insertBefore(styleElm, null);
1047
- }
1048
- }
1049
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1050
- styleElm.innerHTML += SLOT_FB_CSS;
1051
- }
1052
- if (appliedStyles) {
1053
- appliedStyles.add(scopeId2);
1054
- }
1055
- }
1056
- } else if (import_app_data7.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1057
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1058
- }
1059
- }
1060
- return scopeId2;
1061
- };
1062
- var attachStyles = (hostRef) => {
1063
- const cmpMeta = hostRef.$cmpMeta$;
1064
- const elm = hostRef.$hostElement$;
1065
- const flags = cmpMeta.$flags$;
1066
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1067
- const scopeId2 = addStyle(
1068
- import_app_data7.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1069
- cmpMeta,
1070
- hostRef.$modeName$
1071
- );
1072
- if ((import_app_data7.BUILD.shadowDom || import_app_data7.BUILD.scoped) && import_app_data7.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
1073
- elm["s-sc"] = scopeId2;
1074
- elm.classList.add(scopeId2 + "-h");
1075
- if (import_app_data7.BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) {
1076
- elm.classList.add(scopeId2 + "-s");
1077
- }
1078
- }
1079
- endAttachStyles();
1080
- };
1081
- var getScopeId = (cmp, mode) => "sc-" + (import_app_data7.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1082
-
1083
- // src/runtime/vdom/vdom-render.ts
1084
- var import_app_data10 = require("@stencil/core/internal/app-data");
1085
-
1086
- // src/runtime/vdom/update-element.ts
1087
- var import_app_data9 = require("@stencil/core/internal/app-data");
1088
-
1089
- // src/runtime/vdom/set-accessor.ts
1090
- var import_app_data8 = require("@stencil/core/internal/app-data");
1091
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1092
- if (oldValue !== newValue) {
1093
- let isProp = isMemberInElement(elm, memberName);
1094
- let ln = memberName.toLowerCase();
1095
- if (import_app_data8.BUILD.vdomClass && memberName === "class") {
1096
- const classList = elm.classList;
1097
- const oldClasses = parseClassList(oldValue);
1098
- const newClasses = parseClassList(newValue);
1099
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
1100
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
1101
- } else if (import_app_data8.BUILD.vdomStyle && memberName === "style") {
1102
- if (import_app_data8.BUILD.updatable) {
1103
- for (const prop in oldValue) {
1104
- if (!newValue || newValue[prop] == null) {
1105
- if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) {
1106
- elm.style.removeProperty(prop);
1107
- } else {
1108
- elm.style[prop] = "";
1109
- }
1110
- }
1111
- }
1112
- }
1113
- for (const prop in newValue) {
1114
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
1115
- if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) {
1116
- elm.style.setProperty(prop, newValue[prop]);
1117
- } else {
1118
- elm.style[prop] = newValue[prop];
1119
- }
1120
- }
1121
- }
1122
- } else if (import_app_data8.BUILD.vdomKey && memberName === "key") {
1123
- } else if (import_app_data8.BUILD.vdomRef && memberName === "ref") {
1124
- if (newValue) {
1125
- newValue(elm);
1126
- }
1127
- } else if (import_app_data8.BUILD.vdomListener && (import_app_data8.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
683
+ } else if (import_app_data2.BUILD.vdomListener && (import_app_data2.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
1128
684
  if (memberName[2] === "-") {
1129
685
  memberName = memberName.slice(3);
1130
686
  } else if (isMemberInElement(win, ln)) {
@@ -1142,7 +698,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1142
698
  plt.ael(elm, memberName, newValue, capture);
1143
699
  }
1144
700
  }
1145
- } else if (import_app_data8.BUILD.vdomPropOrAttr) {
701
+ } else if (import_app_data2.BUILD.vdomPropOrAttr) {
1146
702
  const isComplex = isComplexType(newValue);
1147
703
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
1148
704
  try {
@@ -1164,7 +720,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1164
720
  }
1165
721
  }
1166
722
  let xlink = false;
1167
- if (import_app_data8.BUILD.vdomXlink) {
723
+ if (import_app_data2.BUILD.vdomXlink) {
1168
724
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
1169
725
  memberName = ln;
1170
726
  xlink = true;
@@ -1172,7 +728,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1172
728
  }
1173
729
  if (newValue == null || newValue === false) {
1174
730
  if (newValue !== false || elm.getAttribute(memberName) === "") {
1175
- if (import_app_data8.BUILD.vdomXlink && xlink) {
731
+ if (import_app_data2.BUILD.vdomXlink && xlink) {
1176
732
  elm.removeAttributeNS(XLINK_NS, memberName);
1177
733
  } else {
1178
734
  elm.removeAttribute(memberName);
@@ -1180,7 +736,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1180
736
  }
1181
737
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
1182
738
  newValue = newValue === true ? "" : newValue;
1183
- if (import_app_data8.BUILD.vdomXlink && xlink) {
739
+ if (import_app_data2.BUILD.vdomXlink && xlink) {
1184
740
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
1185
741
  } else {
1186
742
  elm.setAttribute(memberName, newValue);
@@ -1199,7 +755,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
1199
755
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
1200
756
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
1201
757
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
1202
- if (import_app_data9.BUILD.updatable) {
758
+ if (import_app_data3.BUILD.updatable) {
1203
759
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
1204
760
  if (!(memberName in newVnodeAttrs)) {
1205
761
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -1235,7 +791,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1235
791
  let elm;
1236
792
  let childNode;
1237
793
  let oldVNode;
1238
- if (import_app_data10.BUILD.slotRelocation && !useNativeShadowDom) {
794
+ if (import_app_data4.BUILD.slotRelocation && !useNativeShadowDom) {
1239
795
  checkSlotRelocate = true;
1240
796
  if (newVNode2.$tag$ === "slot") {
1241
797
  if (scopeId) {
@@ -1253,37 +809,37 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1253
809
  );
1254
810
  }
1255
811
  }
1256
- if (import_app_data10.BUILD.isDev && newVNode2.$elm$) {
812
+ if (import_app_data4.BUILD.isDev && newVNode2.$elm$) {
1257
813
  consoleDevError(
1258
814
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
1259
815
  );
1260
816
  }
1261
- if (import_app_data10.BUILD.vdomText && newVNode2.$text$ !== null) {
817
+ if (import_app_data4.BUILD.vdomText && newVNode2.$text$ !== null) {
1262
818
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
1263
- } else if (import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
1264
- elm = newVNode2.$elm$ = import_app_data10.BUILD.isDebug || import_app_data10.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
819
+ } else if (import_app_data4.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
820
+ elm = newVNode2.$elm$ = import_app_data4.BUILD.isDebug || import_app_data4.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
1265
821
  } else {
1266
- if (import_app_data10.BUILD.svg && !isSvgMode) {
822
+ if (import_app_data4.BUILD.svg && !isSvgMode) {
1267
823
  isSvgMode = newVNode2.$tag$ === "svg";
1268
824
  }
1269
- elm = newVNode2.$elm$ = import_app_data10.BUILD.svg ? doc.createElementNS(
825
+ elm = newVNode2.$elm$ = import_app_data4.BUILD.svg ? doc.createElementNS(
1270
826
  isSvgMode ? SVG_NS : HTML_NS,
1271
- !useNativeShadowDom && import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
827
+ !useNativeShadowDom && import_app_data4.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1272
828
  ) : doc.createElement(
1273
- !useNativeShadowDom && import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
829
+ !useNativeShadowDom && import_app_data4.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1274
830
  );
1275
- if (import_app_data10.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
831
+ if (import_app_data4.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
1276
832
  isSvgMode = false;
1277
833
  }
1278
- if (import_app_data10.BUILD.vdomAttribute) {
834
+ if (import_app_data4.BUILD.vdomAttribute) {
1279
835
  updateElement(null, newVNode2, isSvgMode);
1280
836
  }
1281
837
  const rootNode = elm.getRootNode();
1282
838
  const isElementWithinShadowRoot = !rootNode.querySelector("body");
1283
- if (!isElementWithinShadowRoot && import_app_data10.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
839
+ if (!isElementWithinShadowRoot && import_app_data4.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
1284
840
  elm.classList.add(elm["s-si"] = scopeId);
1285
841
  }
1286
- if (import_app_data10.BUILD.scoped) {
842
+ if (import_app_data4.BUILD.scoped) {
1287
843
  updateElementScopeIds(elm, parentElm);
1288
844
  }
1289
845
  if (newVNode2.$children$) {
@@ -1294,7 +850,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1294
850
  }
1295
851
  }
1296
852
  }
1297
- if (import_app_data10.BUILD.svg) {
853
+ if (import_app_data4.BUILD.svg) {
1298
854
  if (newVNode2.$tag$ === "svg") {
1299
855
  isSvgMode = false;
1300
856
  } else if (elm.tagName === "foreignObject") {
@@ -1303,7 +859,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1303
859
  }
1304
860
  }
1305
861
  elm["s-hn"] = hostTagName;
1306
- if (import_app_data10.BUILD.slotRelocation) {
862
+ if (import_app_data4.BUILD.slotRelocation) {
1307
863
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
1308
864
  elm["s-sr"] = true;
1309
865
  elm["s-cr"] = contentRef;
@@ -1311,7 +867,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1311
867
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
1312
868
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1313
869
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
1314
- if (import_app_data10.BUILD.experimentalSlotFixes) {
870
+ if (import_app_data4.BUILD.experimentalSlotFixes) {
1315
871
  relocateToHostRoot(oldParentVNode.$elm$);
1316
872
  } else {
1317
873
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
@@ -1325,8 +881,12 @@ var relocateToHostRoot = (parentElm) => {
1325
881
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1326
882
  const host = parentElm.closest(hostTagName.toLowerCase());
1327
883
  if (host != null) {
1328
- const contentRefNode = Array.from(host.childNodes).find((ref) => ref["s-cr"]);
1329
- const childNodeArray = Array.from(parentElm.childNodes);
884
+ const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
885
+ (ref) => ref["s-cr"]
886
+ );
887
+ const childNodeArray = Array.from(
888
+ parentElm.__childNodes || parentElm.childNodes
889
+ );
1330
890
  for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
1331
891
  if (childNode["s-sh"] != null) {
1332
892
  insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
@@ -1339,8 +899,8 @@ var relocateToHostRoot = (parentElm) => {
1339
899
  };
1340
900
  var putBackInOriginalLocation = (parentElm, recursive) => {
1341
901
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1342
- const oldSlotChildNodes = Array.from(parentElm.childNodes);
1343
- if (parentElm["s-sr"] && import_app_data10.BUILD.experimentalSlotFixes) {
902
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
903
+ if (parentElm["s-sr"] && import_app_data4.BUILD.experimentalSlotFixes) {
1344
904
  let node = parentElm;
1345
905
  while (node = node.nextSibling) {
1346
906
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -1364,9 +924,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
1364
924
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1365
925
  };
1366
926
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1367
- let containerElm = import_app_data10.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
927
+ let containerElm = import_app_data4.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1368
928
  let childNode;
1369
- if (import_app_data10.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
929
+ if (import_app_data4.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1370
930
  containerElm = containerElm.shadowRoot;
1371
931
  }
1372
932
  for (; startIdx <= endIdx; ++startIdx) {
@@ -1374,7 +934,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1374
934
  childNode = createElm(null, parentVNode, startIdx, parentElm);
1375
935
  if (childNode) {
1376
936
  vnodes[startIdx].$elm$ = childNode;
1377
- insertBefore(containerElm, childNode, import_app_data10.BUILD.slotRelocation ? referenceNode(before) : before);
937
+ insertBefore(containerElm, childNode, import_app_data4.BUILD.slotRelocation ? referenceNode(before) : before);
1378
938
  }
1379
939
  }
1380
940
  }
@@ -1386,7 +946,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
1386
946
  const elm = vnode.$elm$;
1387
947
  nullifyVNodeRefs(vnode);
1388
948
  if (elm) {
1389
- if (import_app_data10.BUILD.slotRelocation) {
949
+ if (import_app_data4.BUILD.slotRelocation) {
1390
950
  checkSlotFallbackVisibility = true;
1391
951
  if (elm["s-ol"]) {
1392
952
  elm["s-ol"].remove();
@@ -1430,7 +990,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1430
990
  oldEndVnode = oldCh[--oldEndIdx];
1431
991
  newEndVnode = newCh[--newEndIdx];
1432
992
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1433
- if (import_app_data10.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
993
+ if (import_app_data4.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1434
994
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1435
995
  }
1436
996
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1438,7 +998,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1438
998
  oldStartVnode = oldCh[++oldStartIdx];
1439
999
  newEndVnode = newCh[--newEndIdx];
1440
1000
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1441
- if (import_app_data10.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1001
+ if (import_app_data4.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1442
1002
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1443
1003
  }
1444
1004
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1447,7 +1007,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1447
1007
  newStartVnode = newCh[++newStartIdx];
1448
1008
  } else {
1449
1009
  idxInOld = -1;
1450
- if (import_app_data10.BUILD.vdomKey) {
1010
+ if (import_app_data4.BUILD.vdomKey) {
1451
1011
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1452
1012
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1453
1013
  idxInOld = i2;
@@ -1455,7 +1015,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1455
1015
  }
1456
1016
  }
1457
1017
  }
1458
- if (import_app_data10.BUILD.vdomKey && idxInOld >= 0) {
1018
+ if (import_app_data4.BUILD.vdomKey && idxInOld >= 0) {
1459
1019
  elmToMove = oldCh[idxInOld];
1460
1020
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1461
1021
  node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
@@ -1470,7 +1030,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1470
1030
  newStartVnode = newCh[++newStartIdx];
1471
1031
  }
1472
1032
  if (node) {
1473
- if (import_app_data10.BUILD.slotRelocation) {
1033
+ if (import_app_data4.BUILD.slotRelocation) {
1474
1034
  insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
1475
1035
  } else {
1476
1036
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
@@ -1487,13 +1047,13 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1487
1047
  newStartIdx,
1488
1048
  newEndIdx
1489
1049
  );
1490
- } else if (import_app_data10.BUILD.updatable && newStartIdx > newEndIdx) {
1050
+ } else if (import_app_data4.BUILD.updatable && newStartIdx > newEndIdx) {
1491
1051
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1492
1052
  }
1493
1053
  };
1494
1054
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1495
1055
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1496
- if (import_app_data10.BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
1056
+ if (import_app_data4.BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
1497
1057
  if (
1498
1058
  // The component gets hydrated and no VDOM has been initialized.
1499
1059
  // Here the comparison can't happen as $name$ property is not set for `leftNode`.
@@ -1505,7 +1065,7 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1505
1065
  }
1506
1066
  return leftVNode.$name$ === rightVNode.$name$;
1507
1067
  }
1508
- if (import_app_data10.BUILD.vdomKey && !isInitialRender) {
1068
+ if (import_app_data4.BUILD.vdomKey && !isInitialRender) {
1509
1069
  return leftVNode.$key$ === rightVNode.$key$;
1510
1070
  }
1511
1071
  return true;
@@ -1523,13 +1083,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1523
1083
  const tag = newVNode2.$tag$;
1524
1084
  const text = newVNode2.$text$;
1525
1085
  let defaultHolder;
1526
- if (!import_app_data10.BUILD.vdomText || text === null) {
1527
- if (import_app_data10.BUILD.svg) {
1086
+ if (!import_app_data4.BUILD.vdomText || text === null) {
1087
+ if (import_app_data4.BUILD.svg) {
1528
1088
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1529
1089
  }
1530
- if (import_app_data10.BUILD.vdomAttribute || import_app_data10.BUILD.reflect) {
1531
- if (import_app_data10.BUILD.slot && tag === "slot" && !useNativeShadowDom) {
1532
- if (import_app_data10.BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1090
+ if (import_app_data4.BUILD.vdomAttribute || import_app_data4.BUILD.reflect) {
1091
+ if (import_app_data4.BUILD.slot && tag === "slot" && !useNativeShadowDom) {
1092
+ if (import_app_data4.BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1533
1093
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
1534
1094
  relocateToHostRoot(newVNode2.$elm$.parentElement);
1535
1095
  }
@@ -1537,30 +1097,30 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1537
1097
  updateElement(oldVNode, newVNode2, isSvgMode);
1538
1098
  }
1539
1099
  }
1540
- if (import_app_data10.BUILD.updatable && oldChildren !== null && newChildren !== null) {
1100
+ if (import_app_data4.BUILD.updatable && oldChildren !== null && newChildren !== null) {
1541
1101
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1542
1102
  } else if (newChildren !== null) {
1543
- if (import_app_data10.BUILD.updatable && import_app_data10.BUILD.vdomText && oldVNode.$text$ !== null) {
1103
+ if (import_app_data4.BUILD.updatable && import_app_data4.BUILD.vdomText && oldVNode.$text$ !== null) {
1544
1104
  elm.textContent = "";
1545
1105
  }
1546
1106
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1547
1107
  } else if (
1548
1108
  // don't do this on initial render as it can cause non-hydrated content to be removed
1549
- !isInitialRender && import_app_data10.BUILD.updatable && oldChildren !== null
1109
+ !isInitialRender && import_app_data4.BUILD.updatable && oldChildren !== null
1550
1110
  ) {
1551
1111
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1552
1112
  }
1553
- if (import_app_data10.BUILD.svg && isSvgMode && tag === "svg") {
1113
+ if (import_app_data4.BUILD.svg && isSvgMode && tag === "svg") {
1554
1114
  isSvgMode = false;
1555
1115
  }
1556
- } else if (import_app_data10.BUILD.vdomText && import_app_data10.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
1116
+ } else if (import_app_data4.BUILD.vdomText && import_app_data4.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
1557
1117
  defaultHolder.parentNode.textContent = text;
1558
- } else if (import_app_data10.BUILD.vdomText && oldVNode.$text$ !== text) {
1118
+ } else if (import_app_data4.BUILD.vdomText && oldVNode.$text$ !== text) {
1559
1119
  elm.data = text;
1560
1120
  }
1561
1121
  };
1562
1122
  var updateFallbackSlotVisibility = (elm) => {
1563
- const childNodes = elm.childNodes;
1123
+ const childNodes = elm.__childNodes || elm.childNodes;
1564
1124
  for (const childNode of childNodes) {
1565
1125
  if (childNode.nodeType === 1 /* ElementNode */) {
1566
1126
  if (childNode["s-sr"]) {
@@ -1573,7 +1133,7 @@ var updateFallbackSlotVisibility = (elm) => {
1573
1133
  childNode.hidden = true;
1574
1134
  break;
1575
1135
  }
1576
- } else {
1136
+ } else if (slotName === siblingNode["s-sn"]) {
1577
1137
  if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
1578
1138
  childNode.hidden = true;
1579
1139
  break;
@@ -1591,13 +1151,14 @@ var markSlotContentForRelocation = (elm) => {
1591
1151
  let node;
1592
1152
  let hostContentNodes;
1593
1153
  let j;
1594
- for (const childNode of elm.childNodes) {
1154
+ const children = elm.__childNodes || elm.childNodes;
1155
+ for (const childNode of children) {
1595
1156
  if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
1596
- hostContentNodes = node.parentNode.childNodes;
1157
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
1597
1158
  const slotName = childNode["s-sn"];
1598
1159
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1599
1160
  node = hostContentNodes[j];
1600
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!import_app_data10.BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1161
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!import_app_data4.BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1601
1162
  if (isNodeLocatedInSlot(node, slotName)) {
1602
1163
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1603
1164
  checkSlotFallbackVisibility = true;
@@ -1651,14 +1212,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1651
1212
  return slotName === "";
1652
1213
  };
1653
1214
  var nullifyVNodeRefs = (vNode) => {
1654
- if (import_app_data10.BUILD.vdomRef) {
1215
+ if (import_app_data4.BUILD.vdomRef) {
1655
1216
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1656
1217
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1657
1218
  }
1658
1219
  };
1659
1220
  var insertBefore = (parent, newNode, reference) => {
1660
1221
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1661
- if (import_app_data10.BUILD.scoped) {
1222
+ if (import_app_data4.BUILD.scoped) {
1662
1223
  updateElementScopeIds(newNode, parent);
1663
1224
  }
1664
1225
  return inserted;
@@ -1682,7 +1243,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1682
1243
  if (scopeIds.size) {
1683
1244
  (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
1684
1245
  if (element["s-ol"] || iterateChildNodes) {
1685
- for (const childNode of Array.from(element.childNodes)) {
1246
+ for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
1686
1247
  updateElementScopeIds(childNode, element, true);
1687
1248
  }
1688
1249
  }
@@ -1696,7 +1257,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1696
1257
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1697
1258
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1698
1259
  hostTagName = hostElm.tagName;
1699
- if (import_app_data10.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1260
+ if (import_app_data4.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1700
1261
  throw new Error(`The <Host> must be the single root component.
1701
1262
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1702
1263
 
@@ -1710,7 +1271,7 @@ render() {
1710
1271
  }
1711
1272
  `);
1712
1273
  }
1713
- if (import_app_data10.BUILD.reflect && cmpMeta.$attrsToReflect$) {
1274
+ if (import_app_data4.BUILD.reflect && cmpMeta.$attrsToReflect$) {
1714
1275
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1715
1276
  cmpMeta.$attrsToReflect$.map(
1716
1277
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -1726,24 +1287,24 @@ render() {
1726
1287
  rootVnode.$tag$ = null;
1727
1288
  rootVnode.$flags$ |= 4 /* isHost */;
1728
1289
  hostRef.$vnode$ = rootVnode;
1729
- rootVnode.$elm$ = oldVNode.$elm$ = import_app_data10.BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1730
- if (import_app_data10.BUILD.scoped || import_app_data10.BUILD.shadowDom) {
1290
+ rootVnode.$elm$ = oldVNode.$elm$ = import_app_data4.BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1291
+ if (import_app_data4.BUILD.scoped || import_app_data4.BUILD.shadowDom) {
1731
1292
  scopeId = hostElm["s-sc"];
1732
1293
  }
1733
1294
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1734
- if (import_app_data10.BUILD.slotRelocation) {
1295
+ if (import_app_data4.BUILD.slotRelocation) {
1735
1296
  contentRef = hostElm["s-cr"];
1736
1297
  checkSlotFallbackVisibility = false;
1737
1298
  }
1738
1299
  patch(oldVNode, rootVnode, isInitialLoad);
1739
- if (import_app_data10.BUILD.slotRelocation) {
1300
+ if (import_app_data4.BUILD.slotRelocation) {
1740
1301
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1741
1302
  if (checkSlotRelocate) {
1742
1303
  markSlotContentForRelocation(rootVnode.$elm$);
1743
1304
  for (const relocateData of relocateNodes) {
1744
1305
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1745
1306
  if (!nodeToRelocate["s-ol"]) {
1746
- const orgLocationNode = import_app_data10.BUILD.isDebug || import_app_data10.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1307
+ const orgLocationNode = import_app_data4.BUILD.isDebug || import_app_data4.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1747
1308
  orgLocationNode["s-nr"] = nodeToRelocate;
1748
1309
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1749
1310
  }
@@ -1754,7 +1315,7 @@ render() {
1754
1315
  if (slotRefNode) {
1755
1316
  const parentNodeRef = slotRefNode.parentNode;
1756
1317
  let insertBeforeNode = slotRefNode.nextSibling;
1757
- if (!import_app_data10.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1318
+ if (!import_app_data4.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1758
1319
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1759
1320
  while (orgLocationNode) {
1760
1321
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -1773,7 +1334,7 @@ render() {
1773
1334
  }
1774
1335
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1775
1336
  if (nodeToRelocate !== insertBeforeNode) {
1776
- if (!import_app_data10.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1337
+ if (!import_app_data4.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1777
1338
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1778
1339
  }
1779
1340
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
@@ -1799,8 +1360,9 @@ render() {
1799
1360
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1800
1361
  relocateNodes.length = 0;
1801
1362
  }
1802
- if (import_app_data10.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1803
- for (const childNode of rootVnode.$elm$.childNodes) {
1363
+ if (import_app_data4.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1364
+ const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
1365
+ for (const childNode of children) {
1804
1366
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
1805
1367
  if (isInitialLoad && childNode["s-ih"] == null) {
1806
1368
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
@@ -1809,37 +1371,926 @@ render() {
1809
1371
  }
1810
1372
  }
1811
1373
  }
1812
- contentRef = void 0;
1374
+ contentRef = void 0;
1375
+ };
1376
+ var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1377
+ `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1378
+ );
1379
+ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1380
+ `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1381
+ );
1382
+
1383
+ // src/runtime/dom-extras.ts
1384
+ var patchPseudoShadowDom = (hostElementPrototype) => {
1385
+ patchCloneNode(hostElementPrototype);
1386
+ patchSlotAppendChild(hostElementPrototype);
1387
+ patchSlotAppend(hostElementPrototype);
1388
+ patchSlotPrepend(hostElementPrototype);
1389
+ patchSlotInsertAdjacentElement(hostElementPrototype);
1390
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
1391
+ patchSlotInsertAdjacentText(hostElementPrototype);
1392
+ patchTextContent(hostElementPrototype);
1393
+ patchChildSlotNodes(hostElementPrototype);
1394
+ patchSlotRemoveChild(hostElementPrototype);
1395
+ };
1396
+ var patchCloneNode = (HostElementPrototype) => {
1397
+ const orgCloneNode = HostElementPrototype.cloneNode;
1398
+ HostElementPrototype.cloneNode = function(deep) {
1399
+ const srcNode = this;
1400
+ const isShadowDom = import_app_data5.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1401
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
1402
+ if (import_app_data5.BUILD.slot && !isShadowDom && deep) {
1403
+ let i2 = 0;
1404
+ let slotted, nonStencilNode;
1405
+ const stencilPrivates = [
1406
+ "s-id",
1407
+ "s-cr",
1408
+ "s-lr",
1409
+ "s-rc",
1410
+ "s-sc",
1411
+ "s-p",
1412
+ "s-cn",
1413
+ "s-sr",
1414
+ "s-sn",
1415
+ "s-hn",
1416
+ "s-ol",
1417
+ "s-nr",
1418
+ "s-si",
1419
+ "s-rf",
1420
+ "s-scs"
1421
+ ];
1422
+ const childNodes = this.__childNodes || this.childNodes;
1423
+ for (; i2 < childNodes.length; i2++) {
1424
+ slotted = childNodes[i2]["s-nr"];
1425
+ nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
1426
+ if (slotted) {
1427
+ if (import_app_data5.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
1428
+ clonedNode.__appendChild(slotted.cloneNode(true));
1429
+ } else {
1430
+ clonedNode.appendChild(slotted.cloneNode(true));
1431
+ }
1432
+ }
1433
+ if (nonStencilNode) {
1434
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
1435
+ }
1436
+ }
1437
+ }
1438
+ return clonedNode;
1439
+ };
1440
+ };
1441
+ var patchSlotAppendChild = (HostElementPrototype) => {
1442
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
1443
+ HostElementPrototype.appendChild = function(newChild) {
1444
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1445
+ const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
1446
+ if (slotNode) {
1447
+ addSlotRelocateNode(newChild, slotNode);
1448
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1449
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
1450
+ const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1451
+ updateFallbackSlotVisibility(this);
1452
+ return insertedNode;
1453
+ }
1454
+ return this.__appendChild(newChild);
1455
+ };
1456
+ };
1457
+ var patchSlotRemoveChild = (ElementPrototype) => {
1458
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
1459
+ ElementPrototype.removeChild = function(toRemove) {
1460
+ if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
1461
+ const childNodes = this.__childNodes || this.childNodes;
1462
+ const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
1463
+ if (slotNode && toRemove.isConnected) {
1464
+ toRemove.remove();
1465
+ updateFallbackSlotVisibility(this);
1466
+ return;
1467
+ }
1468
+ }
1469
+ return this.__removeChild(toRemove);
1470
+ };
1471
+ };
1472
+ var patchSlotPrepend = (HostElementPrototype) => {
1473
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
1474
+ HostElementPrototype.prepend = function(...newChildren) {
1475
+ newChildren.forEach((newChild) => {
1476
+ if (typeof newChild === "string") {
1477
+ newChild = this.ownerDocument.createTextNode(newChild);
1478
+ }
1479
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1480
+ const childNodes = this.__childNodes || this.childNodes;
1481
+ const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
1482
+ if (slotNode) {
1483
+ addSlotRelocateNode(newChild, slotNode, true);
1484
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1485
+ const appendAfter = slotChildNodes[0];
1486
+ return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1487
+ }
1488
+ if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
1489
+ newChild.hidden = true;
1490
+ }
1491
+ return HostElementPrototype.__prepend(newChild);
1492
+ });
1493
+ };
1494
+ };
1495
+ var patchSlotAppend = (HostElementPrototype) => {
1496
+ HostElementPrototype.__append = HostElementPrototype.append;
1497
+ HostElementPrototype.append = function(...newChildren) {
1498
+ newChildren.forEach((newChild) => {
1499
+ if (typeof newChild === "string") {
1500
+ newChild = this.ownerDocument.createTextNode(newChild);
1501
+ }
1502
+ this.appendChild(newChild);
1503
+ });
1504
+ };
1505
+ };
1506
+ var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
1507
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
1508
+ HostElementPrototype.insertAdjacentHTML = function(position, text) {
1509
+ if (position !== "afterbegin" && position !== "beforeend") {
1510
+ return originalInsertAdjacentHtml.call(this, position, text);
1511
+ }
1512
+ const container = this.ownerDocument.createElement("_");
1513
+ let node;
1514
+ container.innerHTML = text;
1515
+ if (position === "afterbegin") {
1516
+ while (node = container.firstChild) {
1517
+ this.prepend(node);
1518
+ }
1519
+ } else if (position === "beforeend") {
1520
+ while (node = container.firstChild) {
1521
+ this.append(node);
1522
+ }
1523
+ }
1524
+ };
1525
+ };
1526
+ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
1527
+ HostElementPrototype.insertAdjacentText = function(position, text) {
1528
+ this.insertAdjacentHTML(position, text);
1529
+ };
1530
+ };
1531
+ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
1532
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
1533
+ HostElementPrototype.insertAdjacentElement = function(position, element) {
1534
+ if (position !== "afterbegin" && position !== "beforeend") {
1535
+ return originalInsertAdjacentElement.call(this, position, element);
1536
+ }
1537
+ if (position === "afterbegin") {
1538
+ this.prepend(element);
1539
+ return element;
1540
+ } else if (position === "beforeend") {
1541
+ this.append(element);
1542
+ return element;
1543
+ }
1544
+ return element;
1545
+ };
1546
+ };
1547
+ var patchTextContent = (hostElementPrototype) => {
1548
+ let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
1549
+ if (!descriptor) {
1550
+ descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
1551
+ }
1552
+ if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
1553
+ Object.defineProperty(hostElementPrototype, "textContent", {
1554
+ get: function() {
1555
+ let text = "";
1556
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1557
+ childNodes.forEach((node) => text += node.textContent || "");
1558
+ return text;
1559
+ },
1560
+ set: function(value) {
1561
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1562
+ childNodes.forEach((node) => {
1563
+ if (node["s-ol"]) node["s-ol"].remove();
1564
+ node.remove();
1565
+ });
1566
+ this.insertAdjacentHTML("beforeend", value);
1567
+ }
1568
+ });
1569
+ };
1570
+ var patchChildSlotNodes = (elm) => {
1571
+ class FakeNodeList extends Array {
1572
+ item(n) {
1573
+ return this[n];
1574
+ }
1575
+ }
1576
+ let childNodesFn = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
1577
+ if (!childNodesFn) {
1578
+ childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
1579
+ }
1580
+ if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
1581
+ let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
1582
+ if (!childrenFn) {
1583
+ childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
1584
+ }
1585
+ if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
1586
+ Object.defineProperty(elm, "children", {
1587
+ get() {
1588
+ return this.childNodes.filter((n) => n.nodeType === 1);
1589
+ }
1590
+ });
1591
+ Object.defineProperty(elm, "childElementCount", {
1592
+ get() {
1593
+ return this.children.length;
1594
+ }
1595
+ });
1596
+ if (!childNodesFn) return;
1597
+ Object.defineProperty(elm, "childNodes", {
1598
+ get() {
1599
+ var _a, _b;
1600
+ if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
1601
+ const result = new FakeNodeList();
1602
+ const nodes = getSlottedChildNodes(this.__childNodes);
1603
+ result.push(...nodes);
1604
+ return result;
1605
+ }
1606
+ return FakeNodeList.from(this.__childNodes);
1607
+ }
1608
+ });
1609
+ };
1610
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
1611
+ let slottedNodeLocation;
1612
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
1613
+ slottedNodeLocation = newChild["s-ol"];
1614
+ } else {
1615
+ slottedNodeLocation = document.createTextNode("");
1616
+ slottedNodeLocation["s-nr"] = newChild;
1617
+ }
1618
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
1619
+ const parent = slotNode["s-cr"].parentNode;
1620
+ const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
1621
+ if (typeof position !== "undefined") {
1622
+ if (import_app_data5.BUILD.hydrateClientSide) {
1623
+ slottedNodeLocation["s-oo"] = position;
1624
+ const childNodes = parent.__childNodes || parent.childNodes;
1625
+ const slotRelocateNodes = [slottedNodeLocation];
1626
+ childNodes.forEach((n) => {
1627
+ if (n["s-nr"]) slotRelocateNodes.push(n);
1628
+ });
1629
+ slotRelocateNodes.sort((a, b) => {
1630
+ if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
1631
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
1632
+ return 0;
1633
+ });
1634
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
1635
+ }
1636
+ } else {
1637
+ appendMethod.call(parent, slottedNodeLocation);
1638
+ }
1639
+ newChild["s-ol"] = slottedNodeLocation;
1640
+ newChild["s-sh"] = slotNode["s-hn"];
1641
+ };
1642
+ var getSlottedChildNodes = (childNodes) => {
1643
+ const result = [];
1644
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
1645
+ const slottedNode = childNodes[i2]["s-nr"];
1646
+ if (slottedNode && slottedNode.isConnected) {
1647
+ result.push(slottedNode);
1648
+ }
1649
+ }
1650
+ return result;
1651
+ };
1652
+ var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
1653
+ var getHostSlotNode = (childNodes, slotName, hostName) => {
1654
+ let i2 = 0;
1655
+ let childNode;
1656
+ for (; i2 < childNodes.length; i2++) {
1657
+ childNode = childNodes[i2];
1658
+ if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
1659
+ return childNode;
1660
+ }
1661
+ childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
1662
+ if (childNode) {
1663
+ return childNode;
1664
+ }
1665
+ }
1666
+ return null;
1667
+ };
1668
+ var getHostSlotChildNodes = (n, slotName) => {
1669
+ const childNodes = [n];
1670
+ while ((n = n.nextSibling) && n["s-sn"] === slotName) {
1671
+ childNodes.push(n);
1672
+ }
1673
+ return childNodes;
1674
+ };
1675
+
1676
+ // src/runtime/profile.ts
1677
+ var import_app_data6 = require("@stencil/core/internal/app-data");
1678
+ var i = 0;
1679
+ var createTime = (fnName, tagName = "") => {
1680
+ if (import_app_data6.BUILD.profile && performance.mark) {
1681
+ const key = `st:${fnName}:${tagName}:${i++}`;
1682
+ performance.mark(key);
1683
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
1684
+ } else {
1685
+ return () => {
1686
+ return;
1687
+ };
1688
+ }
1689
+ };
1690
+ var uniqueTime = (key, measureText) => {
1691
+ if (import_app_data6.BUILD.profile && performance.mark) {
1692
+ if (performance.getEntriesByName(key, "mark").length === 0) {
1693
+ performance.mark(key);
1694
+ }
1695
+ return () => {
1696
+ if (performance.getEntriesByName(measureText, "measure").length === 0) {
1697
+ performance.measure(measureText, key);
1698
+ }
1699
+ };
1700
+ } else {
1701
+ return () => {
1702
+ return;
1703
+ };
1704
+ }
1705
+ };
1706
+ var inspect = (ref) => {
1707
+ const hostRef = getHostRef(ref);
1708
+ if (!hostRef) {
1709
+ return void 0;
1710
+ }
1711
+ const flags = hostRef.$flags$;
1712
+ const hostElement = hostRef.$hostElement$;
1713
+ return {
1714
+ renderCount: hostRef.$renderCount$,
1715
+ flags: {
1716
+ hasRendered: !!(flags & 2 /* hasRendered */),
1717
+ hasConnected: !!(flags & 1 /* hasConnected */),
1718
+ isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
1719
+ isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
1720
+ isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
1721
+ hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
1722
+ hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
1723
+ isWatchReady: !!(flags & 128 /* isWatchReady */),
1724
+ isListenReady: !!(flags & 256 /* isListenReady */),
1725
+ needsRerender: !!(flags & 512 /* needsRerender */)
1726
+ },
1727
+ instanceValues: hostRef.$instanceValues$,
1728
+ ancestorComponent: hostRef.$ancestorComponent$,
1729
+ hostElement,
1730
+ lazyInstance: hostRef.$lazyInstance$,
1731
+ vnode: hostRef.$vnode$,
1732
+ modeName: hostRef.$modeName$,
1733
+ onReadyPromise: hostRef.$onReadyPromise$,
1734
+ onReadyResolve: hostRef.$onReadyResolve$,
1735
+ onInstancePromise: hostRef.$onInstancePromise$,
1736
+ onInstanceResolve: hostRef.$onInstanceResolve$,
1737
+ onRenderResolve: hostRef.$onRenderResolve$,
1738
+ queuedListeners: hostRef.$queuedListeners$,
1739
+ rmListeners: hostRef.$rmListeners$,
1740
+ ["s-id"]: hostElement["s-id"],
1741
+ ["s-cr"]: hostElement["s-cr"],
1742
+ ["s-lr"]: hostElement["s-lr"],
1743
+ ["s-p"]: hostElement["s-p"],
1744
+ ["s-rc"]: hostElement["s-rc"],
1745
+ ["s-sc"]: hostElement["s-sc"]
1746
+ };
1747
+ };
1748
+ var installDevTools = () => {
1749
+ if (import_app_data6.BUILD.devTools) {
1750
+ const stencil = win.stencil = win.stencil || {};
1751
+ const originalInspect = stencil.inspect;
1752
+ stencil.inspect = (ref) => {
1753
+ let result = inspect(ref);
1754
+ if (!result && typeof originalInspect === "function") {
1755
+ result = originalInspect(ref);
1756
+ }
1757
+ return result;
1758
+ };
1759
+ }
1760
+ };
1761
+
1762
+ // src/runtime/client-hydrate.ts
1763
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1764
+ const endHydrate = createTime("hydrateClient", tagName);
1765
+ const shadowRoot = hostElm.shadowRoot;
1766
+ const childRenderNodes = [];
1767
+ const slotNodes = [];
1768
+ const slottedNodes = [];
1769
+ const shadowRootNodes = import_app_data7.BUILD.shadowDom && shadowRoot ? [] : null;
1770
+ const vnode = newVNode(tagName, null);
1771
+ vnode.$elm$ = hostElm;
1772
+ if (!plt.$orgLocNodes$) {
1773
+ initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1774
+ }
1775
+ hostElm[HYDRATE_ID] = hostId;
1776
+ hostElm.removeAttribute(HYDRATE_ID);
1777
+ hostRef.$vnode$ = clientHydrate(
1778
+ vnode,
1779
+ childRenderNodes,
1780
+ slotNodes,
1781
+ shadowRootNodes,
1782
+ hostElm,
1783
+ hostElm,
1784
+ hostId,
1785
+ slottedNodes
1786
+ );
1787
+ let crIndex = 0;
1788
+ const crLength = childRenderNodes.length;
1789
+ let childRenderNode;
1790
+ for (crIndex; crIndex < crLength; crIndex++) {
1791
+ childRenderNode = childRenderNodes[crIndex];
1792
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1793
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1794
+ const node = childRenderNode.$elm$;
1795
+ if (!shadowRoot) {
1796
+ node["s-hn"] = tagName.toUpperCase();
1797
+ if (childRenderNode.$tag$ === "slot") {
1798
+ node["s-cr"] = hostElm["s-cr"];
1799
+ }
1800
+ }
1801
+ if (orgLocationNode && orgLocationNode.isConnected) {
1802
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1803
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1804
+ }
1805
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
1806
+ if (!shadowRoot) {
1807
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1808
+ }
1809
+ }
1810
+ plt.$orgLocNodes$.delete(orgLocationId);
1811
+ }
1812
+ const hosts = [];
1813
+ let snIndex = 0;
1814
+ const snLen = slottedNodes.length;
1815
+ let slotGroup;
1816
+ let snGroupIdx;
1817
+ let snGroupLen;
1818
+ let slottedItem;
1819
+ for (snIndex; snIndex < snLen; snIndex++) {
1820
+ slotGroup = slottedNodes[snIndex];
1821
+ if (!slotGroup || !slotGroup.length) continue;
1822
+ snGroupLen = slotGroup.length;
1823
+ snGroupIdx = 0;
1824
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1825
+ slottedItem = slotGroup[snGroupIdx];
1826
+ if (!hosts[slottedItem.hostId]) {
1827
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1828
+ }
1829
+ if (!hosts[slottedItem.hostId]) continue;
1830
+ const hostEle = hosts[slottedItem.hostId];
1831
+ if (!hostEle.shadowRoot || !shadowRoot) {
1832
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1833
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1834
+ slottedItem.slot["s-cr"] = hostEle;
1835
+ } else {
1836
+ const hostChildren = hostEle.__childNodes || hostEle.childNodes;
1837
+ slottedItem.slot["s-cr"] = hostChildren[0];
1838
+ }
1839
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1840
+ }
1841
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1842
+ hostEle.appendChild(slottedItem.node);
1843
+ }
1844
+ }
1845
+ }
1846
+ if (import_app_data7.BUILD.shadowDom && shadowRoot) {
1847
+ let rnIdex = 0;
1848
+ const rnLen = shadowRootNodes.length;
1849
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
1850
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1851
+ }
1852
+ Array.from(hostElm.childNodes).forEach((node) => {
1853
+ if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
1854
+ node.parentNode.removeChild(node);
1855
+ }
1856
+ });
1857
+ }
1858
+ hostRef.$hostElement$ = hostElm;
1859
+ endHydrate();
1860
+ };
1861
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1862
+ let childNodeType;
1863
+ let childIdSplt;
1864
+ let childVNode;
1865
+ let i2;
1866
+ const scopeId2 = hostElm["s-sc"];
1867
+ if (node.nodeType === 1 /* ElementNode */) {
1868
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1869
+ if (childNodeType) {
1870
+ childIdSplt = childNodeType.split(".");
1871
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1872
+ childVNode = createSimpleVNode({
1873
+ $flags$: 0,
1874
+ $hostId$: childIdSplt[0],
1875
+ $nodeId$: childIdSplt[1],
1876
+ $depth$: childIdSplt[2],
1877
+ $index$: childIdSplt[3],
1878
+ $tag$: node.tagName.toLowerCase(),
1879
+ $elm$: node,
1880
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` reconciliation will fail:
1881
+ // client side changes before componentDidLoad will be ignored, `set-accessor.ts` will just take the element's initial classes
1882
+ $attrs$: { class: node.className }
1883
+ });
1884
+ childRenderNodes.push(childVNode);
1885
+ node.removeAttribute(HYDRATE_CHILD_ID);
1886
+ if (!parentVNode.$children$) {
1887
+ parentVNode.$children$ = [];
1888
+ }
1889
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
1890
+ if (typeof slotName === "string") {
1891
+ if (childVNode.$tag$ === "slot-fb") {
1892
+ addSlot(
1893
+ slotName,
1894
+ childIdSplt[2],
1895
+ childVNode,
1896
+ node,
1897
+ parentVNode,
1898
+ childRenderNodes,
1899
+ slotNodes,
1900
+ shadowRootNodes,
1901
+ slottedNodes
1902
+ );
1903
+ }
1904
+ childVNode.$elm$["s-sn"] = slotName;
1905
+ childVNode.$elm$.removeAttribute("s-sn");
1906
+ }
1907
+ if (childVNode.$index$ !== void 0) {
1908
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1909
+ }
1910
+ if (scopeId2) node["s-si"] = scopeId2;
1911
+ parentVNode = childVNode;
1912
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1913
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1914
+ }
1915
+ }
1916
+ }
1917
+ if (node.shadowRoot) {
1918
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1919
+ clientHydrate(
1920
+ parentVNode,
1921
+ childRenderNodes,
1922
+ slotNodes,
1923
+ shadowRootNodes,
1924
+ hostElm,
1925
+ node.shadowRoot.childNodes[i2],
1926
+ hostId,
1927
+ slottedNodes
1928
+ );
1929
+ }
1930
+ }
1931
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1932
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1933
+ clientHydrate(
1934
+ parentVNode,
1935
+ childRenderNodes,
1936
+ slotNodes,
1937
+ shadowRootNodes,
1938
+ hostElm,
1939
+ nonShadowNodes[i2],
1940
+ hostId,
1941
+ slottedNodes
1942
+ );
1943
+ }
1944
+ } else if (node.nodeType === 8 /* CommentNode */) {
1945
+ childIdSplt = node.nodeValue.split(".");
1946
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1947
+ childNodeType = childIdSplt[0];
1948
+ childVNode = createSimpleVNode({
1949
+ $hostId$: childIdSplt[1],
1950
+ $nodeId$: childIdSplt[2],
1951
+ $depth$: childIdSplt[3],
1952
+ $index$: childIdSplt[4] || "0",
1953
+ $elm$: node,
1954
+ $attrs$: null,
1955
+ $children$: null,
1956
+ $key$: null,
1957
+ $name$: null,
1958
+ $tag$: null,
1959
+ $text$: null
1960
+ });
1961
+ if (childNodeType === TEXT_NODE_ID) {
1962
+ childVNode.$elm$ = node.nextSibling;
1963
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1964
+ childVNode.$text$ = childVNode.$elm$.textContent;
1965
+ childRenderNodes.push(childVNode);
1966
+ node.remove();
1967
+ if (hostId === childVNode.$hostId$) {
1968
+ if (!parentVNode.$children$) {
1969
+ parentVNode.$children$ = [];
1970
+ }
1971
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1972
+ }
1973
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1974
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1975
+ }
1976
+ }
1977
+ } else if (childNodeType === COMMENT_NODE_ID) {
1978
+ childVNode.$elm$ = node.nextSibling;
1979
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1980
+ childRenderNodes.push(childVNode);
1981
+ node.remove();
1982
+ }
1983
+ } else if (childVNode.$hostId$ === hostId) {
1984
+ if (childNodeType === SLOT_NODE_ID) {
1985
+ childVNode.$tag$ = "slot";
1986
+ const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
1987
+ addSlot(
1988
+ slotName,
1989
+ childIdSplt[2],
1990
+ childVNode,
1991
+ node,
1992
+ parentVNode,
1993
+ childRenderNodes,
1994
+ slotNodes,
1995
+ shadowRootNodes,
1996
+ slottedNodes
1997
+ );
1998
+ } else if (childNodeType === CONTENT_REF_ID) {
1999
+ if (import_app_data7.BUILD.shadowDom && shadowRootNodes) {
2000
+ node.remove();
2001
+ } else if (import_app_data7.BUILD.slotRelocation) {
2002
+ hostElm["s-cr"] = node;
2003
+ node["s-cn"] = true;
2004
+ }
2005
+ }
2006
+ }
2007
+ }
2008
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
2009
+ const vnode = newVNode(null, node.textContent);
2010
+ vnode.$elm$ = node;
2011
+ vnode.$index$ = "0";
2012
+ parentVNode.$children$ = [vnode];
2013
+ }
2014
+ return parentVNode;
2015
+ };
2016
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
2017
+ if (node.nodeType === 1 /* ElementNode */) {
2018
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
2019
+ if (componentId) {
2020
+ orgLocNodes.set(componentId, node);
2021
+ }
2022
+ let i2 = 0;
2023
+ if (node.shadowRoot) {
2024
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
2025
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
2026
+ }
2027
+ }
2028
+ const nonShadowNodes = node.__childNodes || node.childNodes;
2029
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
2030
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
2031
+ }
2032
+ } else if (node.nodeType === 8 /* CommentNode */) {
2033
+ const childIdSplt = node.nodeValue.split(".");
2034
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
2035
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
2036
+ node.nodeValue = "";
2037
+ node["s-en"] = childIdSplt[3];
2038
+ }
2039
+ }
2040
+ };
2041
+ var createSimpleVNode = (vnode) => {
2042
+ const defaultVNode = {
2043
+ $flags$: 0,
2044
+ $hostId$: null,
2045
+ $nodeId$: null,
2046
+ $depth$: null,
2047
+ $index$: "0",
2048
+ $elm$: null,
2049
+ $attrs$: null,
2050
+ $children$: null,
2051
+ $key$: null,
2052
+ $name$: null,
2053
+ $tag$: null,
2054
+ $text$: null
2055
+ };
2056
+ return { ...defaultVNode, ...vnode };
2057
+ };
2058
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
2059
+ node["s-sr"] = true;
2060
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
2061
+ if (import_app_data7.BUILD.shadowDom && shadowRootNodes) {
2062
+ const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
2063
+ if (childVNode.$name$) {
2064
+ childVNode.$elm$.setAttribute("name", slotName);
2065
+ }
2066
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
2067
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
2068
+ } else {
2069
+ node.parentNode.insertBefore(childVNode.$elm$, node);
2070
+ }
2071
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
2072
+ node.remove();
2073
+ if (childVNode.$depth$ === "0") {
2074
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2075
+ }
2076
+ } else {
2077
+ const slot = childVNode.$elm$;
2078
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
2079
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
2080
+ if (shouldMove) {
2081
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
2082
+ }
2083
+ childRenderNodes.push(childVNode);
2084
+ }
2085
+ slotNodes.push(childVNode);
2086
+ if (!parentVNode.$children$) {
2087
+ parentVNode.$children$ = [];
2088
+ }
2089
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2090
+ }
2091
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
2092
+ let slottedNode = slotNode.nextSibling;
2093
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
2094
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
2095
+ slottedNode["s-sn"] = slotName;
2096
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
2097
+ slottedNode = slottedNode.nextSibling;
2098
+ }
2099
+ };
2100
+
2101
+ // src/runtime/initialize-component.ts
2102
+ var import_app_data15 = require("@stencil/core/internal/app-data");
2103
+
2104
+ // src/runtime/mode.ts
2105
+ var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
2106
+ var setMode = (handler) => modeResolutionChain.push(handler);
2107
+ var getMode = (ref) => getHostRef(ref).$modeName$;
2108
+
2109
+ // src/runtime/proxy-component.ts
2110
+ var import_app_data14 = require("@stencil/core/internal/app-data");
2111
+
2112
+ // src/runtime/set-value.ts
2113
+ var import_app_data13 = require("@stencil/core/internal/app-data");
2114
+
2115
+ // src/runtime/parse-property-value.ts
2116
+ var import_app_data8 = require("@stencil/core/internal/app-data");
2117
+ var parsePropertyValue = (propValue, propType) => {
2118
+ if (propValue != null && !isComplexType(propValue)) {
2119
+ if (import_app_data8.BUILD.propBoolean && propType & 4 /* Boolean */) {
2120
+ return propValue === "false" ? false : propValue === "" || !!propValue;
2121
+ }
2122
+ if (import_app_data8.BUILD.propNumber && propType & 2 /* Number */) {
2123
+ return parseFloat(propValue);
2124
+ }
2125
+ if (import_app_data8.BUILD.propString && propType & 1 /* String */) {
2126
+ return String(propValue);
2127
+ }
2128
+ return propValue;
2129
+ }
2130
+ return propValue;
2131
+ };
2132
+
2133
+ // src/runtime/update-component.ts
2134
+ var import_app_data12 = require("@stencil/core/internal/app-data");
2135
+
2136
+ // src/runtime/event-emitter.ts
2137
+ var import_app_data10 = require("@stencil/core/internal/app-data");
2138
+
2139
+ // src/runtime/element.ts
2140
+ var import_app_data9 = require("@stencil/core/internal/app-data");
2141
+ var getElement = (ref) => import_app_data9.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2142
+
2143
+ // src/runtime/event-emitter.ts
2144
+ var createEvent = (ref, name, flags) => {
2145
+ const elm = getElement(ref);
2146
+ return {
2147
+ emit: (detail) => {
2148
+ if (import_app_data10.BUILD.isDev && !elm.isConnected) {
2149
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2150
+ }
2151
+ return emitEvent(elm, name, {
2152
+ bubbles: !!(flags & 4 /* Bubbles */),
2153
+ composed: !!(flags & 2 /* Composed */),
2154
+ cancelable: !!(flags & 1 /* Cancellable */),
2155
+ detail
2156
+ });
2157
+ }
2158
+ };
2159
+ };
2160
+ var emitEvent = (elm, name, opts) => {
2161
+ const ev = plt.ce(name, opts);
2162
+ elm.dispatchEvent(ev);
2163
+ return ev;
2164
+ };
2165
+
2166
+ // src/runtime/styles.ts
2167
+ var import_app_data11 = require("@stencil/core/internal/app-data");
2168
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2169
+ var registerStyle = (scopeId2, cssText, allowCS) => {
2170
+ let style = styles.get(scopeId2);
2171
+ if (supportsConstructableStylesheets && allowCS) {
2172
+ style = style || new CSSStyleSheet();
2173
+ if (typeof style === "string") {
2174
+ style = cssText;
2175
+ } else {
2176
+ style.replaceSync(cssText);
2177
+ }
2178
+ } else {
2179
+ style = cssText;
2180
+ }
2181
+ styles.set(scopeId2, style);
2182
+ };
2183
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2184
+ var _a;
2185
+ const scopeId2 = getScopeId(cmpMeta, mode);
2186
+ const style = styles.get(scopeId2);
2187
+ if (!import_app_data11.BUILD.attachStyles) {
2188
+ return scopeId2;
2189
+ }
2190
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
2191
+ if (style) {
2192
+ if (typeof style === "string") {
2193
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
2194
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2195
+ let styleElm;
2196
+ if (!appliedStyles) {
2197
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2198
+ }
2199
+ if (!appliedStyles.has(scopeId2)) {
2200
+ if (import_app_data11.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2201
+ styleElm.innerHTML = style;
2202
+ } else {
2203
+ styleElm = doc.createElement("style");
2204
+ styleElm.innerHTML = style;
2205
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
2206
+ if (nonce != null) {
2207
+ styleElm.setAttribute("nonce", nonce);
2208
+ }
2209
+ if ((import_app_data11.BUILD.hydrateServerSide || import_app_data11.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2210
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2211
+ }
2212
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2213
+ if (styleContainerNode.nodeName === "HEAD") {
2214
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2215
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2216
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
2217
+ } else if ("host" in styleContainerNode) {
2218
+ if (supportsConstructableStylesheets) {
2219
+ const stylesheet = new CSSStyleSheet();
2220
+ stylesheet.replaceSync(style);
2221
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2222
+ } else {
2223
+ const existingStyleContainer = styleContainerNode.querySelector("style");
2224
+ if (existingStyleContainer) {
2225
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2226
+ } else {
2227
+ styleContainerNode.prepend(styleElm);
2228
+ }
2229
+ }
2230
+ } else {
2231
+ styleContainerNode.append(styleElm);
2232
+ }
2233
+ }
2234
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
2235
+ styleContainerNode.insertBefore(styleElm, null);
2236
+ }
2237
+ }
2238
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2239
+ styleElm.innerHTML += SLOT_FB_CSS;
2240
+ }
2241
+ if (appliedStyles) {
2242
+ appliedStyles.add(scopeId2);
2243
+ }
2244
+ }
2245
+ } else if (import_app_data11.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2246
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2247
+ }
2248
+ }
2249
+ return scopeId2;
2250
+ };
2251
+ var attachStyles = (hostRef) => {
2252
+ const cmpMeta = hostRef.$cmpMeta$;
2253
+ const elm = hostRef.$hostElement$;
2254
+ const flags = cmpMeta.$flags$;
2255
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2256
+ const scopeId2 = addStyle(
2257
+ import_app_data11.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2258
+ cmpMeta,
2259
+ hostRef.$modeName$
2260
+ );
2261
+ if ((import_app_data11.BUILD.shadowDom || import_app_data11.BUILD.scoped) && import_app_data11.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
2262
+ elm["s-sc"] = scopeId2;
2263
+ elm.classList.add(scopeId2 + "-h");
2264
+ if (import_app_data11.BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) {
2265
+ elm.classList.add(scopeId2 + "-s");
2266
+ }
2267
+ }
2268
+ endAttachStyles();
1813
2269
  };
1814
- var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1815
- `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1816
- );
1817
- var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1818
- `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1819
- );
2270
+ var getScopeId = (cmp, mode) => "sc-" + (import_app_data11.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1820
2271
 
1821
2272
  // src/runtime/update-component.ts
1822
2273
  var attachToAncestor = (hostRef, ancestorComponent) => {
1823
- if (import_app_data11.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2274
+ if (import_app_data12.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1824
2275
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1825
2276
  }
1826
2277
  };
1827
2278
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1828
- if (import_app_data11.BUILD.taskQueue && import_app_data11.BUILD.updatable) {
2279
+ if (import_app_data12.BUILD.taskQueue && import_app_data12.BUILD.updatable) {
1829
2280
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1830
2281
  }
1831
- if (import_app_data11.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2282
+ if (import_app_data12.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1832
2283
  hostRef.$flags$ |= 512 /* needsRerender */;
1833
2284
  return;
1834
2285
  }
1835
2286
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1836
2287
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1837
- return import_app_data11.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
2288
+ return import_app_data12.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
1838
2289
  };
1839
2290
  var dispatchHooks = (hostRef, isInitialLoad) => {
1840
2291
  const elm = hostRef.$hostElement$;
1841
2292
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1842
- const instance = import_app_data11.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2293
+ const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1843
2294
  if (!instance) {
1844
2295
  throw new Error(
1845
2296
  `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
@@ -1847,7 +2298,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1847
2298
  }
1848
2299
  let maybePromise;
1849
2300
  if (isInitialLoad) {
1850
- if (import_app_data11.BUILD.lazyLoad && import_app_data11.BUILD.hostListener) {
2301
+ if (import_app_data12.BUILD.lazyLoad && import_app_data12.BUILD.hostListener) {
1851
2302
  hostRef.$flags$ |= 256 /* isListenReady */;
1852
2303
  if (hostRef.$queuedListeners$) {
1853
2304
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1855,17 +2306,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1855
2306
  }
1856
2307
  }
1857
2308
  emitLifecycleEvent(elm, "componentWillLoad");
1858
- if (import_app_data11.BUILD.cmpWillLoad) {
2309
+ if (import_app_data12.BUILD.cmpWillLoad) {
1859
2310
  maybePromise = safeCall(instance, "componentWillLoad");
1860
2311
  }
1861
2312
  } else {
1862
2313
  emitLifecycleEvent(elm, "componentWillUpdate");
1863
- if (import_app_data11.BUILD.cmpWillUpdate) {
2314
+ if (import_app_data12.BUILD.cmpWillUpdate) {
1864
2315
  maybePromise = safeCall(instance, "componentWillUpdate");
1865
2316
  }
1866
2317
  }
1867
2318
  emitLifecycleEvent(elm, "componentWillRender");
1868
- if (import_app_data11.BUILD.cmpWillRender) {
2319
+ if (import_app_data12.BUILD.cmpWillRender) {
1869
2320
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1870
2321
  }
1871
2322
  endSchedule();
@@ -1881,23 +2332,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1881
2332
  const elm = hostRef.$hostElement$;
1882
2333
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1883
2334
  const rc = elm["s-rc"];
1884
- if (import_app_data11.BUILD.style && isInitialLoad) {
2335
+ if (import_app_data12.BUILD.style && isInitialLoad) {
1885
2336
  attachStyles(hostRef);
1886
2337
  }
1887
2338
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1888
- if (import_app_data11.BUILD.isDev) {
2339
+ if (import_app_data12.BUILD.isDev) {
1889
2340
  hostRef.$flags$ |= 1024 /* devOnRender */;
1890
2341
  }
1891
- if (import_app_data11.BUILD.hydrateServerSide) {
2342
+ if (import_app_data12.BUILD.hydrateServerSide) {
1892
2343
  await callRender(hostRef, instance, elm, isInitialLoad);
1893
2344
  } else {
1894
2345
  callRender(hostRef, instance, elm, isInitialLoad);
1895
2346
  }
1896
- if (import_app_data11.BUILD.isDev) {
2347
+ if (import_app_data12.BUILD.isDev) {
1897
2348
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1898
2349
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1899
2350
  }
1900
- if (import_app_data11.BUILD.hydrateServerSide) {
2351
+ if (import_app_data12.BUILD.hydrateServerSide) {
1901
2352
  try {
1902
2353
  serverSideConnected(elm);
1903
2354
  if (isInitialLoad) {
@@ -1911,13 +2362,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1911
2362
  consoleError(e, elm);
1912
2363
  }
1913
2364
  }
1914
- if (import_app_data11.BUILD.asyncLoading && rc) {
2365
+ if (import_app_data12.BUILD.asyncLoading && rc) {
1915
2366
  rc.map((cb) => cb());
1916
2367
  elm["s-rc"] = void 0;
1917
2368
  }
1918
2369
  endRender();
1919
2370
  endUpdate();
1920
- if (import_app_data11.BUILD.asyncLoading) {
2371
+ if (import_app_data12.BUILD.asyncLoading) {
1921
2372
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1922
2373
  const postUpdate = () => postUpdateComponent(hostRef);
1923
2374
  if (childrenPromises.length === 0) {
@@ -1933,10 +2384,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1933
2384
  };
1934
2385
  var renderingRef = null;
1935
2386
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
1936
- const allRenderFn = import_app_data11.BUILD.allRenderFn ? true : false;
1937
- const lazyLoad = import_app_data11.BUILD.lazyLoad ? true : false;
1938
- const taskQueue = import_app_data11.BUILD.taskQueue ? true : false;
1939
- const updatable = import_app_data11.BUILD.updatable ? true : false;
2387
+ const allRenderFn = import_app_data12.BUILD.allRenderFn ? true : false;
2388
+ const lazyLoad = import_app_data12.BUILD.lazyLoad ? true : false;
2389
+ const taskQueue = import_app_data12.BUILD.taskQueue ? true : false;
2390
+ const updatable = import_app_data12.BUILD.updatable ? true : false;
1940
2391
  try {
1941
2392
  renderingRef = instance;
1942
2393
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -1946,9 +2397,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1946
2397
  if (updatable || lazyLoad) {
1947
2398
  hostRef.$flags$ |= 2 /* hasRendered */;
1948
2399
  }
1949
- if (import_app_data11.BUILD.hasRenderFn || import_app_data11.BUILD.reflect) {
1950
- if (import_app_data11.BUILD.vdomRender || import_app_data11.BUILD.reflect) {
1951
- if (import_app_data11.BUILD.hydrateServerSide) {
2400
+ if (import_app_data12.BUILD.hasRenderFn || import_app_data12.BUILD.reflect) {
2401
+ if (import_app_data12.BUILD.vdomRender || import_app_data12.BUILD.reflect) {
2402
+ if (import_app_data12.BUILD.hydrateServerSide) {
1952
2403
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
1953
2404
  } else {
1954
2405
  renderVdom(hostRef, instance, isInitialLoad);
@@ -1973,57 +2424,57 @@ var postUpdateComponent = (hostRef) => {
1973
2424
  const tagName = hostRef.$cmpMeta$.$tagName$;
1974
2425
  const elm = hostRef.$hostElement$;
1975
2426
  const endPostUpdate = createTime("postUpdate", tagName);
1976
- const instance = import_app_data11.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2427
+ const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1977
2428
  const ancestorComponent = hostRef.$ancestorComponent$;
1978
- if (import_app_data11.BUILD.cmpDidRender) {
1979
- if (import_app_data11.BUILD.isDev) {
2429
+ if (import_app_data12.BUILD.cmpDidRender) {
2430
+ if (import_app_data12.BUILD.isDev) {
1980
2431
  hostRef.$flags$ |= 1024 /* devOnRender */;
1981
2432
  }
1982
2433
  safeCall(instance, "componentDidRender");
1983
- if (import_app_data11.BUILD.isDev) {
2434
+ if (import_app_data12.BUILD.isDev) {
1984
2435
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1985
2436
  }
1986
2437
  }
1987
2438
  emitLifecycleEvent(elm, "componentDidRender");
1988
2439
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1989
2440
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1990
- if (import_app_data11.BUILD.asyncLoading && import_app_data11.BUILD.cssAnnotations) {
2441
+ if (import_app_data12.BUILD.asyncLoading && import_app_data12.BUILD.cssAnnotations) {
1991
2442
  addHydratedFlag(elm);
1992
2443
  }
1993
- if (import_app_data11.BUILD.cmpDidLoad) {
1994
- if (import_app_data11.BUILD.isDev) {
2444
+ if (import_app_data12.BUILD.cmpDidLoad) {
2445
+ if (import_app_data12.BUILD.isDev) {
1995
2446
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1996
2447
  }
1997
2448
  safeCall(instance, "componentDidLoad");
1998
- if (import_app_data11.BUILD.isDev) {
2449
+ if (import_app_data12.BUILD.isDev) {
1999
2450
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
2000
2451
  }
2001
2452
  }
2002
2453
  emitLifecycleEvent(elm, "componentDidLoad");
2003
2454
  endPostUpdate();
2004
- if (import_app_data11.BUILD.asyncLoading) {
2455
+ if (import_app_data12.BUILD.asyncLoading) {
2005
2456
  hostRef.$onReadyResolve$(elm);
2006
2457
  if (!ancestorComponent) {
2007
2458
  appDidLoad(tagName);
2008
2459
  }
2009
2460
  }
2010
2461
  } else {
2011
- if (import_app_data11.BUILD.cmpDidUpdate) {
2012
- if (import_app_data11.BUILD.isDev) {
2462
+ if (import_app_data12.BUILD.cmpDidUpdate) {
2463
+ if (import_app_data12.BUILD.isDev) {
2013
2464
  hostRef.$flags$ |= 1024 /* devOnRender */;
2014
2465
  }
2015
2466
  safeCall(instance, "componentDidUpdate");
2016
- if (import_app_data11.BUILD.isDev) {
2467
+ if (import_app_data12.BUILD.isDev) {
2017
2468
  hostRef.$flags$ &= ~1024 /* devOnRender */;
2018
2469
  }
2019
2470
  }
2020
2471
  emitLifecycleEvent(elm, "componentDidUpdate");
2021
2472
  endPostUpdate();
2022
2473
  }
2023
- if (import_app_data11.BUILD.method && import_app_data11.BUILD.lazyLoad) {
2474
+ if (import_app_data12.BUILD.method && import_app_data12.BUILD.lazyLoad) {
2024
2475
  hostRef.$onInstanceResolve$(elm);
2025
2476
  }
2026
- if (import_app_data11.BUILD.asyncLoading) {
2477
+ if (import_app_data12.BUILD.asyncLoading) {
2027
2478
  if (hostRef.$onRenderResolve$) {
2028
2479
  hostRef.$onRenderResolve$();
2029
2480
  hostRef.$onRenderResolve$ = void 0;
@@ -2035,7 +2486,7 @@ var postUpdateComponent = (hostRef) => {
2035
2486
  }
2036
2487
  };
2037
2488
  var forceUpdate = (ref) => {
2038
- if (import_app_data11.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2489
+ if (import_app_data12.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2039
2490
  const hostRef = getHostRef(ref);
2040
2491
  const isConnected = hostRef.$hostElement$.isConnected;
2041
2492
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -2046,15 +2497,15 @@ var forceUpdate = (ref) => {
2046
2497
  return false;
2047
2498
  };
2048
2499
  var appDidLoad = (who) => {
2049
- if (import_app_data11.BUILD.cssAnnotations) {
2500
+ if (import_app_data12.BUILD.cssAnnotations) {
2050
2501
  addHydratedFlag(doc.documentElement);
2051
2502
  }
2052
- if (import_app_data11.BUILD.asyncQueue) {
2503
+ if (import_app_data12.BUILD.asyncQueue) {
2053
2504
  plt.$flags$ |= 2 /* appLoaded */;
2054
2505
  }
2055
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data11.NAMESPACE } }));
2056
- if (import_app_data11.BUILD.profile && performance.measure) {
2057
- performance.measure(`[Stencil] ${import_app_data11.NAMESPACE} initial load (by ${who})`, "st:app:start");
2506
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data12.NAMESPACE } }));
2507
+ if (import_app_data12.BUILD.profile && performance.measure) {
2508
+ performance.measure(`[Stencil] ${import_app_data12.NAMESPACE} initial load (by ${who})`, "st:app:start");
2058
2509
  }
2059
2510
  };
2060
2511
  var safeCall = (instance, method, arg) => {
@@ -2068,19 +2519,19 @@ var safeCall = (instance, method, arg) => {
2068
2519
  return void 0;
2069
2520
  };
2070
2521
  var emitLifecycleEvent = (elm, lifecycleName) => {
2071
- if (import_app_data11.BUILD.lifecycleDOMEvents) {
2522
+ if (import_app_data12.BUILD.lifecycleDOMEvents) {
2072
2523
  emitEvent(elm, "stencil_" + lifecycleName, {
2073
2524
  bubbles: true,
2074
2525
  composed: true,
2075
2526
  detail: {
2076
- namespace: import_app_data11.NAMESPACE
2527
+ namespace: import_app_data12.NAMESPACE
2077
2528
  }
2078
2529
  });
2079
2530
  }
2080
2531
  };
2081
2532
  var addHydratedFlag = (elm) => {
2082
2533
  var _a, _b;
2083
- return import_app_data11.BUILD.hydratedClass ? elm.classList.add((_a = import_app_data11.BUILD.hydratedSelectorName) != null ? _a : "hydrated") : import_app_data11.BUILD.hydratedAttribute ? elm.setAttribute((_b = import_app_data11.BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2534
+ return import_app_data12.BUILD.hydratedClass ? elm.classList.add((_a = import_app_data12.BUILD.hydratedSelectorName) != null ? _a : "hydrated") : import_app_data12.BUILD.hydratedAttribute ? elm.setAttribute((_b = import_app_data12.BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2084
2535
  };
2085
2536
  var serverSideConnected = (elm) => {
2086
2537
  const children = elm.children;
@@ -2099,21 +2550,21 @@ var serverSideConnected = (elm) => {
2099
2550
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2100
2551
  var setValue = (ref, propName, newVal, cmpMeta) => {
2101
2552
  const hostRef = getHostRef(ref);
2102
- if (import_app_data12.BUILD.lazyLoad && !hostRef) {
2553
+ if (import_app_data13.BUILD.lazyLoad && !hostRef) {
2103
2554
  throw new Error(
2104
2555
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
2105
2556
  );
2106
2557
  }
2107
- const elm = import_app_data12.BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
2558
+ const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
2108
2559
  const oldVal = hostRef.$instanceValues$.get(propName);
2109
2560
  const flags = hostRef.$flags$;
2110
- const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2561
+ const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2111
2562
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2112
2563
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2113
2564
  const didValueChange = newVal !== oldVal && !areBothNaN;
2114
- if ((!import_app_data12.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2565
+ if ((!import_app_data13.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2115
2566
  hostRef.$instanceValues$.set(propName, newVal);
2116
- if (import_app_data12.BUILD.isDev) {
2567
+ if (import_app_data13.BUILD.isDev) {
2117
2568
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
2118
2569
  consoleDevWarn(
2119
2570
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -2136,8 +2587,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2136
2587
  );
2137
2588
  }
2138
2589
  }
2139
- if (!import_app_data12.BUILD.lazyLoad || instance) {
2140
- if (import_app_data12.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2590
+ if (!import_app_data13.BUILD.lazyLoad || instance) {
2591
+ if (import_app_data13.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2141
2592
  const watchMethods = cmpMeta.$watchers$[propName];
2142
2593
  if (watchMethods) {
2143
2594
  watchMethods.map((watchMethodName) => {
@@ -2149,8 +2600,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2149
2600
  });
2150
2601
  }
2151
2602
  }
2152
- if (import_app_data12.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2153
- if (import_app_data12.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
2603
+ if (import_app_data13.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2604
+ if (import_app_data13.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
2154
2605
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2155
2606
  return;
2156
2607
  }
@@ -2165,59 +2616,105 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2165
2616
  var proxyComponent = (Cstr, cmpMeta, flags) => {
2166
2617
  var _a, _b;
2167
2618
  const prototype = Cstr.prototype;
2168
- if (import_app_data13.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2619
+ if (import_app_data14.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2169
2620
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
2170
2621
  const originalFormAssociatedCallback = prototype[cbName];
2171
2622
  Object.defineProperty(prototype, cbName, {
2172
2623
  value(...args) {
2173
2624
  const hostRef = getHostRef(this);
2174
- const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
2625
+ const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
2175
2626
  if (!instance) {
2176
2627
  hostRef.$onReadyPromise$.then((asyncInstance) => {
2177
2628
  const cb = asyncInstance[cbName];
2178
2629
  typeof cb === "function" && cb.call(asyncInstance, ...args);
2179
2630
  });
2180
2631
  } else {
2181
- const cb = import_app_data13.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2632
+ const cb = import_app_data14.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2182
2633
  typeof cb === "function" && cb.call(instance, ...args);
2183
2634
  }
2184
2635
  }
2185
2636
  });
2186
2637
  });
2187
2638
  }
2188
- if (import_app_data13.BUILD.member && cmpMeta.$members$ || import_app_data13.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2189
- if (import_app_data13.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2639
+ if (import_app_data14.BUILD.member && cmpMeta.$members$ || import_app_data14.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2640
+ if (import_app_data14.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2190
2641
  cmpMeta.$watchers$ = Cstr.watchers;
2191
2642
  }
2192
2643
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2193
2644
  members.map(([memberName, [memberFlags]]) => {
2194
- if ((import_app_data13.BUILD.prop || import_app_data13.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data13.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2195
- Object.defineProperty(prototype, memberName, {
2196
- get() {
2197
- return getValue(this, memberName);
2198
- },
2199
- set(newValue) {
2200
- if (import_app_data13.BUILD.isDev) {
2201
- const ref = getHostRef(this);
2202
- if (
2203
- // we are proxying the instance (not element)
2204
- (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
2205
- (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
2206
- (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
2207
- (memberFlags & 1024 /* Mutable */) === 0
2208
- ) {
2209
- consoleDevWarn(
2210
- `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
2645
+ if ((import_app_data14.BUILD.prop || import_app_data14.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data14.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2646
+ if ((memberFlags & 2048 /* Getter */) === 0) {
2647
+ Object.defineProperty(prototype, memberName, {
2648
+ get() {
2649
+ return getValue(this, memberName);
2650
+ },
2651
+ set(newValue) {
2652
+ if (import_app_data14.BUILD.isDev) {
2653
+ const ref = getHostRef(this);
2654
+ if (
2655
+ // we are proxying the instance (not element)
2656
+ (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
2657
+ (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
2658
+ (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
2659
+ (memberFlags & 1024 /* Mutable */) === 0
2660
+ ) {
2661
+ consoleDevWarn(
2662
+ `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
2211
2663
  More information: https://stenciljs.com/docs/properties#prop-mutability`
2212
- );
2664
+ );
2665
+ }
2213
2666
  }
2214
- }
2215
- setValue(this, memberName, newValue, cmpMeta);
2216
- },
2217
- configurable: true,
2218
- enumerable: true
2219
- });
2220
- } else if (import_app_data13.BUILD.lazyLoad && import_app_data13.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2667
+ setValue(this, memberName, newValue, cmpMeta);
2668
+ },
2669
+ configurable: true,
2670
+ enumerable: true
2671
+ });
2672
+ } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
2673
+ if (import_app_data14.BUILD.lazyLoad) {
2674
+ Object.defineProperty(prototype, memberName, {
2675
+ get() {
2676
+ const ref = getHostRef(this);
2677
+ const instance = import_app_data14.BUILD.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2678
+ if (!instance) return;
2679
+ return instance[memberName];
2680
+ },
2681
+ configurable: true,
2682
+ enumerable: true
2683
+ });
2684
+ }
2685
+ if (memberFlags & 4096 /* Setter */) {
2686
+ const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
2687
+ Object.defineProperty(prototype, memberName, {
2688
+ set(newValue) {
2689
+ const ref = getHostRef(this);
2690
+ if (origSetter) {
2691
+ const currentValue = ref.$hostElement$[memberName];
2692
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2693
+ ref.$instanceValues$.set(memberName, currentValue);
2694
+ }
2695
+ origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
2696
+ setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
2697
+ return;
2698
+ }
2699
+ if (!ref) return;
2700
+ const setterSetVal = () => {
2701
+ const currentValue = ref.$lazyInstance$[memberName];
2702
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2703
+ ref.$instanceValues$.set(memberName, currentValue);
2704
+ }
2705
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
2706
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
2707
+ };
2708
+ if (ref.$lazyInstance$) {
2709
+ setterSetVal();
2710
+ } else {
2711
+ ref.$onReadyPromise$.then(() => setterSetVal());
2712
+ }
2713
+ }
2714
+ });
2715
+ }
2716
+ }
2717
+ } else if (import_app_data14.BUILD.lazyLoad && import_app_data14.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2221
2718
  Object.defineProperty(prototype, memberName, {
2222
2719
  value(...args) {
2223
2720
  var _a2;
@@ -2230,7 +2727,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2230
2727
  });
2231
2728
  }
2232
2729
  });
2233
- if (import_app_data13.BUILD.observeAttribute && (!import_app_data13.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
2730
+ if (import_app_data14.BUILD.observeAttribute && (!import_app_data14.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
2234
2731
  const attrNameToPropName = /* @__PURE__ */ new Map();
2235
2732
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2236
2733
  plt.jmp(() => {
@@ -2246,8 +2743,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2246
2743
  const hostRef = getHostRef(this);
2247
2744
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2248
2745
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
2249
- const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2250
- const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2746
+ const elm = import_app_data14.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2747
+ const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2251
2748
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2252
2749
  entry == null ? void 0 : entry.forEach((callbackName) => {
2253
2750
  if (instance[callbackName] != null) {
@@ -2257,7 +2754,10 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2257
2754
  }
2258
2755
  return;
2259
2756
  }
2260
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2757
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2758
+ if (!propDesc.get || !!propDesc.set) {
2759
+ this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2760
+ }
2261
2761
  });
2262
2762
  };
2263
2763
  Cstr.observedAttributes = Array.from(
@@ -2267,7 +2767,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2267
2767
  var _a2;
2268
2768
  const attrName = m[1] || propName;
2269
2769
  attrNameToPropName.set(attrName, propName);
2270
- if (import_app_data13.BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
2770
+ if (import_app_data14.BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
2271
2771
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2272
2772
  }
2273
2773
  return attrName;
@@ -2285,7 +2785,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2285
2785
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2286
2786
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2287
2787
  const bundleId = cmpMeta.$lazyBundleId$;
2288
- if ((import_app_data14.BUILD.lazyLoad || import_app_data14.BUILD.hydrateClientSide) && bundleId) {
2788
+ if ((import_app_data15.BUILD.lazyLoad || import_app_data15.BUILD.hydrateClientSide) && bundleId) {
2289
2789
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
2290
2790
  if (CstrImport && "then" in CstrImport) {
2291
2791
  const endLoad = uniqueTime(
@@ -2300,15 +2800,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2300
2800
  if (!Cstr) {
2301
2801
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2302
2802
  }
2303
- if (import_app_data14.BUILD.member && !Cstr.isProxied) {
2304
- if (import_app_data14.BUILD.watchCallback) {
2803
+ if (import_app_data15.BUILD.member && !Cstr.isProxied) {
2804
+ if (import_app_data15.BUILD.watchCallback) {
2305
2805
  cmpMeta.$watchers$ = Cstr.watchers;
2306
2806
  }
2307
2807
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2308
2808
  Cstr.isProxied = true;
2309
2809
  }
2310
2810
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
2311
- if (import_app_data14.BUILD.member) {
2811
+ if (import_app_data15.BUILD.member) {
2312
2812
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
2313
2813
  }
2314
2814
  try {
@@ -2316,10 +2816,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2316
2816
  } catch (e) {
2317
2817
  consoleError(e);
2318
2818
  }
2319
- if (import_app_data14.BUILD.member) {
2819
+ if (import_app_data15.BUILD.member) {
2320
2820
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2321
2821
  }
2322
- if (import_app_data14.BUILD.watchCallback) {
2822
+ if (import_app_data15.BUILD.watchCallback) {
2323
2823
  hostRef.$flags$ |= 128 /* isWatchReady */;
2324
2824
  }
2325
2825
  endNewInstance();
@@ -2329,24 +2829,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2329
2829
  const cmpTag = elm.localName;
2330
2830
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2331
2831
  }
2332
- if (import_app_data14.BUILD.style && Cstr && Cstr.style) {
2832
+ if (import_app_data15.BUILD.style && Cstr && Cstr.style) {
2333
2833
  let style;
2334
2834
  if (typeof Cstr.style === "string") {
2335
2835
  style = Cstr.style;
2336
- } else if (import_app_data14.BUILD.mode && typeof Cstr.style !== "string") {
2836
+ } else if (import_app_data15.BUILD.mode && typeof Cstr.style !== "string") {
2337
2837
  hostRef.$modeName$ = computeMode(elm);
2338
2838
  if (hostRef.$modeName$) {
2339
2839
  style = Cstr.style[hostRef.$modeName$];
2340
2840
  }
2341
- if (import_app_data14.BUILD.hydrateServerSide && hostRef.$modeName$) {
2841
+ if (import_app_data15.BUILD.hydrateServerSide && hostRef.$modeName$) {
2342
2842
  elm.setAttribute("s-mode", hostRef.$modeName$);
2343
2843
  }
2344
2844
  }
2345
2845
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2346
2846
  if (!styles.has(scopeId2)) {
2347
2847
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2348
- if (!import_app_data14.BUILD.hydrateServerSide && import_app_data14.BUILD.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2349
- import_app_data14.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2848
+ if (!import_app_data15.BUILD.hydrateServerSide && import_app_data15.BUILD.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2849
+ import_app_data15.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2350
2850
  style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
2351
2851
  }
2352
2852
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -2356,14 +2856,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2356
2856
  }
2357
2857
  const ancestorComponent = hostRef.$ancestorComponent$;
2358
2858
  const schedule = () => scheduleUpdate(hostRef, true);
2359
- if (import_app_data14.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2859
+ if (import_app_data15.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2360
2860
  ancestorComponent["s-rc"].push(schedule);
2361
2861
  } else {
2362
2862
  schedule();
2363
2863
  }
2364
2864
  };
2365
2865
  var fireConnectedCallback = (instance) => {
2366
- if (import_app_data14.BUILD.lazyLoad && import_app_data14.BUILD.connectedCallback) {
2866
+ if (import_app_data15.BUILD.lazyLoad && import_app_data15.BUILD.connectedCallback) {
2367
2867
  safeCall(instance, "connectedCallback");
2368
2868
  }
2369
2869
  };
@@ -2374,38 +2874,41 @@ var connectedCallback = (elm) => {
2374
2874
  const hostRef = getHostRef(elm);
2375
2875
  const cmpMeta = hostRef.$cmpMeta$;
2376
2876
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2377
- if (import_app_data15.BUILD.hostListenerTargetParent) {
2877
+ if (import_app_data16.BUILD.hostListenerTargetParent) {
2378
2878
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2379
2879
  }
2380
2880
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2381
2881
  hostRef.$flags$ |= 1 /* hasConnected */;
2382
2882
  let hostId;
2383
- if (import_app_data15.BUILD.hydrateClientSide) {
2883
+ if (import_app_data16.BUILD.hydrateClientSide) {
2384
2884
  hostId = elm.getAttribute(HYDRATE_ID);
2385
2885
  if (hostId) {
2386
- if (import_app_data15.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2387
- const scopeId2 = import_app_data15.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2886
+ if (import_app_data16.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2887
+ const scopeId2 = import_app_data16.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2388
2888
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2889
+ } else if (import_app_data16.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2890
+ const scopeId2 = getScopeId(cmpMeta, import_app_data16.BUILD.mode ? elm.getAttribute("s-mode") : void 0);
2891
+ elm["s-sc"] = scopeId2;
2389
2892
  }
2390
2893
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2391
2894
  }
2392
2895
  }
2393
- if (import_app_data15.BUILD.slotRelocation && !hostId) {
2394
- if (import_app_data15.BUILD.hydrateServerSide || (import_app_data15.BUILD.slot || import_app_data15.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2896
+ if (import_app_data16.BUILD.slotRelocation && !hostId) {
2897
+ if (import_app_data16.BUILD.hydrateServerSide || (import_app_data16.BUILD.slot || import_app_data16.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2395
2898
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2396
2899
  setContentReference(elm);
2397
2900
  }
2398
2901
  }
2399
- if (import_app_data15.BUILD.asyncLoading) {
2902
+ if (import_app_data16.BUILD.asyncLoading) {
2400
2903
  let ancestorComponent = elm;
2401
2904
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2402
- if (import_app_data15.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2905
+ if (import_app_data16.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2403
2906
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2404
2907
  break;
2405
2908
  }
2406
2909
  }
2407
2910
  }
2408
- if (import_app_data15.BUILD.prop && !import_app_data15.BUILD.hydrateServerSide && cmpMeta.$members$) {
2911
+ if (import_app_data16.BUILD.prop && !import_app_data16.BUILD.hydrateServerSide && cmpMeta.$members$) {
2409
2912
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2410
2913
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2411
2914
  const value = elm[memberName];
@@ -2414,7 +2917,7 @@ var connectedCallback = (elm) => {
2414
2917
  }
2415
2918
  });
2416
2919
  }
2417
- if (import_app_data15.BUILD.initializeNextTick) {
2920
+ if (import_app_data16.BUILD.initializeNextTick) {
2418
2921
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2419
2922
  } else {
2420
2923
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2432,32 +2935,32 @@ var connectedCallback = (elm) => {
2432
2935
  };
2433
2936
  var setContentReference = (elm) => {
2434
2937
  const contentRefElm = elm["s-cr"] = doc.createComment(
2435
- import_app_data15.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
2938
+ import_app_data16.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
2436
2939
  );
2437
2940
  contentRefElm["s-cn"] = true;
2438
2941
  insertBefore(elm, contentRefElm, elm.firstChild);
2439
2942
  };
2440
2943
 
2441
2944
  // src/runtime/disconnected-callback.ts
2442
- var import_app_data16 = require("@stencil/core/internal/app-data");
2945
+ var import_app_data17 = require("@stencil/core/internal/app-data");
2443
2946
  var disconnectInstance = (instance) => {
2444
- if (import_app_data16.BUILD.lazyLoad && import_app_data16.BUILD.disconnectedCallback) {
2947
+ if (import_app_data17.BUILD.lazyLoad && import_app_data17.BUILD.disconnectedCallback) {
2445
2948
  safeCall(instance, "disconnectedCallback");
2446
2949
  }
2447
- if (import_app_data16.BUILD.cmpDidUnload) {
2950
+ if (import_app_data17.BUILD.cmpDidUnload) {
2448
2951
  safeCall(instance, "componentDidUnload");
2449
2952
  }
2450
2953
  };
2451
2954
  var disconnectedCallback = async (elm) => {
2452
2955
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2453
2956
  const hostRef = getHostRef(elm);
2454
- if (import_app_data16.BUILD.hostListener) {
2957
+ if (import_app_data17.BUILD.hostListener) {
2455
2958
  if (hostRef.$rmListeners$) {
2456
2959
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2457
2960
  hostRef.$rmListeners$ = void 0;
2458
2961
  }
2459
2962
  }
2460
- if (!import_app_data16.BUILD.lazyLoad) {
2963
+ if (!import_app_data17.BUILD.lazyLoad) {
2461
2964
  disconnectInstance(elm);
2462
2965
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2463
2966
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2467,325 +2970,6 @@ var disconnectedCallback = async (elm) => {
2467
2970
  }
2468
2971
  };
2469
2972
 
2470
- // src/runtime/dom-extras.ts
2471
- var import_app_data17 = require("@stencil/core/internal/app-data");
2472
- var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2473
- patchCloneNode(hostElementPrototype);
2474
- patchSlotAppendChild(hostElementPrototype);
2475
- patchSlotAppend(hostElementPrototype);
2476
- patchSlotPrepend(hostElementPrototype);
2477
- patchSlotInsertAdjacentElement(hostElementPrototype);
2478
- patchSlotInsertAdjacentHTML(hostElementPrototype);
2479
- patchSlotInsertAdjacentText(hostElementPrototype);
2480
- patchTextContent(hostElementPrototype);
2481
- patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2482
- patchSlotRemoveChild(hostElementPrototype);
2483
- };
2484
- var patchCloneNode = (HostElementPrototype) => {
2485
- const orgCloneNode = HostElementPrototype.cloneNode;
2486
- HostElementPrototype.cloneNode = function(deep) {
2487
- const srcNode = this;
2488
- const isShadowDom = import_app_data17.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2489
- const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2490
- if (import_app_data17.BUILD.slot && !isShadowDom && deep) {
2491
- let i2 = 0;
2492
- let slotted, nonStencilNode;
2493
- const stencilPrivates = [
2494
- "s-id",
2495
- "s-cr",
2496
- "s-lr",
2497
- "s-rc",
2498
- "s-sc",
2499
- "s-p",
2500
- "s-cn",
2501
- "s-sr",
2502
- "s-sn",
2503
- "s-hn",
2504
- "s-ol",
2505
- "s-nr",
2506
- "s-si",
2507
- "s-rf",
2508
- "s-scs"
2509
- ];
2510
- for (; i2 < srcNode.childNodes.length; i2++) {
2511
- slotted = srcNode.childNodes[i2]["s-nr"];
2512
- nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
2513
- if (slotted) {
2514
- if (import_app_data17.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2515
- clonedNode.__appendChild(slotted.cloneNode(true));
2516
- } else {
2517
- clonedNode.appendChild(slotted.cloneNode(true));
2518
- }
2519
- }
2520
- if (nonStencilNode) {
2521
- clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
2522
- }
2523
- }
2524
- }
2525
- return clonedNode;
2526
- };
2527
- };
2528
- var patchSlotAppendChild = (HostElementPrototype) => {
2529
- HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2530
- HostElementPrototype.appendChild = function(newChild) {
2531
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2532
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2533
- if (slotNode) {
2534
- const slotPlaceholder = document.createTextNode("");
2535
- slotPlaceholder["s-nr"] = newChild;
2536
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2537
- newChild["s-ol"] = slotPlaceholder;
2538
- newChild["s-sh"] = slotNode["s-hn"];
2539
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2540
- const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2541
- const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2542
- updateFallbackSlotVisibility(this);
2543
- return insertedNode;
2544
- }
2545
- return this.__appendChild(newChild);
2546
- };
2547
- };
2548
- var patchSlotRemoveChild = (ElementPrototype) => {
2549
- ElementPrototype.__removeChild = ElementPrototype.removeChild;
2550
- ElementPrototype.removeChild = function(toRemove) {
2551
- if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
2552
- const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
2553
- if (slotNode) {
2554
- const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
2555
- const existingNode = slotChildNodes.find((n) => n === toRemove);
2556
- if (existingNode) {
2557
- existingNode.remove();
2558
- updateFallbackSlotVisibility(this);
2559
- return;
2560
- }
2561
- }
2562
- }
2563
- return this.__removeChild(toRemove);
2564
- };
2565
- };
2566
- var patchSlotPrepend = (HostElementPrototype) => {
2567
- const originalPrepend = HostElementPrototype.prepend;
2568
- HostElementPrototype.prepend = function(...newChildren) {
2569
- newChildren.forEach((newChild) => {
2570
- if (typeof newChild === "string") {
2571
- newChild = this.ownerDocument.createTextNode(newChild);
2572
- }
2573
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2574
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2575
- if (slotNode) {
2576
- const slotPlaceholder = document.createTextNode("");
2577
- slotPlaceholder["s-nr"] = newChild;
2578
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2579
- newChild["s-ol"] = slotPlaceholder;
2580
- newChild["s-sh"] = slotNode["s-hn"];
2581
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2582
- const appendAfter = slotChildNodes[0];
2583
- return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2584
- }
2585
- if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
2586
- newChild.hidden = true;
2587
- }
2588
- return originalPrepend.call(this, newChild);
2589
- });
2590
- };
2591
- };
2592
- var patchSlotAppend = (HostElementPrototype) => {
2593
- HostElementPrototype.append = function(...newChildren) {
2594
- newChildren.forEach((newChild) => {
2595
- if (typeof newChild === "string") {
2596
- newChild = this.ownerDocument.createTextNode(newChild);
2597
- }
2598
- this.appendChild(newChild);
2599
- });
2600
- };
2601
- };
2602
- var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2603
- const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2604
- HostElementPrototype.insertAdjacentHTML = function(position, text) {
2605
- if (position !== "afterbegin" && position !== "beforeend") {
2606
- return originalInsertAdjacentHtml.call(this, position, text);
2607
- }
2608
- const container = this.ownerDocument.createElement("_");
2609
- let node;
2610
- container.innerHTML = text;
2611
- if (position === "afterbegin") {
2612
- while (node = container.firstChild) {
2613
- this.prepend(node);
2614
- }
2615
- } else if (position === "beforeend") {
2616
- while (node = container.firstChild) {
2617
- this.append(node);
2618
- }
2619
- }
2620
- };
2621
- };
2622
- var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2623
- HostElementPrototype.insertAdjacentText = function(position, text) {
2624
- this.insertAdjacentHTML(position, text);
2625
- };
2626
- };
2627
- var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2628
- const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2629
- HostElementPrototype.insertAdjacentElement = function(position, element) {
2630
- if (position !== "afterbegin" && position !== "beforeend") {
2631
- return originalInsertAdjacentElement.call(this, position, element);
2632
- }
2633
- if (position === "afterbegin") {
2634
- this.prepend(element);
2635
- return element;
2636
- } else if (position === "beforeend") {
2637
- this.append(element);
2638
- return element;
2639
- }
2640
- return element;
2641
- };
2642
- };
2643
- var patchTextContent = (hostElementPrototype) => {
2644
- const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2645
- Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2646
- if (import_app_data17.BUILD.experimentalScopedSlotChanges) {
2647
- Object.defineProperty(hostElementPrototype, "textContent", {
2648
- // To mimic shadow root behavior, we need to return the text content of all
2649
- // nodes in a slot reference node
2650
- get() {
2651
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2652
- const textContent = slotRefNodes.map((node) => {
2653
- var _a, _b;
2654
- const text = [];
2655
- let slotContent = node.nextSibling;
2656
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2657
- if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
2658
- text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
2659
- }
2660
- slotContent = slotContent.nextSibling;
2661
- }
2662
- return text.filter((ref) => ref !== "").join(" ");
2663
- }).filter((text) => text !== "").join(" ");
2664
- return " " + textContent + " ";
2665
- },
2666
- // To mimic shadow root behavior, we need to overwrite all nodes in a slot
2667
- // reference node. If a default slot reference node exists, the text content will be
2668
- // placed there. Otherwise, the new text node will be hidden
2669
- set(value) {
2670
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2671
- slotRefNodes.forEach((node) => {
2672
- let slotContent = node.nextSibling;
2673
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2674
- const tmp = slotContent;
2675
- slotContent = slotContent.nextSibling;
2676
- tmp.remove();
2677
- }
2678
- if (node["s-sn"] === "") {
2679
- const textNode = this.ownerDocument.createTextNode(value);
2680
- textNode["s-sn"] = "";
2681
- insertBefore(node.parentElement, textNode, node.nextSibling);
2682
- } else {
2683
- node.remove();
2684
- }
2685
- });
2686
- }
2687
- });
2688
- } else {
2689
- Object.defineProperty(hostElementPrototype, "textContent", {
2690
- get() {
2691
- var _a;
2692
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2693
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2694
- return slotNode.nextSibling.textContent;
2695
- } else if (slotNode) {
2696
- return slotNode.textContent;
2697
- } else {
2698
- return this.__textContent;
2699
- }
2700
- },
2701
- set(value) {
2702
- var _a;
2703
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2704
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2705
- slotNode.nextSibling.textContent = value;
2706
- } else if (slotNode) {
2707
- slotNode.textContent = value;
2708
- } else {
2709
- this.__textContent = value;
2710
- const contentRefElm = this["s-cr"];
2711
- if (contentRefElm) {
2712
- insertBefore(this, contentRefElm, this.firstChild);
2713
- }
2714
- }
2715
- }
2716
- });
2717
- }
2718
- };
2719
- var patchChildSlotNodes = (elm, cmpMeta) => {
2720
- class FakeNodeList extends Array {
2721
- item(n) {
2722
- return this[n];
2723
- }
2724
- }
2725
- if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2726
- const childNodesFn = elm.__lookupGetter__("childNodes");
2727
- Object.defineProperty(elm, "children", {
2728
- get() {
2729
- return this.childNodes.map((n) => n.nodeType === 1);
2730
- }
2731
- });
2732
- Object.defineProperty(elm, "childElementCount", {
2733
- get() {
2734
- return elm.children.length;
2735
- }
2736
- });
2737
- Object.defineProperty(elm, "childNodes", {
2738
- get() {
2739
- const childNodes = childNodesFn.call(this);
2740
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
2741
- const result = new FakeNodeList();
2742
- for (let i2 = 0; i2 < childNodes.length; i2++) {
2743
- const slot = childNodes[i2]["s-nr"];
2744
- if (slot) {
2745
- result.push(slot);
2746
- }
2747
- }
2748
- return result;
2749
- }
2750
- return FakeNodeList.from(childNodes);
2751
- }
2752
- });
2753
- }
2754
- };
2755
- var getAllChildSlotNodes = (childNodes) => {
2756
- const slotRefNodes = [];
2757
- for (const childNode of Array.from(childNodes)) {
2758
- if (childNode["s-sr"]) {
2759
- slotRefNodes.push(childNode);
2760
- }
2761
- slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
2762
- }
2763
- return slotRefNodes;
2764
- };
2765
- var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
2766
- var getHostSlotNode = (childNodes, slotName, hostName) => {
2767
- let i2 = 0;
2768
- let childNode;
2769
- for (; i2 < childNodes.length; i2++) {
2770
- childNode = childNodes[i2];
2771
- if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
2772
- return childNode;
2773
- }
2774
- childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
2775
- if (childNode) {
2776
- return childNode;
2777
- }
2778
- }
2779
- return null;
2780
- };
2781
- var getHostSlotChildNodes = (n, slotName) => {
2782
- const childNodes = [n];
2783
- while ((n = n.nextSibling) && n["s-sn"] === slotName) {
2784
- childNodes.push(n);
2785
- }
2786
- return childNodes;
2787
- };
2788
-
2789
2973
  // src/runtime/bootstrap-custom-element.ts
2790
2974
  var defineCustomElement = (Cstr, compactMeta) => {
2791
2975
  customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
@@ -2812,11 +2996,11 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2812
2996
  }
2813
2997
  if (import_app_data18.BUILD.experimentalSlotFixes) {
2814
2998
  if (import_app_data18.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2815
- patchPseudoShadowDom(Cstr.prototype, cmpMeta);
2999
+ patchPseudoShadowDom(Cstr.prototype);
2816
3000
  }
2817
3001
  } else {
2818
3002
  if (import_app_data18.BUILD.slotChildNodesFix) {
2819
- patchChildSlotNodes(Cstr.prototype, cmpMeta);
3003
+ patchChildSlotNodes(Cstr.prototype);
2820
3004
  }
2821
3005
  if (import_app_data18.BUILD.cloneNodeFix) {
2822
3006
  patchCloneNode(Cstr.prototype);
@@ -2830,16 +3014,16 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2830
3014
  }
2831
3015
  const originalConnectedCallback = Cstr.prototype.connectedCallback;
2832
3016
  const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2833
- let hasHostListenerAttached = false;
2834
3017
  Object.assign(Cstr.prototype, {
3018
+ __hasHostListenerAttached: false,
2835
3019
  __registerHost() {
2836
3020
  registerHost(this, cmpMeta);
2837
3021
  },
2838
3022
  connectedCallback() {
2839
- if (!hasHostListenerAttached) {
3023
+ if (!this.__hasHostListenerAttached) {
2840
3024
  const hostRef = getHostRef(this);
2841
3025
  addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2842
- hasHostListenerAttached = true;
3026
+ this.__hasHostListenerAttached = true;
2843
3027
  }
2844
3028
  connectedCallback(this);
2845
3029
  if (import_app_data18.BUILD.connectedCallback && originalConnectedCallback) {
@@ -3022,11 +3206,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3022
3206
  };
3023
3207
  if (import_app_data19.BUILD.experimentalSlotFixes) {
3024
3208
  if (import_app_data19.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3025
- patchPseudoShadowDom(HostElement.prototype, cmpMeta);
3209
+ patchPseudoShadowDom(HostElement.prototype);
3026
3210
  }
3027
3211
  } else {
3028
3212
  if (import_app_data19.BUILD.slotChildNodesFix) {
3029
- patchChildSlotNodes(HostElement.prototype, cmpMeta);
3213
+ patchChildSlotNodes(HostElement.prototype);
3030
3214
  }
3031
3215
  if (import_app_data19.BUILD.cloneNodeFix) {
3032
3216
  patchCloneNode(HostElement.prototype);
@@ -3164,6 +3348,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
3164
3348
  childId = `${hostId}.${nodeId}`;
3165
3349
  if (nodeRef.nodeType === 1 /* ElementNode */) {
3166
3350
  nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
3351
+ if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
3352
+ nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
3353
+ }
3167
3354
  } else if (nodeRef.nodeType === 3 /* TextNode */) {
3168
3355
  if (hostId === 0) {
3169
3356
  const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
@@ -3175,6 +3362,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
3175
3362
  const commentBeforeTextNode = doc2.createComment(childId);
3176
3363
  commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
3177
3364
  insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
3365
+ } else if (nodeRef.nodeType === 8 /* CommentNode */) {
3366
+ const commentBeforeTextNode = doc2.createComment(childId);
3367
+ commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
3368
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
3178
3369
  }
3179
3370
  }
3180
3371
  let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
@@ -3255,6 +3446,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
3255
3446
  childElm["s-node-id"] = nodeId;
3256
3447
  if (childElm.nodeType === 1 /* ElementNode */) {
3257
3448
  childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3449
+ if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
3450
+ childElm.setAttribute("s-sn", childElm["s-sn"]);
3451
+ }
3258
3452
  } else if (childElm.nodeType === 3 /* TextNode */) {
3259
3453
  const parentNode = childElm.parentNode;
3260
3454
  const nodeName = parentNode == null ? void 0 : parentNode.nodeName;