@uh-design-system/component-library 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/cjs/{utils-3412cbed.js → attributes-BMbXzbwU.js} +2 -28
  2. package/dist/cjs/component-library.cjs.js +7 -7
  3. package/dist/cjs/controlUtils-ofqiQxRF.js +42 -0
  4. package/dist/cjs/ds-accordion.cjs.entry.js +79 -0
  5. package/dist/cjs/ds-button.cjs.entry.js +107 -0
  6. package/dist/cjs/ds-card.cjs.entry.js +58 -0
  7. package/dist/cjs/ds-checkbox-group.cjs.entry.js +82 -32
  8. package/dist/cjs/ds-checkbox.cjs.entry.js +70 -64
  9. package/dist/cjs/ds-icon.cjs.entry.js +943 -0
  10. package/dist/cjs/ds-input-validity.cjs.entry.js +13 -14
  11. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +21 -20
  12. package/dist/cjs/ds-link.cjs.entry.js +34 -31
  13. package/dist/cjs/ds-radio-button-group.cjs.entry.js +72 -30
  14. package/dist/cjs/ds-radio-button.cjs.entry.js +60 -59
  15. package/dist/cjs/ds-spinner.cjs.entry.js +62 -0
  16. package/dist/cjs/ds-text-input.cjs.entry.js +89 -77
  17. package/dist/cjs/ds-visually-hidden.cjs.entry.js +17 -0
  18. package/dist/cjs/index-Bp6Dd2i1.js +94 -0
  19. package/dist/cjs/{store-e8e87298.js → index-DwLFyR5p.js} +6 -2
  20. package/dist/cjs/{index-947af833.js → index-Mjp9Y-Sw.js} +666 -52
  21. package/dist/cjs/index.cjs.js +3 -5
  22. package/dist/cjs/{linkUtils-695da37c.js → linkUtils-onlbgKdI.js} +4 -2
  23. package/dist/cjs/loader.cjs.js +3 -5
  24. package/dist/cjs/utils-BjZTECpy.js +29 -0
  25. package/dist/collection/accessibility/stories/naming.stories.js +3 -3
  26. package/dist/collection/collection-manifest.json +74 -2
  27. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +7 -6
  28. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +88 -45
  29. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +6 -6
  30. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +14 -14
  31. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +24 -66
  32. package/dist/collection/components/01-base-components/ds-button/ds-button.css +38 -70
  33. package/dist/collection/components/01-base-components/ds-button/ds-button.js +91 -91
  34. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +84 -52
  35. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +49 -42
  36. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +16 -75
  37. package/dist/collection/components/01-base-components/ds-card/ds-card.css +127 -0
  38. package/dist/collection/components/01-base-components/ds-card/ds-card.js +303 -0
  39. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.examples.stories.js +92 -0
  40. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.features.stories.js +66 -0
  41. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.stories.js +71 -0
  42. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +23 -30
  43. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +112 -84
  44. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +20 -20
  45. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +12 -25
  46. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +1 -2
  47. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +170 -45
  48. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +153 -44
  49. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +30 -28
  50. package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +36 -31
  51. package/dist/collection/components/01-base-components/ds-icon/stories/ds-icon.stories.js +10 -37
  52. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +60 -30
  53. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +4 -4
  54. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +4 -9
  55. package/dist/collection/components/01-base-components/ds-link/ds-link.css +13 -3
  56. package/dist/collection/components/01-base-components/ds-link/ds-link.js +74 -75
  57. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +27 -27
  58. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +38 -21
  59. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +8 -67
  60. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +1 -3
  61. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +30 -52
  62. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.examples.stories.js +4 -4
  63. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.features.stories.js +6 -6
  64. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -28
  65. package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +26 -27
  66. package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +98 -117
  67. package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +29 -27
  68. package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +9 -23
  69. package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +1 -2
  70. package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +111 -38
  71. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +16 -25
  72. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +40 -27
  73. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +23 -22
  74. package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +34 -64
  75. package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.js +42 -42
  76. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.js +15 -17
  77. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.js +8 -8
  78. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.stories.js +4 -49
  79. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +45 -78
  80. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +229 -155
  81. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +26 -21
  82. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.features.stories.js +40 -40
  83. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +30 -56
  84. package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
  85. package/dist/collection/store.js +7 -1
  86. package/dist/collection/utils/attributes/attributes.js +2 -2
  87. package/dist/collection/utils/controls/controlUtils.js +35 -1
  88. package/dist/collection/utils/link/linkUtils.js +3 -2
  89. package/dist/collection/utils/utils.js +10 -9
  90. package/dist/component-library/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +1 -1
  91. package/dist/component-library/component-library.css +1 -1
  92. package/dist/component-library/component-library.esm.js +1 -1
  93. package/dist/component-library/controlUtils-CNER0MvM.js +1 -0
  94. package/dist/component-library/ds-accordion.entry.js +1 -0
  95. package/dist/component-library/ds-button.entry.js +1 -0
  96. package/dist/component-library/ds-card.entry.js +1 -0
  97. package/dist/component-library/ds-checkbox-group.entry.js +1 -1
  98. package/dist/component-library/ds-checkbox.entry.js +1 -1
  99. package/dist/component-library/ds-icon.entry.js +1 -0
  100. package/dist/component-library/ds-input-validity.entry.js +1 -1
  101. package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
  102. package/dist/component-library/ds-link.entry.js +1 -1
  103. package/dist/component-library/ds-radio-button-group.entry.js +1 -1
  104. package/dist/component-library/ds-radio-button.entry.js +1 -1
  105. package/dist/component-library/ds-spinner.entry.js +1 -0
  106. package/dist/component-library/ds-text-input.entry.js +1 -1
  107. package/dist/component-library/ds-visually-hidden.entry.js +1 -0
  108. package/dist/component-library/index-BfTCfPZ1.js +6 -0
  109. package/dist/component-library/index-Cm7V4EAn.js +2 -0
  110. package/dist/component-library/index-DuYjhvTn.js +1 -0
  111. package/dist/component-library/index.esm.js +1 -1
  112. package/dist/component-library/linkUtils-02nCfO0F.js +1 -0
  113. package/dist/component-library/utils-CqaqnfY4.js +1 -0
  114. package/dist/components/attributes.js +3 -3
  115. package/dist/components/controlUtils.js +35 -2
  116. package/dist/components/ds-accordion.js +39 -33
  117. package/dist/components/ds-button2.js +49 -51
  118. package/dist/components/ds-card.d.ts +11 -0
  119. package/dist/components/ds-card.js +91 -0
  120. package/dist/components/ds-checkbox-group.js +88 -39
  121. package/dist/components/ds-checkbox2.js +73 -64
  122. package/dist/components/ds-icon2.js +292 -292
  123. package/dist/components/ds-input-validity2.js +16 -13
  124. package/dist/components/ds-link-with-arrow.js +22 -22
  125. package/dist/components/ds-link.js +43 -40
  126. package/dist/components/ds-radio-button-group.js +72 -34
  127. package/dist/components/ds-radio-button.js +63 -61
  128. package/dist/components/ds-spinner2.js +31 -32
  129. package/dist/components/ds-text-input.js +114 -99
  130. package/dist/components/ds-visually-hidden2.js +2 -3
  131. package/dist/components/index.js +208 -2
  132. package/dist/components/index2.js +679 -36
  133. package/dist/components/index3.js +69 -57
  134. package/dist/components/linkUtils.js +4 -2
  135. package/dist/docs.d.ts +443 -0
  136. package/dist/docs.json +4790 -0
  137. package/dist/esm/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +3 -26
  138. package/dist/esm/component-library.js +6 -5
  139. package/dist/esm/controlUtils-CNER0MvM.js +37 -0
  140. package/dist/esm/ds-accordion.entry.js +77 -0
  141. package/dist/esm/ds-button.entry.js +105 -0
  142. package/dist/esm/ds-card.entry.js +56 -0
  143. package/dist/esm/ds-checkbox-group.entry.js +81 -29
  144. package/dist/esm/ds-checkbox.entry.js +60 -52
  145. package/dist/esm/ds-icon.entry.js +941 -0
  146. package/dist/esm/ds-input-validity.entry.js +13 -12
  147. package/dist/esm/ds-link-with-arrow.entry.js +21 -18
  148. package/dist/esm/ds-link.entry.js +34 -29
  149. package/dist/esm/ds-radio-button-group.entry.js +71 -27
  150. package/dist/esm/ds-radio-button.entry.js +52 -49
  151. package/dist/esm/ds-spinner.entry.js +60 -0
  152. package/dist/esm/ds-text-input.entry.js +87 -73
  153. package/dist/esm/ds-visually-hidden.entry.js +15 -0
  154. package/dist/esm/index-BfTCfPZ1.js +92 -0
  155. package/dist/esm/{index-84fd0ee9.js → index-Cm7V4EAn.js} +665 -31
  156. package/dist/{components/store.js → esm/index-DuYjhvTn.js} +6 -3
  157. package/dist/esm/index.js +2 -2
  158. package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-02nCfO0F.js} +4 -2
  159. package/dist/esm/loader.js +4 -4
  160. package/dist/esm/utils-CqaqnfY4.js +25 -0
  161. package/dist/hydrate/index.d.ts +271 -0
  162. package/dist/hydrate/index.js +22280 -0
  163. package/dist/hydrate/index.mjs +22272 -0
  164. package/dist/hydrate/package.json +12 -0
  165. package/dist/styles/helpers.css +9 -1
  166. package/dist/styles/helpers.css.map +1 -1
  167. package/dist/styles/mixins/_breakpoints.scss +1 -2
  168. package/dist/styles/mixins/_focus.scss +3 -5
  169. package/dist/styles/mixins.scss +8 -6
  170. package/dist/styles/variables.css +32 -24
  171. package/dist/styles/variables.css.map +1 -1
  172. package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +11 -8
  173. package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +14 -14
  174. package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +1 -0
  175. package/dist/types/components/01-base-components/ds-card/ds-card.d.ts +20 -0
  176. package/dist/types/components/01-base-components/ds-card/stories/ds-card.examples.stories.d.ts +8 -0
  177. package/dist/types/components/01-base-components/ds-card/stories/ds-card.features.stories.d.ts +8 -0
  178. package/dist/types/components/01-base-components/ds-card/stories/ds-card.stories.d.ts +7 -0
  179. package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +16 -13
  180. package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +16 -7
  181. package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +3 -0
  182. package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +7 -5
  183. package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +5 -6
  184. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +13 -14
  185. package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +2 -0
  186. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +5 -7
  187. package/dist/types/components/01-base-components/ds-radio-button/ds-radio-button.d.ts +14 -14
  188. package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.d.ts +1 -1
  189. package/dist/types/components/01-base-components/ds-radio-button-group/ds-radio-button-group.d.ts +16 -6
  190. package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.d.ts +1 -0
  191. package/dist/types/components/01-base-components/ds-spinner/ds-spinner.d.ts +7 -7
  192. package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +37 -32
  193. package/dist/types/components.d.ts +1225 -281
  194. package/dist/types/stencil-public-runtime.d.ts +22 -0
  195. package/dist/types/store.d.ts +6 -1
  196. package/dist/types/utils/attributes/attributes.d.ts +1 -1
  197. package/dist/types/utils/controls/controlUtils.d.ts +2 -0
  198. package/dist/types/utils/link/linkUtils.d.ts +1 -1
  199. package/dist/types/utils/utils.d.ts +2 -1
  200. package/package.json +28 -24
  201. package/dist/cjs/controlUtils-8bf55ef0.js +0 -7
  202. package/dist/cjs/ds-accordion_5.cjs.entry.js +0 -1190
  203. package/dist/cjs/index-5b0b9d4c.js +0 -82
  204. package/dist/component-library/controlUtils-c2ba44bd.js +0 -1
  205. package/dist/component-library/ds-accordion_5.entry.js +0 -1
  206. package/dist/component-library/index-72ac5051.js +0 -6
  207. package/dist/component-library/index-84fd0ee9.js +0 -2
  208. package/dist/component-library/linkUtils-3d1b28cf.js +0 -1
  209. package/dist/component-library/store-73a56075.js +0 -1
  210. package/dist/esm/controlUtils-c2ba44bd.js +0 -4
  211. package/dist/esm/ds-accordion_5.entry.js +0 -1182
  212. package/dist/esm/index-72ac5051.js +0 -80
  213. package/dist/esm/store-73a56075.js +0 -204
  214. package/dist/loader/package.json +0 -11
  215. /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
  216. /package/dist/component-library/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  217. /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'component-library';
2
- const BUILD = /* component-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: false, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
2
+ const BUILD = /* component-library */ { hydratedSelectorName: "hydrated", lazyLoad: false, slotRelocation: true, updatable: true};
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.30.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
@@ -13,6 +13,30 @@ var __export = (target, all) => {
13
13
  // src/utils/constants.ts
14
14
  var SVG_NS = "http://www.w3.org/2000/svg";
15
15
  var HTML_NS = "http://www.w3.org/1999/xhtml";
16
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
17
+ PrimitiveType2["Undefined"] = "undefined";
18
+ PrimitiveType2["Null"] = "null";
19
+ PrimitiveType2["String"] = "string";
20
+ PrimitiveType2["Number"] = "number";
21
+ PrimitiveType2["SpecialNumber"] = "number";
22
+ PrimitiveType2["Boolean"] = "boolean";
23
+ PrimitiveType2["BigInt"] = "bigint";
24
+ return PrimitiveType2;
25
+ })(PrimitiveType || {});
26
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
27
+ NonPrimitiveType2["Array"] = "array";
28
+ NonPrimitiveType2["Date"] = "date";
29
+ NonPrimitiveType2["Map"] = "map";
30
+ NonPrimitiveType2["Object"] = "object";
31
+ NonPrimitiveType2["RegularExpression"] = "regexp";
32
+ NonPrimitiveType2["Set"] = "set";
33
+ NonPrimitiveType2["Channel"] = "channel";
34
+ NonPrimitiveType2["Symbol"] = "symbol";
35
+ return NonPrimitiveType2;
36
+ })(NonPrimitiveType || {});
37
+ var TYPE_CONSTANT = "type";
38
+ var VALUE_CONSTANT = "value";
39
+ var SERIALIZED_PREFIX = "serialized:";
16
40
 
17
41
  // src/utils/es2022-rewire-class-members.ts
18
42
  var reWireGetterSetter = (instance, hostRef) => {
@@ -69,7 +93,16 @@ var consoleError = (e, el) => (0, console.error)(e, el);
69
93
 
70
94
  // src/client/client-style.ts
71
95
  var styles = /* @__PURE__ */ new Map();
96
+
97
+ // src/runtime/runtime-constants.ts
98
+ var CONTENT_REF_ID = "r";
99
+ var ORG_LOCATION_ID = "o";
100
+ var SLOT_NODE_ID = "s";
101
+ var TEXT_NODE_ID = "t";
102
+ var COMMENT_NODE_ID = "c";
103
+ var HYDRATE_ID = "s-id";
72
104
  var HYDRATED_STYLE_ID = "sty-id";
105
+ var HYDRATE_CHILD_ID = "c-id";
73
106
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
74
107
  var XLINK_NS = "http://www.w3.org/1999/xlink";
75
108
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
@@ -172,6 +205,106 @@ function queryNonceMetaTagContent(doc) {
172
205
  return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
173
206
  }
174
207
 
208
+ // src/utils/regular-expression.ts
209
+ var escapeRegExpSpecialCharacters = (text) => {
210
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
211
+ };
212
+
213
+ // src/utils/remote-value.ts
214
+ var RemoteValue = class _RemoteValue {
215
+ /**
216
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
217
+ *
218
+ * @param serialized The serialized LocalValue object
219
+ * @returns The original JavaScript value/object
220
+ */
221
+ static fromLocalValue(serialized) {
222
+ const type = serialized[TYPE_CONSTANT];
223
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
224
+ switch (type) {
225
+ case "string" /* String */:
226
+ return value;
227
+ case "boolean" /* Boolean */:
228
+ return value;
229
+ case "bigint" /* BigInt */:
230
+ return BigInt(value);
231
+ case "undefined" /* Undefined */:
232
+ return void 0;
233
+ case "null" /* Null */:
234
+ return null;
235
+ case "number" /* Number */:
236
+ if (value === "NaN") return NaN;
237
+ if (value === "-0") return -0;
238
+ if (value === "Infinity") return Infinity;
239
+ if (value === "-Infinity") return -Infinity;
240
+ return value;
241
+ case "array" /* Array */:
242
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
243
+ case "date" /* Date */:
244
+ return new Date(value);
245
+ case "map" /* Map */:
246
+ const map2 = /* @__PURE__ */ new Map();
247
+ for (const [key, val] of value) {
248
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
249
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
250
+ map2.set(deserializedKey, deserializedValue);
251
+ }
252
+ return map2;
253
+ case "object" /* Object */:
254
+ const obj = {};
255
+ for (const [key, val] of value) {
256
+ obj[key] = _RemoteValue.fromLocalValue(val);
257
+ }
258
+ return obj;
259
+ case "regexp" /* RegularExpression */:
260
+ const { pattern, flags } = value;
261
+ return new RegExp(pattern, flags);
262
+ case "set" /* Set */:
263
+ const set = /* @__PURE__ */ new Set();
264
+ for (const item of value) {
265
+ set.add(_RemoteValue.fromLocalValue(item));
266
+ }
267
+ return set;
268
+ case "symbol" /* Symbol */:
269
+ return Symbol(value);
270
+ default:
271
+ throw new Error(`Unsupported type: ${type}`);
272
+ }
273
+ }
274
+ /**
275
+ * Utility method to deserialize multiple LocalValues at once
276
+ *
277
+ * @param serializedValues Array of serialized LocalValue objects
278
+ * @returns Array of deserialized JavaScript values
279
+ */
280
+ static fromLocalValueArray(serializedValues) {
281
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
282
+ }
283
+ /**
284
+ * Verifies if the given object matches the structure of a serialized LocalValue
285
+ *
286
+ * @param obj Object to verify
287
+ * @returns boolean indicating if the object has LocalValue structure
288
+ */
289
+ static isLocalValueObject(obj) {
290
+ if (typeof obj !== "object" || obj === null) {
291
+ return false;
292
+ }
293
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
294
+ return false;
295
+ }
296
+ const type = obj[TYPE_CONSTANT];
297
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
298
+ if (!hasTypeProperty) {
299
+ return false;
300
+ }
301
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
302
+ return obj.hasOwnProperty(VALUE_CONSTANT);
303
+ }
304
+ return true;
305
+ }
306
+ };
307
+
175
308
  // src/utils/result.ts
176
309
  var result_exports = {};
177
310
  __export(result_exports, {
@@ -220,6 +353,14 @@ var unwrapErr = (result) => {
220
353
  throw result.value;
221
354
  }
222
355
  };
356
+
357
+ // src/utils/serialize.ts
358
+ function deserializeProperty(value) {
359
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
360
+ return value;
361
+ }
362
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
363
+ }
223
364
  var updateFallbackSlotVisibility = (elm) => {
224
365
  const childNodes = internalCall(elm, "childNodes");
225
366
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
@@ -257,9 +398,8 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
257
398
  let childNode;
258
399
  for (; i2 < childNodes.length; i2++) {
259
400
  childNode = childNodes[i2];
260
- if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
401
+ if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
261
402
  slottedNodes.push(childNode);
262
- if (typeof slotName !== "undefined") return slottedNodes;
263
403
  }
264
404
  slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
265
405
  }
@@ -289,6 +429,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
289
429
  }
290
430
  return slotName === "";
291
431
  };
432
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
433
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
434
+ return;
435
+ }
436
+ const slottedNodeLocation = document.createTextNode("");
437
+ slottedNodeLocation["s-nr"] = newChild;
438
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
439
+ const parent = slotNode["s-cr"].parentNode;
440
+ const appendMethod = internalCall(parent, "appendChild");
441
+ if (typeof position !== "undefined") {
442
+ slottedNodeLocation["s-oo"] = position;
443
+ const childNodes = internalCall(parent, "childNodes");
444
+ const slotRelocateNodes = [slottedNodeLocation];
445
+ childNodes.forEach((n) => {
446
+ if (n["s-nr"]) slotRelocateNodes.push(n);
447
+ });
448
+ slotRelocateNodes.sort((a, b) => {
449
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
450
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
451
+ return 0;
452
+ });
453
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
454
+ } else {
455
+ appendMethod.call(parent, slottedNodeLocation);
456
+ }
457
+ newChild["s-ol"] = slottedNodeLocation;
458
+ newChild["s-sh"] = slotNode["s-hn"];
459
+ };
292
460
  var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
293
461
  function patchSlotNode(node) {
294
462
  if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
@@ -445,13 +613,442 @@ var convertToPrivate = (node) => {
445
613
  vnode.$name$ = node.vname;
446
614
  return vnode;
447
615
  };
616
+
617
+ // src/runtime/client-hydrate.ts
618
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
619
+ var _a;
620
+ const endHydrate = createTime("hydrateClient", tagName);
621
+ const shadowRoot = hostElm.shadowRoot;
622
+ const childRenderNodes = [];
623
+ const slotNodes = [];
624
+ const slottedNodes = [];
625
+ const shadowRootNodes = shadowRoot ? [] : null;
626
+ const vnode = newVNode(tagName, null);
627
+ vnode.$elm$ = hostElm;
628
+ const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
629
+ members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
630
+ var _a2;
631
+ if (!(memberFlags & 31 /* Prop */)) {
632
+ return;
633
+ }
634
+ const attributeName = metaAttributeName || memberName;
635
+ const attrVal = hostElm.getAttribute(attributeName);
636
+ if (attrVal !== null) {
637
+ const attrPropVal = parsePropertyValue(attrVal, memberFlags);
638
+ (_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
639
+ }
640
+ });
641
+ let scopeId2;
642
+ {
643
+ const cmpMeta = hostRef.$cmpMeta$;
644
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
645
+ scopeId2 = hostElm["s-sc"];
646
+ hostElm.classList.add(scopeId2 + "-h");
647
+ } else if (hostElm["s-sc"]) {
648
+ delete hostElm["s-sc"];
649
+ }
650
+ }
651
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
652
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
653
+ }
654
+ hostElm[HYDRATE_ID] = hostId;
655
+ hostElm.removeAttribute(HYDRATE_ID);
656
+ hostRef.$vnode$ = clientHydrate(
657
+ vnode,
658
+ childRenderNodes,
659
+ slotNodes,
660
+ shadowRootNodes,
661
+ hostElm,
662
+ hostElm,
663
+ hostId,
664
+ slottedNodes
665
+ );
666
+ let crIndex = 0;
667
+ const crLength = childRenderNodes.length;
668
+ let childRenderNode;
669
+ for (crIndex; crIndex < crLength; crIndex++) {
670
+ childRenderNode = childRenderNodes[crIndex];
671
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
672
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
673
+ const node = childRenderNode.$elm$;
674
+ if (!shadowRoot) {
675
+ node["s-hn"] = tagName.toUpperCase();
676
+ if (childRenderNode.$tag$ === "slot") {
677
+ node["s-cr"] = hostElm["s-cr"];
678
+ }
679
+ }
680
+ if (childRenderNode.$tag$ === "slot") {
681
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
682
+ if (childRenderNode.$children$) {
683
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
684
+ if (!childRenderNode.$elm$.childNodes.length) {
685
+ childRenderNode.$children$.forEach((c) => {
686
+ childRenderNode.$elm$.appendChild(c.$elm$);
687
+ });
688
+ }
689
+ } else {
690
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
691
+ }
692
+ }
693
+ if (orgLocationNode && orgLocationNode.isConnected) {
694
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
695
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
696
+ }
697
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
698
+ if (!shadowRoot) {
699
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
700
+ }
701
+ }
702
+ plt.$orgLocNodes$.delete(orgLocationId);
703
+ }
704
+ const hosts = [];
705
+ const snLen = slottedNodes.length;
706
+ let snIndex = 0;
707
+ let slotGroup;
708
+ let snGroupIdx;
709
+ let snGroupLen;
710
+ let slottedItem;
711
+ for (snIndex; snIndex < snLen; snIndex++) {
712
+ slotGroup = slottedNodes[snIndex];
713
+ if (!slotGroup || !slotGroup.length) continue;
714
+ snGroupLen = slotGroup.length;
715
+ snGroupIdx = 0;
716
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
717
+ slottedItem = slotGroup[snGroupIdx];
718
+ if (!hosts[slottedItem.hostId]) {
719
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
720
+ }
721
+ if (!hosts[slottedItem.hostId]) continue;
722
+ const hostEle = hosts[slottedItem.hostId];
723
+ if (!hostEle.shadowRoot || !shadowRoot) {
724
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
725
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
726
+ slottedItem.slot["s-cr"] = hostEle;
727
+ } else {
728
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
729
+ }
730
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
731
+ }
732
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
733
+ hostEle.appendChild(slottedItem.node);
734
+ }
735
+ }
736
+ }
737
+ if (scopeId2 && slotNodes.length) {
738
+ slotNodes.forEach((slot) => {
739
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
740
+ });
741
+ }
742
+ if (shadowRoot && !shadowRoot.childNodes.length) {
743
+ let rnIdex = 0;
744
+ const rnLen = shadowRootNodes.length;
745
+ if (rnLen) {
746
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
747
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
748
+ }
749
+ Array.from(hostElm.childNodes).forEach((node) => {
750
+ if (typeof node["s-sn"] !== "string") {
751
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
752
+ node.removeAttribute("hidden");
753
+ } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
754
+ node.parentNode.removeChild(node);
755
+ }
756
+ }
757
+ });
758
+ }
759
+ }
760
+ plt.$orgLocNodes$.delete(hostElm["s-id"]);
761
+ hostRef.$hostElement$ = hostElm;
762
+ endHydrate();
763
+ };
764
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
765
+ let childNodeType;
766
+ let childIdSplt;
767
+ let childVNode;
768
+ let i2;
769
+ const scopeId2 = hostElm["s-sc"];
770
+ if (node.nodeType === 1 /* ElementNode */) {
771
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
772
+ if (childNodeType) {
773
+ childIdSplt = childNodeType.split(".");
774
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
775
+ childVNode = createSimpleVNode({
776
+ $flags$: 0,
777
+ $hostId$: childIdSplt[0],
778
+ $nodeId$: childIdSplt[1],
779
+ $depth$: childIdSplt[2],
780
+ $index$: childIdSplt[3],
781
+ $tag$: node.tagName.toLowerCase(),
782
+ $elm$: node,
783
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
784
+ // won't try to reconcile them. Classes set on the node will be blown away.
785
+ $attrs$: { class: node.className || "" }
786
+ });
787
+ childRenderNodes.push(childVNode);
788
+ node.removeAttribute(HYDRATE_CHILD_ID);
789
+ if (!parentVNode.$children$) {
790
+ parentVNode.$children$ = [];
791
+ }
792
+ if (scopeId2) {
793
+ node["s-si"] = scopeId2;
794
+ childVNode.$attrs$.class += " " + scopeId2;
795
+ }
796
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
797
+ if (typeof slotName === "string") {
798
+ if (childVNode.$tag$ === "slot-fb") {
799
+ addSlot(
800
+ slotName,
801
+ childIdSplt[2],
802
+ childVNode,
803
+ node,
804
+ parentVNode,
805
+ childRenderNodes,
806
+ slotNodes,
807
+ shadowRootNodes,
808
+ slottedNodes
809
+ );
810
+ if (scopeId2) {
811
+ node.classList.add(scopeId2);
812
+ }
813
+ }
814
+ childVNode.$elm$["s-sn"] = slotName;
815
+ childVNode.$elm$.removeAttribute("s-sn");
816
+ }
817
+ if (childVNode.$index$ !== void 0) {
818
+ parentVNode.$children$[childVNode.$index$] = childVNode;
819
+ }
820
+ parentVNode = childVNode;
821
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
822
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
823
+ }
824
+ }
825
+ }
826
+ if (node.shadowRoot) {
827
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
828
+ clientHydrate(
829
+ parentVNode,
830
+ childRenderNodes,
831
+ slotNodes,
832
+ shadowRootNodes,
833
+ hostElm,
834
+ node.shadowRoot.childNodes[i2],
835
+ hostId,
836
+ slottedNodes
837
+ );
838
+ }
839
+ }
840
+ const nonShadowNodes = node.__childNodes || node.childNodes;
841
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
842
+ clientHydrate(
843
+ parentVNode,
844
+ childRenderNodes,
845
+ slotNodes,
846
+ shadowRootNodes,
847
+ hostElm,
848
+ nonShadowNodes[i2],
849
+ hostId,
850
+ slottedNodes
851
+ );
852
+ }
853
+ } else if (node.nodeType === 8 /* CommentNode */) {
854
+ childIdSplt = node.nodeValue.split(".");
855
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
856
+ childNodeType = childIdSplt[0];
857
+ childVNode = createSimpleVNode({
858
+ $hostId$: childIdSplt[1],
859
+ $nodeId$: childIdSplt[2],
860
+ $depth$: childIdSplt[3],
861
+ $index$: childIdSplt[4] || "0",
862
+ $elm$: node,
863
+ $attrs$: null,
864
+ $children$: null,
865
+ $key$: null,
866
+ $name$: null,
867
+ $tag$: null,
868
+ $text$: null
869
+ });
870
+ if (childNodeType === TEXT_NODE_ID) {
871
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
872
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
873
+ childVNode.$text$ = childVNode.$elm$.textContent;
874
+ childRenderNodes.push(childVNode);
875
+ node.remove();
876
+ if (hostId === childVNode.$hostId$) {
877
+ if (!parentVNode.$children$) {
878
+ parentVNode.$children$ = [];
879
+ }
880
+ parentVNode.$children$[childVNode.$index$] = childVNode;
881
+ }
882
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
883
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
884
+ }
885
+ }
886
+ } else if (childNodeType === COMMENT_NODE_ID) {
887
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
888
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
889
+ childRenderNodes.push(childVNode);
890
+ node.remove();
891
+ }
892
+ } else if (childVNode.$hostId$ === hostId) {
893
+ if (childNodeType === SLOT_NODE_ID) {
894
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
895
+ addSlot(
896
+ slotName,
897
+ childIdSplt[2],
898
+ childVNode,
899
+ node,
900
+ parentVNode,
901
+ childRenderNodes,
902
+ slotNodes,
903
+ shadowRootNodes,
904
+ slottedNodes
905
+ );
906
+ } else if (childNodeType === CONTENT_REF_ID) {
907
+ if (shadowRootNodes) {
908
+ node.remove();
909
+ } else {
910
+ hostElm["s-cr"] = node;
911
+ node["s-cn"] = true;
912
+ }
913
+ }
914
+ }
915
+ }
916
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
917
+ const vnode = newVNode(null, node.textContent);
918
+ vnode.$elm$ = node;
919
+ vnode.$index$ = "0";
920
+ parentVNode.$children$ = [vnode];
921
+ } else {
922
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
923
+ node.remove();
924
+ }
925
+ }
926
+ return parentVNode;
927
+ };
928
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
929
+ if (node.nodeType === 1 /* ElementNode */) {
930
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
931
+ if (componentId) {
932
+ orgLocNodes.set(componentId, node);
933
+ }
934
+ let i2 = 0;
935
+ if (node.shadowRoot) {
936
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
937
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
938
+ }
939
+ }
940
+ const nonShadowNodes = node.__childNodes || node.childNodes;
941
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
942
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
943
+ }
944
+ } else if (node.nodeType === 8 /* CommentNode */) {
945
+ const childIdSplt = node.nodeValue.split(".");
946
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
947
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
948
+ node.nodeValue = "";
949
+ node["s-en"] = childIdSplt[3];
950
+ }
951
+ }
952
+ };
953
+ var createSimpleVNode = (vnode) => {
954
+ const defaultVNode = {
955
+ $flags$: 0,
956
+ $hostId$: null,
957
+ $nodeId$: null,
958
+ $depth$: null,
959
+ $index$: "0",
960
+ $elm$: null,
961
+ $attrs$: null,
962
+ $children$: null,
963
+ $key$: null,
964
+ $name$: null,
965
+ $tag$: null,
966
+ $text$: null
967
+ };
968
+ return { ...defaultVNode, ...vnode };
969
+ };
970
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
971
+ node["s-sr"] = true;
972
+ childVNode.$name$ = slotName || null;
973
+ childVNode.$tag$ = "slot";
974
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
975
+ if (shadowRootNodes && win.document) {
976
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
977
+ if (childVNode.$name$) {
978
+ childVNode.$elm$.setAttribute("name", slotName);
979
+ }
980
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
981
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
982
+ } else {
983
+ node.parentNode.insertBefore(childVNode.$elm$, node);
984
+ }
985
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
986
+ node.remove();
987
+ if (childVNode.$depth$ === "0") {
988
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
989
+ }
990
+ } else {
991
+ const slot = childVNode.$elm$;
992
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
993
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
994
+ patchSlotNode(node);
995
+ if (shouldMove) {
996
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
997
+ }
998
+ childRenderNodes.push(childVNode);
999
+ }
1000
+ slotNodes.push(childVNode);
1001
+ if (!parentVNode.$children$) {
1002
+ parentVNode.$children$ = [];
1003
+ }
1004
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1005
+ }
1006
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1007
+ let slottedNode = slotNode.nextSibling;
1008
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1009
+ 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 */))) {
1010
+ slottedNode["s-sn"] = slotName;
1011
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1012
+ slottedNode = slottedNode.nextSibling;
1013
+ }
1014
+ };
1015
+ var findCorrespondingNode = (node, type) => {
1016
+ let sibling = node;
1017
+ do {
1018
+ sibling = sibling.nextSibling;
1019
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
1020
+ return sibling;
1021
+ };
1022
+ var createSupportsRuleRe = (selector) => {
1023
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
1024
+ return new RegExp(
1025
+ // First capture group: match any context before the selector that's not inside @supports selector()
1026
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
1027
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
1028
+ "g"
1029
+ );
1030
+ };
1031
+ createSupportsRuleRe("::slotted");
1032
+ createSupportsRuleRe(":host");
1033
+ createSupportsRuleRe(":host-context");
448
1034
  var parsePropertyValue = (propValue, propType) => {
1035
+ if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
1036
+ try {
1037
+ propValue = JSON.parse(propValue);
1038
+ return propValue;
1039
+ } catch (e) {
1040
+ }
1041
+ }
1042
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1043
+ propValue = deserializeProperty(propValue);
1044
+ return propValue;
1045
+ }
449
1046
  if (propValue != null && !isComplexType(propValue)) {
450
1047
  if (propType & 4 /* Boolean */) {
451
1048
  return propValue === "false" ? false : propValue === "" || !!propValue;
452
1049
  }
453
1050
  if (propType & 2 /* Number */) {
454
- return parseFloat(propValue);
1051
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
455
1052
  }
456
1053
  if (propType & 1 /* String */) {
457
1054
  return String(propValue);
@@ -468,9 +1065,9 @@ var createEvent = (ref, name, flags) => {
468
1065
  return {
469
1066
  emit: (detail) => {
470
1067
  return emitEvent(elm, name, {
471
- bubbles: !!(flags & 4 /* Bubbles */),
472
- composed: !!(flags & 2 /* Composed */),
473
- cancelable: !!(flags & 1 /* Cancellable */),
1068
+ bubbles: true,
1069
+ composed: true,
1070
+ cancelable: true,
474
1071
  detail
475
1072
  });
476
1073
  }
@@ -513,7 +1110,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
513
1110
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
514
1111
  }
515
1112
  if (!appliedStyles.has(scopeId2)) {
516
- {
1113
+ if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1114
+ styleElm.innerHTML = style;
1115
+ } else {
517
1116
  styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
518
1117
  styleElm.innerHTML = style;
519
1118
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -570,13 +1169,24 @@ var attachStyles = (hostRef) => {
570
1169
  const scopeId2 = addStyle(
571
1170
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
572
1171
  cmpMeta);
573
- if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
1172
+ if (flags & 10 /* needsScopedEncapsulation */) {
574
1173
  elm["s-sc"] = scopeId2;
575
1174
  elm.classList.add(scopeId2 + "-h");
576
1175
  }
577
1176
  endAttachStyles();
578
1177
  };
579
1178
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
1179
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1180
+ var hydrateScopedToShadow = () => {
1181
+ if (!win.document) {
1182
+ return;
1183
+ }
1184
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1185
+ let i2 = 0;
1186
+ for (; i2 < styles2.length; i2++) {
1187
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1188
+ }
1189
+ };
580
1190
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
581
1191
  if (oldValue === newValue) {
582
1192
  return;
@@ -587,7 +1197,14 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
587
1197
  const classList = elm.classList;
588
1198
  const oldClasses = parseClassList(oldValue);
589
1199
  let newClasses = parseClassList(newValue);
590
- {
1200
+ if (elm["s-si"] && initialRender) {
1201
+ newClasses.push(elm["s-si"]);
1202
+ oldClasses.forEach((c) => {
1203
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
1204
+ });
1205
+ newClasses = [...new Set(newClasses)];
1206
+ classList.add(...newClasses);
1207
+ } else {
591
1208
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
592
1209
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
593
1210
  }
@@ -707,7 +1324,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
707
1324
  oldVnodeAttrs[memberName],
708
1325
  void 0,
709
1326
  isSvgMode2,
710
- newVnode.$flags$);
1327
+ newVnode.$flags$,
1328
+ isInitialRender
1329
+ );
711
1330
  }
712
1331
  }
713
1332
  }
@@ -718,7 +1337,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
718
1337
  oldVnodeAttrs[memberName],
719
1338
  newVnodeAttrs[memberName],
720
1339
  isSvgMode2,
721
- newVnode.$flags$);
1340
+ newVnode.$flags$,
1341
+ isInitialRender
1342
+ );
722
1343
  }
723
1344
  };
724
1345
  function sortedAttrNames(attrNames) {
@@ -830,14 +1451,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
830
1451
  var putBackInOriginalLocation = (parentElm, recursive) => {
831
1452
  plt.$flags$ |= 1 /* isTmpDisconnected */;
832
1453
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
833
- if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
834
- let node = parentElm;
835
- while (node = node.nextSibling) {
836
- if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
837
- oldSlotChildNodes.push(node);
838
- }
839
- }
840
- }
841
1454
  for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
842
1455
  const childNode = oldSlotChildNodes[i2];
843
1456
  if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
@@ -851,7 +1464,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
851
1464
  putBackInOriginalLocation(childNode, recursive);
852
1465
  }
853
1466
  }
854
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1467
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
855
1468
  };
856
1469
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
857
1470
  let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
@@ -1011,7 +1624,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1011
1624
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1012
1625
  }
1013
1626
  {
1014
- updateElement(oldVNode, newVNode2, isSvgMode);
1627
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
1015
1628
  }
1016
1629
  if (oldChildren !== null && newChildren !== null) {
1017
1630
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -1047,7 +1660,7 @@ var markSlotContentForRelocation = (elm) => {
1047
1660
  const slotName = childNode["s-sn"];
1048
1661
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1049
1662
  node = hostContentNodes[j];
1050
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
1663
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
1051
1664
  if (isNodeLocatedInSlot(node, slotName)) {
1052
1665
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1053
1666
  checkSlotFallbackVisibility = true;
@@ -1125,7 +1738,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1125
1738
  const hostElm = hostRef.$hostElement$;
1126
1739
  const cmpMeta = hostRef.$cmpMeta$;
1127
1740
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1128
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1741
+ const isHostElement = isHost(renderFnResults);
1742
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
1129
1743
  hostTagName = hostElm.tagName;
1130
1744
  if (isInitialLoad && rootVnode.$attrs$) {
1131
1745
  for (const key of Object.keys(rootVnode.$attrs$)) {
@@ -1209,7 +1823,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1209
1823
  if (checkSlotFallbackVisibility) {
1210
1824
  updateFallbackSlotVisibility(rootVnode.$elm$);
1211
1825
  }
1212
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1826
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
1213
1827
  relocateNodes.length = 0;
1214
1828
  }
1215
1829
  contentRef = void 0;
@@ -1300,7 +1914,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1300
1914
  renderingRef = instance;
1301
1915
  instance = instance.render() ;
1302
1916
  {
1303
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1917
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
1304
1918
  }
1305
1919
  {
1306
1920
  hostRef.$flags$ |= 2 /* hasRendered */;
@@ -1351,7 +1965,7 @@ var postUpdateComponent = (hostRef) => {
1351
1965
  if (hostRef.$flags$ & 512 /* needsRerender */) {
1352
1966
  nextTick(() => scheduleUpdate(hostRef, false));
1353
1967
  }
1354
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1968
+ hostRef.$flags$ &= -517;
1355
1969
  }
1356
1970
  };
1357
1971
  var forceUpdate = (ref) => {
@@ -1454,7 +2068,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1454
2068
  const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1455
2069
  if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1456
2070
  if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1457
- if (flags & 1 /* isElementConstructor */ || !origGetter) {
2071
+ {
1458
2072
  Object.defineProperty(prototype, memberName, {
1459
2073
  get() {
1460
2074
  {
@@ -1494,10 +2108,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1494
2108
  plt.jmp(() => {
1495
2109
  var _a2;
1496
2110
  const propName = attrNameToPropName.get(attrName);
1497
- if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
1498
- newValue = this[propName];
1499
- delete this[propName];
1500
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
2111
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ; else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
1501
2112
  this[propName] == newValue) {
1502
2113
  return;
1503
2114
  } else if (propName == null) {
@@ -1579,7 +2190,21 @@ var connectedCallback = (elm) => {
1579
2190
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1580
2191
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1581
2192
  hostRef.$flags$ |= 1 /* hasConnected */;
2193
+ let hostId;
1582
2194
  {
2195
+ hostId = elm.getAttribute(HYDRATE_ID);
2196
+ if (hostId) {
2197
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2198
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
2199
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2200
+ } else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2201
+ const scopeId2 = getScopeId(cmpMeta);
2202
+ elm["s-sc"] = scopeId2;
2203
+ }
2204
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2205
+ }
2206
+ }
2207
+ if (!hostId) {
1583
2208
  if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1584
2209
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
1585
2210
  setContentReference(elm);
@@ -1588,7 +2213,7 @@ var connectedCallback = (elm) => {
1588
2213
  {
1589
2214
  let ancestorComponent = elm;
1590
2215
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1591
- if (ancestorComponent["s-p"]) {
2216
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1592
2217
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1593
2218
  break;
1594
2219
  }
@@ -1603,7 +2228,9 @@ var connectedCallback = (elm) => {
1603
2228
  }
1604
2229
  });
1605
2230
  }
1606
- {
2231
+ if (BUILD.initializeNextTick) {
2232
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2233
+ } else {
1607
2234
  initializeComponent(elm, hostRef, cmpMeta);
1608
2235
  }
1609
2236
  } else {
@@ -1656,6 +2283,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
1656
2283
  {
1657
2284
  cmpMeta.$watchers$ = Cstr.$watchers$;
1658
2285
  }
2286
+ {
2287
+ hydrateScopedToShadow();
2288
+ }
1659
2289
  const originalConnectedCallback = Cstr.prototype.connectedCallback;
1660
2290
  const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
1661
2291
  Object.assign(Cstr.prototype, {
@@ -1739,4 +2369,17 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
1739
2369
  // src/runtime/platform-options.ts
1740
2370
  var setPlatformOptions = (opts) => Object.assign(plt, opts);
1741
2371
 
1742
- export { Fragment as F, H, setNonce as a, setPlatformOptions as b, getRenderingRef as c, createEvent as d, Host as e, forceUpdate as f, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
2372
+ // src/runtime/render.ts
2373
+ function render(vnode, container) {
2374
+ const cmpMeta = {
2375
+ $flags$: 0,
2376
+ $tagName$: container.tagName
2377
+ };
2378
+ const ref = {
2379
+ $cmpMeta$: cmpMeta,
2380
+ $hostElement$: container
2381
+ };
2382
+ renderVdom(ref, vnode);
2383
+ }
2384
+
2385
+ export { Fragment as F, H, Host as a, getAssetPath as b, createEvent as c, setNonce as d, setPlatformOptions as e, forceUpdate as f, getRenderingRef as g, h, proxyCustomElement as p, render as r, setAssetPath as s };