@devschile/chucao 1.5.3 → 1.7.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 (132) hide show
  1. package/README.md +5 -3
  2. package/dist/chucao/chucao.css +1 -1
  3. package/dist/chucao/chucao.esm.js +1 -1
  4. package/dist/chucao/chucao.esm.js.map +1 -1
  5. package/dist/chucao/index.esm.js +1 -1
  6. package/dist/chucao/index.esm.js.map +1 -1
  7. package/dist/chucao/p-0305f2eb.entry.js +2 -0
  8. package/dist/chucao/{p-117c93d3.entry.js.map → p-0305f2eb.entry.js.map} +1 -1
  9. package/dist/chucao/{p-b07c23e1.entry.js → p-053d58a4.entry.js} +2 -2
  10. package/dist/chucao/{p-bb82aaf8.entry.js → p-20492b73.entry.js} +2 -2
  11. package/dist/chucao/p-488c7838.entry.js +2 -0
  12. package/dist/chucao/{p-061ffcf3.entry.js → p-9a614e82.entry.js} +2 -2
  13. package/dist/chucao/{p-14d8a79c.entry.js → p-ad3206a2.entry.js} +2 -2
  14. package/dist/chucao/p-c598f978.entry.js +2 -0
  15. package/dist/chucao/p-c598f978.entry.js.map +1 -0
  16. package/dist/chucao/{p-c0c5522f.entry.js → p-fe8e9537.entry.js} +2 -2
  17. package/dist/chucao/p-pfWAsOzE.js +3 -0
  18. package/dist/chucao/p-pfWAsOzE.js.map +1 -0
  19. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  20. package/dist/cjs/{ch-badge_6.cjs.entry.js → ch-alert_8.cjs.entry.js} +73 -9
  21. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -0
  22. package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
  23. package/dist/cjs/ch-divider.cjs.entry.js +2 -2
  24. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  25. package/dist/cjs/ch-radio.cjs.entry.js +2 -2
  26. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  27. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  28. package/dist/cjs/chucao.cjs.js +3 -3
  29. package/dist/cjs/chucao.cjs.js.map +1 -1
  30. package/dist/cjs/{index-D7ZSLrHc.js → index-ls4U227d.js} +715 -16
  31. package/dist/cjs/index-ls4U227d.js.map +1 -0
  32. package/dist/cjs/index.cjs.js +7 -1
  33. package/dist/cjs/index.cjs.js.map +1 -1
  34. package/dist/cjs/loader.cjs.js +2 -2
  35. package/dist/collection/collection-manifest.json +3 -1
  36. package/dist/collection/components/ch-alert/ch-alert.css +77 -0
  37. package/dist/collection/components/ch-alert/ch-alert.js +118 -0
  38. package/dist/collection/components/ch-alert/ch-alert.js.map +1 -0
  39. package/dist/collection/components/ch-badge/ch-badge.js +1 -1
  40. package/dist/collection/components/ch-button/ch-button.js +1 -1
  41. package/dist/collection/components/ch-button/ch-button.js.map +1 -1
  42. package/dist/collection/components/ch-card/ch-card.js +1 -1
  43. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  44. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  45. package/dist/collection/components/ch-input/ch-input.js +1 -1
  46. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  47. package/dist/collection/components/ch-select/ch-select.js +1 -1
  48. package/dist/collection/components/ch-spinner/ch-spinner.css +39 -0
  49. package/dist/collection/components/ch-spinner/ch-spinner.js +90 -0
  50. package/dist/collection/components/ch-spinner/ch-spinner.js.map +1 -0
  51. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  52. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  53. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  54. package/dist/collection/tokens/tokens.js +5 -1
  55. package/dist/collection/tokens/tokens.js.map +1 -1
  56. package/dist/collection/tokens/types.js.map +1 -1
  57. package/dist/components/ch-accordion.js +1 -1
  58. package/dist/components/ch-alert.d.ts +11 -0
  59. package/dist/components/ch-alert.js +2 -0
  60. package/dist/components/ch-alert.js.map +1 -0
  61. package/dist/components/ch-badge.js +1 -1
  62. package/dist/components/ch-button.js +1 -1
  63. package/dist/components/ch-button.js.map +1 -1
  64. package/dist/components/ch-card.js +1 -1
  65. package/dist/components/ch-card.js.map +1 -1
  66. package/dist/components/ch-checkbox.js +1 -1
  67. package/dist/components/ch-divider.js +1 -1
  68. package/dist/components/ch-input.js +1 -1
  69. package/dist/components/ch-link.js +1 -1
  70. package/dist/components/ch-radio.js +1 -1
  71. package/dist/components/ch-select.js +1 -1
  72. package/dist/components/ch-spinner.d.ts +11 -0
  73. package/dist/components/ch-spinner.js +2 -0
  74. package/dist/components/ch-spinner.js.map +1 -0
  75. package/dist/components/ch-switch.js +1 -1
  76. package/dist/components/ch-tabs.js +1 -1
  77. package/dist/components/ch-textarea.js +1 -1
  78. package/dist/components/index.js +1 -1
  79. package/dist/components/index.js.map +1 -1
  80. package/dist/components/p-ONE3uKkF.js +2 -0
  81. package/dist/components/p-ONE3uKkF.js.map +1 -0
  82. package/dist/esm/ch-accordion.entry.js +1 -1
  83. package/dist/esm/{ch-badge_6.entry.js → ch-alert_8.entry.js} +72 -10
  84. package/dist/esm/ch-alert_8.entry.js.map +1 -0
  85. package/dist/esm/ch-checkbox.entry.js +2 -2
  86. package/dist/esm/ch-divider.entry.js +2 -2
  87. package/dist/esm/ch-link.entry.js +1 -1
  88. package/dist/esm/ch-radio.entry.js +2 -2
  89. package/dist/esm/ch-tabs.entry.js +2 -2
  90. package/dist/esm/ch-textarea.entry.js +2 -2
  91. package/dist/esm/chucao.js +4 -4
  92. package/dist/esm/chucao.js.map +1 -1
  93. package/dist/esm/{index-B0AkgfgP.js → index-pfWAsOzE.js} +715 -16
  94. package/dist/esm/index-pfWAsOzE.js.map +1 -0
  95. package/dist/esm/index.js +6 -2
  96. package/dist/esm/index.js.map +1 -1
  97. package/dist/esm/loader.js +3 -3
  98. package/dist/types/components/ch-alert/ch-alert.d.ts +34 -0
  99. package/dist/types/components/ch-spinner/ch-spinner.d.ts +25 -0
  100. package/dist/types/components.d.ts +153 -0
  101. package/dist/types/stencil-public-runtime.d.ts +11 -0
  102. package/dist/types/tokens/tokens.d.ts +4 -0
  103. package/dist/types/tokens/types.d.ts +2 -2
  104. package/dist-react/components.d.ts +9 -1
  105. package/dist-react/components.js +18 -0
  106. package/dist-react/components.ts +25 -1
  107. package/dist-vue/index.d.ts +2 -0
  108. package/dist-vue/index.js +13 -0
  109. package/dist-vue/index.ts +17 -0
  110. package/hydrate/index.d.ts +287 -0
  111. package/hydrate/index.js +24405 -0
  112. package/hydrate/index.mjs +24395 -0
  113. package/hydrate/package.json +12 -0
  114. package/package.json +12 -2
  115. package/dist/chucao/p-117c93d3.entry.js +0 -2
  116. package/dist/chucao/p-B0AkgfgP.js +0 -3
  117. package/dist/chucao/p-B0AkgfgP.js.map +0 -1
  118. package/dist/chucao/p-c1edf460.entry.js +0 -2
  119. package/dist/chucao/p-fa56821f.entry.js +0 -2
  120. package/dist/chucao/p-fa56821f.entry.js.map +0 -1
  121. package/dist/cjs/ch-badge_6.cjs.entry.js.map +0 -1
  122. package/dist/cjs/index-D7ZSLrHc.js.map +0 -1
  123. package/dist/components/p-W-iJXblk.js +0 -2
  124. package/dist/components/p-W-iJXblk.js.map +0 -1
  125. package/dist/esm/ch-badge_6.entry.js.map +0 -1
  126. package/dist/esm/index-B0AkgfgP.js.map +0 -1
  127. /package/dist/chucao/{p-b07c23e1.entry.js.map → p-053d58a4.entry.js.map} +0 -0
  128. /package/dist/chucao/{p-bb82aaf8.entry.js.map → p-20492b73.entry.js.map} +0 -0
  129. /package/dist/chucao/{p-c1edf460.entry.js.map → p-488c7838.entry.js.map} +0 -0
  130. /package/dist/chucao/{p-061ffcf3.entry.js.map → p-9a614e82.entry.js.map} +0 -0
  131. /package/dist/chucao/{p-14d8a79c.entry.js.map → p-ad3206a2.entry.js.map} +0 -0
  132. /package/dist/chucao/{p-c0c5522f.entry.js.map → p-fe8e9537.entry.js.map} +0 -0
@@ -4,12 +4,36 @@ const NAMESPACE = 'chucao';
4
4
  const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
5
5
 
6
6
  const globalScripts = () => {};
7
- const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--easing-default:ease;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
7
+ const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--duration-spin:800ms;--easing-default:ease;--easing-linear:linear;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
8
8
 
9
9
  /*
10
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
10
+ Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
11
11
  */
12
12
 
13
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
14
+ PrimitiveType2["Undefined"] = "undefined";
15
+ PrimitiveType2["Null"] = "null";
16
+ PrimitiveType2["String"] = "string";
17
+ PrimitiveType2["Number"] = "number";
18
+ PrimitiveType2["SpecialNumber"] = "number";
19
+ PrimitiveType2["Boolean"] = "boolean";
20
+ PrimitiveType2["BigInt"] = "bigint";
21
+ return PrimitiveType2;
22
+ })(PrimitiveType || {});
23
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
24
+ NonPrimitiveType2["Array"] = "array";
25
+ NonPrimitiveType2["Date"] = "date";
26
+ NonPrimitiveType2["Map"] = "map";
27
+ NonPrimitiveType2["Object"] = "object";
28
+ NonPrimitiveType2["RegularExpression"] = "regexp";
29
+ NonPrimitiveType2["Set"] = "set";
30
+ NonPrimitiveType2["Channel"] = "channel";
31
+ NonPrimitiveType2["Symbol"] = "symbol";
32
+ return NonPrimitiveType2;
33
+ })(NonPrimitiveType || {});
34
+ var TYPE_CONSTANT = "type";
35
+ var VALUE_CONSTANT = "value";
36
+ var SERIALIZED_PREFIX = "serialized:";
13
37
 
14
38
  // src/utils/get-prop-descriptor.ts
15
39
  function getPropertyDescriptor(obj, memberName, getOnly) {
@@ -92,7 +116,9 @@ var consoleError = (e, el) => (0, console.error)(e, el);
92
116
 
93
117
  // src/client/client-load-module.ts
94
118
  var cmpModules = /* @__PURE__ */ new Map();
119
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
95
120
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
121
+ var _a;
96
122
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
97
123
  const bundleId = cmpMeta.$lazyBundleId$;
98
124
  if (!bundleId) {
@@ -102,21 +128,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
102
128
  if (module) {
103
129
  return module[exportName];
104
130
  }
131
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
132
+ const cacheBustParams = [
133
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
134
+ ""
135
+ ].filter(Boolean).join("&");
105
136
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
106
137
  return import(
107
138
  /* @vite-ignore */
108
139
  /* webpackInclude: /\.entry\.js$/ */
109
140
  /* webpackExclude: /\.system\.entry\.js$/ */
110
141
  /* webpackMode: "lazy" */
111
- `./${bundleId}.entry.js${""}`
142
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
112
143
  ).then(
113
144
  (importedModule) => {
114
145
  {
146
+ failedLoadAttempts.delete(bundleId);
115
147
  cmpModules.set(bundleId, importedModule);
116
148
  }
117
149
  return importedModule[exportName];
118
150
  },
119
151
  (e) => {
152
+ failedLoadAttempts.set(bundleId, retryCount + 1);
120
153
  consoleError(e, hostRef.$hostElement$);
121
154
  }
122
155
  );
@@ -124,7 +157,19 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
124
157
 
125
158
  // src/client/client-style.ts
126
159
  var styles = /* @__PURE__ */ new Map();
160
+
161
+ // src/runtime/runtime-constants.ts
162
+ var CONTENT_REF_ID = "r";
163
+ var ORG_LOCATION_ID = "o";
164
+ var SLOT_NODE_ID = "s";
165
+ var TEXT_NODE_ID = "t";
166
+ var COMMENT_NODE_ID = "c";
167
+ var HYDRATE_ID = "s-id";
168
+ var HYDRATED_STYLE_ID = "sty-id";
169
+ var HYDRATE_CHILD_ID = "c-id";
127
170
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
171
+ var MAX_LAZY_LOAD_RETRIES = 3;
172
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
128
173
  var win = typeof window !== "undefined" ? window : {};
129
174
  var plt = {
130
175
  $flags$: 0,
@@ -151,6 +196,10 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
151
196
  var queuePending = false;
152
197
  var queueDomReads = [];
153
198
  var queueDomWrites = [];
199
+ var scheduleFlush = () => {
200
+ var _a;
201
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
202
+ };
154
203
  var queueTask = (queue, write) => (cb) => {
155
204
  queue.push(cb);
156
205
  if (!queuePending) {
@@ -158,7 +207,7 @@ var queueTask = (queue, write) => (cb) => {
158
207
  if (write && plt.$flags$ & 4 /* queueSync */) {
159
208
  nextTick(flush);
160
209
  } else {
161
- plt.raf(flush);
210
+ scheduleFlush();
162
211
  }
163
212
  }
164
213
  };
@@ -177,7 +226,7 @@ var flush = () => {
177
226
  {
178
227
  consume(queueDomWrites);
179
228
  if (queuePending = queueDomReads.length > 0) {
180
- plt.raf(flush);
229
+ scheduleFlush();
181
230
  }
182
231
  }
183
232
  };
@@ -211,6 +260,82 @@ function createShadowRoot(cmpMeta) {
211
260
  shadowRoot.prepend(styleElm);
212
261
  }
213
262
  }
263
+ var getSlottedChildNodes = (childNodes) => {
264
+ const result = [];
265
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
266
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
267
+ if (slottedNode && slottedNode.isConnected) {
268
+ result.push(slottedNode);
269
+ }
270
+ }
271
+ return result;
272
+ };
273
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
274
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
275
+ return;
276
+ }
277
+ const slottedNodeLocation = document.createTextNode("");
278
+ slottedNodeLocation["s-nr"] = newChild;
279
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
280
+ const parent = slotNode["s-cr"].parentNode;
281
+ const appendMethod = internalCall(parent, "appendChild");
282
+ if (typeof position !== "undefined") {
283
+ slottedNodeLocation["s-oo"] = position;
284
+ const childNodes = internalCall(parent, "childNodes");
285
+ const slotRelocateNodes = [slottedNodeLocation];
286
+ childNodes.forEach((n) => {
287
+ if (n["s-nr"]) slotRelocateNodes.push(n);
288
+ });
289
+ slotRelocateNodes.sort((a, b) => {
290
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
291
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
292
+ return 0;
293
+ });
294
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
295
+ } else {
296
+ appendMethod.call(parent, slottedNodeLocation);
297
+ }
298
+ newChild["s-ol"] = slottedNodeLocation;
299
+ newChild["s-sh"] = slotNode["s-hn"];
300
+ };
301
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
302
+ function patchSlotNode(node) {
303
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
304
+ const assignedFactory = (elementsOnly) => (function(opts) {
305
+ const toReturn = [];
306
+ const slotName = this["s-sn"];
307
+ if (opts == null ? void 0 : opts.flatten) {
308
+ console.error(`
309
+ Flattening is not supported for Stencil non-shadow slots.
310
+ You can use \`.childNodes\` to nested slot fallback content.
311
+ If you have a particular use case, please open an issue on the Stencil repo.
312
+ `);
313
+ }
314
+ const parent = this["s-cr"].parentElement;
315
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
316
+ slottedNodes.forEach((n) => {
317
+ if (slotName === getSlotName(n)) {
318
+ toReturn.push(n);
319
+ }
320
+ });
321
+ if (elementsOnly) {
322
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
323
+ }
324
+ return toReturn;
325
+ }).bind(node);
326
+ node.assignedElements = assignedFactory(true);
327
+ node.assignedNodes = assignedFactory(false);
328
+ }
329
+ function internalCall(node, method) {
330
+ if ("__" + method in node) {
331
+ const toReturn = node["__" + method];
332
+ if (typeof toReturn !== "function") return toReturn;
333
+ return toReturn.bind(node);
334
+ } else {
335
+ if (typeof node[method] !== "function") return node[method];
336
+ return node[method].bind(node);
337
+ }
338
+ }
214
339
  var createTime = (fnName, tagName = "") => {
215
340
  {
216
341
  return () => {
@@ -264,7 +389,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
264
389
  if (!appliedStyles) {
265
390
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
266
391
  }
267
- if (!appliedStyles.has(scopeId2)) {
392
+ const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
393
+ if (existingStyleElm) {
394
+ existingStyleElm.textContent = style;
395
+ } else if (!appliedStyles.has(scopeId2)) {
268
396
  styleElm = win.document.createElement("style");
269
397
  styleElm.textContent = style;
270
398
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -333,6 +461,12 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
333
461
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
334
462
  }
335
463
  appliedStyles.add(scopeId2);
464
+ if ("host" in styleContainerNode) {
465
+ const ssrStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
466
+ if (ssrStyleElm) {
467
+ writeTask(() => ssrStyleElm.remove());
468
+ }
469
+ }
336
470
  }
337
471
  }
338
472
  }
@@ -353,6 +487,17 @@ var attachStyles = (hostRef) => {
353
487
  endAttachStyles();
354
488
  };
355
489
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
490
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
491
+ var hydrateScopedToShadow = () => {
492
+ if (!win.document) {
493
+ return;
494
+ }
495
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
496
+ let i2 = 0;
497
+ for (; i2 < styles2.length; i2++) {
498
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
499
+ }
500
+ };
356
501
  var isComplexType = (o) => {
357
502
  o = typeof o;
358
503
  return o === "object" || o === "function";
@@ -376,6 +521,11 @@ var h = (nodeName, vnodeData, ...children) => {
376
521
  } else if (child != null && typeof child !== "boolean") {
377
522
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
378
523
  child = String(child);
524
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
525
+ {
526
+ consoleError("Invalid vNode child");
527
+ }
528
+ continue;
379
529
  }
380
530
  if (simple && lastSimple) {
381
531
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -428,8 +578,511 @@ var newVNode = (tag, text) => {
428
578
  var Host = {};
429
579
  var isHost = (node) => node && node.$tag$ === Host;
430
580
 
581
+ // src/runtime/client-hydrate.ts
582
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
583
+ var _a, _b, _c, _d;
584
+ const endHydrate = createTime("hydrateClient", tagName);
585
+ const shadowRoot = hostElm.shadowRoot;
586
+ const childRenderNodes = [];
587
+ const slotNodes = [];
588
+ const slottedNodes = [];
589
+ const shadowRootNodes = shadowRoot ? [] : null;
590
+ const vnode = newVNode(tagName, null);
591
+ vnode.$elm$ = hostElm;
592
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
593
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
594
+ }
595
+ hostElm[HYDRATE_ID] = hostId;
596
+ hostElm.removeAttribute(HYDRATE_ID);
597
+ hostRef.$vnode$ = clientHydrate(
598
+ vnode,
599
+ childRenderNodes,
600
+ slotNodes,
601
+ shadowRootNodes,
602
+ hostElm,
603
+ hostElm,
604
+ hostId,
605
+ slottedNodes
606
+ );
607
+ let crIndex = 0;
608
+ const crLength = childRenderNodes.length;
609
+ let childRenderNode;
610
+ for (crIndex; crIndex < crLength; crIndex++) {
611
+ childRenderNode = childRenderNodes[crIndex];
612
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
613
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
614
+ const node = childRenderNode.$elm$;
615
+ if (!shadowRoot) {
616
+ node["s-hn"] = transformTag(tagName).toUpperCase();
617
+ if (childRenderNode.$tag$ === "slot") {
618
+ node["s-cr"] = hostElm["s-cr"];
619
+ }
620
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
621
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
622
+ if (cmpMeta) {
623
+ const scopeId3 = getScopeId(
624
+ cmpMeta.$cmpMeta$);
625
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
626
+ if (styleSheet) {
627
+ shadowRootNodes.unshift(styleSheet.cloneNode(true));
628
+ }
629
+ }
630
+ }
631
+ if (childRenderNode.$tag$ === "slot") {
632
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
633
+ if (childRenderNode.$children$) {
634
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
635
+ if (!childRenderNode.$elm$.childNodes.length) {
636
+ childRenderNode.$children$.forEach((c) => {
637
+ childRenderNode.$elm$.appendChild(c.$elm$);
638
+ });
639
+ }
640
+ } else {
641
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
642
+ }
643
+ }
644
+ if (orgLocationNode && orgLocationNode.isConnected) {
645
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
646
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
647
+ }
648
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
649
+ if (!shadowRoot) {
650
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
651
+ }
652
+ }
653
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
654
+ plt.$orgLocNodes$.delete(orgLocationId);
655
+ }
656
+ }
657
+ const hosts = [];
658
+ const snLen = slottedNodes.length;
659
+ let snIndex = 0;
660
+ let slotGroup;
661
+ let snGroupIdx;
662
+ let snGroupLen;
663
+ let slottedItem;
664
+ let currentPos = 0;
665
+ for (snIndex; snIndex < snLen; snIndex++) {
666
+ slotGroup = slottedNodes[snIndex];
667
+ if (!slotGroup || !slotGroup.length) continue;
668
+ snGroupLen = slotGroup.length;
669
+ snGroupIdx = 0;
670
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
671
+ slottedItem = slotGroup[snGroupIdx];
672
+ if (!hosts[slottedItem.hostId]) {
673
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
674
+ }
675
+ if (!hosts[slottedItem.hostId]) continue;
676
+ const hostEle = hosts[slottedItem.hostId];
677
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
678
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
679
+ }
680
+ if (!hostEle.shadowRoot || !shadowRoot) {
681
+ if (!slottedItem.slot["s-cr"]) {
682
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
683
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
684
+ slottedItem.slot["s-cr"] = hostEle;
685
+ } else {
686
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
687
+ }
688
+ }
689
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
690
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
691
+ slottedItem.node.removeAttribute("slot");
692
+ }
693
+ }
694
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
695
+ }
696
+ }
697
+ if (shadowRoot && !shadowRoot.childNodes.length) {
698
+ let rnIdex = 0;
699
+ const rnLen = shadowRootNodes.length;
700
+ if (rnLen) {
701
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
702
+ const node = shadowRootNodes[rnIdex];
703
+ if (node) {
704
+ shadowRoot.appendChild(node);
705
+ }
706
+ }
707
+ Array.from(hostElm.childNodes).forEach((node) => {
708
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
709
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
710
+ node.removeAttribute("hidden");
711
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
712
+ node.parentNode.removeChild(node);
713
+ }
714
+ }
715
+ });
716
+ }
717
+ }
718
+ hostRef.$hostElement$ = hostElm;
719
+ endHydrate();
720
+ };
721
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
722
+ let childNodeType;
723
+ let childIdSplt;
724
+ let childVNode;
725
+ let i2;
726
+ if (node.nodeType === 1 /* ElementNode */) {
727
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
728
+ if (childNodeType) {
729
+ childIdSplt = childNodeType.split(".");
730
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
731
+ childVNode = createSimpleVNode({
732
+ $flags$: 0,
733
+ $hostId$: childIdSplt[0],
734
+ $nodeId$: childIdSplt[1],
735
+ $depth$: childIdSplt[2],
736
+ $index$: childIdSplt[3],
737
+ $tag$: node.tagName.toLowerCase(),
738
+ $elm$: node,
739
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
740
+ // won't try to reconcile them. Classes set on the node will be blown away.
741
+ $attrs$: { class: node.className || "" }
742
+ });
743
+ childRenderNodes.push(childVNode);
744
+ node.removeAttribute(HYDRATE_CHILD_ID);
745
+ if (!parentVNode.$children$) {
746
+ parentVNode.$children$ = [];
747
+ }
748
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
749
+ if (typeof slotName === "string") {
750
+ if (childVNode.$tag$ === "slot-fb") {
751
+ addSlot(
752
+ slotName,
753
+ childIdSplt[2],
754
+ childVNode,
755
+ node,
756
+ parentVNode,
757
+ childRenderNodes,
758
+ slotNodes,
759
+ shadowRootNodes,
760
+ slottedNodes
761
+ );
762
+ }
763
+ childVNode.$elm$["s-sn"] = slotName;
764
+ childVNode.$elm$.removeAttribute("s-sn");
765
+ }
766
+ if (childVNode.$index$ !== void 0) {
767
+ parentVNode.$children$[childVNode.$index$] = childVNode;
768
+ }
769
+ parentVNode = childVNode;
770
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
771
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
772
+ }
773
+ }
774
+ }
775
+ if (node.shadowRoot) {
776
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
777
+ clientHydrate(
778
+ parentVNode,
779
+ childRenderNodes,
780
+ slotNodes,
781
+ shadowRootNodes,
782
+ hostElm,
783
+ node.shadowRoot.childNodes[i2],
784
+ hostId,
785
+ slottedNodes
786
+ );
787
+ }
788
+ }
789
+ const nonShadowNodes = node.__childNodes || node.childNodes;
790
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
791
+ clientHydrate(
792
+ parentVNode,
793
+ childRenderNodes,
794
+ slotNodes,
795
+ shadowRootNodes,
796
+ hostElm,
797
+ nonShadowNodes[i2],
798
+ hostId,
799
+ slottedNodes
800
+ );
801
+ }
802
+ } else if (node.nodeType === 8 /* CommentNode */) {
803
+ childIdSplt = node.nodeValue.split(".");
804
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
805
+ childNodeType = childIdSplt[0];
806
+ childVNode = createSimpleVNode({
807
+ $hostId$: childIdSplt[1],
808
+ $nodeId$: childIdSplt[2],
809
+ $depth$: childIdSplt[3],
810
+ $index$: childIdSplt[4] || "0",
811
+ $elm$: node,
812
+ $attrs$: null,
813
+ $children$: null,
814
+ $key$: null,
815
+ $name$: null,
816
+ $tag$: null,
817
+ $text$: null
818
+ });
819
+ if (childNodeType === TEXT_NODE_ID) {
820
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
821
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
822
+ childVNode.$text$ = childVNode.$elm$.textContent;
823
+ childRenderNodes.push(childVNode);
824
+ node.remove();
825
+ if (hostId === childVNode.$hostId$) {
826
+ if (!parentVNode.$children$) {
827
+ parentVNode.$children$ = [];
828
+ }
829
+ parentVNode.$children$[childVNode.$index$] = childVNode;
830
+ }
831
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
832
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
833
+ }
834
+ }
835
+ } else if (childNodeType === COMMENT_NODE_ID) {
836
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
837
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
838
+ childRenderNodes.push(childVNode);
839
+ node.remove();
840
+ }
841
+ } else if (childVNode.$hostId$ === hostId) {
842
+ if (childNodeType === SLOT_NODE_ID) {
843
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
844
+ addSlot(
845
+ slotName,
846
+ childIdSplt[2],
847
+ childVNode,
848
+ node,
849
+ parentVNode,
850
+ childRenderNodes,
851
+ slotNodes,
852
+ shadowRootNodes,
853
+ slottedNodes
854
+ );
855
+ } else if (childNodeType === CONTENT_REF_ID) {
856
+ if (shadowRootNodes) {
857
+ node.remove();
858
+ }
859
+ }
860
+ }
861
+ }
862
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
863
+ const vnode = newVNode(null, node.textContent);
864
+ vnode.$elm$ = node;
865
+ vnode.$index$ = "0";
866
+ parentVNode.$children$ = [vnode];
867
+ }
868
+ return parentVNode;
869
+ };
870
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
871
+ if (node.nodeType === 1 /* ElementNode */) {
872
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
873
+ if (componentId) {
874
+ orgLocNodes.set(componentId, node);
875
+ }
876
+ let i2 = 0;
877
+ if (node.shadowRoot) {
878
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
879
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
880
+ }
881
+ }
882
+ const nonShadowNodes = node.__childNodes || node.childNodes;
883
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
884
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
885
+ }
886
+ } else if (node.nodeType === 8 /* CommentNode */) {
887
+ const childIdSplt = node.nodeValue.split(".");
888
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
889
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
890
+ node.nodeValue = "";
891
+ node["s-en"] = childIdSplt[3];
892
+ }
893
+ }
894
+ };
895
+ var createSimpleVNode = (vnode) => {
896
+ const defaultVNode = {
897
+ $flags$: 0,
898
+ $hostId$: null,
899
+ $nodeId$: null,
900
+ $depth$: null,
901
+ $index$: "0",
902
+ $elm$: null,
903
+ $attrs$: null,
904
+ $children$: null,
905
+ $key$: null,
906
+ $name$: null,
907
+ $tag$: null,
908
+ $text$: null
909
+ };
910
+ return { ...defaultVNode, ...vnode };
911
+ };
912
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
913
+ node["s-sr"] = true;
914
+ childVNode.$name$ = slotName || null;
915
+ childVNode.$tag$ = "slot";
916
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
917
+ if (shadowRootNodes && win.document) {
918
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
919
+ if (childVNode.$name$) {
920
+ childVNode.$elm$.setAttribute("name", slotName);
921
+ }
922
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
923
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
924
+ } else {
925
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
926
+ }
927
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
928
+ node.remove();
929
+ if (childVNode.$depth$ === "0") {
930
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
931
+ }
932
+ } else {
933
+ const slot = childVNode.$elm$;
934
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
935
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
936
+ patchSlotNode(node);
937
+ if (shouldMove) {
938
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
939
+ }
940
+ }
941
+ childRenderNodes.push(childVNode);
942
+ slotNodes.push(childVNode);
943
+ if (!parentVNode.$children$) {
944
+ parentVNode.$children$ = [];
945
+ }
946
+ parentVNode.$children$[childVNode.$index$] = childVNode;
947
+ }
948
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
949
+ var _a, _b;
950
+ let slottedNode = slotNode.nextSibling;
951
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
952
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
953
+ do {
954
+ 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 */))) {
955
+ slottedNode["s-sn"] = slotName;
956
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
957
+ }
958
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
959
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
960
+ };
961
+ var findCorrespondingNode = (node, type) => {
962
+ let sibling = node;
963
+ do {
964
+ sibling = sibling.nextSibling;
965
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
966
+ return sibling;
967
+ };
968
+
969
+ // src/utils/remote-value.ts
970
+ var RemoteValue = class _RemoteValue {
971
+ /**
972
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
973
+ *
974
+ * @param serialized The serialized LocalValue object
975
+ * @returns The original JavaScript value/object
976
+ */
977
+ static fromLocalValue(serialized) {
978
+ const type = serialized[TYPE_CONSTANT];
979
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
980
+ switch (type) {
981
+ case "string" /* String */:
982
+ return value;
983
+ case "boolean" /* Boolean */:
984
+ return value;
985
+ case "bigint" /* BigInt */:
986
+ return BigInt(value);
987
+ case "undefined" /* Undefined */:
988
+ return void 0;
989
+ case "null" /* Null */:
990
+ return null;
991
+ case "number" /* Number */:
992
+ if (value === "NaN") return NaN;
993
+ if (value === "-0") return -0;
994
+ if (value === "Infinity") return Infinity;
995
+ if (value === "-Infinity") return -Infinity;
996
+ return value;
997
+ case "array" /* Array */:
998
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
999
+ case "date" /* Date */:
1000
+ return new Date(value);
1001
+ case "map" /* Map */:
1002
+ const map = /* @__PURE__ */ new Map();
1003
+ for (const [key, val] of value) {
1004
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
1005
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
1006
+ map.set(deserializedKey, deserializedValue);
1007
+ }
1008
+ return map;
1009
+ case "object" /* Object */:
1010
+ const obj = {};
1011
+ for (const [key, val] of value) {
1012
+ obj[key] = _RemoteValue.fromLocalValue(val);
1013
+ }
1014
+ return obj;
1015
+ case "regexp" /* RegularExpression */:
1016
+ const { pattern, flags } = value;
1017
+ return new RegExp(pattern, flags);
1018
+ case "set" /* Set */:
1019
+ const set = /* @__PURE__ */ new Set();
1020
+ for (const item of value) {
1021
+ set.add(_RemoteValue.fromLocalValue(item));
1022
+ }
1023
+ return set;
1024
+ case "symbol" /* Symbol */:
1025
+ return Symbol(value);
1026
+ default:
1027
+ throw new Error(`Unsupported type: ${type}`);
1028
+ }
1029
+ }
1030
+ /**
1031
+ * Utility method to deserialize multiple LocalValues at once
1032
+ *
1033
+ * @param serializedValues Array of serialized LocalValue objects
1034
+ * @returns Array of deserialized JavaScript values
1035
+ */
1036
+ static fromLocalValueArray(serializedValues) {
1037
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
1038
+ }
1039
+ /**
1040
+ * Verifies if the given object matches the structure of a serialized LocalValue
1041
+ *
1042
+ * @param obj Object to verify
1043
+ * @returns boolean indicating if the object has LocalValue structure
1044
+ */
1045
+ static isLocalValueObject(obj) {
1046
+ if (typeof obj !== "object" || obj === null) {
1047
+ return false;
1048
+ }
1049
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
1050
+ return false;
1051
+ }
1052
+ const type = obj[TYPE_CONSTANT];
1053
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1054
+ if (!hasTypeProperty) {
1055
+ return false;
1056
+ }
1057
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1058
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1059
+ }
1060
+ return true;
1061
+ }
1062
+ };
1063
+
1064
+ // src/utils/serialize.ts
1065
+ function decodeBase64Unicode(base64) {
1066
+ const binary = atob(base64);
1067
+ const bytes = new Uint8Array(binary.length);
1068
+ for (let i2 = 0; i2 < binary.length; i2++) {
1069
+ bytes[i2] = binary.charCodeAt(i2);
1070
+ }
1071
+ return new TextDecoder().decode(bytes);
1072
+ }
1073
+ function deserializeProperty(value) {
1074
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
1075
+ return value;
1076
+ }
1077
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
1078
+ }
1079
+
431
1080
  // src/runtime/parse-property-value.ts
432
1081
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1082
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1083
+ propValue = deserializeProperty(propValue);
1084
+ return propValue;
1085
+ }
433
1086
  if (propValue != null && !isComplexType(propValue)) {
434
1087
  if (propType & 4 /* Boolean */) {
435
1088
  {
@@ -480,7 +1133,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
480
1133
  const classList = elm.classList;
481
1134
  const oldClasses = parseClassList(oldValue);
482
1135
  let newClasses = parseClassList(newValue);
483
- {
1136
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
1137
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
1138
+ newClasses.push(scopeId2);
1139
+ oldClasses.forEach((c) => {
1140
+ if (c.startsWith(scopeId2)) newClasses.push(c);
1141
+ });
1142
+ newClasses = [...new Set(newClasses)].filter((c) => c);
1143
+ classList.add(...newClasses);
1144
+ } else {
484
1145
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
485
1146
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
486
1147
  }
@@ -598,7 +1259,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
598
1259
  oldVnodeAttrs[memberName],
599
1260
  void 0,
600
1261
  isSvgMode2,
601
- newVnode.$flags$);
1262
+ newVnode.$flags$,
1263
+ isInitialRender
1264
+ );
602
1265
  }
603
1266
  }
604
1267
  }
@@ -609,7 +1272,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
609
1272
  oldVnodeAttrs[memberName],
610
1273
  newVnodeAttrs[memberName],
611
1274
  isSvgMode2,
612
- newVnode.$flags$);
1275
+ newVnode.$flags$,
1276
+ isInitialRender
1277
+ );
613
1278
  }
614
1279
  };
615
1280
  function sortedAttrNames(attrNames) {
@@ -817,7 +1482,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
817
1482
  relocateToHostRoot(newVNode2.$elm$.parentElement);
818
1483
  }
819
1484
  }
820
- updateElement(oldVNode, newVNode2, isSvgMode);
1485
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
821
1486
  }
822
1487
  if (oldChildren !== null && newChildren !== null) {
823
1488
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -831,7 +1496,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
831
1496
  !isInitialRender && BUILD.updatable && oldChildren !== null
832
1497
  ) {
833
1498
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
834
- } else ;
1499
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
1500
+ newVNode2.$children$ = oldChildren;
1501
+ }
835
1502
  } else if (oldVNode.$text$ !== text) {
836
1503
  elm.data = text;
837
1504
  }
@@ -1031,7 +1698,13 @@ var postUpdateComponent = (hostRef) => {
1031
1698
  }
1032
1699
  };
1033
1700
  var appDidLoad = (who) => {
1701
+ var _a;
1034
1702
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1703
+ {
1704
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
1705
+ plt.$orgLocNodes$.clear();
1706
+ }
1707
+ }
1035
1708
  };
1036
1709
  var safeCall = (instance, method, arg, elm) => {
1037
1710
  if (instance && instance[method]) {
@@ -1219,10 +1892,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1219
1892
 
1220
1893
  // src/runtime/initialize-component.ts
1221
1894
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1895
+ var _a;
1222
1896
  let Cstr;
1223
1897
  try {
1224
1898
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1225
1899
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1900
+ hostRef.$flags$ &= -1025 /* hasFailedLoad */;
1226
1901
  const bundleId = cmpMeta.$lazyBundleId$;
1227
1902
  if (bundleId) {
1228
1903
  const CstrImport = loadModule(cmpMeta, hostRef);
@@ -1234,6 +1909,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1234
1909
  Cstr = CstrImport;
1235
1910
  }
1236
1911
  if (!Cstr) {
1912
+ hostRef.$flags$ &= -33 /* hasInitializedComponent */;
1913
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
1914
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
1915
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
1916
+ }
1237
1917
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1238
1918
  }
1239
1919
  if (!Cstr.isProxied) {
@@ -1287,7 +1967,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1287
1967
  hostRef.$onRenderResolve$();
1288
1968
  hostRef.$onRenderResolve$ = void 0;
1289
1969
  }
1290
- if (hostRef.$onReadyResolve$) {
1970
+ if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
1291
1971
  hostRef.$onReadyResolve$(elm);
1292
1972
  }
1293
1973
  }
@@ -1309,10 +1989,21 @@ var connectedCallback = (elm) => {
1309
1989
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1310
1990
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1311
1991
  hostRef.$flags$ |= 1 /* hasConnected */;
1992
+ let hostId;
1993
+ {
1994
+ hostId = elm.getAttribute(HYDRATE_ID);
1995
+ if (hostId) {
1996
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1997
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
1998
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
1999
+ }
2000
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2001
+ }
2002
+ }
1312
2003
  {
1313
2004
  let ancestorComponent = elm;
1314
2005
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1315
- if (ancestorComponent["s-p"]) {
2006
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1316
2007
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1317
2008
  break;
1318
2009
  }
@@ -1333,6 +2024,8 @@ var connectedCallback = (elm) => {
1333
2024
  } else {
1334
2025
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1335
2026
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
2027
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
2028
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
1336
2029
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1337
2030
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1338
2031
  }
@@ -1381,6 +2074,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1381
2074
  let isBootstrapping = true;
1382
2075
  Object.assign(plt, options);
1383
2076
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
2077
+ {
2078
+ plt.$flags$ |= 2 /* appLoaded */;
2079
+ }
2080
+ {
2081
+ hydrateScopedToShadow();
2082
+ }
1384
2083
  lazyBundles.map((lazyBundle) => {
1385
2084
  lazyBundle[1].map((compactMeta) => {
1386
2085
  const cmpMeta = {
@@ -1436,7 +2135,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1436
2135
  }
1437
2136
  disconnectedCallback() {
1438
2137
  plt.jmp(() => disconnectedCallback(this));
1439
- plt.raf(() => {
2138
+ nextTick(() => {
1440
2139
  var _a3;
1441
2140
  const hostRef = getHostRef(this);
1442
2141
  if (!hostRef) {
@@ -1501,6 +2200,6 @@ exports.h = h;
1501
2200
  exports.promiseResolve = promiseResolve;
1502
2201
  exports.registerInstance = registerInstance;
1503
2202
  exports.setNonce = setNonce;
1504
- //# sourceMappingURL=index-D7ZSLrHc.js.map
2203
+ //# sourceMappingURL=index-ls4U227d.js.map
1505
2204
 
1506
- //# sourceMappingURL=index-D7ZSLrHc.js.map
2205
+ //# sourceMappingURL=index-ls4U227d.js.map