@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 Platform v4.35.3-dev.1752112116.e504206 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client 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) => {
@@ -553,7 +553,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
553
553
  import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
554
554
 
555
555
  // src/runtime/client-hydrate.ts
556
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
556
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
557
557
 
558
558
  // src/runtime/dom-extras.ts
559
559
  import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
@@ -1160,8 +1160,133 @@ var installDevTools = () => {
1160
1160
  }
1161
1161
  };
1162
1162
 
1163
- // src/runtime/vdom/h.ts
1163
+ // src/runtime/styles.ts
1164
1164
  import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
1165
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1166
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1167
+ let style = styles.get(scopeId2);
1168
+ if (supportsConstructableStylesheets && allowCS) {
1169
+ style = style || new CSSStyleSheet();
1170
+ if (typeof style === "string") {
1171
+ style = cssText;
1172
+ } else {
1173
+ style.replaceSync(cssText);
1174
+ }
1175
+ } else {
1176
+ style = cssText;
1177
+ }
1178
+ styles.set(scopeId2, style);
1179
+ };
1180
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1181
+ var _a;
1182
+ const scopeId2 = getScopeId(cmpMeta, mode);
1183
+ const style = styles.get(scopeId2);
1184
+ if (!BUILD12.attachStyles || !win.document) {
1185
+ return scopeId2;
1186
+ }
1187
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1188
+ if (style) {
1189
+ if (typeof style === "string") {
1190
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1191
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1192
+ let styleElm;
1193
+ if (!appliedStyles) {
1194
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1195
+ }
1196
+ if (!appliedStyles.has(scopeId2)) {
1197
+ if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1198
+ styleElm.innerHTML = style;
1199
+ } else {
1200
+ styleElm = win.document.createElement("style");
1201
+ styleElm.innerHTML = style;
1202
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1203
+ if (nonce != null) {
1204
+ styleElm.setAttribute("nonce", nonce);
1205
+ }
1206
+ if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1207
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1208
+ }
1209
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1210
+ if (styleContainerNode.nodeName === "HEAD") {
1211
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1212
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1213
+ styleContainerNode.insertBefore(
1214
+ styleElm,
1215
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1216
+ );
1217
+ } else if ("host" in styleContainerNode) {
1218
+ if (supportsConstructableStylesheets) {
1219
+ const stylesheet = new CSSStyleSheet();
1220
+ stylesheet.replaceSync(style);
1221
+ if (supportsMutableAdoptedStyleSheets) {
1222
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1223
+ } else {
1224
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1225
+ }
1226
+ } else {
1227
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1228
+ if (existingStyleContainer) {
1229
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1230
+ } else {
1231
+ styleContainerNode.prepend(styleElm);
1232
+ }
1233
+ }
1234
+ } else {
1235
+ styleContainerNode.append(styleElm);
1236
+ }
1237
+ }
1238
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1239
+ styleContainerNode.insertBefore(styleElm, null);
1240
+ }
1241
+ }
1242
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1243
+ styleElm.innerHTML += SLOT_FB_CSS;
1244
+ }
1245
+ if (appliedStyles) {
1246
+ appliedStyles.add(scopeId2);
1247
+ }
1248
+ }
1249
+ } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1250
+ if (supportsMutableAdoptedStyleSheets) {
1251
+ styleContainerNode.adoptedStyleSheets.push(style);
1252
+ } else {
1253
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1254
+ }
1255
+ }
1256
+ }
1257
+ return scopeId2;
1258
+ };
1259
+ var attachStyles = (hostRef) => {
1260
+ const cmpMeta = hostRef.$cmpMeta$;
1261
+ const elm = hostRef.$hostElement$;
1262
+ const flags = cmpMeta.$flags$;
1263
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1264
+ const scopeId2 = addStyle(
1265
+ BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1266
+ cmpMeta,
1267
+ hostRef.$modeName$
1268
+ );
1269
+ if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1270
+ elm["s-sc"] = scopeId2;
1271
+ elm.classList.add(scopeId2 + "-h");
1272
+ }
1273
+ endAttachStyles();
1274
+ };
1275
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1276
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1277
+ var hydrateScopedToShadow = () => {
1278
+ if (!win.document) {
1279
+ return;
1280
+ }
1281
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1282
+ let i2 = 0;
1283
+ for (; i2 < styles2.length; i2++) {
1284
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1285
+ }
1286
+ };
1287
+
1288
+ // src/runtime/vdom/h.ts
1289
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
1165
1290
  var h = (nodeName, vnodeData, ...children) => {
1166
1291
  let child = null;
1167
1292
  let key = null;
@@ -1177,7 +1302,7 @@ var h = (nodeName, vnodeData, ...children) => {
1177
1302
  } else if (child != null && typeof child !== "boolean") {
1178
1303
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1179
1304
  child = String(child);
1180
- } else if (BUILD12.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1305
+ } else if (BUILD13.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1181
1306
  consoleDevError(`vNode passed as children has unexpected type.
1182
1307
  Make sure it's using the correct h() function.
1183
1308
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -1193,28 +1318,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1193
1318
  };
1194
1319
  walk(children);
1195
1320
  if (vnodeData) {
1196
- if (BUILD12.isDev && nodeName === "input") {
1321
+ if (BUILD13.isDev && nodeName === "input") {
1197
1322
  validateInputProperties(vnodeData);
1198
1323
  }
1199
- if (BUILD12.vdomKey && vnodeData.key) {
1324
+ if (BUILD13.vdomKey && vnodeData.key) {
1200
1325
  key = vnodeData.key;
1201
1326
  }
1202
- if (BUILD12.slotRelocation && vnodeData.name) {
1327
+ if (BUILD13.slotRelocation && vnodeData.name) {
1203
1328
  slotName = vnodeData.name;
1204
1329
  }
1205
- if (BUILD12.vdomClass) {
1330
+ if (BUILD13.vdomClass) {
1206
1331
  const classData = vnodeData.className || vnodeData.class;
1207
1332
  if (classData) {
1208
1333
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1209
1334
  }
1210
1335
  }
1211
1336
  }
1212
- if (BUILD12.isDev && vNodeChildren.some(isHost)) {
1337
+ if (BUILD13.isDev && vNodeChildren.some(isHost)) {
1213
1338
  consoleDevError(`The <Host> must be the single root component. Make sure:
1214
1339
  - You are NOT using hostData() and <Host> in the same component.
1215
1340
  - <Host> is used once, and it's the single root component of the render() function.`);
1216
1341
  }
1217
- if (BUILD12.vdomFunctional && typeof nodeName === "function") {
1342
+ if (BUILD13.vdomFunctional && typeof nodeName === "function") {
1218
1343
  return nodeName(
1219
1344
  vnodeData === null ? {} : vnodeData,
1220
1345
  vNodeChildren,
@@ -1226,10 +1351,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1226
1351
  if (vNodeChildren.length > 0) {
1227
1352
  vnode.$children$ = vNodeChildren;
1228
1353
  }
1229
- if (BUILD12.vdomKey) {
1354
+ if (BUILD13.vdomKey) {
1230
1355
  vnode.$key$ = key;
1231
1356
  }
1232
- if (BUILD12.slotRelocation) {
1357
+ if (BUILD13.slotRelocation) {
1233
1358
  vnode.$name$ = slotName;
1234
1359
  }
1235
1360
  return vnode;
@@ -1242,13 +1367,13 @@ var newVNode = (tag, text) => {
1242
1367
  $elm$: null,
1243
1368
  $children$: null
1244
1369
  };
1245
- if (BUILD12.vdomAttribute) {
1370
+ if (BUILD13.vdomAttribute) {
1246
1371
  vnode.$attrs$ = null;
1247
1372
  }
1248
- if (BUILD12.vdomKey) {
1373
+ if (BUILD13.vdomKey) {
1249
1374
  vnode.$key$ = null;
1250
1375
  }
1251
- if (BUILD12.slotRelocation) {
1376
+ if (BUILD13.slotRelocation) {
1252
1377
  vnode.$name$ = null;
1253
1378
  }
1254
1379
  return vnode;
@@ -1302,18 +1427,18 @@ var validateInputProperties = (inputElm) => {
1302
1427
 
1303
1428
  // src/runtime/client-hydrate.ts
1304
1429
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1305
- var _a;
1430
+ var _a, _b;
1306
1431
  const endHydrate = createTime("hydrateClient", tagName);
1307
1432
  const shadowRoot = hostElm.shadowRoot;
1308
1433
  const childRenderNodes = [];
1309
1434
  const slotNodes = [];
1310
1435
  const slottedNodes = [];
1311
- const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
1436
+ const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
1312
1437
  const vnode = newVNode(tagName, null);
1313
1438
  vnode.$elm$ = hostElm;
1314
1439
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1315
1440
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1316
- var _a2, _b;
1441
+ var _a2, _b2;
1317
1442
  if (!(memberFlags & 31 /* Prop */)) {
1318
1443
  return;
1319
1444
  }
@@ -1323,13 +1448,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1323
1448
  const attrPropVal = parsePropertyValue(
1324
1449
  attrVal,
1325
1450
  memberFlags,
1326
- BUILD13.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1451
+ BUILD14.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1327
1452
  );
1328
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1453
+ (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1329
1454
  }
1330
1455
  });
1331
1456
  let scopeId2;
1332
- if (BUILD13.scoped) {
1457
+ if (BUILD14.scoped) {
1333
1458
  const cmpMeta = hostRef.$cmpMeta$;
1334
1459
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1335
1460
  scopeId2 = hostElm["s-sc"];
@@ -1366,6 +1491,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1366
1491
  if (childRenderNode.$tag$ === "slot") {
1367
1492
  node["s-cr"] = hostElm["s-cr"];
1368
1493
  }
1494
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1495
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1496
+ const scopeId3 = getScopeId(
1497
+ cmpMeta.$cmpMeta$,
1498
+ BUILD14.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1499
+ );
1500
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1501
+ if (styleSheet) {
1502
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1503
+ }
1369
1504
  }
1370
1505
  if (childRenderNode.$tag$ === "slot") {
1371
1506
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1381,7 +1516,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1381
1516
  }
1382
1517
  }
1383
1518
  if (orgLocationNode && orgLocationNode.isConnected) {
1384
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1519
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1385
1520
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1386
1521
  }
1387
1522
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1389,7 +1524,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1389
1524
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1390
1525
  }
1391
1526
  }
1392
- plt.$orgLocNodes$.delete(orgLocationId);
1527
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1528
+ plt.$orgLocNodes$.delete(orgLocationId);
1529
+ }
1393
1530
  }
1394
1531
  const hosts = [];
1395
1532
  const snLen = slottedNodes.length;
@@ -1411,14 +1548,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1411
1548
  if (!hosts[slottedItem.hostId]) continue;
1412
1549
  const hostEle = hosts[slottedItem.hostId];
1413
1550
  if (!hostEle.shadowRoot || !shadowRoot) {
1414
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1415
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1416
- slottedItem.slot["s-cr"] = hostEle;
1417
- } else {
1418
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1551
+ if (!slottedItem.slot["s-cr"]) {
1552
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1553
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1554
+ slottedItem.slot["s-cr"] = hostEle;
1555
+ } else {
1556
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1557
+ }
1419
1558
  }
1420
1559
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1421
- if (BUILD13.experimentalSlotFixes) {
1560
+ if (BUILD14.experimentalSlotFixes) {
1422
1561
  patchSlottedNode(slottedItem.node);
1423
1562
  }
1424
1563
  }
@@ -1427,12 +1566,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1427
1566
  }
1428
1567
  }
1429
1568
  }
1430
- if (BUILD13.scoped && scopeId2 && slotNodes.length) {
1569
+ if (BUILD14.scoped && scopeId2 && slotNodes.length) {
1431
1570
  slotNodes.forEach((slot) => {
1432
1571
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1433
1572
  });
1434
1573
  }
1435
- if (BUILD13.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1574
+ if (BUILD14.shadowDom && shadowRoot) {
1436
1575
  let rnIdex = 0;
1437
1576
  const rnLen = shadowRootNodes.length;
1438
1577
  if (rnLen) {
@@ -1443,14 +1582,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1443
1582
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1444
1583
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1445
1584
  node.removeAttribute("hidden");
1446
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1585
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1447
1586
  node.parentNode.removeChild(node);
1448
1587
  }
1449
1588
  }
1450
1589
  });
1451
1590
  }
1452
1591
  }
1453
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1454
1592
  hostRef.$hostElement$ = hostElm;
1455
1593
  endHydrate();
1456
1594
  };
@@ -1482,7 +1620,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1482
1620
  if (!parentVNode.$children$) {
1483
1621
  parentVNode.$children$ = [];
1484
1622
  }
1485
- if (BUILD13.scoped && scopeId2) {
1623
+ if (BUILD14.scoped && scopeId2 && childIdSplt[0] === hostId) {
1486
1624
  node["s-si"] = scopeId2;
1487
1625
  childVNode.$attrs$.class += " " + scopeId2;
1488
1626
  }
@@ -1500,7 +1638,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1500
1638
  shadowRootNodes,
1501
1639
  slottedNodes
1502
1640
  );
1503
- if (BUILD13.scoped && scopeId2) {
1641
+ if (BUILD14.scoped && scopeId2) {
1504
1642
  node.classList.add(scopeId2);
1505
1643
  }
1506
1644
  }
@@ -1597,9 +1735,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1597
1735
  slottedNodes
1598
1736
  );
1599
1737
  } else if (childNodeType === CONTENT_REF_ID) {
1600
- if (BUILD13.shadowDom && shadowRootNodes) {
1738
+ if (BUILD14.shadowDom && shadowRootNodes) {
1601
1739
  node.remove();
1602
- } else if (BUILD13.slotRelocation) {
1740
+ } else if (BUILD14.slotRelocation) {
1603
1741
  hostElm["s-cr"] = node;
1604
1742
  node["s-cn"] = true;
1605
1743
  }
@@ -1612,7 +1750,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1612
1750
  vnode.$index$ = "0";
1613
1751
  parentVNode.$children$ = [vnode];
1614
1752
  } else {
1615
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1753
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1616
1754
  node.remove();
1617
1755
  }
1618
1756
  }
@@ -1665,15 +1803,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1665
1803
  childVNode.$name$ = slotName || null;
1666
1804
  childVNode.$tag$ = "slot";
1667
1805
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1668
- if (BUILD13.shadowDom && shadowRootNodes && win.document) {
1806
+ if (BUILD14.shadowDom && shadowRootNodes && win.document) {
1669
1807
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1670
1808
  if (childVNode.$name$) {
1671
1809
  childVNode.$elm$.setAttribute("name", slotName);
1672
1810
  }
1673
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1674
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1811
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1812
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1675
1813
  } else {
1676
- node.parentNode.insertBefore(slot, node);
1814
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1677
1815
  }
1678
1816
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1679
1817
  node.remove();
@@ -1699,7 +1837,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1699
1837
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1700
1838
  let slottedNode = slotNode.nextSibling;
1701
1839
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1702
- 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 */))) {
1840
+ 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"))) {
1703
1841
  slottedNode["s-sn"] = slotName;
1704
1842
  slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1705
1843
  slottedNode = slottedNode.nextSibling;
@@ -2134,31 +2272,31 @@ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2134
2272
  import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
2135
2273
 
2136
2274
  // src/runtime/parse-property-value.ts
2137
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2275
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2138
2276
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2139
- if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2277
+ if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2140
2278
  try {
2141
2279
  propValue = JSON.parse(propValue);
2142
2280
  return propValue;
2143
2281
  } catch (e) {
2144
2282
  }
2145
2283
  }
2146
- if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2284
+ if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2147
2285
  propValue = deserializeProperty(propValue);
2148
2286
  return propValue;
2149
2287
  }
2150
2288
  if (propValue != null && !isComplexType(propValue)) {
2151
- if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
2152
- if (BUILD14.formAssociated && isFormAssociated && typeof propValue === "string") {
2289
+ if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
2290
+ if (BUILD15.formAssociated && isFormAssociated && typeof propValue === "string") {
2153
2291
  return propValue === "" || !!propValue;
2154
2292
  } else {
2155
2293
  return propValue === "false" ? false : propValue === "" || !!propValue;
2156
2294
  }
2157
2295
  }
2158
- if (BUILD14.propNumber && propType & 2 /* Number */) {
2296
+ if (BUILD15.propNumber && propType & 2 /* Number */) {
2159
2297
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2160
2298
  }
2161
- if (BUILD14.propString && propType & 1 /* String */) {
2299
+ if (BUILD15.propString && propType & 1 /* String */) {
2162
2300
  return String(propValue);
2163
2301
  }
2164
2302
  return propValue;
@@ -2170,18 +2308,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2170
2308
  import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
2171
2309
 
2172
2310
  // src/runtime/event-emitter.ts
2173
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2311
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2174
2312
 
2175
2313
  // src/runtime/element.ts
2176
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2177
- var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2314
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2315
+ var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2178
2316
 
2179
2317
  // src/runtime/event-emitter.ts
2180
2318
  var createEvent = (ref, name, flags) => {
2181
2319
  const elm = getElement(ref);
2182
2320
  return {
2183
2321
  emit: (detail) => {
2184
- if (BUILD16.isDev && !elm.isConnected) {
2322
+ if (BUILD17.isDev && !elm.isConnected) {
2185
2323
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2186
2324
  }
2187
2325
  return emitEvent(elm, name, {
@@ -2199,131 +2337,6 @@ var emitEvent = (elm, name, opts) => {
2199
2337
  return ev;
2200
2338
  };
2201
2339
 
2202
- // src/runtime/styles.ts
2203
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2204
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2205
- var registerStyle = (scopeId2, cssText, allowCS) => {
2206
- let style = styles.get(scopeId2);
2207
- if (supportsConstructableStylesheets && allowCS) {
2208
- style = style || new CSSStyleSheet();
2209
- if (typeof style === "string") {
2210
- style = cssText;
2211
- } else {
2212
- style.replaceSync(cssText);
2213
- }
2214
- } else {
2215
- style = cssText;
2216
- }
2217
- styles.set(scopeId2, style);
2218
- };
2219
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
2220
- var _a;
2221
- const scopeId2 = getScopeId(cmpMeta, mode);
2222
- const style = styles.get(scopeId2);
2223
- if (!BUILD17.attachStyles || !win.document) {
2224
- return scopeId2;
2225
- }
2226
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2227
- if (style) {
2228
- if (typeof style === "string") {
2229
- styleContainerNode = styleContainerNode.head || styleContainerNode;
2230
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2231
- let styleElm;
2232
- if (!appliedStyles) {
2233
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2234
- }
2235
- if (!appliedStyles.has(scopeId2)) {
2236
- if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2237
- styleElm.innerHTML = style;
2238
- } else {
2239
- styleElm = win.document.createElement("style");
2240
- styleElm.innerHTML = style;
2241
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2242
- if (nonce != null) {
2243
- styleElm.setAttribute("nonce", nonce);
2244
- }
2245
- if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2246
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2247
- }
2248
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2249
- if (styleContainerNode.nodeName === "HEAD") {
2250
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2251
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2252
- styleContainerNode.insertBefore(
2253
- styleElm,
2254
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2255
- );
2256
- } else if ("host" in styleContainerNode) {
2257
- if (supportsConstructableStylesheets) {
2258
- const stylesheet = new CSSStyleSheet();
2259
- stylesheet.replaceSync(style);
2260
- if (supportsMutableAdoptedStyleSheets) {
2261
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
2262
- } else {
2263
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2264
- }
2265
- } else {
2266
- const existingStyleContainer = styleContainerNode.querySelector("style");
2267
- if (existingStyleContainer) {
2268
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2269
- } else {
2270
- styleContainerNode.prepend(styleElm);
2271
- }
2272
- }
2273
- } else {
2274
- styleContainerNode.append(styleElm);
2275
- }
2276
- }
2277
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2278
- styleContainerNode.insertBefore(styleElm, null);
2279
- }
2280
- }
2281
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2282
- styleElm.innerHTML += SLOT_FB_CSS;
2283
- }
2284
- if (appliedStyles) {
2285
- appliedStyles.add(scopeId2);
2286
- }
2287
- }
2288
- } else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2289
- if (supportsMutableAdoptedStyleSheets) {
2290
- styleContainerNode.adoptedStyleSheets.push(style);
2291
- } else {
2292
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2293
- }
2294
- }
2295
- }
2296
- return scopeId2;
2297
- };
2298
- var attachStyles = (hostRef) => {
2299
- const cmpMeta = hostRef.$cmpMeta$;
2300
- const elm = hostRef.$hostElement$;
2301
- const flags = cmpMeta.$flags$;
2302
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2303
- const scopeId2 = addStyle(
2304
- BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2305
- cmpMeta,
2306
- hostRef.$modeName$
2307
- );
2308
- if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2309
- elm["s-sc"] = scopeId2;
2310
- elm.classList.add(scopeId2 + "-h");
2311
- }
2312
- endAttachStyles();
2313
- };
2314
- var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2315
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2316
- var hydrateScopedToShadow = () => {
2317
- if (!win.document) {
2318
- return;
2319
- }
2320
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2321
- let i2 = 0;
2322
- for (; i2 < styles2.length; i2++) {
2323
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2324
- }
2325
- };
2326
-
2327
2340
  // src/runtime/vdom/vdom-render.ts
2328
2341
  import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
2329
2342
 
@@ -2342,12 +2355,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2342
2355
  const classList = elm.classList;
2343
2356
  const oldClasses = parseClassList(oldValue);
2344
2357
  let newClasses = parseClassList(newValue);
2345
- if (BUILD18.hydrateClientSide && elm["s-si"] && initialRender) {
2346
- newClasses.push(elm["s-si"]);
2358
+ if (BUILD18.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2359
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2360
+ newClasses.push(scopeId2);
2347
2361
  oldClasses.forEach((c) => {
2348
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2362
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2349
2363
  });
2350
- newClasses = [...new Set(newClasses)];
2364
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2351
2365
  classList.add(...newClasses);
2352
2366
  } else {
2353
2367
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2829,6 +2843,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2829
2843
  !isInitialRender && BUILD20.updatable && oldChildren !== null
2830
2844
  ) {
2831
2845
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2846
+ } else if (BUILD20.hydrateClientSide && isInitialRender && BUILD20.updatable && oldChildren !== null && newChildren === null) {
2847
+ newVNode2.$children$ = oldChildren;
2832
2848
  }
2833
2849
  if (BUILD20.svg && isSvgMode && tag === "svg") {
2834
2850
  isSvgMode = false;
@@ -3296,10 +3312,16 @@ var forceUpdate = (ref) => {
3296
3312
  return false;
3297
3313
  };
3298
3314
  var appDidLoad = (who) => {
3315
+ var _a;
3299
3316
  if (BUILD21.asyncQueue) {
3300
3317
  plt.$flags$ |= 2 /* appLoaded */;
3301
3318
  }
3302
3319
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3320
+ if (BUILD21.hydrateClientSide) {
3321
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3322
+ plt.$orgLocNodes$.clear();
3323
+ }
3324
+ }
3303
3325
  if (BUILD21.profile && performance.measure) {
3304
3326
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3305
3327
  }
@@ -3731,6 +3753,11 @@ var connectedCallback = (elm) => {
3731
3753
  if (BUILD25.hydrateServerSide || (BUILD25.slot || BUILD25.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3732
3754
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3733
3755
  setContentReference(elm);
3756
+ } else if (BUILD25.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3757
+ const commendPlaceholder = elm.firstChild;
3758
+ if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3759
+ elm.removeChild(commendPlaceholder);
3760
+ }
3734
3761
  }
3735
3762
  }
3736
3763
  if (BUILD25.asyncLoading) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.35.3-dev.1752112116.e504206",
3
+ "version": "4.35.3-dev.1752123834.56fe6e3",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",