@stencil/core 4.22.3-dev.1733806913.ee4aa0b → 4.22.3-dev.1733893307.ec243c2
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.
- package/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +4 -4
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +1233 -1046
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +1233 -1046
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +35 -31
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +5 -0
- package/internal/testing/index.js +1235 -1048
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +9 -5
- package/mock-doc/index.js +9 -5
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
|
@@ -460,102 +460,20 @@ var unwrapErr = (result) => {
|
|
|
460
460
|
};
|
|
461
461
|
|
|
462
462
|
// src/runtime/connected-callback.ts
|
|
463
|
-
var
|
|
463
|
+
var import_app_data16 = require("@stencil/core/internal/app-data");
|
|
464
464
|
|
|
465
465
|
// src/runtime/client-hydrate.ts
|
|
466
|
-
var
|
|
466
|
+
var import_app_data7 = require("@stencil/core/internal/app-data");
|
|
467
467
|
|
|
468
|
-
// src/runtime/
|
|
469
|
-
var
|
|
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
|
|
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 (
|
|
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 (
|
|
532
|
+
if (import_app_data.BUILD.isDev && nodeName === "input") {
|
|
612
533
|
validateInputProperties(vnodeData);
|
|
613
534
|
}
|
|
614
|
-
if (
|
|
535
|
+
if (import_app_data.BUILD.vdomKey && vnodeData.key) {
|
|
615
536
|
key = vnodeData.key;
|
|
616
537
|
}
|
|
617
|
-
if (
|
|
538
|
+
if (import_app_data.BUILD.slotRelocation && vnodeData.name) {
|
|
618
539
|
slotName = vnodeData.name;
|
|
619
540
|
}
|
|
620
|
-
if (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
565
|
+
if (import_app_data.BUILD.vdomKey) {
|
|
645
566
|
vnode.$key$ = key;
|
|
646
567
|
}
|
|
647
|
-
if (
|
|
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 (
|
|
581
|
+
if (import_app_data.BUILD.vdomAttribute) {
|
|
661
582
|
vnode.$attrs$ = null;
|
|
662
583
|
}
|
|
663
|
-
if (
|
|
584
|
+
if (import_app_data.BUILD.vdomKey) {
|
|
664
585
|
vnode.$key$ = null;
|
|
665
586
|
}
|
|
666
|
-
if (
|
|
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/
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
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
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
if (
|
|
853
|
-
|
|
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
|
-
|
|
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
|
-
|
|
885
|
-
|
|
886
|
-
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
817
|
+
if (import_app_data4.BUILD.vdomText && newVNode2.$text$ !== null) {
|
|
1262
818
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1263
|
-
} else if (
|
|
1264
|
-
elm = newVNode2.$elm$ =
|
|
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 (
|
|
822
|
+
if (import_app_data4.BUILD.svg && !isSvgMode) {
|
|
1267
823
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1268
824
|
}
|
|
1269
|
-
elm = newVNode2.$elm$ =
|
|
825
|
+
elm = newVNode2.$elm$ = import_app_data4.BUILD.svg ? doc.createElementNS(
|
|
1270
826
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1271
|
-
!useNativeShadowDom &&
|
|
827
|
+
!useNativeShadowDom && import_app_data4.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1272
828
|
) : doc.createElement(
|
|
1273
|
-
!useNativeShadowDom &&
|
|
829
|
+
!useNativeShadowDom && import_app_data4.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1274
830
|
);
|
|
1275
|
-
if (
|
|
831
|
+
if (import_app_data4.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1276
832
|
isSvgMode = false;
|
|
1277
833
|
}
|
|
1278
|
-
if (
|
|
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 &&
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
870
|
+
if (import_app_data4.BUILD.experimentalSlotFixes) {
|
|
1315
871
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1316
872
|
} else {
|
|
1317
873
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
@@ -1344,7 +900,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1344
900
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1345
901
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1346
902
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1347
|
-
if (parentElm["s-sr"] &&
|
|
903
|
+
if (parentElm["s-sr"] && import_app_data4.BUILD.experimentalSlotFixes) {
|
|
1348
904
|
let node = parentElm;
|
|
1349
905
|
while (node = node.nextSibling) {
|
|
1350
906
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1368,9 +924,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1368
924
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1369
925
|
};
|
|
1370
926
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1371
|
-
let containerElm =
|
|
927
|
+
let containerElm = import_app_data4.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1372
928
|
let childNode;
|
|
1373
|
-
if (
|
|
929
|
+
if (import_app_data4.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1374
930
|
containerElm = containerElm.shadowRoot;
|
|
1375
931
|
}
|
|
1376
932
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1378,7 +934,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
1378
934
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
1379
935
|
if (childNode) {
|
|
1380
936
|
vnodes[startIdx].$elm$ = childNode;
|
|
1381
|
-
insertBefore(containerElm, childNode,
|
|
937
|
+
insertBefore(containerElm, childNode, import_app_data4.BUILD.slotRelocation ? referenceNode(before) : before);
|
|
1382
938
|
}
|
|
1383
939
|
}
|
|
1384
940
|
}
|
|
@@ -1390,7 +946,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1390
946
|
const elm = vnode.$elm$;
|
|
1391
947
|
nullifyVNodeRefs(vnode);
|
|
1392
948
|
if (elm) {
|
|
1393
|
-
if (
|
|
949
|
+
if (import_app_data4.BUILD.slotRelocation) {
|
|
1394
950
|
checkSlotFallbackVisibility = true;
|
|
1395
951
|
if (elm["s-ol"]) {
|
|
1396
952
|
elm["s-ol"].remove();
|
|
@@ -1434,7 +990,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1434
990
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1435
991
|
newEndVnode = newCh[--newEndIdx];
|
|
1436
992
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1437
|
-
if (
|
|
993
|
+
if (import_app_data4.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1438
994
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1439
995
|
}
|
|
1440
996
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1442,7 +998,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1442
998
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1443
999
|
newEndVnode = newCh[--newEndIdx];
|
|
1444
1000
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1445
|
-
if (
|
|
1001
|
+
if (import_app_data4.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1446
1002
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1447
1003
|
}
|
|
1448
1004
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1451,7 +1007,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1451
1007
|
newStartVnode = newCh[++newStartIdx];
|
|
1452
1008
|
} else {
|
|
1453
1009
|
idxInOld = -1;
|
|
1454
|
-
if (
|
|
1010
|
+
if (import_app_data4.BUILD.vdomKey) {
|
|
1455
1011
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1456
1012
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1457
1013
|
idxInOld = i2;
|
|
@@ -1459,7 +1015,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1459
1015
|
}
|
|
1460
1016
|
}
|
|
1461
1017
|
}
|
|
1462
|
-
if (
|
|
1018
|
+
if (import_app_data4.BUILD.vdomKey && idxInOld >= 0) {
|
|
1463
1019
|
elmToMove = oldCh[idxInOld];
|
|
1464
1020
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1465
1021
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
|
|
@@ -1474,7 +1030,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1474
1030
|
newStartVnode = newCh[++newStartIdx];
|
|
1475
1031
|
}
|
|
1476
1032
|
if (node) {
|
|
1477
|
-
if (
|
|
1033
|
+
if (import_app_data4.BUILD.slotRelocation) {
|
|
1478
1034
|
insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
|
|
1479
1035
|
} else {
|
|
1480
1036
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
@@ -1491,13 +1047,13 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1491
1047
|
newStartIdx,
|
|
1492
1048
|
newEndIdx
|
|
1493
1049
|
);
|
|
1494
|
-
} else if (
|
|
1050
|
+
} else if (import_app_data4.BUILD.updatable && newStartIdx > newEndIdx) {
|
|
1495
1051
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1496
1052
|
}
|
|
1497
1053
|
};
|
|
1498
1054
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1499
1055
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1500
|
-
if (
|
|
1056
|
+
if (import_app_data4.BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1501
1057
|
if (
|
|
1502
1058
|
// The component gets hydrated and no VDOM has been initialized.
|
|
1503
1059
|
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
@@ -1509,7 +1065,7 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
1509
1065
|
}
|
|
1510
1066
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1511
1067
|
}
|
|
1512
|
-
if (
|
|
1068
|
+
if (import_app_data4.BUILD.vdomKey && !isInitialRender) {
|
|
1513
1069
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1514
1070
|
}
|
|
1515
1071
|
return true;
|
|
@@ -1527,13 +1083,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1527
1083
|
const tag = newVNode2.$tag$;
|
|
1528
1084
|
const text = newVNode2.$text$;
|
|
1529
1085
|
let defaultHolder;
|
|
1530
|
-
if (!
|
|
1531
|
-
if (
|
|
1086
|
+
if (!import_app_data4.BUILD.vdomText || text === null) {
|
|
1087
|
+
if (import_app_data4.BUILD.svg) {
|
|
1532
1088
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1533
1089
|
}
|
|
1534
|
-
if (
|
|
1535
|
-
if (
|
|
1536
|
-
if (
|
|
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$) {
|
|
1537
1093
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1538
1094
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1539
1095
|
}
|
|
@@ -1541,25 +1097,25 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1541
1097
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1542
1098
|
}
|
|
1543
1099
|
}
|
|
1544
|
-
if (
|
|
1100
|
+
if (import_app_data4.BUILD.updatable && oldChildren !== null && newChildren !== null) {
|
|
1545
1101
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1546
1102
|
} else if (newChildren !== null) {
|
|
1547
|
-
if (
|
|
1103
|
+
if (import_app_data4.BUILD.updatable && import_app_data4.BUILD.vdomText && oldVNode.$text$ !== null) {
|
|
1548
1104
|
elm.textContent = "";
|
|
1549
1105
|
}
|
|
1550
1106
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1551
1107
|
} else if (
|
|
1552
1108
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1553
|
-
!isInitialRender &&
|
|
1109
|
+
!isInitialRender && import_app_data4.BUILD.updatable && oldChildren !== null
|
|
1554
1110
|
) {
|
|
1555
1111
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1556
1112
|
}
|
|
1557
|
-
if (
|
|
1113
|
+
if (import_app_data4.BUILD.svg && isSvgMode && tag === "svg") {
|
|
1558
1114
|
isSvgMode = false;
|
|
1559
1115
|
}
|
|
1560
|
-
} else if (
|
|
1116
|
+
} else if (import_app_data4.BUILD.vdomText && import_app_data4.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1561
1117
|
defaultHolder.parentNode.textContent = text;
|
|
1562
|
-
} else if (
|
|
1118
|
+
} else if (import_app_data4.BUILD.vdomText && oldVNode.$text$ !== text) {
|
|
1563
1119
|
elm.data = text;
|
|
1564
1120
|
}
|
|
1565
1121
|
};
|
|
@@ -1577,7 +1133,7 @@ var updateFallbackSlotVisibility = (elm) => {
|
|
|
1577
1133
|
childNode.hidden = true;
|
|
1578
1134
|
break;
|
|
1579
1135
|
}
|
|
1580
|
-
} else {
|
|
1136
|
+
} else if (slotName === siblingNode["s-sn"]) {
|
|
1581
1137
|
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1582
1138
|
childNode.hidden = true;
|
|
1583
1139
|
break;
|
|
@@ -1602,7 +1158,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1602
1158
|
const slotName = childNode["s-sn"];
|
|
1603
1159
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1604
1160
|
node = hostContentNodes[j];
|
|
1605
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== 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"])) {
|
|
1606
1162
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1607
1163
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1608
1164
|
checkSlotFallbackVisibility = true;
|
|
@@ -1656,14 +1212,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
1656
1212
|
return slotName === "";
|
|
1657
1213
|
};
|
|
1658
1214
|
var nullifyVNodeRefs = (vNode) => {
|
|
1659
|
-
if (
|
|
1215
|
+
if (import_app_data4.BUILD.vdomRef) {
|
|
1660
1216
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1661
1217
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1662
1218
|
}
|
|
1663
1219
|
};
|
|
1664
1220
|
var insertBefore = (parent, newNode, reference) => {
|
|
1665
1221
|
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1666
|
-
if (
|
|
1222
|
+
if (import_app_data4.BUILD.scoped) {
|
|
1667
1223
|
updateElementScopeIds(newNode, parent);
|
|
1668
1224
|
}
|
|
1669
1225
|
return inserted;
|
|
@@ -1701,7 +1257,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1701
1257
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1702
1258
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1703
1259
|
hostTagName = hostElm.tagName;
|
|
1704
|
-
if (
|
|
1260
|
+
if (import_app_data4.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1705
1261
|
throw new Error(`The <Host> must be the single root component.
|
|
1706
1262
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1707
1263
|
|
|
@@ -1715,7 +1271,7 @@ render() {
|
|
|
1715
1271
|
}
|
|
1716
1272
|
`);
|
|
1717
1273
|
}
|
|
1718
|
-
if (
|
|
1274
|
+
if (import_app_data4.BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1719
1275
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1720
1276
|
cmpMeta.$attrsToReflect$.map(
|
|
1721
1277
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1731,24 +1287,24 @@ render() {
|
|
|
1731
1287
|
rootVnode.$tag$ = null;
|
|
1732
1288
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1733
1289
|
hostRef.$vnode$ = rootVnode;
|
|
1734
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1735
|
-
if (
|
|
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) {
|
|
1736
1292
|
scopeId = hostElm["s-sc"];
|
|
1737
1293
|
}
|
|
1738
1294
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1739
|
-
if (
|
|
1295
|
+
if (import_app_data4.BUILD.slotRelocation) {
|
|
1740
1296
|
contentRef = hostElm["s-cr"];
|
|
1741
1297
|
checkSlotFallbackVisibility = false;
|
|
1742
1298
|
}
|
|
1743
1299
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1744
|
-
if (
|
|
1300
|
+
if (import_app_data4.BUILD.slotRelocation) {
|
|
1745
1301
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1746
1302
|
if (checkSlotRelocate) {
|
|
1747
1303
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1748
1304
|
for (const relocateData of relocateNodes) {
|
|
1749
1305
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1750
1306
|
if (!nodeToRelocate["s-ol"]) {
|
|
1751
|
-
const orgLocationNode =
|
|
1307
|
+
const orgLocationNode = import_app_data4.BUILD.isDebug || import_app_data4.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1752
1308
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1753
1309
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1754
1310
|
}
|
|
@@ -1759,7 +1315,7 @@ render() {
|
|
|
1759
1315
|
if (slotRefNode) {
|
|
1760
1316
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1761
1317
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1762
|
-
if (!
|
|
1318
|
+
if (!import_app_data4.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
|
|
1763
1319
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1764
1320
|
while (orgLocationNode) {
|
|
1765
1321
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1778,7 +1334,7 @@ render() {
|
|
|
1778
1334
|
}
|
|
1779
1335
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1780
1336
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1781
|
-
if (!
|
|
1337
|
+
if (!import_app_data4.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1782
1338
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1783
1339
|
}
|
|
1784
1340
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -1804,7 +1360,7 @@ render() {
|
|
|
1804
1360
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1805
1361
|
relocateNodes.length = 0;
|
|
1806
1362
|
}
|
|
1807
|
-
if (
|
|
1363
|
+
if (import_app_data4.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1808
1364
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1809
1365
|
for (const childNode of children) {
|
|
1810
1366
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -1815,37 +1371,926 @@ render() {
|
|
|
1815
1371
|
}
|
|
1816
1372
|
}
|
|
1817
1373
|
}
|
|
1818
|
-
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();
|
|
1819
2269
|
};
|
|
1820
|
-
var
|
|
1821
|
-
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1822
|
-
);
|
|
1823
|
-
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1824
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1825
|
-
);
|
|
2270
|
+
var getScopeId = (cmp, mode) => "sc-" + (import_app_data11.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1826
2271
|
|
|
1827
2272
|
// src/runtime/update-component.ts
|
|
1828
2273
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1829
|
-
if (
|
|
2274
|
+
if (import_app_data12.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1830
2275
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
1831
2276
|
}
|
|
1832
2277
|
};
|
|
1833
2278
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1834
|
-
if (
|
|
2279
|
+
if (import_app_data12.BUILD.taskQueue && import_app_data12.BUILD.updatable) {
|
|
1835
2280
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1836
2281
|
}
|
|
1837
|
-
if (
|
|
2282
|
+
if (import_app_data12.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1838
2283
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1839
2284
|
return;
|
|
1840
2285
|
}
|
|
1841
2286
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1842
2287
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1843
|
-
return
|
|
2288
|
+
return import_app_data12.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1844
2289
|
};
|
|
1845
2290
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1846
2291
|
const elm = hostRef.$hostElement$;
|
|
1847
2292
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1848
|
-
const instance =
|
|
2293
|
+
const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1849
2294
|
if (!instance) {
|
|
1850
2295
|
throw new Error(
|
|
1851
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`
|
|
@@ -1853,7 +2298,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1853
2298
|
}
|
|
1854
2299
|
let maybePromise;
|
|
1855
2300
|
if (isInitialLoad) {
|
|
1856
|
-
if (
|
|
2301
|
+
if (import_app_data12.BUILD.lazyLoad && import_app_data12.BUILD.hostListener) {
|
|
1857
2302
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1858
2303
|
if (hostRef.$queuedListeners$) {
|
|
1859
2304
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -1861,17 +2306,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1861
2306
|
}
|
|
1862
2307
|
}
|
|
1863
2308
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
1864
|
-
if (
|
|
2309
|
+
if (import_app_data12.BUILD.cmpWillLoad) {
|
|
1865
2310
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
1866
2311
|
}
|
|
1867
2312
|
} else {
|
|
1868
2313
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
1869
|
-
if (
|
|
2314
|
+
if (import_app_data12.BUILD.cmpWillUpdate) {
|
|
1870
2315
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
1871
2316
|
}
|
|
1872
2317
|
}
|
|
1873
2318
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
1874
|
-
if (
|
|
2319
|
+
if (import_app_data12.BUILD.cmpWillRender) {
|
|
1875
2320
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1876
2321
|
}
|
|
1877
2322
|
endSchedule();
|
|
@@ -1887,23 +2332,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1887
2332
|
const elm = hostRef.$hostElement$;
|
|
1888
2333
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1889
2334
|
const rc = elm["s-rc"];
|
|
1890
|
-
if (
|
|
2335
|
+
if (import_app_data12.BUILD.style && isInitialLoad) {
|
|
1891
2336
|
attachStyles(hostRef);
|
|
1892
2337
|
}
|
|
1893
2338
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1894
|
-
if (
|
|
2339
|
+
if (import_app_data12.BUILD.isDev) {
|
|
1895
2340
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1896
2341
|
}
|
|
1897
|
-
if (
|
|
2342
|
+
if (import_app_data12.BUILD.hydrateServerSide) {
|
|
1898
2343
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
1899
2344
|
} else {
|
|
1900
2345
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1901
2346
|
}
|
|
1902
|
-
if (
|
|
2347
|
+
if (import_app_data12.BUILD.isDev) {
|
|
1903
2348
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
1904
2349
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1905
2350
|
}
|
|
1906
|
-
if (
|
|
2351
|
+
if (import_app_data12.BUILD.hydrateServerSide) {
|
|
1907
2352
|
try {
|
|
1908
2353
|
serverSideConnected(elm);
|
|
1909
2354
|
if (isInitialLoad) {
|
|
@@ -1917,13 +2362,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1917
2362
|
consoleError(e, elm);
|
|
1918
2363
|
}
|
|
1919
2364
|
}
|
|
1920
|
-
if (
|
|
2365
|
+
if (import_app_data12.BUILD.asyncLoading && rc) {
|
|
1921
2366
|
rc.map((cb) => cb());
|
|
1922
2367
|
elm["s-rc"] = void 0;
|
|
1923
2368
|
}
|
|
1924
2369
|
endRender();
|
|
1925
2370
|
endUpdate();
|
|
1926
|
-
if (
|
|
2371
|
+
if (import_app_data12.BUILD.asyncLoading) {
|
|
1927
2372
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1928
2373
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1929
2374
|
if (childrenPromises.length === 0) {
|
|
@@ -1939,10 +2384,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1939
2384
|
};
|
|
1940
2385
|
var renderingRef = null;
|
|
1941
2386
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1942
|
-
const allRenderFn =
|
|
1943
|
-
const lazyLoad =
|
|
1944
|
-
const taskQueue =
|
|
1945
|
-
const updatable =
|
|
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;
|
|
1946
2391
|
try {
|
|
1947
2392
|
renderingRef = instance;
|
|
1948
2393
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -1952,9 +2397,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1952
2397
|
if (updatable || lazyLoad) {
|
|
1953
2398
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1954
2399
|
}
|
|
1955
|
-
if (
|
|
1956
|
-
if (
|
|
1957
|
-
if (
|
|
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) {
|
|
1958
2403
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
1959
2404
|
} else {
|
|
1960
2405
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -1979,57 +2424,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1979
2424
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1980
2425
|
const elm = hostRef.$hostElement$;
|
|
1981
2426
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1982
|
-
const instance =
|
|
2427
|
+
const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1983
2428
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1984
|
-
if (
|
|
1985
|
-
if (
|
|
2429
|
+
if (import_app_data12.BUILD.cmpDidRender) {
|
|
2430
|
+
if (import_app_data12.BUILD.isDev) {
|
|
1986
2431
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1987
2432
|
}
|
|
1988
2433
|
safeCall(instance, "componentDidRender");
|
|
1989
|
-
if (
|
|
2434
|
+
if (import_app_data12.BUILD.isDev) {
|
|
1990
2435
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1991
2436
|
}
|
|
1992
2437
|
}
|
|
1993
2438
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
1994
2439
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1995
2440
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1996
|
-
if (
|
|
2441
|
+
if (import_app_data12.BUILD.asyncLoading && import_app_data12.BUILD.cssAnnotations) {
|
|
1997
2442
|
addHydratedFlag(elm);
|
|
1998
2443
|
}
|
|
1999
|
-
if (
|
|
2000
|
-
if (
|
|
2444
|
+
if (import_app_data12.BUILD.cmpDidLoad) {
|
|
2445
|
+
if (import_app_data12.BUILD.isDev) {
|
|
2001
2446
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2002
2447
|
}
|
|
2003
2448
|
safeCall(instance, "componentDidLoad");
|
|
2004
|
-
if (
|
|
2449
|
+
if (import_app_data12.BUILD.isDev) {
|
|
2005
2450
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2006
2451
|
}
|
|
2007
2452
|
}
|
|
2008
2453
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2009
2454
|
endPostUpdate();
|
|
2010
|
-
if (
|
|
2455
|
+
if (import_app_data12.BUILD.asyncLoading) {
|
|
2011
2456
|
hostRef.$onReadyResolve$(elm);
|
|
2012
2457
|
if (!ancestorComponent) {
|
|
2013
2458
|
appDidLoad(tagName);
|
|
2014
2459
|
}
|
|
2015
2460
|
}
|
|
2016
2461
|
} else {
|
|
2017
|
-
if (
|
|
2018
|
-
if (
|
|
2462
|
+
if (import_app_data12.BUILD.cmpDidUpdate) {
|
|
2463
|
+
if (import_app_data12.BUILD.isDev) {
|
|
2019
2464
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2020
2465
|
}
|
|
2021
2466
|
safeCall(instance, "componentDidUpdate");
|
|
2022
|
-
if (
|
|
2467
|
+
if (import_app_data12.BUILD.isDev) {
|
|
2023
2468
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2024
2469
|
}
|
|
2025
2470
|
}
|
|
2026
2471
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2027
2472
|
endPostUpdate();
|
|
2028
2473
|
}
|
|
2029
|
-
if (
|
|
2474
|
+
if (import_app_data12.BUILD.method && import_app_data12.BUILD.lazyLoad) {
|
|
2030
2475
|
hostRef.$onInstanceResolve$(elm);
|
|
2031
2476
|
}
|
|
2032
|
-
if (
|
|
2477
|
+
if (import_app_data12.BUILD.asyncLoading) {
|
|
2033
2478
|
if (hostRef.$onRenderResolve$) {
|
|
2034
2479
|
hostRef.$onRenderResolve$();
|
|
2035
2480
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2041,7 +2486,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2041
2486
|
}
|
|
2042
2487
|
};
|
|
2043
2488
|
var forceUpdate = (ref) => {
|
|
2044
|
-
if (
|
|
2489
|
+
if (import_app_data12.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2045
2490
|
const hostRef = getHostRef(ref);
|
|
2046
2491
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2047
2492
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2052,15 +2497,15 @@ var forceUpdate = (ref) => {
|
|
|
2052
2497
|
return false;
|
|
2053
2498
|
};
|
|
2054
2499
|
var appDidLoad = (who) => {
|
|
2055
|
-
if (
|
|
2500
|
+
if (import_app_data12.BUILD.cssAnnotations) {
|
|
2056
2501
|
addHydratedFlag(doc.documentElement);
|
|
2057
2502
|
}
|
|
2058
|
-
if (
|
|
2503
|
+
if (import_app_data12.BUILD.asyncQueue) {
|
|
2059
2504
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2060
2505
|
}
|
|
2061
|
-
nextTick(() => emitEvent(win, "appload", { detail: { namespace:
|
|
2062
|
-
if (
|
|
2063
|
-
performance.measure(`[Stencil] ${
|
|
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");
|
|
2064
2509
|
}
|
|
2065
2510
|
};
|
|
2066
2511
|
var safeCall = (instance, method, arg) => {
|
|
@@ -2074,19 +2519,19 @@ var safeCall = (instance, method, arg) => {
|
|
|
2074
2519
|
return void 0;
|
|
2075
2520
|
};
|
|
2076
2521
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2077
|
-
if (
|
|
2522
|
+
if (import_app_data12.BUILD.lifecycleDOMEvents) {
|
|
2078
2523
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2079
2524
|
bubbles: true,
|
|
2080
2525
|
composed: true,
|
|
2081
2526
|
detail: {
|
|
2082
|
-
namespace:
|
|
2527
|
+
namespace: import_app_data12.NAMESPACE
|
|
2083
2528
|
}
|
|
2084
2529
|
});
|
|
2085
2530
|
}
|
|
2086
2531
|
};
|
|
2087
2532
|
var addHydratedFlag = (elm) => {
|
|
2088
2533
|
var _a, _b;
|
|
2089
|
-
return
|
|
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;
|
|
2090
2535
|
};
|
|
2091
2536
|
var serverSideConnected = (elm) => {
|
|
2092
2537
|
const children = elm.children;
|
|
@@ -2105,21 +2550,21 @@ var serverSideConnected = (elm) => {
|
|
|
2105
2550
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2106
2551
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2107
2552
|
const hostRef = getHostRef(ref);
|
|
2108
|
-
if (
|
|
2553
|
+
if (import_app_data13.BUILD.lazyLoad && !hostRef) {
|
|
2109
2554
|
throw new Error(
|
|
2110
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).`
|
|
2111
2556
|
);
|
|
2112
2557
|
}
|
|
2113
|
-
const elm =
|
|
2558
|
+
const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2114
2559
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2115
2560
|
const flags = hostRef.$flags$;
|
|
2116
|
-
const instance =
|
|
2561
|
+
const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2117
2562
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2118
2563
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2119
2564
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2120
|
-
if ((!
|
|
2565
|
+
if ((!import_app_data13.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2121
2566
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2122
|
-
if (
|
|
2567
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2123
2568
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2124
2569
|
consoleDevWarn(
|
|
2125
2570
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2142,8 +2587,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2142
2587
|
);
|
|
2143
2588
|
}
|
|
2144
2589
|
}
|
|
2145
|
-
if (!
|
|
2146
|
-
if (
|
|
2590
|
+
if (!import_app_data13.BUILD.lazyLoad || instance) {
|
|
2591
|
+
if (import_app_data13.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2147
2592
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2148
2593
|
if (watchMethods) {
|
|
2149
2594
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2155,8 +2600,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2155
2600
|
});
|
|
2156
2601
|
}
|
|
2157
2602
|
}
|
|
2158
|
-
if (
|
|
2159
|
-
if (
|
|
2603
|
+
if (import_app_data13.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2604
|
+
if (import_app_data13.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2160
2605
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2161
2606
|
return;
|
|
2162
2607
|
}
|
|
@@ -2171,40 +2616,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2171
2616
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2172
2617
|
var _a, _b;
|
|
2173
2618
|
const prototype = Cstr.prototype;
|
|
2174
|
-
if (
|
|
2619
|
+
if (import_app_data14.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2175
2620
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2176
2621
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2177
2622
|
Object.defineProperty(prototype, cbName, {
|
|
2178
2623
|
value(...args) {
|
|
2179
2624
|
const hostRef = getHostRef(this);
|
|
2180
|
-
const instance =
|
|
2625
|
+
const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2181
2626
|
if (!instance) {
|
|
2182
2627
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2183
2628
|
const cb = asyncInstance[cbName];
|
|
2184
2629
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2185
2630
|
});
|
|
2186
2631
|
} else {
|
|
2187
|
-
const cb =
|
|
2632
|
+
const cb = import_app_data14.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2188
2633
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2189
2634
|
}
|
|
2190
2635
|
}
|
|
2191
2636
|
});
|
|
2192
2637
|
});
|
|
2193
2638
|
}
|
|
2194
|
-
if (
|
|
2195
|
-
if (
|
|
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$) {
|
|
2196
2641
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2197
2642
|
}
|
|
2198
2643
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2199
2644
|
members.map(([memberName, [memberFlags]]) => {
|
|
2200
|
-
if ((
|
|
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 */)) {
|
|
2201
2646
|
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2202
2647
|
Object.defineProperty(prototype, memberName, {
|
|
2203
2648
|
get() {
|
|
2204
2649
|
return getValue(this, memberName);
|
|
2205
2650
|
},
|
|
2206
2651
|
set(newValue) {
|
|
2207
|
-
if (
|
|
2652
|
+
if (import_app_data14.BUILD.isDev) {
|
|
2208
2653
|
const ref = getHostRef(this);
|
|
2209
2654
|
if (
|
|
2210
2655
|
// we are proxying the instance (not element)
|
|
@@ -2225,11 +2670,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2225
2670
|
enumerable: true
|
|
2226
2671
|
});
|
|
2227
2672
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2228
|
-
if (
|
|
2673
|
+
if (import_app_data14.BUILD.lazyLoad) {
|
|
2229
2674
|
Object.defineProperty(prototype, memberName, {
|
|
2230
2675
|
get() {
|
|
2231
2676
|
const ref = getHostRef(this);
|
|
2232
|
-
const instance =
|
|
2677
|
+
const instance = import_app_data14.BUILD.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2233
2678
|
if (!instance) return;
|
|
2234
2679
|
return instance[memberName];
|
|
2235
2680
|
},
|
|
@@ -2269,7 +2714,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2269
2714
|
});
|
|
2270
2715
|
}
|
|
2271
2716
|
}
|
|
2272
|
-
} else if (
|
|
2717
|
+
} else if (import_app_data14.BUILD.lazyLoad && import_app_data14.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2273
2718
|
Object.defineProperty(prototype, memberName, {
|
|
2274
2719
|
value(...args) {
|
|
2275
2720
|
var _a2;
|
|
@@ -2282,7 +2727,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2282
2727
|
});
|
|
2283
2728
|
}
|
|
2284
2729
|
});
|
|
2285
|
-
if (
|
|
2730
|
+
if (import_app_data14.BUILD.observeAttribute && (!import_app_data14.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2286
2731
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2287
2732
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2288
2733
|
plt.jmp(() => {
|
|
@@ -2298,8 +2743,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2298
2743
|
const hostRef = getHostRef(this);
|
|
2299
2744
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2300
2745
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2301
|
-
const elm =
|
|
2302
|
-
const instance =
|
|
2746
|
+
const elm = import_app_data14.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2747
|
+
const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2303
2748
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2304
2749
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2305
2750
|
if (instance[callbackName] != null) {
|
|
@@ -2322,7 +2767,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2322
2767
|
var _a2;
|
|
2323
2768
|
const attrName = m[1] || propName;
|
|
2324
2769
|
attrNameToPropName.set(attrName, propName);
|
|
2325
|
-
if (
|
|
2770
|
+
if (import_app_data14.BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2326
2771
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2327
2772
|
}
|
|
2328
2773
|
return attrName;
|
|
@@ -2340,7 +2785,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2340
2785
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2341
2786
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2342
2787
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2343
|
-
if ((
|
|
2788
|
+
if ((import_app_data15.BUILD.lazyLoad || import_app_data15.BUILD.hydrateClientSide) && bundleId) {
|
|
2344
2789
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2345
2790
|
if (CstrImport && "then" in CstrImport) {
|
|
2346
2791
|
const endLoad = uniqueTime(
|
|
@@ -2355,442 +2800,174 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2355
2800
|
if (!Cstr) {
|
|
2356
2801
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2357
2802
|
}
|
|
2358
|
-
if (
|
|
2359
|
-
if (
|
|
2803
|
+
if (import_app_data15.BUILD.member && !Cstr.isProxied) {
|
|
2804
|
+
if (import_app_data15.BUILD.watchCallback) {
|
|
2360
2805
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2361
2806
|
}
|
|
2362
2807
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2363
2808
|
Cstr.isProxied = true;
|
|
2364
2809
|
}
|
|
2365
2810
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2366
|
-
if (
|
|
2367
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2368
|
-
}
|
|
2369
|
-
try {
|
|
2370
|
-
new Cstr(hostRef);
|
|
2371
|
-
} catch (e) {
|
|
2372
|
-
consoleError(e);
|
|
2373
|
-
}
|
|
2374
|
-
if (import_app_data14.BUILD.member) {
|
|
2375
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2376
|
-
}
|
|
2377
|
-
if (import_app_data14.BUILD.watchCallback) {
|
|
2378
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2379
|
-
}
|
|
2380
|
-
endNewInstance();
|
|
2381
|
-
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2382
|
-
} else {
|
|
2383
|
-
Cstr = elm.constructor;
|
|
2384
|
-
const cmpTag = elm.localName;
|
|
2385
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2386
|
-
}
|
|
2387
|
-
if (import_app_data14.BUILD.style && Cstr && Cstr.style) {
|
|
2388
|
-
let style;
|
|
2389
|
-
if (typeof Cstr.style === "string") {
|
|
2390
|
-
style = Cstr.style;
|
|
2391
|
-
} else if (import_app_data14.BUILD.mode && typeof Cstr.style !== "string") {
|
|
2392
|
-
hostRef.$modeName$ = computeMode(elm);
|
|
2393
|
-
if (hostRef.$modeName$) {
|
|
2394
|
-
style = Cstr.style[hostRef.$modeName$];
|
|
2395
|
-
}
|
|
2396
|
-
if (import_app_data14.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2397
|
-
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2401
|
-
if (!styles.has(scopeId2)) {
|
|
2402
|
-
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2403
|
-
if (!import_app_data14.BUILD.hydrateServerSide && import_app_data14.BUILD.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2404
|
-
import_app_data14.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2405
|
-
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2406
|
-
}
|
|
2407
|
-
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
2408
|
-
endRegisterStyles();
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2413
|
-
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2414
|
-
if (import_app_data14.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2415
|
-
ancestorComponent["s-rc"].push(schedule);
|
|
2416
|
-
} else {
|
|
2417
|
-
schedule();
|
|
2418
|
-
}
|
|
2419
|
-
};
|
|
2420
|
-
var fireConnectedCallback = (instance) => {
|
|
2421
|
-
if (import_app_data14.BUILD.lazyLoad && import_app_data14.BUILD.connectedCallback) {
|
|
2422
|
-
safeCall(instance, "connectedCallback");
|
|
2423
|
-
}
|
|
2424
|
-
};
|
|
2425
|
-
|
|
2426
|
-
// src/runtime/connected-callback.ts
|
|
2427
|
-
var connectedCallback = (elm) => {
|
|
2428
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2429
|
-
const hostRef = getHostRef(elm);
|
|
2430
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
2431
|
-
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2432
|
-
if (import_app_data15.BUILD.hostListenerTargetParent) {
|
|
2433
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2434
|
-
}
|
|
2435
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2436
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2437
|
-
let hostId;
|
|
2438
|
-
if (import_app_data15.BUILD.hydrateClientSide) {
|
|
2439
|
-
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2440
|
-
if (hostId) {
|
|
2441
|
-
if (import_app_data15.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2442
|
-
const scopeId2 = import_app_data15.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2443
|
-
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2444
|
-
}
|
|
2445
|
-
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
if (import_app_data15.BUILD.slotRelocation && !hostId) {
|
|
2449
|
-
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
|
|
2450
|
-
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2451
|
-
setContentReference(elm);
|
|
2452
|
-
}
|
|
2453
|
-
}
|
|
2454
|
-
if (import_app_data15.BUILD.asyncLoading) {
|
|
2455
|
-
let ancestorComponent = elm;
|
|
2456
|
-
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2457
|
-
if (import_app_data15.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2458
|
-
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2459
|
-
break;
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
if (import_app_data15.BUILD.prop && !import_app_data15.BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
2464
|
-
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2465
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2466
|
-
const value = elm[memberName];
|
|
2467
|
-
delete elm[memberName];
|
|
2468
|
-
elm[memberName] = value;
|
|
2469
|
-
}
|
|
2470
|
-
});
|
|
2471
|
-
}
|
|
2472
|
-
if (import_app_data15.BUILD.initializeNextTick) {
|
|
2473
|
-
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2474
|
-
} else {
|
|
2475
|
-
initializeComponent(elm, hostRef, cmpMeta);
|
|
2476
|
-
}
|
|
2477
|
-
} else {
|
|
2478
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
2479
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2480
|
-
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2481
|
-
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2482
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
endConnected();
|
|
2486
|
-
}
|
|
2487
|
-
};
|
|
2488
|
-
var setContentReference = (elm) => {
|
|
2489
|
-
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2490
|
-
import_app_data15.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2491
|
-
);
|
|
2492
|
-
contentRefElm["s-cn"] = true;
|
|
2493
|
-
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2494
|
-
};
|
|
2495
|
-
|
|
2496
|
-
// src/runtime/disconnected-callback.ts
|
|
2497
|
-
var import_app_data16 = require("@stencil/core/internal/app-data");
|
|
2498
|
-
var disconnectInstance = (instance) => {
|
|
2499
|
-
if (import_app_data16.BUILD.lazyLoad && import_app_data16.BUILD.disconnectedCallback) {
|
|
2500
|
-
safeCall(instance, "disconnectedCallback");
|
|
2501
|
-
}
|
|
2502
|
-
if (import_app_data16.BUILD.cmpDidUnload) {
|
|
2503
|
-
safeCall(instance, "componentDidUnload");
|
|
2504
|
-
}
|
|
2505
|
-
};
|
|
2506
|
-
var disconnectedCallback = async (elm) => {
|
|
2507
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2508
|
-
const hostRef = getHostRef(elm);
|
|
2509
|
-
if (import_app_data16.BUILD.hostListener) {
|
|
2510
|
-
if (hostRef.$rmListeners$) {
|
|
2511
|
-
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2512
|
-
hostRef.$rmListeners$ = void 0;
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
if (!import_app_data16.BUILD.lazyLoad) {
|
|
2516
|
-
disconnectInstance(elm);
|
|
2517
|
-
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2518
|
-
disconnectInstance(hostRef.$lazyInstance$);
|
|
2519
|
-
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2520
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
};
|
|
2524
|
-
|
|
2525
|
-
// src/runtime/dom-extras.ts
|
|
2526
|
-
var import_app_data17 = require("@stencil/core/internal/app-data");
|
|
2527
|
-
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
2528
|
-
patchCloneNode(hostElementPrototype);
|
|
2529
|
-
patchSlotAppendChild(hostElementPrototype);
|
|
2530
|
-
patchSlotAppend(hostElementPrototype);
|
|
2531
|
-
patchSlotPrepend(hostElementPrototype);
|
|
2532
|
-
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
2533
|
-
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2534
|
-
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2535
|
-
patchTextContent(hostElementPrototype);
|
|
2536
|
-
patchChildSlotNodes(hostElementPrototype);
|
|
2537
|
-
patchSlotRemoveChild(hostElementPrototype);
|
|
2538
|
-
};
|
|
2539
|
-
var patchCloneNode = (HostElementPrototype) => {
|
|
2540
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2541
|
-
HostElementPrototype.cloneNode = function(deep) {
|
|
2542
|
-
const srcNode = this;
|
|
2543
|
-
const isShadowDom = import_app_data17.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2544
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2545
|
-
if (import_app_data17.BUILD.slot && !isShadowDom && deep) {
|
|
2546
|
-
let i2 = 0;
|
|
2547
|
-
let slotted, nonStencilNode;
|
|
2548
|
-
const stencilPrivates = [
|
|
2549
|
-
"s-id",
|
|
2550
|
-
"s-cr",
|
|
2551
|
-
"s-lr",
|
|
2552
|
-
"s-rc",
|
|
2553
|
-
"s-sc",
|
|
2554
|
-
"s-p",
|
|
2555
|
-
"s-cn",
|
|
2556
|
-
"s-sr",
|
|
2557
|
-
"s-sn",
|
|
2558
|
-
"s-hn",
|
|
2559
|
-
"s-ol",
|
|
2560
|
-
"s-nr",
|
|
2561
|
-
"s-si",
|
|
2562
|
-
"s-rf",
|
|
2563
|
-
"s-scs"
|
|
2564
|
-
];
|
|
2565
|
-
const childNodes = this.__childNodes || this.childNodes;
|
|
2566
|
-
for (; i2 < childNodes.length; i2++) {
|
|
2567
|
-
slotted = childNodes[i2]["s-nr"];
|
|
2568
|
-
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
2569
|
-
if (slotted) {
|
|
2570
|
-
if (import_app_data17.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2571
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2572
|
-
} else {
|
|
2573
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
if (nonStencilNode) {
|
|
2577
|
-
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
return clonedNode;
|
|
2582
|
-
};
|
|
2583
|
-
};
|
|
2584
|
-
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
2585
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2586
|
-
HostElementPrototype.appendChild = function(newChild) {
|
|
2587
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2588
|
-
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
|
|
2589
|
-
if (slotNode) {
|
|
2590
|
-
addSlotRelocateNode(newChild, slotNode);
|
|
2591
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2592
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2593
|
-
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2594
|
-
updateFallbackSlotVisibility(this);
|
|
2595
|
-
return insertedNode;
|
|
2596
|
-
}
|
|
2597
|
-
return this.__appendChild(newChild);
|
|
2598
|
-
};
|
|
2599
|
-
};
|
|
2600
|
-
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
2601
|
-
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2602
|
-
ElementPrototype.removeChild = function(toRemove) {
|
|
2603
|
-
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2604
|
-
const childNodes = this.__childNodes || this.childNodes;
|
|
2605
|
-
const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
|
|
2606
|
-
if (slotNode && toRemove.isConnected) {
|
|
2607
|
-
toRemove.remove();
|
|
2608
|
-
updateFallbackSlotVisibility(this);
|
|
2609
|
-
return;
|
|
2610
|
-
}
|
|
2611
|
-
}
|
|
2612
|
-
return this.__removeChild(toRemove);
|
|
2613
|
-
};
|
|
2614
|
-
};
|
|
2615
|
-
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2616
|
-
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
2617
|
-
HostElementPrototype.prepend = function(...newChildren) {
|
|
2618
|
-
newChildren.forEach((newChild) => {
|
|
2619
|
-
if (typeof newChild === "string") {
|
|
2620
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2621
|
-
}
|
|
2622
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2623
|
-
const childNodes = this.__childNodes || this.childNodes;
|
|
2624
|
-
const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
|
|
2625
|
-
if (slotNode) {
|
|
2626
|
-
addSlotRelocateNode(newChild, slotNode, true);
|
|
2627
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2628
|
-
const appendAfter = slotChildNodes[0];
|
|
2629
|
-
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2811
|
+
if (import_app_data15.BUILD.member) {
|
|
2812
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2630
2813
|
}
|
|
2631
|
-
|
|
2632
|
-
|
|
2814
|
+
try {
|
|
2815
|
+
new Cstr(hostRef);
|
|
2816
|
+
} catch (e) {
|
|
2817
|
+
consoleError(e);
|
|
2633
2818
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
};
|
|
2637
|
-
};
|
|
2638
|
-
var patchSlotAppend = (HostElementPrototype) => {
|
|
2639
|
-
HostElementPrototype.__append = HostElementPrototype.append;
|
|
2640
|
-
HostElementPrototype.append = function(...newChildren) {
|
|
2641
|
-
newChildren.forEach((newChild) => {
|
|
2642
|
-
if (typeof newChild === "string") {
|
|
2643
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2819
|
+
if (import_app_data15.BUILD.member) {
|
|
2820
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2644
2821
|
}
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2822
|
+
if (import_app_data15.BUILD.watchCallback) {
|
|
2823
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2824
|
+
}
|
|
2825
|
+
endNewInstance();
|
|
2826
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2827
|
+
} else {
|
|
2828
|
+
Cstr = elm.constructor;
|
|
2829
|
+
const cmpTag = elm.localName;
|
|
2830
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2654
2831
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2832
|
+
if (import_app_data15.BUILD.style && Cstr && Cstr.style) {
|
|
2833
|
+
let style;
|
|
2834
|
+
if (typeof Cstr.style === "string") {
|
|
2835
|
+
style = Cstr.style;
|
|
2836
|
+
} else if (import_app_data15.BUILD.mode && typeof Cstr.style !== "string") {
|
|
2837
|
+
hostRef.$modeName$ = computeMode(elm);
|
|
2838
|
+
if (hostRef.$modeName$) {
|
|
2839
|
+
style = Cstr.style[hostRef.$modeName$];
|
|
2840
|
+
}
|
|
2841
|
+
if (import_app_data15.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2842
|
+
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2843
|
+
}
|
|
2661
2844
|
}
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2845
|
+
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2846
|
+
if (!styles.has(scopeId2)) {
|
|
2847
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
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 */) {
|
|
2850
|
+
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2851
|
+
}
|
|
2852
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
2853
|
+
endRegisterStyles();
|
|
2665
2854
|
}
|
|
2666
2855
|
}
|
|
2667
|
-
};
|
|
2668
|
-
};
|
|
2669
|
-
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
2670
|
-
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
2671
|
-
this.insertAdjacentHTML(position, text);
|
|
2672
|
-
};
|
|
2673
|
-
};
|
|
2674
|
-
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
2675
|
-
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
2676
|
-
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
2677
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2678
|
-
return originalInsertAdjacentElement.call(this, position, element);
|
|
2679
|
-
}
|
|
2680
|
-
if (position === "afterbegin") {
|
|
2681
|
-
this.prepend(element);
|
|
2682
|
-
return element;
|
|
2683
|
-
} else if (position === "beforeend") {
|
|
2684
|
-
this.append(element);
|
|
2685
|
-
return element;
|
|
2686
|
-
}
|
|
2687
|
-
return element;
|
|
2688
|
-
};
|
|
2689
|
-
};
|
|
2690
|
-
var patchTextContent = (hostElementPrototype) => {
|
|
2691
|
-
let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2692
|
-
if (!descriptor) {
|
|
2693
|
-
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
2694
2856
|
}
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
return text;
|
|
2702
|
-
},
|
|
2703
|
-
set: function(value) {
|
|
2704
|
-
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2705
|
-
childNodes.forEach((node) => {
|
|
2706
|
-
if (node["s-ol"]) node["s-ol"].remove();
|
|
2707
|
-
node.remove();
|
|
2708
|
-
});
|
|
2709
|
-
this.insertAdjacentHTML("beforeend", value);
|
|
2710
|
-
}
|
|
2711
|
-
});
|
|
2712
|
-
};
|
|
2713
|
-
var patchChildSlotNodes = (elm) => {
|
|
2714
|
-
class FakeNodeList extends Array {
|
|
2715
|
-
item(n) {
|
|
2716
|
-
return this[n];
|
|
2717
|
-
}
|
|
2857
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2858
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2859
|
+
if (import_app_data15.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2860
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
2861
|
+
} else {
|
|
2862
|
+
schedule();
|
|
2718
2863
|
}
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2864
|
+
};
|
|
2865
|
+
var fireConnectedCallback = (instance) => {
|
|
2866
|
+
if (import_app_data15.BUILD.lazyLoad && import_app_data15.BUILD.connectedCallback) {
|
|
2867
|
+
safeCall(instance, "connectedCallback");
|
|
2722
2868
|
}
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2869
|
+
};
|
|
2870
|
+
|
|
2871
|
+
// src/runtime/connected-callback.ts
|
|
2872
|
+
var connectedCallback = (elm) => {
|
|
2873
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2874
|
+
const hostRef = getHostRef(elm);
|
|
2875
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2876
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2877
|
+
if (import_app_data16.BUILD.hostListenerTargetParent) {
|
|
2878
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2732
2879
|
}
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2880
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2881
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2882
|
+
let hostId;
|
|
2883
|
+
if (import_app_data16.BUILD.hydrateClientSide) {
|
|
2884
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2885
|
+
if (hostId) {
|
|
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);
|
|
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;
|
|
2892
|
+
}
|
|
2893
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
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
|
|
2898
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2899
|
+
setContentReference(elm);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
if (import_app_data16.BUILD.asyncLoading) {
|
|
2903
|
+
let ancestorComponent = elm;
|
|
2904
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2905
|
+
if (import_app_data16.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2906
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2907
|
+
break;
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
if (import_app_data16.BUILD.prop && !import_app_data16.BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
2912
|
+
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2913
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2914
|
+
const value = elm[memberName];
|
|
2915
|
+
delete elm[memberName];
|
|
2916
|
+
elm[memberName] = value;
|
|
2917
|
+
}
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
if (import_app_data16.BUILD.initializeNextTick) {
|
|
2921
|
+
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2922
|
+
} else {
|
|
2923
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
2924
|
+
}
|
|
2925
|
+
} else {
|
|
2926
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
2927
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2928
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2929
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2930
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
2743
2931
|
}
|
|
2744
|
-
return FakeNodeList.from(this.__childNodes);
|
|
2745
2932
|
}
|
|
2746
|
-
|
|
2747
|
-
};
|
|
2748
|
-
var addSlotRelocateNode = (newChild, slotNode, prepend) => {
|
|
2749
|
-
let slottedNodeLocation;
|
|
2750
|
-
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
2751
|
-
slottedNodeLocation = newChild["s-ol"];
|
|
2752
|
-
} else {
|
|
2753
|
-
slottedNodeLocation = document.createTextNode("");
|
|
2754
|
-
slottedNodeLocation["s-nr"] = newChild;
|
|
2933
|
+
endConnected();
|
|
2755
2934
|
}
|
|
2756
|
-
const parent = slotNode["s-cr"].parentNode;
|
|
2757
|
-
const appendMethod = prepend ? parent.__prepend : parent.__appendChild;
|
|
2758
|
-
newChild["s-ol"] = slottedNodeLocation;
|
|
2759
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2760
|
-
appendMethod.call(parent, slottedNodeLocation);
|
|
2761
2935
|
};
|
|
2762
|
-
var
|
|
2763
|
-
const
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2936
|
+
var setContentReference = (elm) => {
|
|
2937
|
+
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2938
|
+
import_app_data16.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2939
|
+
);
|
|
2940
|
+
contentRefElm["s-cn"] = true;
|
|
2941
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
// src/runtime/disconnected-callback.ts
|
|
2945
|
+
var import_app_data17 = require("@stencil/core/internal/app-data");
|
|
2946
|
+
var disconnectInstance = (instance) => {
|
|
2947
|
+
if (import_app_data17.BUILD.lazyLoad && import_app_data17.BUILD.disconnectedCallback) {
|
|
2948
|
+
safeCall(instance, "disconnectedCallback");
|
|
2949
|
+
}
|
|
2950
|
+
if (import_app_data17.BUILD.cmpDidUnload) {
|
|
2951
|
+
safeCall(instance, "componentDidUnload");
|
|
2769
2952
|
}
|
|
2770
|
-
return result;
|
|
2771
2953
|
};
|
|
2772
|
-
var
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2954
|
+
var disconnectedCallback = async (elm) => {
|
|
2955
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2956
|
+
const hostRef = getHostRef(elm);
|
|
2957
|
+
if (import_app_data17.BUILD.hostListener) {
|
|
2958
|
+
if (hostRef.$rmListeners$) {
|
|
2959
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2960
|
+
hostRef.$rmListeners$ = void 0;
|
|
2961
|
+
}
|
|
2780
2962
|
}
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2963
|
+
if (!import_app_data17.BUILD.lazyLoad) {
|
|
2964
|
+
disconnectInstance(elm);
|
|
2965
|
+
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2966
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
2967
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2968
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
2784
2969
|
}
|
|
2785
2970
|
}
|
|
2786
|
-
return null;
|
|
2787
|
-
};
|
|
2788
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
2789
|
-
const childNodes = [n];
|
|
2790
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
2791
|
-
childNodes.push(n);
|
|
2792
|
-
}
|
|
2793
|
-
return childNodes;
|
|
2794
2971
|
};
|
|
2795
2972
|
|
|
2796
2973
|
// src/runtime/bootstrap-custom-element.ts
|
|
@@ -3171,6 +3348,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3171
3348
|
childId = `${hostId}.${nodeId}`;
|
|
3172
3349
|
if (nodeRef.nodeType === 1 /* ElementNode */) {
|
|
3173
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
|
+
}
|
|
3174
3354
|
} else if (nodeRef.nodeType === 3 /* TextNode */) {
|
|
3175
3355
|
if (hostId === 0) {
|
|
3176
3356
|
const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
|
|
@@ -3182,6 +3362,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3182
3362
|
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3183
3363
|
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
3184
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);
|
|
3185
3369
|
}
|
|
3186
3370
|
}
|
|
3187
3371
|
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
@@ -3262,6 +3446,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3262
3446
|
childElm["s-node-id"] = nodeId;
|
|
3263
3447
|
if (childElm.nodeType === 1 /* ElementNode */) {
|
|
3264
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
|
+
}
|
|
3265
3452
|
} else if (childElm.nodeType === 3 /* TextNode */) {
|
|
3266
3453
|
const parentNode = childElm.parentNode;
|
|
3267
3454
|
const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
|