@stencil/core 4.35.3-dev.1752112116.e504206 → 4.35.3-dev.1752123834.56fe6e3

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.35.3-dev.1752112116.e504206 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.35.3-dev.1752123834.56fe6e3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.35.3-dev.1752112116.e504206 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.35.3-dev.1752123834.56fe6e3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -293,7 +293,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
293
293
  import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
294
294
 
295
295
  // src/runtime/client-hydrate.ts
296
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
296
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
297
297
 
298
298
  // src/runtime/dom-extras.ts
299
299
  import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
@@ -927,8 +927,133 @@ var installDevTools = () => {
927
927
  }
928
928
  };
929
929
 
930
- // src/runtime/vdom/h.ts
930
+ // src/runtime/styles.ts
931
931
  import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
932
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
933
+ var registerStyle = (scopeId2, cssText, allowCS) => {
934
+ let style = styles.get(scopeId2);
935
+ if (supportsConstructableStylesheets && allowCS) {
936
+ style = style || new CSSStyleSheet();
937
+ if (typeof style === "string") {
938
+ style = cssText;
939
+ } else {
940
+ style.replaceSync(cssText);
941
+ }
942
+ } else {
943
+ style = cssText;
944
+ }
945
+ styles.set(scopeId2, style);
946
+ };
947
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
948
+ var _a;
949
+ const scopeId2 = getScopeId(cmpMeta, mode);
950
+ const style = styles.get(scopeId2);
951
+ if (!BUILD6.attachStyles || !win.document) {
952
+ return scopeId2;
953
+ }
954
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
955
+ if (style) {
956
+ if (typeof style === "string") {
957
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
958
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
959
+ let styleElm;
960
+ if (!appliedStyles) {
961
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
962
+ }
963
+ if (!appliedStyles.has(scopeId2)) {
964
+ if (BUILD6.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
965
+ styleElm.innerHTML = style;
966
+ } else {
967
+ styleElm = win.document.createElement("style");
968
+ styleElm.innerHTML = style;
969
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
970
+ if (nonce != null) {
971
+ styleElm.setAttribute("nonce", nonce);
972
+ }
973
+ if ((BUILD6.hydrateServerSide || BUILD6.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
974
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
975
+ }
976
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
977
+ if (styleContainerNode.nodeName === "HEAD") {
978
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
979
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
980
+ styleContainerNode.insertBefore(
981
+ styleElm,
982
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
983
+ );
984
+ } else if ("host" in styleContainerNode) {
985
+ if (supportsConstructableStylesheets) {
986
+ const stylesheet = new CSSStyleSheet();
987
+ stylesheet.replaceSync(style);
988
+ if (supportsMutableAdoptedStyleSheets) {
989
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
990
+ } else {
991
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
992
+ }
993
+ } else {
994
+ const existingStyleContainer = styleContainerNode.querySelector("style");
995
+ if (existingStyleContainer) {
996
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
997
+ } else {
998
+ styleContainerNode.prepend(styleElm);
999
+ }
1000
+ }
1001
+ } else {
1002
+ styleContainerNode.append(styleElm);
1003
+ }
1004
+ }
1005
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1006
+ styleContainerNode.insertBefore(styleElm, null);
1007
+ }
1008
+ }
1009
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1010
+ styleElm.innerHTML += SLOT_FB_CSS;
1011
+ }
1012
+ if (appliedStyles) {
1013
+ appliedStyles.add(scopeId2);
1014
+ }
1015
+ }
1016
+ } else if (BUILD6.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1017
+ if (supportsMutableAdoptedStyleSheets) {
1018
+ styleContainerNode.adoptedStyleSheets.push(style);
1019
+ } else {
1020
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1021
+ }
1022
+ }
1023
+ }
1024
+ return scopeId2;
1025
+ };
1026
+ var attachStyles = (hostRef) => {
1027
+ const cmpMeta = hostRef.$cmpMeta$;
1028
+ const elm = hostRef.$hostElement$;
1029
+ const flags = cmpMeta.$flags$;
1030
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1031
+ const scopeId2 = addStyle(
1032
+ BUILD6.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1033
+ cmpMeta,
1034
+ hostRef.$modeName$
1035
+ );
1036
+ if ((BUILD6.shadowDom || BUILD6.scoped) && BUILD6.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1037
+ elm["s-sc"] = scopeId2;
1038
+ elm.classList.add(scopeId2 + "-h");
1039
+ }
1040
+ endAttachStyles();
1041
+ };
1042
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD6.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1043
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1044
+ var hydrateScopedToShadow = () => {
1045
+ if (!win.document) {
1046
+ return;
1047
+ }
1048
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1049
+ let i2 = 0;
1050
+ for (; i2 < styles2.length; i2++) {
1051
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1052
+ }
1053
+ };
1054
+
1055
+ // src/runtime/vdom/h.ts
1056
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
932
1057
  var h = (nodeName, vnodeData, ...children) => {
933
1058
  let child = null;
934
1059
  let key = null;
@@ -944,7 +1069,7 @@ var h = (nodeName, vnodeData, ...children) => {
944
1069
  } else if (child != null && typeof child !== "boolean") {
945
1070
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
946
1071
  child = String(child);
947
- } else if (BUILD6.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1072
+ } else if (BUILD7.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
948
1073
  consoleDevError(`vNode passed as children has unexpected type.
949
1074
  Make sure it's using the correct h() function.
950
1075
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -960,28 +1085,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
960
1085
  };
961
1086
  walk(children);
962
1087
  if (vnodeData) {
963
- if (BUILD6.isDev && nodeName === "input") {
1088
+ if (BUILD7.isDev && nodeName === "input") {
964
1089
  validateInputProperties(vnodeData);
965
1090
  }
966
- if (BUILD6.vdomKey && vnodeData.key) {
1091
+ if (BUILD7.vdomKey && vnodeData.key) {
967
1092
  key = vnodeData.key;
968
1093
  }
969
- if (BUILD6.slotRelocation && vnodeData.name) {
1094
+ if (BUILD7.slotRelocation && vnodeData.name) {
970
1095
  slotName = vnodeData.name;
971
1096
  }
972
- if (BUILD6.vdomClass) {
1097
+ if (BUILD7.vdomClass) {
973
1098
  const classData = vnodeData.className || vnodeData.class;
974
1099
  if (classData) {
975
1100
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
976
1101
  }
977
1102
  }
978
1103
  }
979
- if (BUILD6.isDev && vNodeChildren.some(isHost)) {
1104
+ if (BUILD7.isDev && vNodeChildren.some(isHost)) {
980
1105
  consoleDevError(`The <Host> must be the single root component. Make sure:
981
1106
  - You are NOT using hostData() and <Host> in the same component.
982
1107
  - <Host> is used once, and it's the single root component of the render() function.`);
983
1108
  }
984
- if (BUILD6.vdomFunctional && typeof nodeName === "function") {
1109
+ if (BUILD7.vdomFunctional && typeof nodeName === "function") {
985
1110
  return nodeName(
986
1111
  vnodeData === null ? {} : vnodeData,
987
1112
  vNodeChildren,
@@ -993,10 +1118,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
993
1118
  if (vNodeChildren.length > 0) {
994
1119
  vnode.$children$ = vNodeChildren;
995
1120
  }
996
- if (BUILD6.vdomKey) {
1121
+ if (BUILD7.vdomKey) {
997
1122
  vnode.$key$ = key;
998
1123
  }
999
- if (BUILD6.slotRelocation) {
1124
+ if (BUILD7.slotRelocation) {
1000
1125
  vnode.$name$ = slotName;
1001
1126
  }
1002
1127
  return vnode;
@@ -1009,13 +1134,13 @@ var newVNode = (tag, text) => {
1009
1134
  $elm$: null,
1010
1135
  $children$: null
1011
1136
  };
1012
- if (BUILD6.vdomAttribute) {
1137
+ if (BUILD7.vdomAttribute) {
1013
1138
  vnode.$attrs$ = null;
1014
1139
  }
1015
- if (BUILD6.vdomKey) {
1140
+ if (BUILD7.vdomKey) {
1016
1141
  vnode.$key$ = null;
1017
1142
  }
1018
- if (BUILD6.slotRelocation) {
1143
+ if (BUILD7.slotRelocation) {
1019
1144
  vnode.$name$ = null;
1020
1145
  }
1021
1146
  return vnode;
@@ -1069,18 +1194,18 @@ var validateInputProperties = (inputElm) => {
1069
1194
 
1070
1195
  // src/runtime/client-hydrate.ts
1071
1196
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1072
- var _a;
1197
+ var _a, _b;
1073
1198
  const endHydrate = createTime("hydrateClient", tagName);
1074
1199
  const shadowRoot = hostElm.shadowRoot;
1075
1200
  const childRenderNodes = [];
1076
1201
  const slotNodes = [];
1077
1202
  const slottedNodes = [];
1078
- const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1203
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1079
1204
  const vnode = newVNode(tagName, null);
1080
1205
  vnode.$elm$ = hostElm;
1081
1206
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1082
1207
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1083
- var _a2, _b;
1208
+ var _a2, _b2;
1084
1209
  if (!(memberFlags & 31 /* Prop */)) {
1085
1210
  return;
1086
1211
  }
@@ -1090,13 +1215,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1090
1215
  const attrPropVal = parsePropertyValue(
1091
1216
  attrVal,
1092
1217
  memberFlags,
1093
- BUILD7.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1218
+ BUILD8.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1094
1219
  );
1095
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1220
+ (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1096
1221
  }
1097
1222
  });
1098
1223
  let scopeId2;
1099
- if (BUILD7.scoped) {
1224
+ if (BUILD8.scoped) {
1100
1225
  const cmpMeta = hostRef.$cmpMeta$;
1101
1226
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1102
1227
  scopeId2 = hostElm["s-sc"];
@@ -1133,6 +1258,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1133
1258
  if (childRenderNode.$tag$ === "slot") {
1134
1259
  node["s-cr"] = hostElm["s-cr"];
1135
1260
  }
1261
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1262
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1263
+ const scopeId3 = getScopeId(
1264
+ cmpMeta.$cmpMeta$,
1265
+ BUILD8.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1266
+ );
1267
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1268
+ if (styleSheet) {
1269
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1270
+ }
1136
1271
  }
1137
1272
  if (childRenderNode.$tag$ === "slot") {
1138
1273
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1148,7 +1283,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1148
1283
  }
1149
1284
  }
1150
1285
  if (orgLocationNode && orgLocationNode.isConnected) {
1151
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1286
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1152
1287
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1153
1288
  }
1154
1289
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1156,7 +1291,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1156
1291
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1157
1292
  }
1158
1293
  }
1159
- plt.$orgLocNodes$.delete(orgLocationId);
1294
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1295
+ plt.$orgLocNodes$.delete(orgLocationId);
1296
+ }
1160
1297
  }
1161
1298
  const hosts = [];
1162
1299
  const snLen = slottedNodes.length;
@@ -1178,14 +1315,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1178
1315
  if (!hosts[slottedItem.hostId]) continue;
1179
1316
  const hostEle = hosts[slottedItem.hostId];
1180
1317
  if (!hostEle.shadowRoot || !shadowRoot) {
1181
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1182
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1183
- slottedItem.slot["s-cr"] = hostEle;
1184
- } else {
1185
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1318
+ if (!slottedItem.slot["s-cr"]) {
1319
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1320
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1321
+ slottedItem.slot["s-cr"] = hostEle;
1322
+ } else {
1323
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1324
+ }
1186
1325
  }
1187
1326
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1188
- if (BUILD7.experimentalSlotFixes) {
1327
+ if (BUILD8.experimentalSlotFixes) {
1189
1328
  patchSlottedNode(slottedItem.node);
1190
1329
  }
1191
1330
  }
@@ -1194,12 +1333,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1194
1333
  }
1195
1334
  }
1196
1335
  }
1197
- if (BUILD7.scoped && scopeId2 && slotNodes.length) {
1336
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1198
1337
  slotNodes.forEach((slot) => {
1199
1338
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1200
1339
  });
1201
1340
  }
1202
- if (BUILD7.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1341
+ if (BUILD8.shadowDom && shadowRoot) {
1203
1342
  let rnIdex = 0;
1204
1343
  const rnLen = shadowRootNodes.length;
1205
1344
  if (rnLen) {
@@ -1210,14 +1349,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1210
1349
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1211
1350
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1212
1351
  node.removeAttribute("hidden");
1213
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1352
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1214
1353
  node.parentNode.removeChild(node);
1215
1354
  }
1216
1355
  }
1217
1356
  });
1218
1357
  }
1219
1358
  }
1220
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1221
1359
  hostRef.$hostElement$ = hostElm;
1222
1360
  endHydrate();
1223
1361
  };
@@ -1249,7 +1387,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1249
1387
  if (!parentVNode.$children$) {
1250
1388
  parentVNode.$children$ = [];
1251
1389
  }
1252
- if (BUILD7.scoped && scopeId2) {
1390
+ if (BUILD8.scoped && scopeId2 && childIdSplt[0] === hostId) {
1253
1391
  node["s-si"] = scopeId2;
1254
1392
  childVNode.$attrs$.class += " " + scopeId2;
1255
1393
  }
@@ -1267,7 +1405,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1267
1405
  shadowRootNodes,
1268
1406
  slottedNodes
1269
1407
  );
1270
- if (BUILD7.scoped && scopeId2) {
1408
+ if (BUILD8.scoped && scopeId2) {
1271
1409
  node.classList.add(scopeId2);
1272
1410
  }
1273
1411
  }
@@ -1364,9 +1502,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1364
1502
  slottedNodes
1365
1503
  );
1366
1504
  } else if (childNodeType === CONTENT_REF_ID) {
1367
- if (BUILD7.shadowDom && shadowRootNodes) {
1505
+ if (BUILD8.shadowDom && shadowRootNodes) {
1368
1506
  node.remove();
1369
- } else if (BUILD7.slotRelocation) {
1507
+ } else if (BUILD8.slotRelocation) {
1370
1508
  hostElm["s-cr"] = node;
1371
1509
  node["s-cn"] = true;
1372
1510
  }
@@ -1379,7 +1517,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1379
1517
  vnode.$index$ = "0";
1380
1518
  parentVNode.$children$ = [vnode];
1381
1519
  } else {
1382
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1520
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1383
1521
  node.remove();
1384
1522
  }
1385
1523
  }
@@ -1432,15 +1570,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1432
1570
  childVNode.$name$ = slotName || null;
1433
1571
  childVNode.$tag$ = "slot";
1434
1572
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1435
- if (BUILD7.shadowDom && shadowRootNodes && win.document) {
1573
+ if (BUILD8.shadowDom && shadowRootNodes && win.document) {
1436
1574
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1437
1575
  if (childVNode.$name$) {
1438
1576
  childVNode.$elm$.setAttribute("name", slotName);
1439
1577
  }
1440
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1441
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1578
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1579
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1442
1580
  } else {
1443
- node.parentNode.insertBefore(slot, node);
1581
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1444
1582
  }
1445
1583
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1446
1584
  node.remove();
@@ -1466,7 +1604,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1466
1604
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1467
1605
  let slottedNode = slotNode.nextSibling;
1468
1606
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1469
- 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 */))) {
1607
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */ || slottedNode.tagName === "SLOT"))) {
1470
1608
  slottedNode["s-sn"] = slotName;
1471
1609
  slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1472
1610
  slottedNode = slottedNode.nextSibling;
@@ -1901,31 +2039,31 @@ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
1901
2039
  import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
1902
2040
 
1903
2041
  // src/runtime/parse-property-value.ts
1904
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
2042
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1905
2043
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1906
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2044
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
1907
2045
  try {
1908
2046
  propValue = JSON.parse(propValue);
1909
2047
  return propValue;
1910
2048
  } catch (e) {
1911
2049
  }
1912
2050
  }
1913
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2051
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1914
2052
  propValue = deserializeProperty(propValue);
1915
2053
  return propValue;
1916
2054
  }
1917
2055
  if (propValue != null && !isComplexType(propValue)) {
1918
- if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1919
- if (BUILD8.formAssociated && isFormAssociated && typeof propValue === "string") {
2056
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
2057
+ if (BUILD9.formAssociated && isFormAssociated && typeof propValue === "string") {
1920
2058
  return propValue === "" || !!propValue;
1921
2059
  } else {
1922
2060
  return propValue === "false" ? false : propValue === "" || !!propValue;
1923
2061
  }
1924
2062
  }
1925
- if (BUILD8.propNumber && propType & 2 /* Number */) {
2063
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1926
2064
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1927
2065
  }
1928
- if (BUILD8.propString && propType & 1 /* String */) {
2066
+ if (BUILD9.propString && propType & 1 /* String */) {
1929
2067
  return String(propValue);
1930
2068
  }
1931
2069
  return propValue;
@@ -1937,18 +2075,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1937
2075
  import { BUILD as BUILD15, NAMESPACE } from "@stencil/core/internal/app-data";
1938
2076
 
1939
2077
  // src/runtime/event-emitter.ts
1940
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2078
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1941
2079
 
1942
2080
  // src/runtime/element.ts
1943
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1944
- var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2081
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2082
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1945
2083
 
1946
2084
  // src/runtime/event-emitter.ts
1947
2085
  var createEvent = (ref, name, flags) => {
1948
2086
  const elm = getElement(ref);
1949
2087
  return {
1950
2088
  emit: (detail) => {
1951
- if (BUILD10.isDev && !elm.isConnected) {
2089
+ if (BUILD11.isDev && !elm.isConnected) {
1952
2090
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1953
2091
  }
1954
2092
  return emitEvent(elm, name, {
@@ -1966,131 +2104,6 @@ var emitEvent = (elm, name, opts) => {
1966
2104
  return ev;
1967
2105
  };
1968
2106
 
1969
- // src/runtime/styles.ts
1970
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1971
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1972
- var registerStyle = (scopeId2, cssText, allowCS) => {
1973
- let style = styles.get(scopeId2);
1974
- if (supportsConstructableStylesheets && allowCS) {
1975
- style = style || new CSSStyleSheet();
1976
- if (typeof style === "string") {
1977
- style = cssText;
1978
- } else {
1979
- style.replaceSync(cssText);
1980
- }
1981
- } else {
1982
- style = cssText;
1983
- }
1984
- styles.set(scopeId2, style);
1985
- };
1986
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1987
- var _a;
1988
- const scopeId2 = getScopeId(cmpMeta, mode);
1989
- const style = styles.get(scopeId2);
1990
- if (!BUILD11.attachStyles || !win.document) {
1991
- return scopeId2;
1992
- }
1993
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1994
- if (style) {
1995
- if (typeof style === "string") {
1996
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1997
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1998
- let styleElm;
1999
- if (!appliedStyles) {
2000
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2001
- }
2002
- if (!appliedStyles.has(scopeId2)) {
2003
- if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2004
- styleElm.innerHTML = style;
2005
- } else {
2006
- styleElm = win.document.createElement("style");
2007
- styleElm.innerHTML = style;
2008
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2009
- if (nonce != null) {
2010
- styleElm.setAttribute("nonce", nonce);
2011
- }
2012
- if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2013
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2014
- }
2015
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2016
- if (styleContainerNode.nodeName === "HEAD") {
2017
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2018
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2019
- styleContainerNode.insertBefore(
2020
- styleElm,
2021
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2022
- );
2023
- } else if ("host" in styleContainerNode) {
2024
- if (supportsConstructableStylesheets) {
2025
- const stylesheet = new CSSStyleSheet();
2026
- stylesheet.replaceSync(style);
2027
- if (supportsMutableAdoptedStyleSheets) {
2028
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
2029
- } else {
2030
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2031
- }
2032
- } else {
2033
- const existingStyleContainer = styleContainerNode.querySelector("style");
2034
- if (existingStyleContainer) {
2035
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2036
- } else {
2037
- styleContainerNode.prepend(styleElm);
2038
- }
2039
- }
2040
- } else {
2041
- styleContainerNode.append(styleElm);
2042
- }
2043
- }
2044
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2045
- styleContainerNode.insertBefore(styleElm, null);
2046
- }
2047
- }
2048
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2049
- styleElm.innerHTML += SLOT_FB_CSS;
2050
- }
2051
- if (appliedStyles) {
2052
- appliedStyles.add(scopeId2);
2053
- }
2054
- }
2055
- } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2056
- if (supportsMutableAdoptedStyleSheets) {
2057
- styleContainerNode.adoptedStyleSheets.push(style);
2058
- } else {
2059
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2060
- }
2061
- }
2062
- }
2063
- return scopeId2;
2064
- };
2065
- var attachStyles = (hostRef) => {
2066
- const cmpMeta = hostRef.$cmpMeta$;
2067
- const elm = hostRef.$hostElement$;
2068
- const flags = cmpMeta.$flags$;
2069
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2070
- const scopeId2 = addStyle(
2071
- BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2072
- cmpMeta,
2073
- hostRef.$modeName$
2074
- );
2075
- if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2076
- elm["s-sc"] = scopeId2;
2077
- elm.classList.add(scopeId2 + "-h");
2078
- }
2079
- endAttachStyles();
2080
- };
2081
- var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2082
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2083
- var hydrateScopedToShadow = () => {
2084
- if (!win.document) {
2085
- return;
2086
- }
2087
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2088
- let i2 = 0;
2089
- for (; i2 < styles2.length; i2++) {
2090
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2091
- }
2092
- };
2093
-
2094
2107
  // src/runtime/vdom/vdom-render.ts
2095
2108
  import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2096
2109
 
@@ -2109,12 +2122,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2109
2122
  const classList = elm.classList;
2110
2123
  const oldClasses = parseClassList(oldValue);
2111
2124
  let newClasses = parseClassList(newValue);
2112
- if (BUILD12.hydrateClientSide && elm["s-si"] && initialRender) {
2113
- newClasses.push(elm["s-si"]);
2125
+ if (BUILD12.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2126
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2127
+ newClasses.push(scopeId2);
2114
2128
  oldClasses.forEach((c) => {
2115
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2129
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2116
2130
  });
2117
- newClasses = [...new Set(newClasses)];
2131
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2118
2132
  classList.add(...newClasses);
2119
2133
  } else {
2120
2134
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2596,6 +2610,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2596
2610
  !isInitialRender && BUILD14.updatable && oldChildren !== null
2597
2611
  ) {
2598
2612
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2613
+ } else if (BUILD14.hydrateClientSide && isInitialRender && BUILD14.updatable && oldChildren !== null && newChildren === null) {
2614
+ newVNode2.$children$ = oldChildren;
2599
2615
  }
2600
2616
  if (BUILD14.svg && isSvgMode && tag === "svg") {
2601
2617
  isSvgMode = false;
@@ -3063,10 +3079,16 @@ var forceUpdate = (ref) => {
3063
3079
  return false;
3064
3080
  };
3065
3081
  var appDidLoad = (who) => {
3082
+ var _a;
3066
3083
  if (BUILD15.asyncQueue) {
3067
3084
  plt.$flags$ |= 2 /* appLoaded */;
3068
3085
  }
3069
3086
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3087
+ if (BUILD15.hydrateClientSide) {
3088
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3089
+ plt.$orgLocNodes$.clear();
3090
+ }
3091
+ }
3070
3092
  if (BUILD15.profile && performance.measure) {
3071
3093
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3072
3094
  }
@@ -3498,6 +3520,11 @@ var connectedCallback = (elm) => {
3498
3520
  if (BUILD19.hydrateServerSide || (BUILD19.slot || BUILD19.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3499
3521
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3500
3522
  setContentReference(elm);
3523
+ } else if (BUILD19.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3524
+ const commendPlaceholder = elm.firstChild;
3525
+ if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3526
+ elm.removeChild(commendPlaceholder);
3527
+ }
3501
3528
  }
3502
3529
  }
3503
3530
  if (BUILD19.asyncLoading) {