@jasonshimmy/custom-elements-runtime 2.5.1 → 2.5.5

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 (90) hide show
  1. package/README.md +115 -40
  2. package/dist/css/colors.d.ts +14 -0
  3. package/dist/custom-elements-runtime.cjs.js +6 -18
  4. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  5. package/dist/custom-elements-runtime.colors.cjs.js +2 -0
  6. package/dist/custom-elements-runtime.colors.cjs.js.map +1 -0
  7. package/dist/custom-elements-runtime.colors.es.js +279 -0
  8. package/dist/custom-elements-runtime.colors.es.js.map +1 -0
  9. package/dist/custom-elements-runtime.directive-enhancements.es.js +1 -1
  10. package/dist/custom-elements-runtime.es.js +246 -3648
  11. package/dist/custom-elements-runtime.es.js.map +1 -1
  12. package/dist/custom-elements-runtime.event-bus.cjs.js +1 -1
  13. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
  14. package/dist/custom-elements-runtime.event-bus.es.js +28 -25
  15. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
  16. package/dist/custom-elements-runtime.router.cjs.js +20 -20
  17. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  18. package/dist/custom-elements-runtime.router.es.js +790 -464
  19. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  20. package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
  21. package/dist/custom-elements-runtime.ssr.es.js +12 -8
  22. package/dist/custom-elements-runtime.ssr.es.js.map +1 -1
  23. package/dist/custom-elements-runtime.store.cjs.js +1 -1
  24. package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
  25. package/dist/custom-elements-runtime.store.es.js +5 -5
  26. package/dist/custom-elements-runtime.store.es.js.map +1 -1
  27. package/dist/custom-elements-runtime.transitions.cjs.js +1 -1
  28. package/dist/custom-elements-runtime.transitions.es.js +1 -1
  29. package/dist/event-bus.d.ts +17 -4
  30. package/dist/index.d.ts +13 -3
  31. package/dist/keep-alive.d.ts +50 -0
  32. package/dist/{logger-BuUYv7C_.js → logger-BvkEbVM4.js} +15 -11
  33. package/dist/logger-BvkEbVM4.js.map +1 -0
  34. package/dist/logger-CSALKaYm.cjs +2 -0
  35. package/dist/logger-CSALKaYm.cjs.map +1 -0
  36. package/dist/namespace-helpers-4qeKVqQw.cjs +5 -0
  37. package/dist/namespace-helpers-4qeKVqQw.cjs.map +1 -0
  38. package/dist/namespace-helpers-DcD_6_K1.js +989 -0
  39. package/dist/namespace-helpers-DcD_6_K1.js.map +1 -0
  40. package/dist/router/active-proxy.d.ts +5 -0
  41. package/dist/router/component-loader.d.ts +11 -0
  42. package/dist/router/instance.d.ts +11 -0
  43. package/dist/router/matcher.d.ts +14 -0
  44. package/dist/router/path-utils.d.ts +48 -0
  45. package/dist/router/types.d.ts +134 -0
  46. package/dist/router.d.ts +6 -147
  47. package/dist/runtime/builtin-components.d.ts +78 -0
  48. package/dist/runtime/component/element-class.d.ts +4 -0
  49. package/dist/runtime/component/factory.d.ts +39 -0
  50. package/dist/runtime/component/registry.d.ts +16 -0
  51. package/dist/runtime/component.d.ts +3 -50
  52. package/dist/runtime/discovery-state.d.ts +30 -0
  53. package/dist/runtime/hooks.d.ts +115 -0
  54. package/dist/runtime/logger.d.ts +19 -1
  55. package/dist/runtime/monitoring/health-monitor.d.ts +56 -0
  56. package/dist/runtime/reactive.d.ts +39 -7
  57. package/dist/runtime/render.d.ts +20 -4
  58. package/dist/runtime/scheduler.d.ts +115 -2
  59. package/dist/runtime/template-compiler/impl.d.ts +14 -0
  60. package/dist/runtime/template-compiler/lru-cache.d.ts +20 -0
  61. package/dist/runtime/template-compiler/props-parser.d.ts +15 -0
  62. package/dist/runtime/template-compiler/vnode-utils.d.ts +5 -0
  63. package/dist/runtime/template-compiler.d.ts +5 -28
  64. package/dist/runtime/types.d.ts +10 -0
  65. package/dist/runtime/vdom-directives.d.ts +71 -0
  66. package/dist/runtime/vdom-helpers.d.ts +126 -0
  67. package/dist/runtime/vdom-patch.d.ts +67 -0
  68. package/dist/runtime/vdom.d.ts +16 -140
  69. package/dist/ssr.d.ts +2 -1
  70. package/dist/teleport.d.ts +68 -0
  71. package/dist/template-compiler-CA4YRaBu.cjs +23 -0
  72. package/dist/template-compiler-CA4YRaBu.cjs.map +1 -0
  73. package/dist/template-compiler-CJFwjLCP.js +3981 -0
  74. package/dist/template-compiler-CJFwjLCP.js.map +1 -0
  75. package/dist/transitions-DPZiuXb9.cjs +330 -0
  76. package/dist/transitions-DPZiuXb9.cjs.map +1 -0
  77. package/dist/{transitions-CZ21fzhh.js → transitions-Di5wW9yc.js} +1059 -618
  78. package/dist/transitions-Di5wW9yc.js.map +1 -0
  79. package/dist/transitions.d.ts +1 -1
  80. package/package.json +20 -12
  81. package/dist/logger-BuUYv7C_.js.map +0 -1
  82. package/dist/logger-DiXdWaF-.cjs +0 -2
  83. package/dist/logger-DiXdWaF-.cjs.map +0 -1
  84. package/dist/namespace-helpers-BsKQl3aH.cjs +0 -5
  85. package/dist/namespace-helpers-BsKQl3aH.cjs.map +0 -1
  86. package/dist/namespace-helpers-Dw1mgQab.js +0 -692
  87. package/dist/namespace-helpers-Dw1mgQab.js.map +0 -1
  88. package/dist/transitions-CZ21fzhh.js.map +0 -1
  89. package/dist/transitions-RXe2brRm.cjs +0 -302
  90. package/dist/transitions-RXe2brRm.cjs.map +0 -1
package/README.md CHANGED
@@ -80,23 +80,46 @@ Below is the **complete list of public symbols** exported by the runtime and its
80
80
 
81
81
  **Package:** `@jasonshimmy/custom-elements-runtime`
82
82
 
83
- | Export | Description |
84
- | ----------------------- | ---------------------------------------------------------------------- |
85
- | `component` | Define a custom element with the functional component API. |
86
- | `html` | Template tag function producing runtime VNodes from template literals. |
87
- | `css` | Define component-scoped/JIT styles or register stylesheets. |
88
- | `ref` | Create a reactive reference object with a `.value` property. |
89
- | `computed` | Create a derived, read-only reactive value from other reactives. |
90
- | `watch` | Register watchers reacting to changes in reactive values. |
91
- | `useProps` | Hook to declare/consume typed component props with defaults. |
92
- | `useEmit` | Hook returning an emit function for dispatching custom events. |
93
- | `useOnConnected` | Hook that runs a callback when the component connects. |
94
- | `useOnDisconnected` | Hook that runs a callback when the component disconnects. |
95
- | `useOnAttributeChanged` | Hook observing host attribute changes. |
96
- | `useOnError` | Hook to register a component-level error handler. |
97
- | `useStyle` | Hook to register or compute component styles at runtime. |
98
- | `unsafeHTML` | Insert raw HTML into a template (**unsafe; use carefully**). |
99
- | `decodeEntities` | Utility to decode HTML entities in strings. |
83
+ | Export | Description |
84
+ | ---------------------------- | ----------------------------------------------------------------------------------------------------- |
85
+ | `component` | Define a custom element with the functional component API. |
86
+ | `html` | Template tag function producing runtime VNodes from template literals. |
87
+ | `css` | Define component-scoped/JIT styles or register stylesheets. |
88
+ | `ref` | Create a reactive reference object with a `.value` property. |
89
+ | `computed` | Create a memoized, derived read-only value from other reactive sources. |
90
+ | `watch` | Register watchers reacting to changes in reactive values. |
91
+ | `watchEffect` | Auto-track reactive reads and re-run a side-effect whenever dependencies change. |
92
+ | `nextTick` | Returns a Promise resolving after all pending DOM updates are flushed. |
93
+ | `flushDOMUpdates` | Synchronously flush all pending DOM update tasks (useful in tests). |
94
+ | `scheduleWithPriority` | Schedule a callback at a given `UpdatePriority` level. |
95
+ | `provide` | Store a value on the current component for descendant injection. |
96
+ | `inject` | Retrieve a value provided by an ancestor component. |
97
+ | `createComposable` | Package reusable stateful logic (hooks, reactive state) into a composable. |
98
+ | `getCurrentComponentContext` | Access the active component context from within a composable or render function. |
99
+ | `useProps` | Hook to declare/consume typed component props with defaults. |
100
+ | `useEmit` | Hook returning an emit function for dispatching custom events. |
101
+ | `useOnConnected` | Hook that runs a callback when the component connects. |
102
+ | `useOnDisconnected` | Hook that runs a callback when the component disconnects. |
103
+ | `useOnAttributeChanged` | Hook observing host attribute changes. |
104
+ | `useOnError` | Hook to register a component-level error handler. |
105
+ | `useStyle` | Hook to register or compute component styles at runtime. |
106
+ | `useExpose` | Publish methods and properties onto the host element as an imperative public API. |
107
+ | `useSlots` | Inspect which named slots have been filled by the component consumer. |
108
+ | `useTeleport` | Render virtual DOM content into any DOM node outside the shadow root. |
109
+ | `registerKeepAlive` | Register `<cer-keep-alive>` to preserve component state across DOM removals. |
110
+ | `registerSuspense` | Register the `<cer-suspense>` built-in component. |
111
+ | `registerErrorBoundary` | Register the `<cer-error-boundary>` built-in component. |
112
+ | `registerBuiltinComponents` | Register both `<cer-suspense>` and `<cer-error-boundary>` in one call. |
113
+ | `unsafeHTML` | Insert raw HTML into a template (**unsafe; use carefully**). |
114
+ | `decodeEntities` | Utility to decode HTML entities in strings. |
115
+ | `setDevMode` | Toggle dev-mode logging on or off at runtime. |
116
+ | `devLog` | Log a message to the console in dev mode only (no-op in production). |
117
+ | `isReactiveState` | Type-guard returning `true` when a value is a `ReactiveState` instance. |
118
+ | `createHealthMonitor` | Create a new health monitor instance (factory; each call returns an independent instance). |
119
+ | `getHealthMonitor` | Return the global singleton health monitor instance (lazily created). |
120
+ | `updateHealthMetric` | Update a named metric on the global singleton health monitor. |
121
+ | `getHealthStatus` | Return the current `HealthReport` from the global singleton health monitor. |
122
+ | **Types** | `HealthMonitorInstance`, `HealthReport`, `UpdatePriority`, `TeleportHandle`, `ReactiveState`, `VNode` |
100
123
 
101
124
  ---
102
125
 
@@ -156,16 +179,16 @@ Below is the **complete list of public symbols** exported by the runtime and its
156
179
 
157
180
  **Package:** `@jasonshimmy/custom-elements-runtime/event-bus`
158
181
 
159
- | Export | Description |
160
- | ---------------- | ------------------------------------------------------------------------------ |
161
- | `EventHandler` | Type: callback signature used by the event bus. |
162
- | `GlobalEventBus` | Class: singleton implementing a global pub/sub event bus. |
163
- | `eventBus` | Proxy: lazy proxy to the singleton `GlobalEventBus` instance. |
164
- | `emit` | Emit a global event with an optional payload. |
165
- | `on` | Register a handler for a global event (returns unsubscribe function). |
166
- | `off` | Remove a handler for a global event. |
167
- | `once` | Register a one-time handler; returns a Promise resolving with the payload. |
168
- | `listen` | Listen for native `CustomEvent` on the global event bus (returns unsubscribe). |
182
+ | Export | Description |
183
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
184
+ | `EventHandler` | Type: callback signature used by the event bus. |
185
+ | `GlobalEventBus` | Class: singleton implementing a global pub/sub event bus. |
186
+ | `eventBus` | Proxy: lazy proxy to the singleton `GlobalEventBus` instance. |
187
+ | `emit` | Emit a global event with an optional payload. |
188
+ | `on` | Register a handler for a global event (returns unsubscribe function). |
189
+ | `off` | Remove a handler for a global event. |
190
+ | `once` | One-time listener. **Callback form** `once(name, handler)` `void`. **Promise form** `once(name)` `Promise<T>`. Do not mix. |
191
+ | `listen` | Listen for native `CustomEvent` on the global event bus (returns unsubscribe). |
169
192
 
170
193
  ---
171
194
 
@@ -184,15 +207,25 @@ Below is the **complete list of public symbols** exported by the runtime and its
184
207
 
185
208
  **Package:** `@jasonshimmy/custom-elements-runtime/router`
186
209
 
187
- | Export | Description |
188
- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
189
- | `useRouter` | Create and use a router instance configured with routes (client & SSR). |
190
- | `initRouter` | Initialize the router and register `router-view` / `router-link`. |
191
- | `matchRoute` | Match a path against configured routes and extract params. |
192
- | `matchRouteSSR` | SSR-friendly wrapper for route matching. |
193
- | `parseQuery` | Parse a query string into a key/value map. |
194
- | `resolveRouteComponent` | Resolve/load a route's component (supports async loaders + caching). |
195
- | **Types** | `Route`, `RouteState`, `RouteComponent`, `GuardResult`, `RouterLinkProps`, `RouterLinkComputed`, `RouterConfig` |
210
+ | Export | Description |
211
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |
212
+ | `useRouter` | Create and use a router instance configured with routes (client & SSR). |
213
+ | `initRouter` | Initialize the router and register `router-view` / `router-link`. |
214
+ | `matchRoute` | Match a path against configured routes and extract params. |
215
+ | `matchRouteSSR` | SSR-friendly wrapper for route matching. |
216
+ | `findMatchedRoute` | Find the first matching route entry from an array of routes (lower-level helper). |
217
+ | `parseQuery` | Parse a query string into a key/value map. |
218
+ | `serializeQuery` | Serialize a key/value map into a query string (e.g. `?a=b`). |
219
+ | `normalizePathForRoute` | Normalize a path string for consistent route matching (strips trailing slashes, etc.). |
220
+ | `DEFAULT_SCROLL_CONFIG` | Default scroll-to-fragment configuration object used by the router. |
221
+ | `isDangerousScheme` | Returns `true` for dangerous URL schemes (e.g. `javascript:`). |
222
+ | `isAbsoluteUrl` | Returns `true` when a URL string is absolute (has a protocol). |
223
+ | `safeDecode` | Decode a URI component, returning the original string on error. |
224
+ | `canonicalizeBase` | Normalize a router base path string (strips trailing slashes, ensures leading slash). |
225
+ | `resolveRouteComponent` | Resolve/load a route's component (supports async loaders + caching). |
226
+ | `clearComponentCache` | Clear the resolved route component cache (useful for testing and HMR). |
227
+ | `activeRouterProxy` | Stable proxy to the currently active router; forwards subscriptions and method calls (advanced/testing use). |
228
+ | **Types** | `Route`, `RouteState`, `RouteComponent`, `GuardResult`, `RouterLinkProps`, `RouterLinkComputed`, `RouterConfig`, `Router` |
196
229
 
197
230
  ---
198
231
 
@@ -200,10 +233,14 @@ Below is the **complete list of public symbols** exported by the runtime and its
200
233
 
201
234
  **Package:** `@jasonshimmy/custom-elements-runtime/ssr`
202
235
 
203
- | Export | Description |
204
- | ---------------- | ------------------------------------------------------ |
205
- | `renderToString` | Render a VNode tree to HTML for server-side rendering. |
206
- | `VNode` (type) | The runtime VNode shape used by renderers and SSR. |
236
+ | Export | Description |
237
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
238
+ | `renderToString` | Render a VNode tree to HTML for server-side rendering. |
239
+ | `registerEntityMap` | Register a custom named-entity map for SSR `decodeEntities`. |
240
+ | `loadEntityMap` | Async loader that dynamically imports the full HTML5 named-entity map; returns the map to pass to `registerEntityMap`. |
241
+ | `clearRegisteredEntityMap` | Reset the registered entity map back to the built-in minimal set. |
242
+ | `VNode` (type) | The runtime VNode shape used by renderers and SSR. |
243
+ | `RenderOptions` (type) | Options for `renderToString` (`injectSvgNamespace`, `injectKnownNamespaces`). |
207
244
 
208
245
  ### Global Styles (CSS)
209
246
 
@@ -229,6 +266,36 @@ Below is the **complete list of public symbols** exported by the runtime and its
229
266
  | ----------- | ------------------------------------------------- |
230
267
  | `reset.css` | CSS export that contains a base reset for styles. |
231
268
 
269
+ ### Extended Color Palette (TypeScript)
270
+
271
+ **Package:** `@jasonshimmy/custom-elements-runtime/css/colors`
272
+
273
+ Opt-in extended color palette with full Tailwind-compatible color names (`slate`, `gray`, `zinc`, `stone`, `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `violet`, `purple`, `fuchsia`, `pink`, `rose`) with shades 50–950.
274
+
275
+ ```ts
276
+ import { extendedColors } from '@jasonshimmy/custom-elements-runtime/css/colors';
277
+
278
+ // Use individual color scales
279
+ const blueShades = extendedColors.blue; // { '50': '#eff6ff', '100': '...', ... }
280
+
281
+ // Use in a component
282
+ component('branded-card', () => {
283
+ useStyle(
284
+ () => css`
285
+ :host {
286
+ --card-accent: ${extendedColors.violet['500']};
287
+ }
288
+ `,
289
+ );
290
+ return html`<slot></slot>`;
291
+ });
292
+ ```
293
+
294
+ | Export | Description |
295
+ | ---------------- | -------------------------------------------------------------------------------------- |
296
+ | `extendedColors` | Full extended palette — `Record<string, Record<string, string>>` (name → shade → hex). |
297
+ | `ColorScale` | Type: single color scale with shade keys `50`–`950`. |
298
+
232
299
  ## 📖 Documentation Index
233
300
 
234
301
  Explore the complete documentation for every runtime feature:
@@ -258,7 +325,9 @@ Explore the complete documentation for every runtime feature:
258
325
  ### 🎨 **Styling**
259
326
 
260
327
  - [🎨 JIT CSS](./docs/jit-css.md) - On-demand utility-first styling system
328
+ - [📏 Space Utilities](./docs/space-utilities.md) - Tailwind-style `space-x-*` and `space-y-*` spacing utilities
261
329
  - [📝 Prose Typography](./docs/prose.md) - Beautiful typography for long-form content
330
+ - [🎨 Colors](./docs/colors.md) - Extended Tailwind-compatible color palette (`/css/colors` subpath)
262
331
 
263
332
  ### 🔗 **Communication & State**
264
333
 
@@ -269,6 +338,12 @@ Explore the complete documentation for every runtime feature:
269
338
 
270
339
  ### ⚡ **Advanced Features**
271
340
 
341
+ - [⚡ Reactive API](./docs/reactive-api.md) - `watch()` targeted watchers, `computed()` memoization, `watchEffect()` auto-tracking, and `nextTick()`
342
+ - [🏝️ Provide / Inject](./docs/provide-inject.md) - Ancestor-to-descendant dependency injection without prop-drilling
343
+ - [🧩 Composables](./docs/composable.md) - Reusable stateful logic with `createComposable()`
344
+ - [🚀 Teleport](./docs/teleport.md) - Render content outside the shadow root with `useTeleport()`
345
+ - [♻️ Keep-Alive](./docs/keep-alive.md) - Preserve component state across DOM removals with `<cer-keep-alive>`
346
+ - [🩺 Health Monitor](./docs/health-monitor.md) - Track runtime metrics and receive periodic health reports with `createHealthMonitor()`
272
347
  - [🔮 Virtual DOM](./docs/virtual-dom.md) - VDOM implementation and performance details
273
348
  - [🌐 SSR](./docs/ssr.md) - Server-side rendering support
274
349
  - [♻️ HMR](./docs/hmr.md) - Hot module replacement
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Extended Tailwind-compatible color palette — opt-in module.
3
+ *
4
+ * Import individual color objects or the full palette as needed.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { extendedColors } from '@jasonshimmy/custom-elements-runtime/css/colors';
9
+ * ```
10
+ */
11
+ /** A single color scale with shade keys 50–950. */
12
+ export type ColorScale = Record<string, string>;
13
+ /** Full extended color palette with Tailwind-compatible color names. */
14
+ export declare const extendedColors: Record<string, ColorScale>;
@@ -1,19 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./namespace-helpers-BsKQl3aH.cjs"),j=require("./logger-DiXdWaF-.cjs"),D=require("./transitions-RXe2brRm.cjs");function tt(e,n,t){if(t)for(const[s,r]of Object.entries(t)){let o,i={};if(Array.isArray(r)?(o=r[0],i=r[1]||{}):o=r,n.set(s,{callback:o,options:i,oldValue:l.getNestedValue(e,s)}),i.immediate)try{const a=l.getNestedValue(e,s);o(a,void 0,e)}catch(a){j.devError(`Error in immediate watcher for "${s}":`,a)}}}function nt(e,n,t,s){const r=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((g,_)=>r(g,a[_]));const u=i,d=a,E=Object.keys(u||{}),S=Object.keys(d||{});return E.length!==S.length?!1:E.every(g=>r(u[g],d[g]))},o=n.get(t);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(i){j.devError(`Error in watcher for "${t}":`,i)}for(const[i,a]of n.entries())if(a.options.deep&&t.startsWith(i+"."))try{const u=l.getNestedValue(e,i);r(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){j.devError(`Error in deep watcher for "${i}":`,u)}}function Ne(e,n){return n===Boolean?e===""||e==="true":n===Number?Number(e):e}function rt(e,n,t){if(n)for(const s in n){const r=n[s],o=l.toKebab(s),i=e.getAttribute(o);if(r.type===Function&&typeof e[s]=="function")t[s]=e[s];else if(i!==null)t[s]=Ne(i,r.type);else if(typeof e[s]<"u")try{const a=e[s];if(r.type===String&&a&&typeof a=="object")try{t[s]=Ne(String(a),r.type)}catch{t[s]=a}else r.type===Boolean&&typeof a=="boolean"||r.type===Number&&typeof a=="number"||r.type===Function&&typeof a=="function"?t[s]=a:t[s]=Ne(String(a),r.type)}catch{t[s]=e[s]}else"default"in r&&r.default!==void 0&&(t[s]=r.default)}}function st(e,n,t){if(!n.props){try{const s=t?._hookCallbacks?.props||{},r=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(!Object.prototype.hasOwnProperty.call(s,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get(){try{const u=l.toKebab(o),d=e.getAttribute(u);if(d!==null)return d;const E=e[o];let S;return l.isReactiveState(E)||E&&typeof E=="object"&&"value"in E&&!(E instanceof Node)?S=E.value:S=E,S}catch{return e[o]}}})}catch{}}}catch{}return}rt(e,n.props,t)}function it(e,n,t,s){e.onConnected&&!t&&(e.onConnected(n),s(!0))}function ot(e,n,t,s,r,o,i,a){e.onDisconnected&&e.onDisconnected(n),t.forEach(u=>u()),s(),r(),o(!1),i(null),a(!1)}function at(e,n,t,s,r){e.onAttributeChanged&&e.onAttributeChanged(n,t,s,r)}class ct{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(n,t){const s=this.cache.get(n);if(s){if(!s.isSecure){j.devWarn("Blocked cached dangerous expression:",n);return}try{this.cache.delete(n),this.cache.set(n,s)}catch{}return s.evaluator(t)}const r=this.createEvaluator(n);if(this.cache.size>=this.maxCacheSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}if(this.cache.set(n,r),!r.isSecure){j.devWarn("Blocked dangerous expression:",n);return}return r.evaluator(t)}static createEvaluator(n){if(this.hasDangerousPatterns(n))return{evaluator:()=>{},isSecure:!1};if(n.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(n),isSecure:!0}}catch(t){return j.devWarn("Failed to create evaluator for expression:",n,t),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(n){return this.dangerousPatterns.some(t=>t.test(n))}static createSafeEvaluator(n){const t=n.trim();if(t.startsWith("{")&&t.endsWith("}"))return this.createObjectEvaluator(n);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(n.trim())){const s=n.trim().slice(4);return r=>l.getNestedValue(r,s)}return n.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(n)?this.createSimpleEvaluator(n):s=>l.getNestedValue(s,n)}static createObjectEvaluator(n){const t=n.trim().slice(1,-1),s=this.parseObjectProperties(t);return r=>{const o={};for(const{key:i,value:a}of s)try{if(a.startsWith("ctx.")){const u=a.slice(4);o[i]=l.getNestedValue(r,u)}else o[i]=this.evaluateSimpleValue(a,r)}catch{o[i]=void 0}return o}}static parseObjectProperties(n){const t=[],s=n.split(",");for(const r of s){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),a=r.slice(o+1).trim(),u=i.replace(/^['"]|['"]$/g,"");t.push({key:u,value:a})}return t}static createSimpleEvaluator(n){return t=>{try{let s=n;const r=[];s=s.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,S=>`<<#${r.push(S)-1}#>>`);const o=s.match(/ctx\.[\w.]+/g)||[];for(const S of o){const g=S.slice(4),_=l.getNestedValue(t,g);if(_===void 0)return;const w=r.push(JSON.stringify(_))-1;s=s.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${w}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=s.match(i)||[];for(const S of a){if(S.startsWith("ctx."))continue;const g=l.getNestedValue(t,S);if(g===void 0)return;const _=r.push(JSON.stringify(g))-1;s=s.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${_}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let d;const E=new Set;for(;(d=u.exec(s))!==null;){const S=d[1];if(["true","false","null","undefined"].includes(S)||/^[0-9]+$/.test(S)||S==="ctx"||E.has(S))continue;E.add(S);const g=l.getNestedValue(t,S);if(g===void 0)return;const _=JSON.stringify(g),w=r.push(_)-1;S.includes(".")?s=s.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${w}#>>`):s=s.replace(new RegExp("\\b"+S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${w}#>>`)}s=s.replace(/<<#(\d+)#>>/g,(S,g)=>r[Number(g)]);try{return this.evaluateBasicExpression(s)}catch{return}}catch{return}}}static evaluateBasicExpression(n){const t=this.tokenize(n);let s=0;function r(){return t[s]}function o(h){const k=t[s++];if(h&&!k)throw new Error(`Unexpected token EOF, expected ${h}`);if(h&&k&&k.type!==h&&k.value!==h)throw new Error(`Unexpected token ${k.type}/${k.value}, expected ${h}`);return k}function i(){return w()}function a(h){if(typeof h=="number")return h;if(h==null)return NaN;if(typeof h=="boolean")return h?1:0;const k=Number(h);return Number.isNaN(k)?NaN:k}function u(h,k){return typeof h=="string"||typeof k=="string"?String(h)+String(k):a(h)+a(k)}function d(h,k){return a(h)-a(k)}function E(h,k){return a(h)*a(k)}function S(h,k){return a(h)/a(k)}function g(h,k){return a(h)%a(k)}function _(h,k,f){if(typeof k=="number"&&typeof f=="number")switch(h){case">":return k>f;case"<":return k<f;case">=":return k>=f;case"<=":return k<=f;default:return!1}const b=String(k),T=String(f);switch(h){case">":return b>T;case"<":return b<T;case">=":return b>=T;case"<=":return b<=T;default:return!1}}function w(){const h=N(),k=r();if(k&&k.value==="?"){o("?");const f=i();o(":");const b=i();return h?f:b}return h}function N(){let h=c();for(;;){const k=r();if(!k||k.value!=="||")break;o("OP");const f=c();h=h||f}return h}function c(){let h=C();for(;;){const k=r();if(!k||k.value!=="&&")break;o("OP");const f=C();h=h&&f}return h}function C(){let h=y();for(;;){const k=r();if(!k||!["==","!=","===","!=="].includes(k.value))break;const f=o("OP").value,b=y();switch(f){case"==":h=h==b;break;case"!=":h=h!=b;break;case"===":h=h===b;break;case"!==":h=h!==b;break}}return h}function y(){let h=m();for(;;){const k=r();if(!k||![">","<",">=","<="].includes(k.value))break;const f=o("OP").value,b=m();switch(f){case">":h=_(">",h,b);break;case"<":h=_("<",h,b);break;case">=":h=_(">=",h,b);break;case"<=":h=_("<=",h,b);break}}return h}function m(){let h=p();for(;;){const k=r();if(!k||k.value!=="+"&&k.value!=="-")break;const f=o("OP").value,b=p();h=f==="+"?u(h,b):d(h,b)}return h}function p(){let h=A();for(;;){const k=r();if(!k||k.value!=="*"&&k.value!=="/"&&k.value!=="%")break;const f=o("OP").value,b=A();switch(f){case"*":h=E(h,b);break;case"/":h=S(h,b);break;case"%":h=g(h,b);break}}return h}function A(){const h=r();if(h&&h.value==="!")return o("OP"),!A();if(h&&h.value==="-"){o("OP");const k=A();return d(0,k)}return v()}function v(){const h=r();if(h){if(h.type==="NUMBER")return o("NUMBER"),Number(h.value);if(h.type==="STRING")return o("STRING"),h.value.slice(1,-1);if(h.type==="IDENT")return o("IDENT"),h.value==="true"?!0:h.value==="false"?!1:h.value==="null"?null:void 0;if(h.value==="["){o("PUNC");const k=[];for(;;){const f=r();if(!f||f.value==="]")break;k.push(i());const b=r();b&&b.value===","&&o("PUNC")}return o("PUNC"),k}if(h.value==="("){o("PUNC");const k=i();return o("PUNC"),k}throw new Error("Unexpected token in expression")}}return i()}static tokenize(n){const t=[],s=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let r;for(;(r=s.exec(n))!==null;){const o=r[1];o&&(/^\d/.test(o)?t.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?t.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?t.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?t.push({type:"PUNC",value:o}):t.push({type:"OP",value:o}))}return t}static evaluateSimpleValue(n,t){if(n==="true")return!0;if(n==="false")return!1;if(!isNaN(Number(n)))return Number(n);if(n.startsWith("ctx.")){const s=n.slice(4);return l.getNestedValue(t,s)}return n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?n.slice(1,-1):n}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class Z{static cleanupFunctions=new WeakMap;static addListener(n,t,s,r){n.addEventListener(t,s,r);const i={event:t,handler:s,wrapper:s,options:r,cleanup:()=>n.removeEventListener(t,s,r),addedAt:Date.now()};this.cleanupFunctions.has(n)||this.cleanupFunctions.set(n,[]);const a=this.cleanupFunctions.get(n);a.push(i),a.__metaList=a}static removeListener(n,t,s,r){n.removeEventListener(t,s,r);const o=this.cleanupFunctions.get(n);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===t&&a.handler===s){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(n);return}}}static cleanup(n){const t=this.cleanupFunctions.get(n);t&&(t.forEach(s=>{try{s.cleanup()}catch{}}),this.cleanupFunctions.delete(n))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(n){const t=this.cleanupFunctions.get(n);return!!(t&&t.length>0)}static getListenerCount(n){const t=this.cleanupFunctions.get(n);return t?t.length:0}static getListenerInfo(n){const t=this.cleanupFunctions.get(n);return t?t.map(s=>({event:s.event,handler:s.handler,wrapper:s.wrapper,options:s.options})):[]}}function ke(e,n){return Array.isArray(e)&&Array.isArray(n)?JSON.stringify([...e].sort())!==JSON.stringify([...n].sort()):e!==n}function Be(e,n,t,s,r){if(e){const o=n.value;if(r&&typeof o=="object"&&o!==null){const i={...o};i[r]=t,n.value=i}else n.value=t}else{const o=s._state||s;l.setNestedValue(o,n,t)}}function Te(e,n,t,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const r=n?"reactiveState":t;e._triggerWatchers(r,s)}}function lt(e,n,t){const s=`update:${l.toKebab(n)}`,r=`update:${n}`,o=new CustomEvent(s,{detail:t,bubbles:!0,cancelable:!0}),i=new CustomEvent(r,{detail:t,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function De(e,n,t,s){const r=t;if(l.safe(()=>{if(typeof e.setAttribute=="function")try{e[n]=r}catch{}else e[n]=r}),r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){const o=l.safeSerializeAttr(r);o!==null?l.safe(()=>{typeof e.setAttribute=="function"&&l.setAttributeSmart(e,l.toKebab(n),String(o))}):l.safe(()=>{typeof e.removeAttribute=="function"&&l.removeAttributeSmart(e,l.toKebab(n))})}}function ft(e,n,t,s){if(e){const r=n.value;return s&&typeof r=="object"&&r!==null?r[s]:r}else{const r=t._state||t;return l.getNestedValue(r,n)}}function ae(e){return e?e.split(/\s+/).filter(Boolean):[]}function ce(e,n){if(n.length===0)return;const t=n.filter(s=>s&&!e.classList.contains(s));t.length>0&&e.classList.add(...t)}function oe(e,n){if(n.length===0)return;const t=n.filter(Boolean);t.length>0&&e.classList.remove(...t)}let Oe=!1;async function ut(e,n,t=10){if(!Oe){if(!e.isConnected){j.devWarn("⚠️ Element not connected to DOM, skipping style wait");return}for(let s=0;s<t;s++){const r=window.getComputedStyle(e),o=r.transform&&r.transform!=="",i=r.opacity&&r.opacity!=="";if(o||i){Oe=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}Oe=!0,j.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function dt(e){const n=window.getComputedStyle(e),t=n.transitionDuration||"0s",s=n.transitionDelay||"0s",r=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return r(t)+r(s)}function qe(e,n){return new Promise(t=>{const s=n??dt(e);if(s<=0){t();return}let r=!1;const o=()=>{r||(r=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),t())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,s+50)})}async function me(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(w){j.devError("Transition onBeforeEnter error:",w)}if(!r)return s?.onEnter?new Promise(w=>{const N=s.onEnter;typeof N=="function"?N(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(c){j.devError("Transition onAfterEnter error:",c)}w()}):w()}):void 0;const i=ae(t?.enterFrom),a=ae(t?.enterActive),u=ae(t?.enterTo);ce(e,i),e.offsetHeight,ce(e,a),e.offsetHeight;let d;if(s?.onEnter){const w=new Promise(N=>{d=N});try{const N=s.onEnter;typeof N=="function"&&N(e,()=>{d&&d()})}catch(N){j.devError("Transition onEnter error:",N)}d&&await w}await new Promise(w=>requestAnimationFrame(()=>w(void 0))),e.offsetHeight;const E=window.getComputedStyle(e),S=E.transform,g=E.opacity;oe(e,i),S&&S!=="none"&&(e.style.transform=S),g&&g!==""&&(e.style.opacity=g),e.offsetHeight,await new Promise(w=>requestAnimationFrame(()=>w(void 0))),e.style.transform="",e.style.opacity="",ce(e,u),e.offsetHeight,await new Promise(w=>requestAnimationFrame(()=>w(void 0)));let _;if(typeof o=="number"?_=o:o&&typeof o=="object"&&"enter"in o&&(_=o.enter),await qe(e,_),oe(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(w){j.devError("Transition onAfterEnter error:",w)}}async function Re(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(S){j.devError("Transition onBeforeLeave error:",S)}if(!r)return s?.onLeave?new Promise(S=>{const g=s.onLeave;typeof g=="function"?g(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(_){j.devError("Transition onAfterLeave error:",_)}S()}):S()}):void 0;const i=ae(t?.leaveFrom),a=ae(t?.leaveActive),u=ae(t?.leaveTo);ce(e,i),e.offsetHeight,ce(e,a);let d;if(s?.onLeave){const S=new Promise(g=>{d=g});try{const g=s.onLeave;typeof g=="function"&&g(e,()=>{d&&d()})}catch(g){j.devError("Transition onLeave error:",g)}d&&await S}await new Promise(S=>requestAnimationFrame(()=>S(void 0))),await ut(e,[...i,...a]),oe(e,i),ce(e,u);let E;if(typeof o=="number"?E=o:o&&typeof o=="object"&&"leave"in o&&(E=o.leave),await qe(e,E),oe(e,a),oe(e,u),oe(e,i),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(S){j.devError("Transition onAfterLeave error:",S)}}const Ge=new WeakMap,Ze=new WeakMap;function we(e){if(!e)return;const n=Ge.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){const t=e.getAttribute("data-anchor-key");if(t)return t}}function V(e,n){try{Ge.set(e,n)}catch{}try{e.key=n}catch{}try{if(e instanceof Element){const t=l.safeSerializeAttr(n);t!==null&&l.setAttributeSmart(e,"data-anchor-key",t)}}catch{}}function pt(e){if(!e)return;const n=Ze.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function ht(e,n){try{Ze.set(e,n)}catch{}try{e._transitionGroup=n}catch{}}function le(e){return e!==null&&typeof e=="object"&&"value"in e}function $e(e){try{if(l.isReactiveState(e))return e.value}catch{}try{if(le(e))return e.value}catch{}return e}function X(e,n,t){try{e&&e.attrs&&(e.attrs[n]=t)}catch{}}function q(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function fe(e){return e===""?!0:typeof e=="string"?e==="false"?!1:e==="true"?!0:e!=="":e&&typeof e=="object"?l.isReactiveState(e)||"value"in e?!!e.value:!1:!!e}function ie(e,n){if(!n||!(e instanceof Element))return;Z.cleanup(e);for(const s in n)n[s]===e&&delete n[s];const t=e.childNodes;for(let s=0;s<t.length;s++)ie(t[s],n)}function ge(e,n,t){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),r=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(l.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=n;else if(typeof s=="function")s(n);else if(typeof s=="string"&&t)try{const o=String(s);t[o]=n}catch{}}catch{}else if(r&&t)try{const o=String(r);t[o]=n}catch{}}function yt(e,n,t,s,r,o,i,a){if(!o)return;const u=n.includes("lazy"),d=n.includes("trim"),E=n.includes("number"),S=()=>{if(l.isReactiveState(e)){const p=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof p=="object"&&p!==null?p[a]:p}const m=o?._state||o;return l.getNestedValue(m,e)},g=S();let _="text";i instanceof HTMLInputElement?_=s?.type||i.type||"text":i instanceof HTMLSelectElement?_="select":i instanceof HTMLTextAreaElement&&(_="textarea");const w=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,c=w?_==="checkbox"||_==="radio"?"checked":"value":a??"modelValue";if(_==="checkbox")if(Array.isArray(g))t[c]=g.includes(String(i?.getAttribute("value")??s?.value??""));else{const m=i?.getAttribute("true-value")??!0;t[c]=g===m}else if(_==="radio")t[c]=g===(s?.value??"");else if(_==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const m=Array.isArray(g)?g.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(p=>{p.selected=m.includes(p.value)})},0),t[c]=Array.isArray(g)?g:[]}else t[c]=g;else{!w&&l.isReactiveState(e)?t[c]=e:t[c]=g;try{const m=l.toKebab(c);s&&(s[m]=g)}catch{}}const C=u||_==="checkbox"||_==="radio"||_==="select"?"change":"input",y=m=>{if(m.isComposing||r._isComposing)return;const p=globalThis.process,A=!!p&&p.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(m.isTrusted===!1&&!A)return;const v=m.target;if(!v||v._modelUpdating)return;let L=v.value;if(_==="checkbox"){const f=S();if(Array.isArray(f)){const b=v.getAttribute("value")??"",T=Array.from(f);if(v.checked)T.includes(b)||T.push(b);else{const O=T.indexOf(b);O>-1&&T.splice(O,1)}L=T}else{const b=v.getAttribute("true-value")??!0,T=v.getAttribute("false-value")??!1;L=v.checked?b:T}}else if(_==="radio")L=v.getAttribute("value")??v.value;else if(_==="select"&&v.multiple)L=Array.from(v.selectedOptions).map(f=>f.value);else if(d&&typeof L=="string"&&(L=L.trim()),E){const f=Number(L);isNaN(f)||(L=f)}const h=S();if(ke(L,h)){v._modelUpdating=!0;try{Be(l.isReactiveState(e),e,L,o,a),Te(o,l.isReactiveState(e),e,L),v&&lt(v,c,L)}finally{setTimeout(()=>v._modelUpdating=!1,0)}}};if(w){if(r[C]){const m=r[C];i&&Z.removeListener(i,C,m)}r[C]=y}else{const m=`update:${l.toKebab(c)}`,p=`update:${c}`;if(r[m]){const A=r[m];i&&Z.removeListener(i,m,A)}if(r[p]){const A=r[p];i&&Z.removeListener(i,p,A)}if(r[m]=A=>{const v=A.detail;let L=v!==void 0?v:void 0;if(L===void 0){const f=A.target;if(f&&typeof f=="object"&&"value"in f)try{L=f.value}catch{L=void 0}}const h=ft(l.isReactiveState(e),e,o,a);if(ke(L,h)){Be(l.isReactiveState(e),e,L,o,a),Te(o,l.isReactiveState(e),e,L);const f=A.target;f&&De(f,c,l.isReactiveState(e)?e:L,l.isReactiveState(e))}},l.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let A=[];try{A=Reflect.ownKeys(e.value)}catch{A=Object.keys(e.value)}const v=A.filter(L=>typeof L=="string"&&!String(L).startsWith("_")&&L!=="constructor");for(const L of v){const h=String(L),k=`update:${l.toKebab(h)}`,f=`update:${h}`;r[k]||(r[k]=b=>{const T=b.detail!==void 0?b.detail:b.target?.value,O=l.isReactiveState(e)?e.value[h]:l.getNestedValue(o?._state||o,e);if(!ke(T,O))return;if(l.isReactiveState(e)){const I={...e.value};I[h]=T,e.value=I}else l.setNestedValue(o?._state||o,e,T);Te(o,l.isReactiveState(e),e,T);const P=b.currentTarget||i||b.target;P&&De(P,c,l.isReactiveState(e)?e:T,l.isReactiveState(e))},r[f]=r[k])}}r[p]=r[m]}(_==="text"||_==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=m=>{r._isComposing=!1;const p=m.target;p&&setTimeout(()=>{const A=p.value,v=o?._state||o,L=l.getNestedValue(v,e);let h=A;if(d&&(h=h.trim()),E){const f=Number(h);isNaN(f)||(h=f)}if(ke(h,L)){p._modelUpdating=!0;try{l.setNestedValue(v,e,h),Te(o,l.isReactiveState(e),e,h)}finally{setTimeout(()=>p._modelUpdating=!1,0)}}},0)})}function Je(e){const n=e.slice(2);return n?n.charAt(0).toLowerCase()+n.slice(1):""}function mt(e,n,t,s,r){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")t[o]=i;else if(o==="disabled"&&r&&q(r)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return l.isReactiveState(i)}catch{return!1}})()||a?n[o]=i:t[o]=i}else n[o]=i;else if(typeof e=="string"){if(!s)return;try{const o=Ce(e,s);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")t[i]=a;else if(i==="disabled"&&r&&q(r)){const u=a&&typeof a=="object"&&"value"in a;(()=>{try{return l.isReactiveState(a)}catch{return!1}})()||u?n[i]=a:t[i]=a}else n[i]=a;return}else{t[e]=o;return}}catch{const o=l.getNestedValue(s,e);t[e]=o}}}function gt(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ce(e,t)}else s=e;const r=String(n.style||"");let o=r;if(s){if(r){const i=String(r).split(";").map(u=>u.trim()).filter(Boolean),a=i.findIndex(u=>u.startsWith("display:"));a>=0&&i[a]==="display: none"&&(i.splice(a,1),o=i.length>0?i.join("; ")+";":"")}}else if(r){const i=String(r).split(";").filter(Boolean),a=i.findIndex(u=>u.trim().startsWith("display:"));a>=0?i[a]="display: none":i.push("display: none"),o=i.join("; ")}else o="display: none";o!==r&&(o?n.style=o:n.style=void 0)}function Ce(e,n){return ct.evaluate(e,n)}function bt(e,n,t,s){let r;if(typeof e=="string"){if(!t)return;r=Ce(e,t)}else r=e;try{if(r&&typeof r=="object"){if(l.isReactiveState(r))r=r.value;else if("value"in r&&typeof r.value<"u"){const d=r.value;d instanceof Node||(r=d)}}}catch{}let o=[];if(typeof r=="string")o=[r];else if(Array.isArray(r))o=r.filter(Boolean);else if(typeof r=="object"&&r!==null)for(const[d,E]of Object.entries(r))E&&o.push(d);const i=o.join(" "),a=s&&s.class||n.class||"",u=a?`${a} ${i}`.trim():i.trim();u?n.class=u:n.class=void 0}function je(e){if(e===!0||e===!1)return!0;if(e==null)return!1;if(typeof e==="string")return e===""||e==="true"||e==="false";try{if(e&&typeof e=="object"&&"value"in e){const t=e.value,s=typeof t;return s==="boolean"?!0:s==="string"?t===""||t==="true"||t==="false":!1}}catch{}return!1}function St(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ce(e,t)}else s=e;let r="";if(typeof s=="string")r=s;else if(s&&typeof s=="object"){const i=[];for(const[a,u]of Object.entries(s))if(u!=null&&u!==""){const d=a.replace(/[A-Z]/g,g=>`-${g.toLowerCase()}`),E=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let S=String(u);typeof u=="number"&&E.includes(d)&&(S=`${u}px`),i.push(`${d}: ${S}`)}r=i.join("; ")+(i.length>0?";":"")}const o=String(n.style||"");n.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function vt(e,n,t){let s=e;typeof e=="string"&&t&&(s=Ce(e,t)),l.isReactiveState(s)?n.reactiveRef=s:n.ref=s}function Ye(e,n,t,s){const r={},o={...s||{}},i={};for(const[a,u]of Object.entries(e)){const{value:d,modifiers:E,arg:S}=u;if(a==="model"||a.startsWith("model:")){const g=a.split(":"),_=g.length>1?g[1]:S;yt(d,E,r,o,i,n,t,_);continue}switch(a){case"bind":mt(d,r,o,n,t);break;case"show":gt(d,o,n);break;case"class":bt(d,o,n,s);break;case"style":St(d,o,n);break;case"ref":vt(d,r,n);break}}try{if(Object.prototype.hasOwnProperty.call(r,"disabled")&&t&&q(t)){const u=r.disabled,d=u&&typeof u=="object"&&"value"in u;let E=!1;try{E=l.isReactiveState(u)}catch{E=!1}if(!d&&!E)try{o.disabled=u,delete r.disabled;const S=globalThis;S.__VDOM_DISABLED_PROMOTIONS||(S.__VDOM_DISABLED_PROMOTIONS=[]),S.__VDOM_DISABLED_PROMOTIONS.push({phase:"bind-directive:postfix-move",location:"attrs",key:"disabled",value:u,time:Date.now(),stack:new Error().stack})}catch{}}}catch{}return{props:r,attrs:o,listeners:i}}function He(e,n){if(Array.isArray(e)){const o=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const S=i.tag||"node",_=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(w=>w!=null)??"";a=_?`${n}:${S}:${_}`:`${n}:${S}`}let u=a,d=1;for(;o.has(u);)u=`${a}#${d++}`;o.add(u);let E=i.children;return Array.isArray(E)&&(E=He(E,u)),{...i,key:u,children:E}})}const t=e,s=t.props?.key??t.key??n;let r=t.children;return Array.isArray(r)&&(r=He(r,s)),{...t,key:s,children:r}}function ze(e,n,t,s){const r=t.directives??{},o=t.attrs?{...t.attrs}:{},i=Ye(r,s,e,o),a={...n.props||{},...t.props||{},...i.props||{}},u={...n.attrs||{},...o||{},...i.attrs||{}},d=n.props??{},E=a,S=!!(t?.isCustomElement??n?.isCustomElement??!1);let g=!1;for(const c in{...d,...E}){const C=d[c],y=E[c];let m=C,p=y;if(l.safe(()=>{(l.isReactiveState(C)||le(C))&&(m=C.value)}),l.safe(()=>{(l.isReactiveState(y)||le(y))&&(p=y.value)}),!(C===y&&m===p))if(g=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const A=$e(y),v=A==null?"":String(A);e.value!==v&&(e.value=v)}else if(c==="checked"&&e instanceof HTMLInputElement){const A=$e(y);e.checked=!!A}else if(c.startsWith("on")&&typeof y=="function"){const A=Je(c);typeof C=="function"&&Z.removeListener(e,A,C),typeof y=="function"&&Z.addListener(e,A,y);try{if(A&&A.startsWith("update:")){const v=A.split(":",2)[1],L=E[v];let h=[];try{if(l.isReactiveState(L)){const f=L.value;h=f&&typeof f=="object"?Object.keys(f):[]}else L&&typeof L=="object"&&(h=Object.keys(L))}catch{h=[]}const k=h.filter(f=>typeof f=="string"&&!f.startsWith("_")&&f!=="constructor");for(const f of k){const b=`update:${f}`,T=O=>{const R=O.detail!==void 0?O.detail:O.target instanceof HTMLInputElement||O.target instanceof HTMLTextAreaElement||O.target instanceof HTMLSelectElement?O.target.value:void 0,I={...l.isReactiveState(L)?L.value||{}:E[v]||{},[f]:R};try{typeof y=="function"&&y({detail:I})}catch{}};l.safe(()=>{Z.addListener(e,b,T)})}}}catch{}}else if(y==null)l.removeAttributeSmart(e,c);else{const A=t?.isCustomElement??n?.isCustomElement??!1;if(A||c in e)try{e[c]=y,c==="disabled"&&y===!1&&!A&&q(e)&&l.removeAttributeSmart(e,"disabled")}catch{}else y===!1&&l.removeAttributeSmart(e,c)}}for(const[c,C]of Object.entries(i.listeners||{})){Z.addListener(e,c,C);try{const y=e&&e.parentElement;y&&y!==e&&Z.addListener(y,c,C)}catch{}}const _={...n.attrs??{}},w=u,N=i&&i.attrs||{};if(Object.prototype.hasOwnProperty.call(N,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(N,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(Object.prototype.hasOwnProperty.call(N,"class")&&N.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(N,"style")&&N.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==_.class&&(_.class=c)}catch{}}}catch{}}catch{}for(const c in{..._,...w}){const C=_[c],y=w[c];let m=C,p=y;if(l.isReactiveState(C)&&(m=C.value),l.isReactiveState(y)&&(p=y.value),m!==p)if(g=!0,p==null||p===!1)l.safe(()=>{l.removeAttributeSmart(e,c)}),X(n,c,void 0),c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?l.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?l.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&l.safe(()=>{e.value=0})),c==="checked"&&e instanceof HTMLInputElement&&l.safe(()=>{e.checked=!1}),c==="disabled"&&q(e)&&l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(c==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){l.safe(()=>{e.value=p??""});continue}else if(e instanceof HTMLSelectElement){l.safe(()=>{e.value=p??""});continue}else if(e instanceof HTMLProgressElement){l.safe(()=>{e.value=Number(p)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){l.safe(()=>{e.checked=!!p});continue}if(c==="style"){const v=l.safeSerializeAttr(p);v!==null&&l.setAttributeSmart(e,c,String(v)),X(n,c,p);continue}if(c==="class"){const v=l.safeSerializeAttr(p);v!==null&&l.setAttributeSmart(e,c,String(v)),X(n,c,p);continue}if(c==="disabled"&&q(e)){l.safe(()=>{const v=fe(p);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=v)}),fe(p)?l.safe(()=>{l.setAttributeSmart(e,c,"")}):l.safe(()=>{l.removeAttributeSmart(e,c)});continue}const A=e.namespaceURI==="http://www.w3.org/2000/svg";if(S&&!A&&c.includes("-"))if(l.isClassLikeAttr(c)){const v=l.safeSerializeAttr(y??p);if(v!==null){try{l.setAttributeSmart(e,c,String(v))}catch{}X(n,c,p)}}else{const v=l.toCamel(c);try{const L=e;L[v]=l.isReactiveState(y)?y:p,X(n,c,p)}catch{const L=l.safeSerializeAttr(y??p);L!==null&&l.setAttributeSmart(e,c,String(L))}}else if(!A&&c in e)try{const v=e;v[c]=l.isReactiveState(y)?y:p,X(n,c,p)}catch{const v=l.safeSerializeAttr(p);v!==null&&(l.setAttributeSmart(e,c,String(v)),X(n,c,p))}else{const v=l.safeSerializeAttr(p);v!==null&&(l.setAttributeSmart(e,c,String(v)),X(n,c,p))}}}try{if(q(e)){const c=a.disabled;let C;try{const m=Object.prototype.hasOwnProperty.call(i.props||{},"disabled"),p=c&&typeof c=="object"&&"value"in c;let A=!1;l.safe(()=>{A=!!l.isReactiveState(c)});const v=je(c);A||p||m||v?C=c:C=u.disabled}catch{C=u.disabled}const y=fe(C);l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=y)}),y?l.safe(()=>{l.setAttributeSmart(e,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(e,"disabled")})}}catch{}if(S&&g){const c=e;l.safe(()=>{c._applyProps?.(c._cfg)}),l.safe(()=>{typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render?.(c._cfg)})}}function U(e,n,t,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const c=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&V(c,e.key),c}if(e.tag==="#raw"){const c=typeof e.children=="string"?e.children:"";return document.createRange().createContextualFragment(c)}if(e.tag==="#anchor"){const c=e,C=Array.isArray(c.children)?c.children:[],y=document.createTextNode(""),m=document.createTextNode("");c.key!=null&&(V(y,`${c.key}:start`),V(m,`${c.key}:end`)),c._startNode=y,c._endNode=m;const p=document.createDocumentFragment();p.appendChild(y);for(const A of C){const v=U(A,n,t,s);if(c.key!=null&&v instanceof Element&&!v.hasAttribute("data-anchor-key")){const L=A;L&&typeof L=="object"&&L.key!=null||V(v,String(c.key))}p.appendChild(v)}return p.appendChild(m),p}const r=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,i=(r&&typeof r.xmlns=="string"?String(r.xmlns):void 0)??s??l.TAG_NAMESPACE_MAP[e.tag]??null,a=i?document.createElementNS(i,e.tag):document.createElement(e.tag);e.key!=null&&V(a,e.key),e.props&&e.props?._transitionGroup&&ht(a,e.props?._transitionGroup);const{props:u={},attrs:d={},directives:E={}}=e.props??{},S=Ye(E,n,a instanceof HTMLElement?a:void 0,d),g={...u,...S.props},_={...d,...S.attrs};try{const c=(_&&_.class)??(g&&g.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),C=l.safeSerializeAttr(c);if(C!==null){const y=String(C).trim();y&&l.setAttributeSmart(a,"class",y)}}catch{}try{if(g.disabled!==void 0&&a&&q(a)){const c=g.disabled,C=c&&typeof c=="object"&&"value"in c;let y=!1;try{y=l.isReactiveState(c)}catch{y=!1}!C&&!y&&l.safe(()=>{_.disabled=c,delete g.disabled})}}catch{}const w=a.namespaceURI==="http://www.w3.org/2000/svg";for(const c in _){const C=_[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const y=$e(C);if(typeof y=="boolean")y?l.setAttributeSmart(a,c,""):l.safe(()=>{l.removeAttributeSmart(a,c)});else if(y!=null){if(c==="disabled"&&q(a)){const m=g.disabled,p=je(m)?m:y,A=fe(p);l.safe(()=>{a.disabled=A}),A?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}if(!w&&c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLProgressElement))try{a instanceof HTMLProgressElement?a.value=Number(y):a.value=String(y??"")}catch{const m=l.safeSerializeAttr(y);m!==null&&l.setAttributeSmart(a,c,String(m))}else if(!w&&c==="checked"&&a instanceof HTMLInputElement)try{a.checked=!!y}catch{const m=l.safeSerializeAttr(y);m!==null&&l.setAttributeSmart(a,c,String(m))}else if(!w&&c in a)try{a[c]=y,c==="disabled"&&y===!1&&q(a)&&l.removeAttributeSmart(a,"disabled"),X(e.props,c,y)}catch{const m=l.safeSerializeAttr(y);m!==null&&l.setAttributeSmart(a,c,String(m))}else if((e.props?.isCustomElement??!1)&&!w&&c.includes("-")){const p=l.toCamel(c);try{a[p]=y}catch{const A=l.safeSerializeAttr(y);A!==null&&l.setAttributeSmart(a,c,String(A))}}else{const p=l.safeSerializeAttr(y);p!==null&&l.setAttributeSmart(a,c,String(p))}}}for(const c in g){const C=g[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)){const y=typeof C=="object"&&C!==null&&le(C)?C.value:C;l.safe(()=>{a.value=String(y??"")})}else if(c.startsWith("on")&&typeof C=="function"){const y=Je(c),m=y.includes(":")?(()=>{const p=y.split(":"),A=p[1];if(A.includes("-")){const v=A.split("-").map((L,h)=>h===0?L:L.charAt(0).toUpperCase()+L.slice(1)).join("");return`${p[0]}:${v}`}else{const v=A.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${p[0]}:${v}`}})():y;S.listeners&&(S.listeners[y]||S.listeners[m])||Z.addListener(a,y,C)}else{if(c.startsWith("on")&&C===void 0)continue;if(C==null||C===!1)l.removeAttributeSmart(a,c);else{const y=e.props?.isCustomElement??!1,m=typeof C=="object"&&C!==null&&l.isReactiveState(C)?C:le(C)&&typeof C.value<"u"?C.value:C;if(c==="class"||c==="style"){try{const p=l.safeSerializeAttr(m);p!==null&&l.setAttributeSmart(a,c,String(p))}catch{}continue}if(y||c in a)try{const p=typeof C=="object"&&C!==null&&l.isReactiveState(C)?C:le(C)?C.value:C;if(c==="disabled"&&q(a)){const A=g.disabled!==void 0?g.disabled:p,v=fe(A);l.safe(()=>{a.disabled=v}),v?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}try{if(typeof a[c]=="boolean"){let v=p;typeof p=="string"?p==="false"?v=!1:p==="true"?v=!0:v=!!p&&p!=="":v=!!p,a[c]=v}else a[c]=p}catch{a[c]=p}}catch{}}}}for(const[c,C]of Object.entries(S.listeners||{}))Z.addListener(a,c,C);const N={...e,props:{...e.props,...S.props}};ge(N,a,t);try{const c=a;if(typeof c._applyProps=="function")try{c._applyProps(c._cfg)}catch{}typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render(c._cfg)}catch{}if(Array.isArray(e.children)){const c=e.tag==="foreignObject"&&i===l.SVG_NS?null:a.namespaceURI??null;for(const C of e.children)a.appendChild(U(C,n,t,c))}else typeof e.children=="string"&&(a.textContent=e.children);try{if(a instanceof HTMLSelectElement&&_&&Object.prototype.hasOwnProperty.call(_,"value"))try{a.value=String(_.value??"")}catch{}}catch{}try{if(q(a)){const c=g.disabled,C=_.disabled,y=c&&typeof c=="object"&&"value"in c;let m=!1;try{m=!!l.isReactiveState(c)}catch{m=!1}const A=m||y||je(c)?c:C,v=fe(A);l.safe(()=>{a.disabled=v}),v?l.safe(()=>{l.setAttributeSmart(a,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(a,"disabled")})}}catch{}return a}function Et(e,n,t,s,r){if(typeof t=="string"){e.textContent!==t&&(e.textContent=t);return}if(!Array.isArray(t))return;const o=e.childNodes,i=[];for(let N=0;N<o.length;N++)i.push(o[N]);const a=Array.isArray(n)?n:[],u=pt(e);if(u){const N=m=>{if(typeof m=="string")return m.startsWith("each-")?m.substring(5):m;if(typeof m=="number")return String(m)},c=[],C=[];for(const m of t)if(m&&m.tag==="#anchor"){const p=Array.isArray(m.children)?m.children:[];for(const A of p){const v=N(A.key??m.key??"unknown");c.push({...A,key:v})}}else m&&c.push({...m,key:N(m.key)});for(const m of a)if(m&&m.tag==="#anchor"){const p=Array.isArray(m.children)?m.children:[];for(const A of p){const v=N(A.key??m.key??"unknown");C.push({...A,key:v})}}else m&&C.push({...m,key:N(m.key)});if(c.some(m=>m&&m.key!=null)||C.some(m=>m&&m.key!=null)){const m=new Map,p=new Map;for(const f of C)if(f&&f.key!=null){const b=String(f.key);m.set(b,f)}for(let f=0;f<i.length;f++){const b=i[f];let T=we(b);if(T=N(T),T!=null&&b instanceof Element&&b.nodeType===Node.ELEMENT_NODE){let O=typeof T=="string"&&T.includes(":")?T.substring(0,T.lastIndexOf(":")):T;O=String(O),p.set(O,b)}}const A=new Set,v=new Map,L=i.length>0;if(u.moveClass&&L)for(let f=0;f<i.length;f++){const b=i[f];if(b instanceof HTMLElement&&b.parentElement){const T=b.getBoundingClientRect();v.set(b,T)}}const h=[];for(const f of c){let b=f.key;if(b==null)continue;b=String(b);const T=m.get(b);let O=p.get(b);if(O&&T){const R=be(O,T,f,s);A.add(O);const P=String(b);V(R,P),h.push({node:R,key:b,newVNode:f,oldVNode:T,isNew:!1})}else{O=U(f,s,void 0,e instanceof Element?e.namespaceURI??null:null),V(O,String(b)),e.appendChild(O);const R=L||u.appear===!0;O instanceof HTMLElement&&R&&me(O,u).catch(P=>{j.devError("Enter transition error:",P)}),h.push({node:O,key:b,newVNode:f,isNew:!0})}}const k=[];for(let f=0;f<i.length;f++){const b=i[f],T=we(b);if(!A.has(b)&&T!=null&&b instanceof HTMLElement){const R=Re(b,u).then(()=>{e.contains(b)&&e.removeChild(b)}).catch(P=>{j.devError("Leave transition error:",P),e.contains(b)&&e.removeChild(b)});k.push(R)}}if(k.length===0){let f=e.firstChild;for(const{node:b}of h)b!==f&&e.insertBefore(b,f),f=b.nextSibling;if(u.moveClass&&v.size>0){const b=[];for(const{node:T,isNew:O}of h)if(!O&&T instanceof HTMLElement){const R=v.get(T);if(R){const P=T.getBoundingClientRect(),I=R.left-P.left,M=R.top-P.top;if(I!==0||M!==0){const z=u.moveClass.split(/\s+/).filter(x=>x);b.push({node:T,deltaX:I,deltaY:M,moveClasses:z})}}}if(b.length>0){for(const{node:T,deltaX:O,deltaY:R}of b)T.style.transform=`translate(${O}px, ${R}px)`,T.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:T,moveClasses:O}of b)for(const R of O)T.classList.add(R);requestAnimationFrame(()=>{const T=u.moveClass||"",O=T.match(/duration-(\d+)/),R=O?`${O[1]}ms`:"300ms",P=T.match(/ease-(out|in|in-out|linear)/),I=P?`ease-${P[1]}`:"ease-out";for(const{node:M}of b)M.style.transition=`transform ${R} ${I}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of b){M.style.removeProperty("transform");const x=()=>{for(const Q of z)M.classList.remove(Q);M.style.removeProperty("transition"),M.removeEventListener("transitionend",x),M.removeEventListener("transitioncancel",x)};M.addEventListener("transitionend",x,{once:!0}),M.addEventListener("transitioncancel",x,{once:!0})}})})})})}}}return}}const d=new Map;for(const N of a)N&&N.key!=null&&d.set(N.key,N);const E=new Map;for(let N=0;N<i.length;N++){const c=i[N],C=we(c);C!=null&&E.set(C,c)}const S=new Set;let g=e.firstChild;function _(N,c){let C=N;for(;C&&(S.add(C),C!==c);)C=C.nextSibling}function w(N,c,C,y,m,p=!0){const A=[];let v=N.nextSibling;for(;v&&v!==c;)A.push(v),v=v.nextSibling;const L=Array.isArray(C)?C:[];if(y.some(k=>k&&k.key!=null)||L.some(k=>k&&k.key!=null)){const k=new Map,f=new Map;for(const R of L)R&&R.key!=null&&k.set(R.key,R);for(const R of A){const P=we(R);P!=null&&f.set(P,R)}const b=m&&m.state==="visible"&&L.length===0&&y.length>0,T=new Set;let O=N.nextSibling;for(const R of y){let P;if(R.key!=null&&f.has(R.key)){const I=k.get(R.key);P=be(f.get(R.key),I,R,s),T.add(P),m&&P instanceof HTMLElement&&b&&m.appear&&me(P,m).catch(M=>{j.devError("Transition enter error (appear):",M)}),P!==O&&e.contains(P)&&e.insertBefore(P,O)}else P=U(R,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore(P,O),T.add(P),m&&P instanceof HTMLElement&&p&&me(P,m).catch(I=>{j.devError("Transition enter error:",I)});O=P.nextSibling}for(const R of A)!T.has(R)&&e.contains(R)&&(m&&R instanceof HTMLElement&&p?Re(R,m).then(()=>{e.contains(R)&&e.removeChild(R)}).catch(P=>{j.devError("Transition leave error:",P),e.contains(R)&&e.removeChild(R)}):e.removeChild(R))}else{const k=Math.min(L.length,y.length);for(let f=0;f<k;f++){const b=L[f],T=y[f],O=be(A[f],b,T,s);O!==A[f]&&(e.insertBefore(O,A[f]),e.removeChild(A[f]))}for(let f=k;f<y.length;f++){const b=U(y[f],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(b,c),m&&b instanceof HTMLElement&&p&&me(b,m).catch(T=>{j.devError("Transition enter error:",T)})}for(let f=k;f<A.length;f++){const b=A[f];m&&b instanceof HTMLElement&&p?Re(b,m).then(()=>{e.contains(b)&&e.removeChild(b)}).catch(T=>{j.devError("Transition leave error:",T),e.contains(b)&&e.removeChild(b)}):e.removeChild(b)}}}for(const N of t){let c;if(N.tag==="#anchor"){const C=N.key,y=`${C}:start`,m=`${C}:end`;let p=E.get(y),A=E.get(m);const v=Array.isArray(N.children)?N.children:[];if(p||(p=document.createTextNode(""),V(p,y)),A||(A=document.createTextNode(""),V(A,m)),N._startNode=p,N._endNode=A,!e.contains(p)||!e.contains(A)){e.insertBefore(p,g);const L=N._transition,k=!(L&&L.state==="visible"&&v.length>0)||L.appear;for(const f of v){const b=U(f,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(b,g),L&&b instanceof HTMLElement&&k&&me(b,L).catch(T=>{j.devError("Transition enter error:",T)})}e.insertBefore(A,g)}else{const L=N._transition,k=d.get(C)._transition,f=k&&k.state!==L?.state,b=L&&L.state==="visible"&&v.length>0&&!f,T=f||!b||L?.appear===!0;w(p,A,d.get(C)?.children,v,L,T)}_(p,A),g=A.nextSibling;continue}if(N.key!=null&&E.has(N.key)){const C=d.get(N.key);c=be(E.get(N.key),C,N,s,r),S.add(c),c!==g&&e.contains(c)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(c,g))}else c=U(N,s,r,e instanceof Element?e.namespaceURI??null:null),g&&!e.contains(g)&&(g=null),e.insertBefore(c,g),S.add(c);g=c.nextSibling}for(let N=0;N<i.length;N++){const c=i[N];!S.has(c)&&e.contains(c)&&(ie(c,r),e.removeChild(c))}}function be(e,n,t,s,r){if(n&&typeof n!="string"&&n.props?.ref&&r&&ie(e,r),n===t)return e;if(typeof t=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==t&&(e.textContent=t),e;{const i=document.createTextNode(t);return e.parentNode?.replaceChild(i,e),i}}if(t&&typeof t!="string"&&t.tag==="#anchor"){const i=t,a=Array.isArray(i.children)?i.children:[],u=i._startNode??document.createTextNode(""),d=i._endNode??document.createTextNode("");i.key!=null&&(V(u,`${i.key}:start`),V(d,`${i.key}:end`)),i._startNode=u,i._endNode=d;const E=document.createDocumentFragment();E.appendChild(u);for(const S of a){const g=U(S,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);E.appendChild(g)}return E.appendChild(d),e.parentNode?.replaceChild(E,e),u}if(!t){ie(e,r);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!n||typeof n=="string"){ie(e,r);const i=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,i,r),e.parentNode?.replaceChild(i,e),i}if(t.tag==="#anchor"){const i=Array.isArray(t.children)?t.children:[],a=t._startNode??document.createTextNode(""),u=t._endNode??document.createTextNode("");t.key!=null&&(V(a,`${t.key}:start`),V(u,`${t.key}:end`)),t._startNode=a,t._endNode=u;const d=document.createDocumentFragment();d.appendChild(a);for(const E of i)d.appendChild(U(E,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return d.appendChild(u),e.parentNode?.replaceChild(d,e),a}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&n.key===t.key){const i=e;return ze(i,n.props||{},t.props||{},s),Et(i,n.children,t.children,s,r),ge(t,i,r),i}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&(n.tag&&String(n.tag).includes("-")||t.props&&t.props.isCustomElement||n.props&&n.props.isCustomElement))try{const a=e;return ze(a,n.props||{},t.props||{},s),ge(t,a,r),a}catch{}ie(e,r);const o=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,o,r),e.parentNode?.replaceChild(o,e),o}function Ct(e,n,t,s){let r;Array.isArray(n)?n.length===1?(r=n[0],r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})):r={tag:"div",key:"__root__",children:n}:(r=n,r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})),r&&typeof r=="object"&&r.tag==="#anchor"&&(r={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[r]}),r=He(r,String(r.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof r!="string"&&o.tag===r.tag&&o.key===r.key?a=be(i,o,r,t,s):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(a,i)):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let d=0;d<e.childNodes.length;d++){const E=e.childNodes[d];E!==a&&E.nodeName!=="STYLE"&&(ie(E,s),u.push(E))}u.forEach(d=>e.removeChild(d)),e._prevVNode=r,e._prevDom=a}const Se=[],Ke=new WeakMap,ve=new WeakMap;function At(e,n){ve.has(e)||ve.set(e,new Set),ve.get(e).add(n)}function _t(e,n){const t=ve.get(e);t&&t.delete(n)}function kt(e,n,t,s,r,o,i,a){if(e){Se.push(t);try{const u=n.render(t);if(u instanceof Promise){o(!0),u.then(d=>{o(!1),i(null),Ve(e,d,t,s,r),a(e.innerHTML)}).catch(d=>{o(!1),i(d)});return}Ve(e,u,t,s,r),a(e.innerHTML)}finally{Se.pop()}}}function Ve(e,n,t,s,r){e&&(Ct(e,Array.isArray(n)?n:[n],t,s),r(e.innerHTML))}function Tt(e,n,t,s,r,o,i){if(o!==null&&clearTimeout(o),Date.now()-n<16){if(r(t+1),t===15)j.devWarn(`⚠️ Component is re-rendering rapidly. This might indicate:
2
- Common causes:
3
- Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
4
- • State modification during render
5
- • Missing dependencies in computed/watch
6
- Component rendering will be throttled to prevent browser freeze.`);else if(t>20){j.devError(`🛑 Infinite loop detected in component render:
7
- • This might be caused by state updates during render
8
- • Ensure all state modifications are done in event handlers or effects
9
- Stopping runaway component render to prevent browser freeze`),i(null);return}}else r(0);const d=setTimeout(()=>{s(Date.now()),e(),i(null)},t>10?100:0);i(d)}function wt(e,n,t,s,r){if(!e)return;let o=t||"";try{const y=ve.get(e);if(y&&y.size>0)for(const m of y)try{const p=m.lastHtmlStringForJitCSS;p&&typeof p=="string"&&p.trim()&&(o+=`
10
- `+p)}catch{}else{const m=Array.from(e.querySelectorAll("*"));for(const p of m)try{const A=p.lastHtmlStringForJitCSS;A&&typeof A=="string"&&A.trim()&&(o+=`
11
- `+A)}catch{}}}catch{}if(Ke.get(e)===o)return;Ke.set(e,o);const a=D.jitCSS(o),u=D.getProseSheet();if((!a||a.trim()==="")&&!n._computedStyle&&!u){if(r(null),"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){const m=[D.getBaseResetSheet(),D.getTransitionStyleSheet()];e.adoptedStyleSheets=m}else{const m=D.minifyCSS(D.baseReset),p=D.getTransitionStyleSheet();let A="";try{p&&"cssRules"in p&&(A=Array.from(p.cssRules).map(h=>h.cssText).join(`
12
- `))}catch{A=""}const v=D.minifyCSS(`${m}
13
- ${A}`);let L=e.querySelector("style[data-cer-runtime]");L||(L=document.createElement("style"),l.setAttributeSmart(L,"data-cer-runtime","true"),e.appendChild(L));try{L.textContent=v}catch{}try{const h=[D.getBaseResetSheet(),D.getTransitionStyleSheet()];e.adoptedStyleSheets=h}catch{}}return}let d="";n._computedStyle&&(d=n._computedStyle??"");let E=D.sanitizeCSS(`${d}
14
- ${a}
15
- `);E=D.minifyCSS(E);let S=s;if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){S||(S=new CSSStyleSheet);try{S.replaceSync(E)}catch{S=null}if(S){const y=[D.getBaseResetSheet(),D.getTransitionStyleSheet()];u&&y.push(u),y.push(S),e.adoptedStyleSheets=y,r(S);return}}const _=D.minifyCSS(D.baseReset),w=D.getTransitionStyleSheet();let N="";try{w&&"cssRules"in w&&(N=Array.from(w.cssRules).map(y=>y.cssText).join(`
16
- `))}catch{N=""}const c=D.minifyCSS(`${_}
17
- ${N}
18
- ${E}`);let C=e.querySelector("style[data-cer-runtime]");C||(C=document.createElement("style"),l.setAttributeSmart(C,"data-cer-runtime","true"),e.appendChild(C));try{C.textContent=c}catch{}try{const y=[D.getBaseResetSheet(),D.getTransitionStyleSheet()];if(u&&y.push(u),typeof CSSStyleSheet<"u")try{const m=new CSSStyleSheet;try{m.replaceSync(E),y.push(m)}catch{y.push({cssRules:[],replaceSync:()=>{}})}}catch{}e.adoptedStyleSheets=y}catch{}r(null)}let W=null;function Ue(e){W=e}function Me(){W=null}function Lt(){if(!W)throw new Error("useEmit must be called during component render");const e=W.emit;if(typeof e!="function")throw new Error("useEmit requires an emit function on the component context");const n=e;return(t,s,r)=>n(t,s,r)}function de(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function Nt(e){if(!W)throw new Error("useOnConnected must be called during component render");de(W),W._hookCallbacks.onConnected=e}function Ot(e){if(!W)throw new Error("useOnDisconnected must be called during component render");de(W),W._hookCallbacks.onDisconnected=e}function Rt(e){if(!W)throw new Error("useOnAttributeChanged must be called during component render");de(W),W._hookCallbacks.onAttributeChanged=e}function Mt(e){if(!W)throw new Error("useOnError must be called during component render");de(W),W._hookCallbacks.onError=n=>{try{n instanceof Error?e(n):e(new Error(String(n)))}catch{}}}function Pt(e){if(!W)throw new Error("useProps must be called during component render");de(W);const n=W._hookCallbacks;n.props={...n.props||{},...e};const t=W;try{const r=Object.keys(e||{});for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(i&&!i.configurable))try{let u=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;Object.defineProperty(t,o,{configurable:!0,enumerable:!0,get(){try{const d=t&&t._host;if(d){const E=l.toKebab(o),S=d.getAttribute(E);if(S!==null){const g=typeof e[o];return g==="boolean"?S===""||S==="true":g==="number"?Number(S):S}if(typeof d[o]<"u"){const g=d[o];if(l.isReactiveState(g)||g&&typeof g=="object"&&"value"in g&&!(g instanceof Node))return g.value;const _=typeof e[o];if(!(_==="string"&&g&&typeof g=="object"))return _==="boolean"&&typeof g=="string"?g===""||g==="true":g}}}catch{}return u},set(d){u=d}})}catch{}}}catch{}return new Proxy({},{get(r,o){if(typeof o!="string")return;const i=e[o];try{const u=t&&t._host;if(u){if(u instanceof HTMLElement||typeof u.getAttribute=="function"&&typeof u.hasAttribute=="function"){const E=o.replace(/([A-Z])/g,"-$1").toLowerCase(),S=u.getAttribute(E);if(S!==null)return typeof i=="boolean"?S===""||S==="true":typeof i=="number"?Number(S):S}const d=u[o];if(typeof d<"u"&&d!==""){const E=d&&typeof d=="object"&&"value"in d&&!(d instanceof Node);if(!(typeof i=="string"&&d&&typeof d=="object"&&!E&&!l.isReactiveState(d)))return typeof i=="boolean"&&i===!1&&d===""?i:l.isReactiveState(d)||E?d.value:typeof i=="boolean"&&typeof d=="string"?d==="true"||d!==""&&d!=="false":typeof i=="number"&&typeof d=="string"&&!Number.isNaN(Number(d))?Number(d):d}}}catch{}const a=t[o];return typeof i=="boolean"&&a===""?i===!1?i:!0:l.isReactiveState(a)||a&&typeof a=="object"&&"value"in a&&!(a instanceof Node)?a.value:a!=null&&a!==""?typeof i=="boolean"&&typeof a=="string"?a==="true":typeof i=="number"&&typeof a=="string"&&!Number.isNaN(Number(a))?Number(a):a:i},has(r,o){return typeof o=="string"&&(o in t||o in e)},ownKeys(){return Array.from(new Set([...Object.keys(e),...Object.keys(t||{})]))},getOwnPropertyDescriptor(){return{configurable:!0,enumerable:!0}}})}function $t(e){if(!W)throw new Error("useStyle must be called during component render");de(W);try{const n=e();Object.defineProperty(W,"_computedStyle",{value:n,writable:!0,enumerable:!1,configurable:!0})}catch(n){j.devWarn("Error in useStyle callback:",n),Object.defineProperty(W,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const ue=new Map,Fe=Symbol.for("cer.registry");function jt(){if(typeof window<"u"){const e=globalThis;e[Fe]||(e[Fe]=ue)}}function Ht(e,n){if(!n.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ue.get(e)||n,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const t=this._initContext(n),s=(o,i,a)=>{Object.defineProperty(o,i,{value:a,writable:!1,enumerable:!1,configurable:!1})};s(t,"refs",this._refs),s(t,"requestRender",()=>this.requestRender()),s(t,"_requestRender",()=>this._requestRender()),s(t,"_componentId",this._componentId),s(t,"_triggerWatchers",(o,i)=>this._triggerWatchers(o,i)),this.context=t,l.safe(()=>{s(t,"_host",this)}),s(this.context,"emit",(o,i,a)=>{const u={detail:i,bubbles:!0,composed:!0,...a||{}},d=new CustomEvent(o,u);this.dispatchEvent(d);const E=o.indexOf(":");if(E>0){const S=o.substring(0,E),g=o.substring(E+1),_=g.includes("-")?`${S}:${g.split("-").map((w,N)=>N===0?w:w.charAt(0).toUpperCase()+w.slice(1)).join("")}`:`${S}:${g.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;_!==o&&l.safe(()=>{this.dispatchEvent(new CustomEvent(_,u))})}return!d.defaultPrevented});const r=ue.get(e)||n;for(const o in r){const i=r[o];typeof i=="function"&&(this.context[o]=(...a)=>i(...a,this.context))}if(r.props)for(const o in r.props){let i=this[o];Object.defineProperty(this,o,{get(){return i},set(a){const u=i;i=a,this.context[o]=a,this._initializing||(this._applyProps(r),u!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&At(t,this),this._applyProps(n),this._requestRender(),it(n,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&_t(t,this),ot(n,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},s=>{this._templateLoading=s},s=>{this._templateError=s},s=>{this._mounted=s})})}attributeChangedCallback(t,s,r){this._runLogicWithinErrorBoundary(n,()=>{this._applyProps(n),s!==r&&this._requestRender(),at(n,t,s,r,this.context)})}static get observedAttributes(){return n.props?Object.keys(n.props).map(l.toKebab):[]}_render(t){this._runLogicWithinErrorBoundary(t,()=>{kt(this.shadowRoot,t,this.context,this._refs,s=>{this._lastHtmlStringForJitCSS=s,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(s)},s=>{this._templateLoading=s,this?.onLoadingStateChange?.(s)},s=>{this._templateError=s,this?.onErrorStateChange?.(s)},s=>this._applyStyle(t,s))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{l.scheduleDOMUpdate(()=>{Tt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})},this._componentId)})}_applyStyle(t,s){this._runLogicWithinErrorBoundary(t,()=>{wt(this.shadowRoot,this.context,s,this._styleSheet,r=>{this._styleSheet=r})})}_runLogicWithinErrorBoundary(t,s){this._hasError&&(this._hasError=!1);try{s()}catch(r){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",i=this._componentId||"<unknown-id>",a={};if(t&&t.props)for(const u of Object.keys(t.props))try{const d=this.context[u];d instanceof Node?a[u]=`[DOM Node: ${d.nodeName}]`:typeof d=="object"&&d!==null?a[u]=Object.keys(d).length>5?`[object(${Object.keys(d).length} keys)]`:d:a[u]=d}catch{a[u]="[unreadable]"}j.devError(`Error rendering component <${o}> (id=${i}):`,r),j.devError("Component props snapshot:",a),j.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}t.onError&&t.onError(r,this.context)}}_initContext(t){try{let s=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,u,d){const E=Reflect.get(a,u,d);return typeof E=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...g){const _=E.apply(a,g);if(!r._initializing){const w=i||"root";r._triggerWatchers(w,a),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return _}:E},set(a,u,d){if(a[String(u)]=d,!r._initializing){const E=i?`${i}.${String(u)}`:String(u);r._triggerWatchers(E,d),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0},deleteProperty(a,u){if(delete a[String(u)],!r._initializing){const d=i?`${i}.${String(u)}`:String(u);r._triggerWatchers(d,void 0),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0}});if(o&&typeof o=="object"){if(l.isReactiveState(o))return o;for(const a in o){const u=i?`${i}.${a}`:a;o[a]=s(o[a],u)}return new Proxy(o,{set(a,u,d){const E=i?`${i}.${String(u)}`:String(u);return a[String(u)]=s(d,E),r._initializing||(r._triggerWatchers(E,a[String(u)]),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)),!0},get(a,u,d){return Reflect.get(a,u,d)}})}return o};const r=this;return s({...t.props?Object.fromEntries(Object.entries(t.props).map(([o,i])=>[o,i.default])):{}})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{tt(this.context,this._watchers,{})})}_triggerWatchers(t,s){nt(this.context,this._watchers,t,s)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{try{st(this,t,this.context)}catch(s){this._hasError=!0,t.onError&&t.onError(s,this.context)}})}}}function xt(e,n){jt();let t=l.toKebab(e);t.includes("-")||(t=`cer-${t}`);const s={},r={props:{},onConnected:o=>{if(s.onConnected)try{s.onConnected(o)}catch{}},onDisconnected:o=>{if(s.onDisconnected)try{s.onDisconnected(o)}catch{}},onAttributeChanged:(o,i,a,u)=>{if(s.onAttributeChanged)try{s.onAttributeChanged(o,i,a,u)}catch{}},onError:(o,i)=>{if(s.onError&&o)try{s.onError(o,i)}catch{}},render:o=>{const i=o,a=i._componentId||`${t}-${Math.random().toString(36).substr(2,9)}`;l.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Ue(o);let u;try{u=n()}catch(d){try{const E=i._hookCallbacks;if(E&&typeof E.onError=="function")try{E.onError(d)}catch{}}catch{}throw d}if(i._hookCallbacks){const d=i._hookCallbacks;if(d.onConnected&&(s.onConnected=d.onConnected),d.onDisconnected&&(s.onDisconnected=d.onDisconnected),d.onAttributeChanged&&(s.onAttributeChanged=d.onAttributeChanged),d.onError&&(s.onError=d.onError),d.props){const E=d.props;r.props=Object.fromEntries(Object.entries(E).map(([S,g])=>[S,{type:typeof g=="boolean"?Boolean:typeof g=="number"?Number:typeof g=="string"?String:Function,default:g}])),ue.set(t,r)}}return u}finally{Me(),l.reactiveSystem.clearCurrentComponent()}}};if(ue.set(t,r),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};Ue(o);try{n()}catch(i){try{const a=o?._hookCallbacks;if(a&&typeof a.onError=="function")try{a.onError(i)}catch{}j.devError(`Error during component discovery render <${t}>:`,i),j.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw Me(),i}if(Me(),o._hookCallbacks?.props){const i=o._hookCallbacks.props;r.props=Object.fromEntries(Object.entries(i).map(([a,u])=>[a,{type:typeof u=="boolean"?Boolean:typeof u=="number"?Number:typeof u=="string"?String:Function,default:u}])),ue.set(t,r)}}catch{}customElements.get(t)||customElements.define(t,Ht(t,r))}}class It{map=new Map;maxSize;constructor(n){this.maxSize=n}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}set(n,t){if(this.map.delete(n),this.map.set(n,t),this.map.size>this.maxSize){const s=this.map.keys().next().value;s!==void 0&&this.map.delete(s)}}has(n){return this.map.has(n)}clear(){this.map.clear()}}const Pe=new It(500);function Wt(e,n){if(e==null){j.devWarn(`⚠️ Event handler for '@${n}' is ${e}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`);return}typeof e!="function"&&j.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&j.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${n}="\${fn}" not @${n}="\${fn()}"`)}function ee(e,n={},t,s){const r=s??n.key;return{tag:e,key:r,props:n,children:t}}function Ee(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function se(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Ee(e)}function Bt(e,n){return e.key!=null?e:{...e,key:n}}function Dt(e,n=[],t={}){const s={},r={},o={},i=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let u;for(;u=a.exec(e);){const d=u[1],E=u[2];let S="";for(let c=3;c<u.length;c++)if(u[c]!==void 0){S=u[c];break}S.length>=2&&(S[0]==='"'&&S[S.length-1]==='"'||S[0]==="'"&&S[S.length-1]==="'")&&(S=S.slice(1,-1));const g=!/=/.test(u[0]),_=S.match(/^{{(\d+)}}$/);let w=g?!0:_?n[Number(_[1])]??null:S;_||(w==="true"?w=!0:w==="false"?w=!1:w==="null"?w=null:isNaN(Number(w))||(w=Number(w)));const N=["model","bind","show","class","style","ref","when"];if(d===":"){const[c,C]=E.split(":"),[y,...m]=c.split(".");if(N.includes(y)){const p=[...m],A=y==="model"&&C?`model:${C}`:y;o[A]={value:w,modifiers:p,arg:C}}else if(E==="disabled"){let p=w;p&&l.isReactiveState(p)&&(p=p.value);const A=typeof p;if(p===""||A==="boolean"||A==="string"&&(p==="true"||p==="false")||p==null||A==="number")s[E]=p;else{let h=w;h&&l.isReactiveState(h)&&(h=h.value),r[E]=h}i.push(E)}else{let p=w;p&&l.isReactiveState(p)&&(p=p.value),r[E]=p,i.push(E)}}else if(d==="@"){const[c,...C]=E.split("."),y=C;Wt(w,c);const m=typeof w=="function"?w:typeof t[w]=="function"?t[w]:void 0;if(m){const p=v=>{if(y.includes("prevent")&&v.preventDefault(),y.includes("stop")&&v.stopPropagation(),!(y.includes("self")&&v.target!==v.currentTarget))return y.includes("once")&&v.currentTarget?.removeEventListener(c,p),m(v)},A="on"+c.charAt(0).toUpperCase()+c.slice(1);s[A]=p}}else E==="ref"?s.ref=w:r[E]=w}return{props:s,attrs:r,directives:o,bound:i}}function xe(e){if(!se(e)||Ee(e))return e;const n=e.props?.directives;if(n&&n.when){const t=n.when.value,s=l.isReactiveState(t)?t.value:t,r={...n};delete r.when;const o={...e.props};Object.keys(r).length>0?o.directives=r:delete o.directives;const i={...e,props:o};return Array.isArray(i.children)&&(i.children=i.children.map(u=>typeof u=="object"&&u!==null?xe(u):u)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:s?[i]:[]}}if(Array.isArray(e.children)){const t=e.children.map(s=>typeof s=="object"&&s!==null?xe(s):s);return{...e,children:t}}return e}function zt(e,n,t){const s=Se.length>0?Se[Se.length-1]:void 0,r=t??s,o=!t&&n.length===0,i=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&i){const f=Pe.get(i);if(f)return f}function a(f,b){return ee("#text",{},f,b)}function u(f,b,T=!1){let O=typeof f=="string"?l.decodeEntities(f):f;return!T&&typeof O=="string"&&/[\r\n]/.test(O)&&(O=O.replace(/\s+/g," ")),ee("#text",{},O,b)}let d="";for(let f=0;f<e.length;f++)d+=e[f],f<n.length&&(d+=`{{${f}}}`);const E=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,S=[];let g,_=[],w=null,N={},c,C=0;const y=[],m=new Set(["pre","code","textarea","script","style"]);function p(){if(w&&m.has(w.toLowerCase()))return!0;for(const f of S)if(m.has(f.tag.toLowerCase()))return!0;return!1}function A(f){if(!f||typeof f!="object"||Ee(f))return;const b=f,T=N;if(b.props||b.attrs){const O=b;O.props&&(T.props||(T.props={}),Object.assign(T.props,O.props)),O.attrs&&(T.attrs||(T.attrs={}),Object.keys(O.attrs).forEach(R=>{if(R==="style"&&T.attrs.style){const P=String(T.attrs.style).replace(/;?\s*$/,""),I=String(O.attrs.style).replace(/^;?\s*/,"");T.attrs.style=P+"; "+I}else if(R==="class"&&T.attrs.class){const P=String(T.attrs.class).trim().split(/\s+/).filter(Boolean),I=String(O.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...P,...I])];T.attrs.class=M.join(" ")}else T.attrs[R]=O.attrs[R]}))}else T.props||(T.props={}),Object.assign(T.props,b)}function v(f,b){const T=w?_:y;if(Ee(f)){const O=f.key??b,R=f.children;T.push({...f,key:O,children:R});return}if(se(f)){T.push(Bt(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let O=0;O<f.length;O++){const R=f[O];Ee(R)||se(R)||Array.isArray(R)?v(R,`${b}-${O}`):R!==null&&typeof R=="object"?l.isUnsafeHTML(R)?T.push(ee("#raw",{},R.__rawHTML,`${b}-${O}`)):A(R):T.push(a(String(R),`${b}-${O}`))}return}if(f!==null&&typeof f=="object"){if(l.isUnsafeHTML(f)){const O=f.__rawHTML??"";T.push(ee("#raw",{},O,b));return}A(f);return}T.push(a(String(f),b))}const L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;g=E.exec(d);)if(!(g[0].startsWith("<!--")&&g[0].endsWith("-->"))){if(g[1]){const f=g[1],b=g[0][1]==="/",T=g[0][g[0].length-2]==="/"||L.has(f),{props:O,attrs:R,directives:P,bound:I}=Dt(g[2]||"",n,r??{}),M={props:{},attrs:{}};for(const z in O)M.props[z]=O[z];for(const z in R)M.attrs[z]=R[z];M.attrs&&Object.prototype.hasOwnProperty.call(M.attrs,"key")&&!(M.props&&Object.prototype.hasOwnProperty.call(M.props,"key"))&&l.safe(()=>{M.props.key=M.attrs.key});try{const z={input:["value","checked","readonly","required","placeholder","maxlength","minlength"],textarea:["value","readonly","required","placeholder","maxlength","minlength"],select:["value","required","multiple"],option:["selected","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","autofocus","form"]},x=f.toLowerCase(),Q=z[x]??[];if(M.attrs){for(const H of Q)if(I&&I.includes(H)&&H in M.attrs&&!(M.props&&H in M.props)){let $=M.attrs[H];if($&&l.isReactiveState($))$=$.value,M.props[H]=$,delete M.attrs[H];else if($&&typeof $=="object"&&"value"in $&&!($ instanceof Node))try{const B=$.value;M.props[H]=(x==="select"||x==="option")&&H==="value"?String(B):B,delete M.attrs[H]}catch{}else{const B=typeof $;if(H==="disabled")($===""||B==="boolean"||B==="string"&&($==="true"||$==="false")||$==null||B==="number")&&(M.props[H]=$,delete M.attrs[H]);else if($===""||B==="string"||B==="number"||B==="boolean"||$==null){const G=(x==="select"||x==="option")&&H==="value"?String($):$;M.props[H]=G,delete M.attrs[H]}}}}if(f.includes("-")||!!r?.__customElements?.has?.(f)){if(M.isCustomElement=!0,I&&M.attrs){const H=new Set(["id","name","data-key","key"]);for(const $ of I)if($ in M.attrs&&!(M.props&&$ in M.props)){const B=$.includes("-")?l.toCamel($):$,G=M.attrs[$];if(M.props[B]=G,H.has($)||l.isClassLikeAttr($))try{const _e=l.safeSerializeAttr(M.attrs[$]);_e===null?delete M.attrs[$]:M.attrs[$]=_e}catch{delete M.attrs[$]}else delete M.attrs[$]}}try{if(M.attrs&&!(M.props&&"modelValue"in M.props)){const H=M.attrs["model-value"]??M.attrs.modelValue;typeof H<"u"&&(M.props.modelValue=H)}}catch{}}}catch{}if(P&&Object.keys(P).some(z=>z==="model"||z.startsWith("model:")))try{const z=Symbol.for("cer.registry"),x=globalThis[z],Q=!!(x&&typeof x.has=="function"&&x.has(f)),F=r,H=!!(F&&(F.__customElements instanceof Set&&F.__customElements.has(f)||Array.isArray(F.__isCustomElements)&&F.__isCustomElements.includes(f)));if(!!(f.includes("-")||H||Q))for(const G of Object.keys(P)){if(G!=="model"&&!G.startsWith("model:"))continue;const Ae=P[G],_e=Ae.arg??(G.includes(":")?G.split(":",2)[1]:void 0),K=Ae.value,Le=_e??"modelValue",Ie=l.getNestedValue,Xe=l.setNestedValue,pe=r?._state||r;let Y;typeof K=="string"&&pe?Y=Ie(pe,K):Y=K,M.props[Le]=Y;try{const te=l.toKebab(Le);M.attrs||(M.attrs={}),Y!=null&&(typeof Y=="string"||typeof Y=="number"||typeof Y=="boolean")&&(M.attrs[te]=Y)}catch{}M.isCustomElement=!0;const We=`update:${l.toKebab(Le)}`.replace(/-([a-z])/g,(te,J)=>J.toUpperCase()),Qe="on"+We.charAt(0).toUpperCase()+We.slice(1);M.props[Qe]=function(te){const J=te.detail!==void 0?te.detail:te.target?te.target.value:void 0;if(pe)if(K&&l.isReactiveState(K)){const ne=K.value;if(Array.isArray(J)&&Array.isArray(ne)?JSON.stringify([...J].sort())!==JSON.stringify([...ne].sort()):J!==ne){K.value=J;try{const re=r;if(re){const he=re.requestRender,ye=re._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}else{const ne=Ie(pe||{},typeof K=="string"?K:String(K));if(Array.isArray(J)&&Array.isArray(ne)?JSON.stringify([...J].sort())!==JSON.stringify([...ne].sort()):J!==ne){Xe(pe||{},typeof K=="string"?K:String(K),J);try{const re=r;if(re){const he=re.requestRender,ye=re._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}},delete P[G]}}catch{}if(Object.keys(P).length>0&&(M.directives={...P}),b){const z=_.some(H=>typeof H=="object"&&H.tag!=="#text");let x=_;if(z&&_.length>0){let H=0;for(;H<_.length;){const B=_[H];if(!se(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;H++}let $=_.length-1;for(;$>=0;){const B=_[$];if(!se(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;$--}H===0&&$===_.length-1?x=_:H>$?x=[]:x=_.slice(H,$+1)}const Q=ee(w,N,x.length===1&&se(x[0])&&x[0].tag==="#text"?typeof x[0].children=="string"?x[0].children:"":x.length?x:void 0,c),F=S.pop();F?(w=F.tag,N=F.props,c=F.key,_=F.children,_.push(Q)):(y.push(Q),w=null,N={},c=void 0,_=[])}else T?w?_.push(ee(f,M,void 0,void 0)):y.push(ee(f,M,void 0,void 0)):(w&&S.push({tag:w,props:N,children:_,key:c}),w=f,N=M,_=[])}else if(typeof g[3]<"u"){const f=Number(g[3]),b=n[f],T=`interp-${f}`;v(b,T)}else if(g[4]){const f=g[4],b=w?_:y,T=f.split(/({{\d+}})/);for(const O of T){if(!O)continue;const R=O.match(/^{{(\d+)}}$/);if(R){const P=Number(R[1]),I=n[P],M=`interp-${P}`;v(I,M)}else{const P=`text-${C++}`,I=p();b.push(u(O,P,I))}}}}const k=y.filter(f=>se(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0).map(f=>xe(f));if(k.length===1){const f=k[0];return o&&i&&Pe.set(i,f),f}else if(k.length>1){const f=k;return o&&i&&Pe.set(i,f),f}return ee("div",{},"","fallback-root")}function Kt(e,...n){const t=n[n.length-1],s=typeof t=="object"&&t&&!Array.isArray(t)?t:void 0;return zt(e,n,s)}exports.computed=l.computed;exports.decodeEntities=l.decodeEntities;exports.ref=l.ref;exports.unsafeHTML=l.unsafeHTML;exports.watch=l.watch;exports.setDevMode=j.setDevMode;exports.css=D.css;exports.component=xt;exports.html=Kt;exports.useEmit=Lt;exports.useOnAttributeChanged=Rt;exports.useOnConnected=Nt;exports.useOnDisconnected=Ot;exports.useOnError=Mt;exports.useProps=Pt;exports.useStyle=$t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./template-compiler-CA4YRaBu.cjs"),c=require("./namespace-helpers-4qeKVqQw.cjs"),O=require("./transitions-DPZiuXb9.cjs"),d=require("./logger-CSALKaYm.cjs"),x=100,k=3e4;function A(e,t,o){return o==="jitCacheHitRate"?e<t*.5?"critical":e<t?"warning":"healthy":e>t*2?"critical":e>t?"warning":"healthy"}function D(e){const t=[];return e.memoryUsage?.status!=="healthy"&&t.push("Consider reducing component complexity or implementing better memory cleanup"),e.averageRenderTime?.status!=="healthy"&&t.push("Optimize component render functions - consider lazy loading or virtualization"),e.jitCacheHitRate?.status!=="healthy"&&t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"),e.componentErrorRate?.status!=="healthy"&&t.push("High component error rate detected - review error handling and component logic"),e.activeReactiveStates?.status!=="healthy"&&t.push("High number of reactive states - consider state consolidation or cleanup"),e.memoryLeakIndicator?.status!=="healthy"&&t.push("Potential memory leak detected - review component cleanup and event listener management"),t}function v(){const e=new Map,t=new Set;let o=null;function n(s,i,a){e.set(s,{name:s,value:i,threshold:a,status:"healthy",lastUpdated:Date.now(),history:[]})}function l(){n("activeComponents",0,1e3),n("componentCreateRate",0,50),n("componentErrorRate",0,.1),n("memoryUsage",0,50*1024*1024),n("memoryGrowthRate",0,1024*1024),n("averageRenderTime",0,16),n("slowRenderCount",0,10),n("jitCacheHitRate",100,80),n("activeReactiveStates",0,5e3),n("dependencyUpdates",0,100),n("memoryLeakIndicator",0,.1)}function m(s,i){const a=e.get(s);a&&(a.value=i,a.lastUpdated=Date.now(),a.history.push(i),a.history.length>x&&a.history.shift(),a.status=A(i,a.threshold,s))}function u(){const s={};let i="healthy";for(const[a,h]of e)s[a]={...h},h.status==="critical"?i="critical":h.status==="warning"&&i==="healthy"&&(i="warning");return{overall:i,metrics:s,timestamp:Date.now(),recommendations:D(s)}}function p(){if("memory"in performance&&performance.memory){const s=performance.memory;m("memoryUsage",s.usedJSHeapSize);const i=e.get("memoryUsage");if(i&&i.history.length>1){const a=i.history[i.history.length-2],h=i.history[i.history.length-1];m("memoryGrowthRate",Math.max(0,h-a))}}}function w(s){for(const i of t)try{i(s)}catch(a){d.devError("Error in health monitor listener:",a)}}function _(){p();const s=u();w(s),s.overall==="critical"?d.devError("🚨 Runtime Health: Critical issues detected",s.recommendations):s.overall==="warning"&&d.devWarn("⚠️ Runtime Health: Performance warnings",s.recommendations)}function R(){typeof window>"u"||(o=setInterval(_,k))}function H(){o!==null&&(clearInterval(o),o=null)}function M(s){t.add(s)}function L(s){t.delete(s)}function b(s){const i=e.get(s);return i?[...i.history]:[]}function T(){for(const s of e.values())s.history=[]}return l(),R(),{updateMetric:m,getHealthReport:u,addListener:M,removeListener:L,stop:H,getMetricHistory:b,clearHistory:T}}let f=null;function g(){return f||(f=v()),f}function I(e,t){g().updateMetric(e,t)}function U(){return g().getHealthReport()}function C(){typeof window>"u"||typeof customElements>"u"||customElements.get("cer-keep-alive")||customElements.define("cer-keep-alive",K())}function K(){return class extends HTMLElement{_cache=new Map;_slot=null;_slotListener=null;connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.querySelector("slot")||(this.shadowRoot.innerHTML="<slot></slot>"),this._slot=this.shadowRoot.querySelector("slot"),this._slot&&(this._slotListener=()=>this._handleSlotChange(),this._slot.addEventListener("slotchange",this._slotListener),this._handleSlotChange())}disconnectedCallback(){this._slot&&this._slotListener&&this._slot.removeEventListener("slotchange",this._slotListener),this._slotListener=null}clearCache(t){t?this._cache.delete(t):this._cache.clear()}_handleSlotChange(){if(!this._slot)return;const t=this._slot.assignedElements({flatten:!0});for(const o of t){const n=this._buildCacheKey(o);if(!this._cache.has(n))this._cache.set(n,o);else{const l=this._cache.get(n);if(l!==o)try{o.parentNode?.replaceChild(l,o)}catch{this._cache.set(n,o)}}}}_buildCacheKey(t){const o=t.tagName.toLowerCase(),n=t.getAttribute("id");return n?`${o}:${n}`:o}}}function S(){customElements.get("cer-suspense")||r.component("cer-suspense",()=>{const{pending:e}=r.useProps({pending:!1});return e?r.html`<slot name="fallback"><span>Loading…</span></slot>`:r.html`<slot></slot>`})}function E(){customElements.get("cer-error-boundary")||r.component("cer-error-boundary",()=>{const e=c.ref(!1),t=c.ref("");return r.useOnError(o=>{e.value=!0,t.value=o.message}),r.useExpose({_cerHandleChildError:o=>{e.peek()||(e.value=!0,t.value=o instanceof Error?o.message:String(o))},reset:()=>{e.value=!1,t.value=""}}),e.value?r.html`<slot name="fallback"
2
+ ><div role="alert">
3
+ <strong>Something went wrong.</strong>
4
+ ${t.value?r.html`<p>${t.value}</p>`:r.html``}
5
+ </div></slot
6
+ >`:r.html`<slot></slot>`})}function P(){S(),E(),C()}function q(e){if(typeof document>"u")return{portal:()=>{},destroy:()=>{}};if(r.isDiscoveryRender())return{portal:()=>{},destroy:()=>{}};if(r.getCurrentComponentContext()){const o=c.reactiveSystem.getOrCreateState(null),n=o.peek();if(n!==null)return n;const l=y(e,()=>o.initSilent(null));return o.initSilent(l),l}return y(e)}function y(e,t){const o=typeof e=="string"?document.querySelector(e):e;if(!o)return console.warn(`[useTeleport] Target "${String(e)}" not found in the document. Teleported content will not be rendered.`),{portal:()=>{},destroy:()=>{}};const n=document.createElement("cer-teleport");n.dataset.cerTeleport="",o.appendChild(n);const l={};return{portal(u){const p=u==null?[]:Array.isArray(u)?u:[u];r.vdomRenderer(n,p,void 0,l)},destroy(){try{r.vdomRenderer(n,[],void 0,l)}catch{}n.parentNode&&n.parentNode.removeChild(n),t?.()}}}exports.component=r.component;exports.createComposable=r.createComposable;exports.getCurrentComponentContext=r.getCurrentComponentContext;exports.html=r.html;exports.inject=r.inject;exports.provide=r.provide;exports.useEmit=r.useEmit;exports.useExpose=r.useExpose;exports.useOnAttributeChanged=r.useOnAttributeChanged;exports.useOnConnected=r.useOnConnected;exports.useOnDisconnected=r.useOnDisconnected;exports.useOnError=r.useOnError;exports.useProps=r.useProps;exports.useSlots=r.useSlots;exports.useStyle=r.useStyle;exports.ReactiveState=c.ReactiveState;exports.computed=c.computed;exports.decodeEntities=c.decodeEntities;exports.flushDOMUpdates=c.flushDOMUpdates;exports.isReactiveState=c.isReactiveState;exports.nextTick=c.nextTick;exports.ref=c.ref;exports.scheduleWithPriority=c.scheduleWithPriority;exports.unsafeHTML=c.unsafeHTML;exports.watch=c.watch;exports.watchEffect=c.watchEffect;exports.css=O.css;exports.devLog=d.devLog;exports.setDevMode=d.setDevMode;exports.createHealthMonitor=v;exports.getHealthMonitor=g;exports.getHealthStatus=U;exports.registerBuiltinComponents=P;exports.registerErrorBoundary=E;exports.registerKeepAlive=C;exports.registerSuspense=S;exports.updateHealthMetric=I;exports.useTeleport=q;
19
7
  //# sourceMappingURL=custom-elements-runtime.cjs.js.map