xv-webcomponents 1.25.1 → 1.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/cjs/{index-DpLAFt0R.js → index-CsKqwBc1.js} +644 -7
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/xv-accordion-v2_50.cjs.entry.js +59 -41
  4. package/dist/cjs/xv-footer-next.cjs.entry.js +122 -0
  5. package/dist/cjs/xv-header-next.cjs.entry.js +2 -2
  6. package/dist/cjs/xv-mega-menu-next.cjs.entry.js +7 -7
  7. package/dist/cjs/xv-webcomponents.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +2 -1
  10. package/dist/collection/components/xv-footer-next/xv-footer-next.css +486 -0
  11. package/dist/collection/components/xv-footer-next/xv-footer-next.js +167 -0
  12. package/dist/collection/components/xv-footer-next/xv-footer-next.model.js +17 -0
  13. package/dist/collection/components/xv-geo-map/xv-geo-map.js +41 -1
  14. package/dist/collection/components/xv-header/xv-header.js +1 -1
  15. package/dist/collection/components/xv-header-next/xv-header-next.js +1 -1
  16. package/dist/collection/components/xv-image-viewer/xv-image-viewer.js +1 -1
  17. package/dist/collection/components/xv-link/xv-link.js +1 -1
  18. package/dist/collection/components/xv-mega-menu/xv-mega-menu.css +46 -2
  19. package/dist/collection/components/xv-mega-menu/xv-mega-menu.js +6 -7
  20. package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.css +42 -2
  21. package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.js +20 -6
  22. package/dist/collection/components/xv-modal/xv-modal.js +1 -1
  23. package/dist/collection/components/xv-notification/xv-notification.js +1 -1
  24. package/dist/collection/components/xv-number-input/xv-number-input.js +2 -2
  25. package/dist/collection/components/xv-pagination/xv-pagination.js +1 -1
  26. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
  27. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
  28. package/dist/collection/components/xv-radio/xv-radio.js +2 -2
  29. package/dist/collection/components/xv-slider/xv-slider.js +1 -1
  30. package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
  31. package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
  32. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
  33. package/dist/collection/components/xv-table/xv-table.js +1 -1
  34. package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
  35. package/dist/collection/components/xv-tag/xv-tag.js +1 -1
  36. package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +2 -2
  37. package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
  38. package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
  39. package/dist/collection/components/xv-tile/xv-tile.js +2 -2
  40. package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
  41. package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
  42. package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
  43. package/dist/esm/{index-CQm2sRKT.js → index-D0yFoU2h.js} +1 -1
  44. package/dist/esm/{index-DmxA2ysB.js → index-Owr_mJOX.js} +644 -7
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/xv-accordion-v2_50.entry.js +60 -42
  48. package/dist/esm/xv-footer-next.entry.js +120 -0
  49. package/dist/esm/xv-header-next.entry.js +3 -3
  50. package/dist/esm/xv-mega-menu-next.entry.js +8 -8
  51. package/dist/esm/xv-webcomponents.js +3 -3
  52. package/dist/types/components/xv-footer-next/xv-footer-next.d.ts +42 -0
  53. package/dist/types/components/xv-footer-next/xv-footer-next.model.d.ts +43 -0
  54. package/dist/types/components/xv-geo-map/xv-geo-map.d.ts +7 -0
  55. package/dist/types/components/xv-mega-menu-next/xv-mega-menu-next.d.ts +14 -0
  56. package/dist/types/components.d.ts +131 -0
  57. package/dist/xv-webcomponents/index.esm.js +1 -1
  58. package/dist/xv-webcomponents/p-3dd10203.entry.js +1 -0
  59. package/dist/xv-webcomponents/{p-CQm2sRKT.js → p-D0yFoU2h.js} +1 -1
  60. package/dist/xv-webcomponents/p-Owr_mJOX.js +2 -0
  61. package/dist/xv-webcomponents/p-b0fbf402.entry.js +8 -0
  62. package/dist/xv-webcomponents/p-ec19bcc7.entry.js +1 -0
  63. package/dist/xv-webcomponents/{p-f46bb687.entry.js → p-fbd8ca68.entry.js} +1 -1
  64. package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
  65. package/hydrate/index.d.ts +287 -0
  66. package/hydrate/index.js +113808 -0
  67. package/hydrate/index.mjs +113798 -0
  68. package/hydrate/package.json +12 -0
  69. package/package.json +8 -2
  70. package/dist/xv-webcomponents/p-7832549c.entry.js +0 -8
  71. package/dist/xv-webcomponents/p-DmxA2ysB.js +0 -2
  72. package/dist/xv-webcomponents/p-fe9b38f8.entry.js +0 -1
@@ -257,6 +257,30 @@ var require_brace_expansion = __commonJS({
257
257
  // src/utils/constants.ts
258
258
  var SVG_NS = "http://www.w3.org/2000/svg";
259
259
  var HTML_NS = "http://www.w3.org/1999/xhtml";
260
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
261
+ PrimitiveType2["Undefined"] = "undefined";
262
+ PrimitiveType2["Null"] = "null";
263
+ PrimitiveType2["String"] = "string";
264
+ PrimitiveType2["Number"] = "number";
265
+ PrimitiveType2["SpecialNumber"] = "number";
266
+ PrimitiveType2["Boolean"] = "boolean";
267
+ PrimitiveType2["BigInt"] = "bigint";
268
+ return PrimitiveType2;
269
+ })(PrimitiveType || {});
270
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
271
+ NonPrimitiveType2["Array"] = "array";
272
+ NonPrimitiveType2["Date"] = "date";
273
+ NonPrimitiveType2["Map"] = "map";
274
+ NonPrimitiveType2["Object"] = "object";
275
+ NonPrimitiveType2["RegularExpression"] = "regexp";
276
+ NonPrimitiveType2["Set"] = "set";
277
+ NonPrimitiveType2["Channel"] = "channel";
278
+ NonPrimitiveType2["Symbol"] = "symbol";
279
+ return NonPrimitiveType2;
280
+ })(NonPrimitiveType || {});
281
+ var TYPE_CONSTANT = "type";
282
+ var VALUE_CONSTANT = "value";
283
+ var SERIALIZED_PREFIX = "serialized:";
260
284
  var reWireGetterSetter = (instance, hostRef) => {
261
285
  var _a;
262
286
  const cmpMeta = hostRef.$cmpMeta$;
@@ -365,6 +389,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
365
389
 
366
390
  // src/client/client-style.ts
367
391
  var styles = /* @__PURE__ */ new Map();
392
+
393
+ // src/runtime/runtime-constants.ts
394
+ var CONTENT_REF_ID = "r";
395
+ var ORG_LOCATION_ID = "o";
396
+ var SLOT_NODE_ID = "s";
397
+ var TEXT_NODE_ID = "t";
398
+ var COMMENT_NODE_ID = "c";
399
+ var HYDRATE_ID = "s-id";
400
+ var HYDRATED_STYLE_ID = "sty-id";
401
+ var HYDRATE_CHILD_ID = "c-id";
368
402
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
369
403
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
370
404
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
@@ -1820,6 +1854,101 @@ var escapeRegExpSpecialCharacters = (text) => {
1820
1854
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1821
1855
  };
1822
1856
 
1857
+ // src/utils/remote-value.ts
1858
+ var RemoteValue = class _RemoteValue {
1859
+ /**
1860
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
1861
+ *
1862
+ * @param serialized The serialized LocalValue object
1863
+ * @returns The original JavaScript value/object
1864
+ */
1865
+ static fromLocalValue(serialized) {
1866
+ const type = serialized[TYPE_CONSTANT];
1867
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
1868
+ switch (type) {
1869
+ case "string" /* String */:
1870
+ return value;
1871
+ case "boolean" /* Boolean */:
1872
+ return value;
1873
+ case "bigint" /* BigInt */:
1874
+ return BigInt(value);
1875
+ case "undefined" /* Undefined */:
1876
+ return void 0;
1877
+ case "null" /* Null */:
1878
+ return null;
1879
+ case "number" /* Number */:
1880
+ if (value === "NaN") return NaN;
1881
+ if (value === "-0") return -0;
1882
+ if (value === "Infinity") return Infinity;
1883
+ if (value === "-Infinity") return -Infinity;
1884
+ return value;
1885
+ case "array" /* Array */:
1886
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
1887
+ case "date" /* Date */:
1888
+ return new Date(value);
1889
+ case "map" /* Map */:
1890
+ const map2 = /* @__PURE__ */ new Map();
1891
+ for (const [key, val] of value) {
1892
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
1893
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
1894
+ map2.set(deserializedKey, deserializedValue);
1895
+ }
1896
+ return map2;
1897
+ case "object" /* Object */:
1898
+ const obj = {};
1899
+ for (const [key, val] of value) {
1900
+ obj[key] = _RemoteValue.fromLocalValue(val);
1901
+ }
1902
+ return obj;
1903
+ case "regexp" /* RegularExpression */:
1904
+ const { pattern, flags } = value;
1905
+ return new RegExp(pattern, flags);
1906
+ case "set" /* Set */:
1907
+ const set = /* @__PURE__ */ new Set();
1908
+ for (const item of value) {
1909
+ set.add(_RemoteValue.fromLocalValue(item));
1910
+ }
1911
+ return set;
1912
+ case "symbol" /* Symbol */:
1913
+ return Symbol(value);
1914
+ default:
1915
+ throw new Error(`Unsupported type: ${type}`);
1916
+ }
1917
+ }
1918
+ /**
1919
+ * Utility method to deserialize multiple LocalValues at once
1920
+ *
1921
+ * @param serializedValues Array of serialized LocalValue objects
1922
+ * @returns Array of deserialized JavaScript values
1923
+ */
1924
+ static fromLocalValueArray(serializedValues) {
1925
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
1926
+ }
1927
+ /**
1928
+ * Verifies if the given object matches the structure of a serialized LocalValue
1929
+ *
1930
+ * @param obj Object to verify
1931
+ * @returns boolean indicating if the object has LocalValue structure
1932
+ */
1933
+ static isLocalValueObject(obj) {
1934
+ if (typeof obj !== "object" || obj === null) {
1935
+ return false;
1936
+ }
1937
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
1938
+ return false;
1939
+ }
1940
+ const type = obj[TYPE_CONSTANT];
1941
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1942
+ if (!hasTypeProperty) {
1943
+ return false;
1944
+ }
1945
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1946
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1947
+ }
1948
+ return true;
1949
+ }
1950
+ };
1951
+
1823
1952
  // src/utils/result.ts
1824
1953
  var result_exports = {};
1825
1954
  __export(result_exports, {
@@ -1869,6 +1998,14 @@ var unwrapErr = (result) => {
1869
1998
  }
1870
1999
  };
1871
2000
 
2001
+ // src/utils/serialize.ts
2002
+ function deserializeProperty(value) {
2003
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2004
+ return value;
2005
+ }
2006
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
2007
+ }
2008
+
1872
2009
  // src/utils/style.ts
1873
2010
  function createStyleSheetIfNeededAndSupported(styles2) {
1874
2011
  if (!supportsConstructableStylesheets) return void 0;
@@ -1964,6 +2101,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1964
2101
  }
1965
2102
  return slotName === "";
1966
2103
  };
2104
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
2105
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
2106
+ return;
2107
+ }
2108
+ const slottedNodeLocation = document.createTextNode("");
2109
+ slottedNodeLocation["s-nr"] = newChild;
2110
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
2111
+ const parent = slotNode["s-cr"].parentNode;
2112
+ const appendMethod = internalCall(parent, "appendChild");
2113
+ if (typeof position !== "undefined") {
2114
+ slottedNodeLocation["s-oo"] = position;
2115
+ const childNodes = internalCall(parent, "childNodes");
2116
+ const slotRelocateNodes = [slottedNodeLocation];
2117
+ childNodes.forEach((n) => {
2118
+ if (n["s-nr"]) slotRelocateNodes.push(n);
2119
+ });
2120
+ slotRelocateNodes.sort((a, b) => {
2121
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
2122
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
2123
+ return 0;
2124
+ });
2125
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
2126
+ } else {
2127
+ appendMethod.call(parent, slottedNodeLocation);
2128
+ }
2129
+ newChild["s-ol"] = slottedNodeLocation;
2130
+ newChild["s-sh"] = slotNode["s-hn"];
2131
+ };
1967
2132
  var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
1968
2133
  function patchSlotNode(node) {
1969
2134
  if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
@@ -2047,7 +2212,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2047
2212
  if (!appliedStyles) {
2048
2213
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2049
2214
  }
2050
- if (!appliedStyles.has(scopeId2)) {
2215
+ const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
2216
+ if (existingStyleElm) {
2217
+ existingStyleElm.innerHTML = style;
2218
+ } else if (!appliedStyles.has(scopeId2)) {
2051
2219
  styleElm = win.document.createElement("style");
2052
2220
  styleElm.innerHTML = style;
2053
2221
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -2136,6 +2304,17 @@ var attachStyles = (hostRef) => {
2136
2304
  endAttachStyles();
2137
2305
  };
2138
2306
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
2307
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2308
+ var hydrateScopedToShadow = () => {
2309
+ if (!win.document) {
2310
+ return;
2311
+ }
2312
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2313
+ let i2 = 0;
2314
+ for (; i2 < styles2.length; i2++) {
2315
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2316
+ }
2317
+ };
2139
2318
  var h = (nodeName, vnodeData, ...children) => {
2140
2319
  if (typeof nodeName === "string") {
2141
2320
  nodeName = transformTag(nodeName);
@@ -2250,6 +2429,420 @@ var convertToPrivate = (node) => {
2250
2429
  vnode.$name$ = node.vname;
2251
2430
  return vnode;
2252
2431
  };
2432
+
2433
+ // src/runtime/client-hydrate.ts
2434
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
2435
+ var _a, _b, _c, _d;
2436
+ const endHydrate = createTime("hydrateClient", tagName);
2437
+ const shadowRoot = hostElm.shadowRoot;
2438
+ const childRenderNodes = [];
2439
+ const slotNodes = [];
2440
+ const slottedNodes = [];
2441
+ const shadowRootNodes = shadowRoot ? [] : null;
2442
+ const vnode = newVNode(tagName, null);
2443
+ vnode.$elm$ = hostElm;
2444
+ let scopeId2;
2445
+ {
2446
+ const cmpMeta = hostRef.$cmpMeta$;
2447
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
2448
+ scopeId2 = hostElm["s-sc"];
2449
+ hostElm.classList.add(scopeId2 + "-h");
2450
+ } else if (hostElm["s-sc"]) {
2451
+ delete hostElm["s-sc"];
2452
+ }
2453
+ }
2454
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
2455
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
2456
+ }
2457
+ hostElm[HYDRATE_ID] = hostId;
2458
+ hostElm.removeAttribute(HYDRATE_ID);
2459
+ hostRef.$vnode$ = clientHydrate(
2460
+ vnode,
2461
+ childRenderNodes,
2462
+ slotNodes,
2463
+ shadowRootNodes,
2464
+ hostElm,
2465
+ hostElm,
2466
+ hostId,
2467
+ slottedNodes
2468
+ );
2469
+ let crIndex = 0;
2470
+ const crLength = childRenderNodes.length;
2471
+ let childRenderNode;
2472
+ for (crIndex; crIndex < crLength; crIndex++) {
2473
+ childRenderNode = childRenderNodes[crIndex];
2474
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
2475
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
2476
+ const node = childRenderNode.$elm$;
2477
+ if (!shadowRoot) {
2478
+ node["s-hn"] = transformTag(tagName).toUpperCase();
2479
+ if (childRenderNode.$tag$ === "slot") {
2480
+ node["s-cr"] = hostElm["s-cr"];
2481
+ }
2482
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
2483
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
2484
+ if (cmpMeta) {
2485
+ const scopeId3 = getScopeId(
2486
+ cmpMeta.$cmpMeta$);
2487
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
2488
+ if (styleSheet) {
2489
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
2490
+ }
2491
+ }
2492
+ }
2493
+ if (childRenderNode.$tag$ === "slot") {
2494
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
2495
+ if (childRenderNode.$children$) {
2496
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
2497
+ if (!childRenderNode.$elm$.childNodes.length) {
2498
+ childRenderNode.$children$.forEach((c) => {
2499
+ childRenderNode.$elm$.appendChild(c.$elm$);
2500
+ });
2501
+ }
2502
+ } else {
2503
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
2504
+ }
2505
+ }
2506
+ if (orgLocationNode && orgLocationNode.isConnected) {
2507
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
2508
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
2509
+ }
2510
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
2511
+ if (!shadowRoot) {
2512
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
2513
+ }
2514
+ }
2515
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
2516
+ plt.$orgLocNodes$.delete(orgLocationId);
2517
+ }
2518
+ }
2519
+ const hosts = [];
2520
+ const snLen = slottedNodes.length;
2521
+ let snIndex = 0;
2522
+ let slotGroup;
2523
+ let snGroupIdx;
2524
+ let snGroupLen;
2525
+ let slottedItem;
2526
+ let currentPos = 0;
2527
+ for (snIndex; snIndex < snLen; snIndex++) {
2528
+ slotGroup = slottedNodes[snIndex];
2529
+ if (!slotGroup || !slotGroup.length) continue;
2530
+ snGroupLen = slotGroup.length;
2531
+ snGroupIdx = 0;
2532
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
2533
+ slottedItem = slotGroup[snGroupIdx];
2534
+ if (!hosts[slottedItem.hostId]) {
2535
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
2536
+ }
2537
+ if (!hosts[slottedItem.hostId]) continue;
2538
+ const hostEle = hosts[slottedItem.hostId];
2539
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
2540
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
2541
+ }
2542
+ if (!hostEle.shadowRoot || !shadowRoot) {
2543
+ if (!slottedItem.slot["s-cr"]) {
2544
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
2545
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
2546
+ slottedItem.slot["s-cr"] = hostEle;
2547
+ } else {
2548
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
2549
+ }
2550
+ }
2551
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
2552
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
2553
+ slottedItem.node.removeAttribute("slot");
2554
+ }
2555
+ }
2556
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
2557
+ }
2558
+ }
2559
+ if (scopeId2 && slotNodes.length) {
2560
+ slotNodes.forEach((slot) => {
2561
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
2562
+ });
2563
+ }
2564
+ if (shadowRoot) {
2565
+ let rnIdex = 0;
2566
+ const rnLen = shadowRootNodes.length;
2567
+ if (rnLen) {
2568
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
2569
+ const node = shadowRootNodes[rnIdex];
2570
+ if (node) {
2571
+ shadowRoot.appendChild(node);
2572
+ }
2573
+ }
2574
+ Array.from(hostElm.childNodes).forEach((node) => {
2575
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
2576
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
2577
+ node.removeAttribute("hidden");
2578
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
2579
+ node.parentNode.removeChild(node);
2580
+ }
2581
+ }
2582
+ });
2583
+ }
2584
+ }
2585
+ hostRef.$hostElement$ = hostElm;
2586
+ endHydrate();
2587
+ };
2588
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
2589
+ let childNodeType;
2590
+ let childIdSplt;
2591
+ let childVNode;
2592
+ let i2;
2593
+ const scopeId2 = hostElm["s-sc"];
2594
+ if (node.nodeType === 1 /* ElementNode */) {
2595
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
2596
+ if (childNodeType) {
2597
+ childIdSplt = childNodeType.split(".");
2598
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
2599
+ childVNode = createSimpleVNode({
2600
+ $flags$: 0,
2601
+ $hostId$: childIdSplt[0],
2602
+ $nodeId$: childIdSplt[1],
2603
+ $depth$: childIdSplt[2],
2604
+ $index$: childIdSplt[3],
2605
+ $tag$: node.tagName.toLowerCase(),
2606
+ $elm$: node,
2607
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
2608
+ // won't try to reconcile them. Classes set on the node will be blown away.
2609
+ $attrs$: { class: node.className || "" }
2610
+ });
2611
+ childRenderNodes.push(childVNode);
2612
+ node.removeAttribute(HYDRATE_CHILD_ID);
2613
+ if (!parentVNode.$children$) {
2614
+ parentVNode.$children$ = [];
2615
+ }
2616
+ if (scopeId2 && childIdSplt[0] === hostId) {
2617
+ node["s-si"] = scopeId2;
2618
+ childVNode.$attrs$.class += " " + scopeId2;
2619
+ }
2620
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
2621
+ if (typeof slotName === "string") {
2622
+ if (childVNode.$tag$ === "slot-fb") {
2623
+ addSlot(
2624
+ slotName,
2625
+ childIdSplt[2],
2626
+ childVNode,
2627
+ node,
2628
+ parentVNode,
2629
+ childRenderNodes,
2630
+ slotNodes,
2631
+ shadowRootNodes,
2632
+ slottedNodes
2633
+ );
2634
+ if (scopeId2) {
2635
+ node.classList.add(scopeId2);
2636
+ }
2637
+ }
2638
+ childVNode.$elm$["s-sn"] = slotName;
2639
+ childVNode.$elm$.removeAttribute("s-sn");
2640
+ }
2641
+ if (childVNode.$index$ !== void 0) {
2642
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2643
+ }
2644
+ parentVNode = childVNode;
2645
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
2646
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2647
+ }
2648
+ }
2649
+ }
2650
+ if (node.shadowRoot) {
2651
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
2652
+ clientHydrate(
2653
+ parentVNode,
2654
+ childRenderNodes,
2655
+ slotNodes,
2656
+ shadowRootNodes,
2657
+ hostElm,
2658
+ node.shadowRoot.childNodes[i2],
2659
+ hostId,
2660
+ slottedNodes
2661
+ );
2662
+ }
2663
+ }
2664
+ const nonShadowNodes = node.__childNodes || node.childNodes;
2665
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
2666
+ clientHydrate(
2667
+ parentVNode,
2668
+ childRenderNodes,
2669
+ slotNodes,
2670
+ shadowRootNodes,
2671
+ hostElm,
2672
+ nonShadowNodes[i2],
2673
+ hostId,
2674
+ slottedNodes
2675
+ );
2676
+ }
2677
+ } else if (node.nodeType === 8 /* CommentNode */) {
2678
+ childIdSplt = node.nodeValue.split(".");
2679
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
2680
+ childNodeType = childIdSplt[0];
2681
+ childVNode = createSimpleVNode({
2682
+ $hostId$: childIdSplt[1],
2683
+ $nodeId$: childIdSplt[2],
2684
+ $depth$: childIdSplt[3],
2685
+ $index$: childIdSplt[4] || "0",
2686
+ $elm$: node,
2687
+ $attrs$: null,
2688
+ $children$: null,
2689
+ $key$: null,
2690
+ $name$: null,
2691
+ $tag$: null,
2692
+ $text$: null
2693
+ });
2694
+ if (childNodeType === TEXT_NODE_ID) {
2695
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
2696
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
2697
+ childVNode.$text$ = childVNode.$elm$.textContent;
2698
+ childRenderNodes.push(childVNode);
2699
+ node.remove();
2700
+ if (hostId === childVNode.$hostId$) {
2701
+ if (!parentVNode.$children$) {
2702
+ parentVNode.$children$ = [];
2703
+ }
2704
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2705
+ }
2706
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
2707
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2708
+ }
2709
+ }
2710
+ } else if (childNodeType === COMMENT_NODE_ID) {
2711
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
2712
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
2713
+ childRenderNodes.push(childVNode);
2714
+ node.remove();
2715
+ }
2716
+ } else if (childVNode.$hostId$ === hostId) {
2717
+ if (childNodeType === SLOT_NODE_ID) {
2718
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
2719
+ addSlot(
2720
+ slotName,
2721
+ childIdSplt[2],
2722
+ childVNode,
2723
+ node,
2724
+ parentVNode,
2725
+ childRenderNodes,
2726
+ slotNodes,
2727
+ shadowRootNodes,
2728
+ slottedNodes
2729
+ );
2730
+ } else if (childNodeType === CONTENT_REF_ID) {
2731
+ if (shadowRootNodes) {
2732
+ node.remove();
2733
+ } else {
2734
+ hostElm["s-cr"] = node;
2735
+ node["s-cn"] = true;
2736
+ }
2737
+ }
2738
+ }
2739
+ }
2740
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
2741
+ const vnode = newVNode(null, node.textContent);
2742
+ vnode.$elm$ = node;
2743
+ vnode.$index$ = "0";
2744
+ parentVNode.$children$ = [vnode];
2745
+ }
2746
+ return parentVNode;
2747
+ };
2748
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
2749
+ if (node.nodeType === 1 /* ElementNode */) {
2750
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
2751
+ if (componentId) {
2752
+ orgLocNodes.set(componentId, node);
2753
+ }
2754
+ let i2 = 0;
2755
+ if (node.shadowRoot) {
2756
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
2757
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
2758
+ }
2759
+ }
2760
+ const nonShadowNodes = node.__childNodes || node.childNodes;
2761
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
2762
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
2763
+ }
2764
+ } else if (node.nodeType === 8 /* CommentNode */) {
2765
+ const childIdSplt = node.nodeValue.split(".");
2766
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
2767
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
2768
+ node.nodeValue = "";
2769
+ node["s-en"] = childIdSplt[3];
2770
+ }
2771
+ }
2772
+ };
2773
+ var createSimpleVNode = (vnode) => {
2774
+ const defaultVNode = {
2775
+ $flags$: 0,
2776
+ $hostId$: null,
2777
+ $nodeId$: null,
2778
+ $depth$: null,
2779
+ $index$: "0",
2780
+ $elm$: null,
2781
+ $attrs$: null,
2782
+ $children$: null,
2783
+ $key$: null,
2784
+ $name$: null,
2785
+ $tag$: null,
2786
+ $text$: null
2787
+ };
2788
+ return { ...defaultVNode, ...vnode };
2789
+ };
2790
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
2791
+ node["s-sr"] = true;
2792
+ childVNode.$name$ = slotName || null;
2793
+ childVNode.$tag$ = "slot";
2794
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
2795
+ if (shadowRootNodes && win.document) {
2796
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
2797
+ if (childVNode.$name$) {
2798
+ childVNode.$elm$.setAttribute("name", slotName);
2799
+ }
2800
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
2801
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
2802
+ } else {
2803
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
2804
+ }
2805
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
2806
+ node.remove();
2807
+ if (childVNode.$depth$ === "0") {
2808
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2809
+ }
2810
+ } else {
2811
+ const slot = childVNode.$elm$;
2812
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
2813
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
2814
+ patchSlotNode(node);
2815
+ if (shouldMove) {
2816
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
2817
+ }
2818
+ }
2819
+ childRenderNodes.push(childVNode);
2820
+ slotNodes.push(childVNode);
2821
+ if (!parentVNode.$children$) {
2822
+ parentVNode.$children$ = [];
2823
+ }
2824
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2825
+ }
2826
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
2827
+ var _a, _b;
2828
+ let slottedNode = slotNode.nextSibling;
2829
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
2830
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
2831
+ do {
2832
+ if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
2833
+ slottedNode["s-sn"] = slotName;
2834
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
2835
+ }
2836
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
2837
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
2838
+ };
2839
+ var findCorrespondingNode = (node, type) => {
2840
+ let sibling = node;
2841
+ do {
2842
+ sibling = sibling.nextSibling;
2843
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
2844
+ return sibling;
2845
+ };
2253
2846
  var createSupportsRuleRe = (selector) => {
2254
2847
  const safeSelector2 = escapeRegExpSpecialCharacters(selector);
2255
2848
  return new RegExp(
@@ -2263,6 +2856,10 @@ createSupportsRuleRe("::slotted");
2263
2856
  createSupportsRuleRe(":host");
2264
2857
  createSupportsRuleRe(":host-context");
2265
2858
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2859
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2860
+ propValue = deserializeProperty(propValue);
2861
+ return propValue;
2862
+ }
2266
2863
  if (propValue != null && !isComplexType(propValue)) {
2267
2864
  if (propType & 4 /* Boolean */) {
2268
2865
  if (isFormAssociated && typeof propValue === "string") {
@@ -2315,7 +2912,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2315
2912
  const classList = elm.classList;
2316
2913
  const oldClasses = parseClassList(oldValue);
2317
2914
  let newClasses = parseClassList(newValue);
2318
- {
2915
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
2916
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2917
+ newClasses.push(scopeId2);
2918
+ oldClasses.forEach((c) => {
2919
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2920
+ });
2921
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2922
+ classList.add(...newClasses);
2923
+ } else {
2319
2924
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
2320
2925
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
2321
2926
  }
@@ -2424,7 +3029,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2424
3029
  oldVnodeAttrs[memberName],
2425
3030
  void 0,
2426
3031
  isSvgMode2,
2427
- newVnode.$flags$);
3032
+ newVnode.$flags$,
3033
+ isInitialRender
3034
+ );
2428
3035
  }
2429
3036
  }
2430
3037
  }
@@ -2435,7 +3042,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2435
3042
  oldVnodeAttrs[memberName],
2436
3043
  newVnodeAttrs[memberName],
2437
3044
  isSvgMode2,
2438
- newVnode.$flags$);
3045
+ newVnode.$flags$,
3046
+ isInitialRender
3047
+ );
2439
3048
  }
2440
3049
  };
2441
3050
  function sortedAttrNames(attrNames) {
@@ -2725,7 +3334,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2725
3334
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2726
3335
  }
2727
3336
  {
2728
- updateElement(oldVNode, newVNode2, isSvgMode);
3337
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
2729
3338
  }
2730
3339
  if (oldChildren !== null && newChildren !== null) {
2731
3340
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -2739,7 +3348,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2739
3348
  !isInitialRender && BUILD.updatable && oldChildren !== null
2740
3349
  ) {
2741
3350
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2742
- } else ;
3351
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
3352
+ newVNode2.$children$ = oldChildren;
3353
+ }
2743
3354
  if (isSvgMode && tag === "svg") {
2744
3355
  isSvgMode = false;
2745
3356
  }
@@ -3093,7 +3704,13 @@ var postUpdateComponent = (hostRef) => {
3093
3704
  }
3094
3705
  };
3095
3706
  var appDidLoad = (who) => {
3707
+ var _a;
3096
3708
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3709
+ {
3710
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3711
+ plt.$orgLocNodes$.clear();
3712
+ }
3713
+ }
3097
3714
  };
3098
3715
  var safeCall = (instance, method, arg, elm) => {
3099
3716
  if (instance && instance[method]) {
@@ -3439,7 +4056,21 @@ var connectedCallback = (elm) => {
3439
4056
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3440
4057
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
3441
4058
  hostRef.$flags$ |= 1 /* hasConnected */;
4059
+ let hostId;
3442
4060
  {
4061
+ hostId = elm.getAttribute(HYDRATE_ID);
4062
+ if (hostId) {
4063
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4064
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
4065
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
4066
+ } else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4067
+ const scopeId2 = getScopeId(cmpMeta);
4068
+ elm["s-sc"] = scopeId2;
4069
+ }
4070
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
4071
+ }
4072
+ }
4073
+ if (!hostId) {
3443
4074
  if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3444
4075
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3445
4076
  setContentReference(elm);
@@ -3448,7 +4079,7 @@ var connectedCallback = (elm) => {
3448
4079
  {
3449
4080
  let ancestorComponent = elm;
3450
4081
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
3451
- if (ancestorComponent["s-p"]) {
4082
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
3452
4083
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
3453
4084
  break;
3454
4085
  }
@@ -3534,6 +4165,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3534
4165
  let isBootstrapping = true;
3535
4166
  Object.assign(plt, options);
3536
4167
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
4168
+ {
4169
+ plt.$flags$ |= 2 /* appLoaded */;
4170
+ }
4171
+ {
4172
+ hydrateScopedToShadow();
4173
+ }
3537
4174
  let hasSlotRelocation = false;
3538
4175
  lazyBundles.map((lazyBundle) => {
3539
4176
  lazyBundle[1].map((compactMeta) => {