@devschile/chucao 1.7.0 → 1.8.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 (124) hide show
  1. package/README.md +13 -12
  2. package/dist/chucao/chucao.css +1 -1
  3. package/dist/chucao/chucao.esm.js +1 -1
  4. package/dist/chucao/index.esm.js +1 -1
  5. package/dist/chucao/index.esm.js.map +1 -1
  6. package/dist/chucao/{p-9a614e82.entry.js → p-13ab5f9a.entry.js} +2 -2
  7. package/dist/chucao/{p-053d58a4.entry.js → p-1cc7042e.entry.js} +2 -2
  8. package/dist/chucao/{p-c598f978.entry.js → p-23c5220b.entry.js} +2 -2
  9. package/dist/chucao/p-2d7e81b2.entry.js +2 -0
  10. package/dist/chucao/p-2d7e81b2.entry.js.map +1 -0
  11. package/dist/chucao/p-421cda05.entry.js +2 -0
  12. package/dist/chucao/{p-0305f2eb.entry.js.map → p-421cda05.entry.js.map} +1 -1
  13. package/dist/chucao/p-Bvah_WQV.js +3 -0
  14. package/dist/chucao/p-Bvah_WQV.js.map +1 -0
  15. package/dist/chucao/{p-ad3206a2.entry.js → p-c16b18b7.entry.js} +2 -2
  16. package/dist/chucao/p-cbb2b478.entry.js +2 -0
  17. package/dist/chucao/p-cbb2b478.entry.js.map +1 -0
  18. package/dist/chucao/{p-20492b73.entry.js → p-cfb6db53.entry.js} +2 -2
  19. package/dist/chucao/{p-488c7838.entry.js → p-df73f786.entry.js} +2 -2
  20. package/dist/chucao/{p-fe8e9537.entry.js → p-e8fe65bb.entry.js} +2 -2
  21. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  22. package/dist/cjs/ch-alert_8.cjs.entry.js +4 -4
  23. package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
  24. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  25. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  26. package/dist/cjs/ch-modal.cjs.entry.js +167 -0
  27. package/dist/cjs/ch-modal.cjs.entry.js.map +1 -0
  28. package/dist/cjs/ch-radio.cjs.entry.js +1 -1
  29. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  30. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  31. package/dist/cjs/ch-tooltip.cjs.entry.js +82 -0
  32. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -0
  33. package/dist/cjs/chucao.cjs.js +2 -2
  34. package/dist/cjs/{index-ls4U227d.js → index-DMeDkSQU.js} +148 -5
  35. package/dist/cjs/index-DMeDkSQU.js.map +1 -0
  36. package/dist/cjs/index.cjs.js +5 -0
  37. package/dist/cjs/index.cjs.js.map +1 -1
  38. package/dist/cjs/loader.cjs.js +2 -2
  39. package/dist/collection/collection-manifest.json +2 -0
  40. package/dist/collection/components/ch-card/ch-card.js +1 -1
  41. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  42. package/dist/collection/components/ch-input/ch-input.js +1 -1
  43. package/dist/collection/components/ch-modal/ch-modal.css +69 -0
  44. package/dist/collection/components/ch-modal/ch-modal.js +278 -0
  45. package/dist/collection/components/ch-modal/ch-modal.js.map +1 -0
  46. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  47. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  48. package/dist/collection/components/ch-tooltip/ch-tooltip.css +100 -0
  49. package/dist/collection/components/ch-tooltip/ch-tooltip.js +168 -0
  50. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -0
  51. package/dist/collection/tokens/tokens.js +4 -0
  52. package/dist/collection/tokens/tokens.js.map +1 -1
  53. package/dist/collection/tokens/types.js.map +1 -1
  54. package/dist/components/ch-accordion.js +1 -1
  55. package/dist/components/ch-alert.js +1 -1
  56. package/dist/components/ch-badge.js +1 -1
  57. package/dist/components/ch-button.js +1 -1
  58. package/dist/components/ch-card.js +1 -1
  59. package/dist/components/ch-checkbox.js +1 -1
  60. package/dist/components/ch-divider.js +1 -1
  61. package/dist/components/ch-input.js +1 -1
  62. package/dist/components/ch-link.js +1 -1
  63. package/dist/components/ch-modal.d.ts +11 -0
  64. package/dist/components/ch-modal.js +2 -0
  65. package/dist/components/ch-modal.js.map +1 -0
  66. package/dist/components/ch-radio.js +1 -1
  67. package/dist/components/ch-select.js +1 -1
  68. package/dist/components/ch-spinner.js +1 -1
  69. package/dist/components/ch-switch.js +1 -1
  70. package/dist/components/ch-tabs.js +1 -1
  71. package/dist/components/ch-textarea.js +1 -1
  72. package/dist/components/ch-tooltip.d.ts +11 -0
  73. package/dist/components/ch-tooltip.js +2 -0
  74. package/dist/components/ch-tooltip.js.map +1 -0
  75. package/dist/components/index.js +1 -1
  76. package/dist/components/index.js.map +1 -1
  77. package/dist/components/p-hyy-cLgi.js +2 -0
  78. package/dist/components/p-hyy-cLgi.js.map +1 -0
  79. package/dist/esm/ch-accordion.entry.js +1 -1
  80. package/dist/esm/ch-alert_8.entry.js +4 -4
  81. package/dist/esm/ch-checkbox.entry.js +2 -2
  82. package/dist/esm/ch-divider.entry.js +1 -1
  83. package/dist/esm/ch-link.entry.js +1 -1
  84. package/dist/esm/ch-modal.entry.js +165 -0
  85. package/dist/esm/ch-modal.entry.js.map +1 -0
  86. package/dist/esm/ch-radio.entry.js +1 -1
  87. package/dist/esm/ch-tabs.entry.js +1 -1
  88. package/dist/esm/ch-textarea.entry.js +2 -2
  89. package/dist/esm/ch-tooltip.entry.js +80 -0
  90. package/dist/esm/ch-tooltip.entry.js.map +1 -0
  91. package/dist/esm/chucao.js +3 -3
  92. package/dist/esm/{index-pfWAsOzE.js → index-Bvah_WQV.js} +148 -6
  93. package/dist/esm/index-Bvah_WQV.js.map +1 -0
  94. package/dist/esm/index.js +5 -1
  95. package/dist/esm/index.js.map +1 -1
  96. package/dist/esm/loader.js +3 -3
  97. package/dist/types/components/ch-modal/ch-modal.d.ts +67 -0
  98. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +47 -0
  99. package/dist/types/components.d.ts +216 -0
  100. package/dist/types/tokens/tokens.d.ts +4 -0
  101. package/dist/types/tokens/types.d.ts +1 -1
  102. package/dist-react/components.d.ts +10 -1
  103. package/dist-react/components.js +21 -0
  104. package/dist-react/components.ts +31 -1
  105. package/dist-vue/index.d.ts +2 -0
  106. package/dist-vue/index.js +15 -0
  107. package/dist-vue/index.ts +19 -0
  108. package/hydrate/index.js +409 -8
  109. package/hydrate/index.mjs +409 -8
  110. package/package.json +1 -1
  111. package/dist/chucao/p-0305f2eb.entry.js +0 -2
  112. package/dist/chucao/p-pfWAsOzE.js +0 -3
  113. package/dist/chucao/p-pfWAsOzE.js.map +0 -1
  114. package/dist/cjs/index-ls4U227d.js.map +0 -1
  115. package/dist/components/p-ONE3uKkF.js +0 -2
  116. package/dist/components/p-ONE3uKkF.js.map +0 -1
  117. package/dist/esm/index-pfWAsOzE.js.map +0 -1
  118. /package/dist/chucao/{p-9a614e82.entry.js.map → p-13ab5f9a.entry.js.map} +0 -0
  119. /package/dist/chucao/{p-053d58a4.entry.js.map → p-1cc7042e.entry.js.map} +0 -0
  120. /package/dist/chucao/{p-c598f978.entry.js.map → p-23c5220b.entry.js.map} +0 -0
  121. /package/dist/chucao/{p-ad3206a2.entry.js.map → p-c16b18b7.entry.js.map} +0 -0
  122. /package/dist/chucao/{p-20492b73.entry.js.map → p-cfb6db53.entry.js.map} +0 -0
  123. /package/dist/chucao/{p-488c7838.entry.js.map → p-df73f786.entry.js.map} +0 -0
  124. /package/dist/chucao/{p-fe8e9537.entry.js.map → p-e8fe65bb.entry.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'chucao';
2
- const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
2
+ const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
3
3
 
4
4
  const globalScripts = () => {};
5
- 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)}";
5
+ 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-scrim-default:rgba(0, 0, 0, 0.6);--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)}";
6
6
 
7
7
  /*
8
8
  Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
@@ -85,7 +85,7 @@ var registerInstance = (lazyInstance, hostRef) => {
85
85
  if (!hostRef) return;
86
86
  lazyInstance.__stencil__getHostRef = () => hostRef;
87
87
  hostRef.$lazyInstance$ = lazyInstance;
88
- if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.prop)) {
88
+ if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
89
89
  reWireGetterSetter(lazyInstance, hostRef);
90
90
  }
91
91
  };
@@ -178,6 +178,23 @@ var plt = {
178
178
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
179
179
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
180
180
  };
181
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
182
+ var _a;
183
+ let supportsListenerOptions2 = false;
184
+ try {
185
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
186
+ "e",
187
+ null,
188
+ Object.defineProperty({}, "passive", {
189
+ get() {
190
+ supportsListenerOptions2 = true;
191
+ }
192
+ })
193
+ );
194
+ } catch (e) {
195
+ }
196
+ return supportsListenerOptions2;
197
+ })();
181
198
  var promiseResolve = (v) => Promise.resolve(v);
182
199
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
183
200
  try {
@@ -964,6 +981,31 @@ var findCorrespondingNode = (node, type) => {
964
981
  return sibling;
965
982
  };
966
983
 
984
+ // src/runtime/normalize-watchers.ts
985
+ var normalizeWatchers = (raw) => {
986
+ if (!raw) return void 0;
987
+ const keys = Object.keys(raw);
988
+ if (keys.length === 0) return void 0;
989
+ let hasLegacy = false;
990
+ for (const propName of keys) {
991
+ if (hasLegacy) break;
992
+ for (const h2 of raw[propName]) {
993
+ if (typeof h2 === "string") {
994
+ hasLegacy = true;
995
+ break;
996
+ }
997
+ }
998
+ }
999
+ if (!hasLegacy) return raw;
1000
+ const out = {};
1001
+ for (const propName of keys) {
1002
+ out[propName] = raw[propName].map(
1003
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
1004
+ );
1005
+ }
1006
+ return out;
1007
+ };
1008
+
967
1009
  // src/utils/remote-value.ts
968
1010
  var RemoteValue = class _RemoteValue {
969
1011
  /**
@@ -1595,6 +1637,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1595
1637
  let maybePromise;
1596
1638
  if (isInitialLoad) {
1597
1639
  {
1640
+ {
1641
+ hostRef.$flags$ |= 256 /* isListenReady */;
1642
+ if (hostRef.$queuedListeners$) {
1643
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
1644
+ hostRef.$queuedListeners$ = void 0;
1645
+ }
1646
+ }
1598
1647
  if (hostRef.$fetchedCbList$.length) {
1599
1648
  hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
1600
1649
  }
@@ -1727,6 +1776,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1727
1776
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
1728
1777
  );
1729
1778
  }
1779
+ const elm = hostRef.$hostElement$ ;
1730
1780
  const oldVal = hostRef.$instanceValues$.get(propName);
1731
1781
  const flags = hostRef.$flags$;
1732
1782
  const instance = hostRef.$lazyInstance$ ;
@@ -1737,6 +1787,27 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1737
1787
  const didValueChange = newVal !== oldVal && !areBothNaN;
1738
1788
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1739
1789
  hostRef.$instanceValues$.set(propName, newVal);
1790
+ if (cmpMeta.$watchers$) {
1791
+ const watchMethods = cmpMeta.$watchers$[propName];
1792
+ if (watchMethods) {
1793
+ watchMethods.map((watcher) => {
1794
+ try {
1795
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
1796
+ if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
1797
+ if (!instance) {
1798
+ hostRef.$fetchedCbList$.push(() => {
1799
+ hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
1800
+ });
1801
+ } else {
1802
+ instance[watchMethodName](newVal, oldVal, propName);
1803
+ }
1804
+ }
1805
+ } catch (e) {
1806
+ consoleError(e, elm);
1807
+ }
1808
+ });
1809
+ }
1810
+ }
1740
1811
  if (flags & 2 /* hasRendered */) {
1741
1812
  if (instance.componentShouldUpdate) {
1742
1813
  const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
@@ -1756,6 +1827,17 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1756
1827
  var _a, _b;
1757
1828
  const prototype = Cstr.prototype;
1758
1829
  if (cmpMeta.$members$ || BUILD.propChangeCallback) {
1830
+ {
1831
+ if (Cstr.watchers && !cmpMeta.$watchers$) {
1832
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
1833
+ }
1834
+ if (Cstr.deserializers && !cmpMeta.$deserializers$) {
1835
+ cmpMeta.$deserializers$ = Cstr.deserializers;
1836
+ }
1837
+ if (Cstr.serializers && !cmpMeta.$serializers$) {
1838
+ cmpMeta.$serializers$ = Cstr.serializers;
1839
+ }
1840
+ }
1759
1841
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1760
1842
  members.map(([memberName, [memberFlags]]) => {
1761
1843
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
@@ -1915,6 +1997,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1915
1997
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1916
1998
  }
1917
1999
  if (!Cstr.isProxied) {
2000
+ {
2001
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
2002
+ cmpMeta.$serializers$ = Cstr.serializers;
2003
+ cmpMeta.$deserializers$ = Cstr.deserializers;
2004
+ }
1918
2005
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1919
2006
  Cstr.isProxied = true;
1920
2007
  }
@@ -1930,6 +2017,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1930
2017
  {
1931
2018
  hostRef.$flags$ &= -9 /* isConstructingInstance */;
1932
2019
  }
2020
+ {
2021
+ hostRef.$flags$ |= 128 /* isWatchReady */;
2022
+ }
1933
2023
  endNewInstance();
1934
2024
  {
1935
2025
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
@@ -2020,6 +2110,7 @@ var connectedCallback = (elm) => {
2020
2110
  initializeComponent(elm, hostRef, cmpMeta);
2021
2111
  }
2022
2112
  } else {
2113
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2023
2114
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2024
2115
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
2025
2116
  } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
@@ -2039,6 +2130,12 @@ var disconnectInstance = (instance, elm) => {
2039
2130
  var disconnectedCallback = async (elm) => {
2040
2131
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2041
2132
  const hostRef = getHostRef(elm);
2133
+ {
2134
+ if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
2135
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2136
+ hostRef.$rmListeners$ = void 0;
2137
+ }
2138
+ }
2042
2139
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2043
2140
  disconnectInstance(hostRef.$lazyInstance$, elm);
2044
2141
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -2080,6 +2177,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2080
2177
  }
2081
2178
  lazyBundles.map((lazyBundle) => {
2082
2179
  lazyBundle[1].map((compactMeta) => {
2180
+ var _a2, _b;
2083
2181
  const cmpMeta = {
2084
2182
  $flags$: compactMeta[0],
2085
2183
  $tagName$: compactMeta[1],
@@ -2089,6 +2187,14 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2089
2187
  {
2090
2188
  cmpMeta.$members$ = compactMeta[2];
2091
2189
  }
2190
+ {
2191
+ cmpMeta.$listeners$ = compactMeta[3];
2192
+ }
2193
+ {
2194
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
2195
+ cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
2196
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
2197
+ }
2092
2198
  const tagName = transformTag(cmpMeta.$tagName$);
2093
2199
  const HostElement = class extends HTMLElement {
2094
2200
  ["s-p"];
@@ -2120,6 +2226,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2120
2226
  }
2121
2227
  if (!this.hasRegisteredEventListeners) {
2122
2228
  this.hasRegisteredEventListeners = true;
2229
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
2123
2230
  }
2124
2231
  if (appLoadFallback) {
2125
2232
  clearTimeout(appLoadFallback);
@@ -2183,6 +2290,41 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2183
2290
  }
2184
2291
  endBootstrap();
2185
2292
  };
2293
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2294
+ if (listeners && win.document) {
2295
+ listeners.map(([flags, name, method]) => {
2296
+ const target = getHostListenerTarget(win.document, elm, flags) ;
2297
+ const handler = hostListenerProxy(hostRef, method);
2298
+ const opts = hostListenerOpts(flags);
2299
+ plt.ael(target, name, handler, opts);
2300
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2301
+ });
2302
+ }
2303
+ };
2304
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2305
+ var _a;
2306
+ try {
2307
+ {
2308
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
2309
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2310
+ } else {
2311
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2312
+ }
2313
+ }
2314
+ } catch (e) {
2315
+ consoleError(e, hostRef.$hostElement$);
2316
+ }
2317
+ };
2318
+ var getHostListenerTarget = (doc, elm, flags) => {
2319
+ if (flags & 4 /* TargetDocument */) {
2320
+ return doc;
2321
+ }
2322
+ return elm;
2323
+ };
2324
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
2325
+ passive: (flags & 1 /* Passive */) !== 0,
2326
+ capture: (flags & 2 /* Capture */) !== 0
2327
+ } : (flags & 2 /* Capture */) !== 0;
2186
2328
 
2187
2329
  // src/runtime/nonce.ts
2188
2330
  var setNonce = (nonce) => plt.$nonce$ = nonce;
@@ -2190,7 +2332,7 @@ function transformTag(tag) {
2190
2332
  return tag;
2191
2333
  }
2192
2334
 
2193
- export { Host as H, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2194
- //# sourceMappingURL=index-pfWAsOzE.js.map
2335
+ export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2336
+ //# sourceMappingURL=index-Bvah_WQV.js.map
2195
2337
 
2196
- //# sourceMappingURL=index-pfWAsOzE.js.map
2338
+ //# sourceMappingURL=index-Bvah_WQV.js.map