@jasonshimmy/custom-elements-runtime 2.5.2 → 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 (94) 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 -1
  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 +258 -166
  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 +549 -531
  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 -5
  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 -208
  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 +22 -65
  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 +69 -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-Bx0Nc9zR.js → transitions-Di5wW9yc.js} +1072 -632
  78. package/dist/transitions-Di5wW9yc.js.map +1 -0
  79. package/dist/transitions.d.ts +1 -1
  80. package/package.json +18 -11
  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-BCVTzhAO.cjs +0 -5
  85. package/dist/namespace-helpers-BCVTzhAO.cjs.map +0 -1
  86. package/dist/namespace-helpers-CF28TyaG.js +0 -786
  87. package/dist/namespace-helpers-CF28TyaG.js.map +0 -1
  88. package/dist/template-compiler-CXHEnaBh.cjs +0 -17
  89. package/dist/template-compiler-CXHEnaBh.cjs.map +0 -1
  90. package/dist/template-compiler-DD_VZrte.js +0 -3729
  91. package/dist/template-compiler-DD_VZrte.js.map +0 -1
  92. package/dist/transitions-Bx0Nc9zR.js.map +0 -1
  93. package/dist/transitions-DfcqL-X4.cjs +0 -302
  94. package/dist/transitions-DfcqL-X4.cjs.map +0 -1
@@ -0,0 +1,67 @@
1
+ /**
2
+ * vdom-patch.ts
3
+ *
4
+ * Core virtual DOM patching and rendering engine. Provides:
5
+ * - `cleanupRefs` — recursively remove event listeners and clear ref entries
6
+ * - `assignKeysDeep` — recursively assign stable keys to VNode trees
7
+ * - `patchProps` — diff and apply prop/attr/directive changes to a DOM element
8
+ * - `createElement` — create a new DOM element from a VNode descriptor
9
+ * - `patchChildren` — reconcile a list of child VNodes against real DOM children
10
+ * - `patch` — top-level diff/patch driver for a single VNode
11
+ * - `vdomRenderer` — entry-point renderer for a shadow root or container
12
+ */
13
+ import type { VNode, VDomRefs } from './types';
14
+ import { type VNodePropBag } from './vdom-helpers';
15
+ export declare function cleanupRefs(node: Node, refs?: VDomRefs): void;
16
+ /**
17
+ * Assign unique keys to VNodes for efficient rendering
18
+ * @param nodeOrNodes
19
+ * @param baseKey
20
+ * @returns
21
+ */
22
+ export declare function assignKeysDeep(nodeOrNodes: VNode | VNode[], baseKey: string): VNode | VNode[];
23
+ /**
24
+ * Patch props on an element.
25
+ * Only update changed props, remove old, add new.
26
+ * @param el
27
+ * @param oldProps
28
+ * @param newProps
29
+ * @param context
30
+ */
31
+ export declare function patchProps(el: HTMLElement, oldProps: VNodePropBag, newProps: VNodePropBag, context?: Record<string, unknown>): void;
32
+ /**
33
+ * Create a DOM element from a VNode.
34
+ * @param vnode
35
+ * @param context
36
+ * @param refs
37
+ * @returns
38
+ */
39
+ export declare function createElement(vnode: VNode | string, context?: Record<string, unknown>, refs?: VDomRefs, parentNamespace?: string | null): Node;
40
+ /**
41
+ * Patch children using keys for node matching.
42
+ * @param parent
43
+ * @param oldChildren
44
+ * @param newChildren
45
+ * @param context
46
+ * @param refs
47
+ * @returns
48
+ */
49
+ export declare function patchChildren(parent: HTMLElement, oldChildren: VNode[] | string | undefined, newChildren: VNode[] | string | undefined, context?: Record<string, unknown>, refs?: VDomRefs): void;
50
+ /**
51
+ * Patch a node using keys for node matching.
52
+ * @param dom
53
+ * @param oldVNode
54
+ * @param newVNode
55
+ * @param context
56
+ * @param refs
57
+ * @returns
58
+ */
59
+ export declare function patch(dom: Node, oldVNode: VNode | string | null, newVNode: VNode | string | null, context?: Record<string, unknown>, refs?: VDomRefs): Node;
60
+ /**
61
+ * Virtual DOM renderer.
62
+ * @param root The root element to render into.
63
+ * @param vnodeOrArray The virtual node or array of virtual nodes to render.
64
+ * @param context The context to use for rendering.
65
+ * @param refs The refs to use for rendering.
66
+ */
67
+ export declare function vdomRenderer(root: ShadowRoot, vnodeOrArray: VNode | VNode[], context?: Record<string, unknown>, refs?: VDomRefs): void;
@@ -1,142 +1,18 @@
1
1
  /**
2
2
  * vdom.ts
3
- * Lightweight, strongly typed, functional virtual DOM renderer for custom elements.
4
- * Features: keyed diffing, incremental patching, focus/caret preservation, event delegation, SSR-friendly, no dependencies.
5
- */
6
- import type { VNode, VDomRefs } from './types';
7
- type PropsMap = Record<string, unknown>;
8
- type DirectiveSpec = {
9
- value: unknown;
10
- modifiers: string[];
11
- arg?: string;
12
- };
13
- type VNodePropBag = {
14
- props?: PropsMap;
15
- attrs?: PropsMap;
16
- directives?: Record<string, DirectiveSpec>;
17
- isCustomElement?: boolean;
18
- [k: string]: unknown;
19
- };
20
- /**
21
- * Recursively clean up refs and event listeners for all descendants of a node
22
- * @param node The node to clean up.
23
- * @param refs The refs to clean up.
24
- * @returns
25
- */
26
- export declare function cleanupRefs(node: Node, refs?: VDomRefs): void;
27
- /**
28
- * Process :model directive for two-way data binding
29
- * @param value
30
- * @param modifiers
31
- * @param props
32
- * @param attrs
33
- * @param listeners
34
- * @param context
35
- * @param el
36
- * @returns
37
- */
38
- export declare function processModelDirective(value: string | unknown, modifiers: string[], props: Record<string, unknown>, attrs: Record<string, unknown>, listeners: Record<string, EventListener>, context?: Record<string, unknown>, el?: Element, arg?: string): void;
39
- /**
40
- * Process :bind directive for attribute/property binding
41
- * @param value
42
- * @param props
43
- * @param attrs
44
- * @param context
45
- * @returns
46
- */
47
- export declare function processBindDirective(value: unknown, props: PropsMap, attrs: PropsMap, context?: Record<string, unknown>, el?: Element): void;
48
- /**
49
- * Process :show directive for conditional display
50
- * @param value
51
- * @param attrs
52
- * @param context
53
- * @returns
54
- */
55
- export declare function processShowDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>): void;
56
- export declare function processClassDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>, originalVnodeAttrs?: Record<string, unknown>): void;
57
- /**
58
- * Process :style directive for dynamic inline styles
59
- * @param value
60
- * @param attrs
61
- * @param context
62
- * @returns
63
- */
64
- export declare function processStyleDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>): void;
65
- /**
66
- * Process :ref directive for element references
67
- * @param value
68
- * @param props
69
- * @param context
70
- * @returns
71
- */
72
- export declare function processRefDirective(value: unknown, props: Record<string, unknown>, context?: Record<string, unknown>): void;
73
- /**
74
- * Process directives and return merged props, attrs, and event listeners
75
- * @param directives
76
- * @param context
77
- * @param el
78
- * @param vnodeAttrs
79
- * @returns
80
- */
81
- export declare function processDirectives(directives: Record<string, {
82
- value: unknown;
83
- modifiers: string[];
84
- arg?: string;
85
- }>, context?: Record<string, unknown>, el?: Element, vnodeAttrs?: PropsMap): {
86
- props: Record<string, unknown>;
87
- attrs: Record<string, unknown>;
88
- listeners: Record<string, EventListener>;
89
- };
90
- /**
91
- * Assign unique keys to VNodes for efficient rendering
92
- * @param nodeOrNodes
93
- * @param baseKey
94
- * @returns
95
- */
96
- export declare function assignKeysDeep(nodeOrNodes: VNode | VNode[], baseKey: string): VNode | VNode[];
97
- /**
98
- * Patch props on an element.
99
- * Only update changed props, remove old, add new.
100
- * @param el
101
- * @param oldProps
102
- * @param newProps
103
- * @param context
104
- */
105
- export declare function patchProps(el: HTMLElement, oldProps: VNodePropBag, newProps: VNodePropBag, context?: Record<string, unknown>): void;
106
- /**
107
- * Create a DOM element from a VNode.
108
- * @param vnode
109
- * @param context
110
- * @param refs
111
- * @returns
112
- */
113
- export declare function createElement(vnode: VNode | string, context?: Record<string, unknown>, refs?: VDomRefs, parentNamespace?: string | null): Node;
114
- /**
115
- * Patch children using keys for node matching.
116
- * @param parent
117
- * @param oldChildren
118
- * @param newChildren
119
- * @param context
120
- * @param refs
121
- * @returns
122
- */
123
- export declare function patchChildren(parent: HTMLElement, oldChildren: VNode[] | string | undefined, newChildren: VNode[] | string | undefined, context?: Record<string, unknown>, refs?: VDomRefs): void;
124
- /**
125
- * Patch a node using keys for node matching.
126
- * @param dom
127
- * @param oldVNode
128
- * @param newVNode
129
- * @param context
130
- * @param refs
131
- * @returns
132
- */
133
- export declare function patch(dom: Node, oldVNode: VNode | string | null, newVNode: VNode | string | null, context?: Record<string, unknown>, refs?: VDomRefs): Node;
134
- /**
135
- * Virtual DOM renderer.
136
- * @param root The root element to render into.
137
- * @param vnodeOrArray The virtual node or array of virtual nodes to render.
138
- * @param context The context to use for rendering.
139
- * @param refs The refs to use for rendering.
140
- */
141
- export declare function vdomRenderer(root: ShadowRoot, vnodeOrArray: VNode | VNode[], context?: Record<string, unknown>, refs?: VDomRefs): void;
142
- export {};
3
+ *
4
+ * Barrel re-export module for the virtual DOM implementation.
5
+ * The actual code lives in the focused sub-modules:
6
+ *
7
+ * | Module | Responsibilities |
8
+ * |----------------------|--------------------------------------------------------|
9
+ * | vdom-helpers.ts | Private utilities and shared internal types |
10
+ * | vdom-directives.ts | processModelDirective and all process*Directive funcs |
11
+ * | vdom-patch.ts | assignKeysDeep, patchProps, createElement, patch, etc. |
12
+ * | vdom-ssr.ts | renderToString (server-side rendering) |
13
+ *
14
+ * Import directly from these focused modules for tree-shaking.
15
+ * This file is kept for backwards compatibility.
16
+ */
17
+ export { processModelDirective, processBindDirective, processShowDirective, processClassDirective, processStyleDirective, processRefDirective, processDirectives, } from "./vdom-directives";
18
+ export { cleanupRefs, assignKeysDeep, patchProps, createElement, patchChildren, patch, vdomRenderer, } from "./vdom-patch";
package/dist/ssr.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * Examples
17
17
  *
18
18
  * // Default (injects xmlns for <svg> if missing)
19
- * import { renderToString } from '@custom-elements/ssr';
19
+ * import { renderToString } from '@jasonshimmy/custom-elements-runtime/ssr';
20
20
  * const html = renderToString(vnodeTree);
21
21
  *
22
22
  * // Opt-out
@@ -25,3 +25,4 @@
25
25
  export { renderToString } from './runtime/vdom-ssr';
26
26
  export type { VNode } from './runtime/types';
27
27
  export type { RenderOptions } from './runtime/vdom-ssr';
28
+ export { registerEntityMap, loadEntityMap, clearRegisteredEntityMap, } from './runtime/helpers';
@@ -0,0 +1,68 @@
1
+ /**
2
+ * teleport.ts
3
+ *
4
+ * Renders virtual DOM content into an arbitrary DOM target located outside
5
+ * the current component's Shadow Root. Useful for modals, tooltips, popovers,
6
+ * and any UI that must visually escape the component boundary.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { component, html, ref, useOnDisconnected, useTeleport } from '@jasonshimmy/custom-elements-runtime';
11
+ *
12
+ * component('modal-trigger', () => {
13
+ * const isOpen = ref(false);
14
+ *
15
+ * // Render modal content into <body> outside the shadow root
16
+ * const { portal, destroy } = useTeleport('#modal-root');
17
+ * useOnDisconnected(destroy);
18
+ *
19
+ * // Call portal() to update the teleported content on each render
20
+ * if (isOpen.value) {
21
+ * portal(html`<div class="modal">
22
+ * <h2>Hello</h2>
23
+ * <button @click="${() => (isOpen.value = false)}">Close</button>
24
+ * </div>`);
25
+ * } else {
26
+ * portal(null);
27
+ * }
28
+ *
29
+ * return html`
30
+ * <button @click="${() => (isOpen.value = true)}">Open modal</button>
31
+ * `;
32
+ * });
33
+ * ```
34
+ */
35
+ import type { VNode } from './runtime/types';
36
+ /** Handle returned by {@link useTeleport} for managing a portal. */
37
+ export interface TeleportHandle {
38
+ /**
39
+ * Render (or clear) content at the teleport target.
40
+ * Pass `null` or `undefined` to remove previously rendered content.
41
+ */
42
+ portal(content: VNode | VNode[] | null | undefined): void;
43
+ /**
44
+ * Destroy the teleport container and clean up all rendered content.
45
+ * Call this in `useOnDisconnected` to prevent memory leaks.
46
+ */
47
+ destroy(): void;
48
+ }
49
+ /**
50
+ * Create a teleport portal that renders content outside the current Shadow Root.
51
+ *
52
+ * @param target - A CSS selector string or an `Element` reference to render into.
53
+ * @returns A {@link TeleportHandle} with `portal()` (update content) and `destroy()` (cleanup).
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * import { component, html, useOnDisconnected, useTeleport } from '@jasonshimmy/custom-elements-runtime';
58
+ *
59
+ * component('my-tooltip', () => {
60
+ * const { portal, destroy } = useTeleport('body');
61
+ * useOnDisconnected(destroy);
62
+ *
63
+ * portal(html`<div class="tooltip">Tooltip content</div>`);
64
+ * return html`<span>Hover me</span>`;
65
+ * });
66
+ * ```
67
+ */
68
+ export declare function useTeleport(target: string | Element): TeleportHandle;
@@ -0,0 +1,23 @@
1
+ "use strict";const l=require("./namespace-helpers-4qeKVqQw.cjs"),x=require("./logger-CSALKaYm.cjs"),B=require("./transitions-DPZiuXb9.cjs"),le=new Map,Me=Symbol.for("cer.registry");function it(){if(!(typeof window>"u"&&typeof document>"u"&&typeof navigator>"u"))try{const n=globalThis;if(!n[Me]){const t=crypto.randomUUID();n[Me]=new Map([...le.entries()]),n[Me].__realmId=t}}catch(n){x.devWarn("Could not initialize global registry:",n)}}function ot(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){x.devError(`Error in immediate watcher for "${s}":`,a)}}}function at(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((p,A)=>r(p,a[A]));const u=i,d=a,g=Object.keys(u||{}),h=Object.keys(d||{});return g.length!==h.length?!1:g.every(p=>r(u[p],d[p]))},o=n.get(t);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(i){x.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){x.devError(`Error in deep watcher for "${i}":`,u)}}function je(e,n){return n===Boolean?e===""||e==="true":n===Number?Number(e):e}function ct(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]=je(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]=je(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]=je(String(a),r.type)}catch{t[s]=e[s]}else"default"in r&&r.default!==void 0&&(t[s]=r.default)}}function lt(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 g=e[o];let h;return l.isReactiveState(g)||g&&typeof g=="object"&&"value"in g&&!(g instanceof Node)?h=g.value:h=g,h}catch{return e[o]}}})}catch{}}}catch{}return}ct(e,n.props,t)}function ft(e,n,t,s){e.onConnected&&!t&&(e.onConnected(n),s(!0))}function ut(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 dt(e,n,t,s,r){e.onAttributeChanged&&e.onAttributeChanged(n,t,s,r)}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})):[]}}class pt{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){x.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){x.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 x.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,h=>`<<#${r.push(h)-1}#>>`);const o=s.match(/ctx\.[\w.]+/g)||[];for(const h of o){const p=h.slice(4),A=l.getNestedValue(t,p);if(A===void 0)return;const N=r.push(JSON.stringify(A))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${N}#>>`)}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 h of a){if(h.startsWith("ctx."))continue;const p=l.getNestedValue(t,h);if(p===void 0)return;const A=r.push(JSON.stringify(p))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${A}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let d;const g=new Set;for(;(d=u.exec(s))!==null;){const h=d[1];if(["true","false","null","undefined"].includes(h)||/^[0-9]+$/.test(h)||h==="ctx"||g.has(h))continue;g.add(h);const p=l.getNestedValue(t,h);if(p===void 0)return;const A=JSON.stringify(p),N=r.push(A)-1;h.includes(".")?s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${N}#>>`):s=s.replace(new RegExp("\\b"+h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${N}#>>`)}s=s.replace(/<<#(\d+)#>>/g,(h,p)=>r[Number(p)]);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(m){const _=t[s++];if(m&&!_)throw new Error(`Unexpected token EOF, expected ${m}`);if(m&&_&&_.type!==m&&_.value!==m)throw new Error(`Unexpected token ${_.type}/${_.value}, expected ${m}`);return _}function i(){return N()}function a(m){if(typeof m=="number")return m;if(m==null)return NaN;if(typeof m=="boolean")return m?1:0;const _=Number(m);return Number.isNaN(_)?NaN:_}function u(m,_){return typeof m=="string"||typeof _=="string"?String(m)+String(_):a(m)+a(_)}function d(m,_){return a(m)-a(_)}function g(m,_){return a(m)*a(_)}function h(m,_){return a(m)/a(_)}function p(m,_){return a(m)%a(_)}function A(m,_,f){if(typeof _=="number"&&typeof f=="number")switch(m){case">":return _>f;case"<":return _<f;case">=":return _>=f;case"<=":return _<=f;default:return!1}const b=String(_),w=String(f);switch(m){case">":return b>w;case"<":return b<w;case">=":return b>=w;case"<=":return b<=w;default:return!1}}function N(){const m=T(),_=r();if(_&&_.value==="?"){o("?");const f=i();o(":");const b=i();return m?f:b}return m}function T(){let m=c();for(;;){const _=r();if(!_||_.value!=="||")break;o("OP");const f=c();m=m||f}return m}function c(){let m=E();for(;;){const _=r();if(!_||_.value!=="&&")break;o("OP");const f=E();m=m&&f}return m}function E(){let m=S();for(;;){const _=r();if(!_||!["==","!=","===","!=="].includes(_.value))break;const f=o("OP").value,b=S();switch(f){case"==":m=m==b;break;case"!=":m=m!=b;break;case"===":m=m===b;break;case"!==":m=m!==b;break}}return m}function S(){let m=v();for(;;){const _=r();if(!_||![">","<",">=","<="].includes(_.value))break;const f=o("OP").value,b=v();switch(f){case">":m=A(">",m,b);break;case"<":m=A("<",m,b);break;case">=":m=A(">=",m,b);break;case"<=":m=A("<=",m,b);break}}return m}function v(){let m=y();for(;;){const _=r();if(!_||_.value!=="+"&&_.value!=="-")break;const f=o("OP").value,b=y();m=f==="+"?u(m,b):d(m,b)}return m}function y(){let m=k();for(;;){const _=r();if(!_||_.value!=="*"&&_.value!=="/"&&_.value!=="%")break;const f=o("OP").value,b=k();switch(f){case"*":m=g(m,b);break;case"/":m=h(m,b);break;case"%":m=p(m,b);break}}return m}function k(){const m=r();if(m&&m.value==="!")return o("OP"),!k();if(m&&m.value==="-"){o("OP");const _=k();return d(0,_)}return C()}function C(){const m=r();if(m){if(m.type==="NUMBER")return o("NUMBER"),Number(m.value);if(m.type==="STRING")return o("STRING"),m.value.slice(1,-1);if(m.type==="IDENT")return o("IDENT"),m.value==="true"?!0:m.value==="false"?!1:m.value==="null"?null:void 0;if(m.value==="["){o("PUNC");const _=[];for(;;){const f=r();if(!f||f.value==="]")break;_.push(i());const b=r();b&&b.value===","&&o("PUNC")}return o("PUNC"),_}if(m.value==="("){o("PUNC");const _=i();return o("PUNC"),_}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}}function we(e,n){return Array.isArray(e)&&Array.isArray(n)?JSON.stringify([...e].sort())!==JSON.stringify([...n].sort()):e!==n}function Ke(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 ht(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 Ve(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 yt(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 ve(e){return e!=null&&typeof e=="object"&&"value"in e}function He(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function X(e,n,t){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[n]=t}function q(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function oe(e){return e!=null&&typeof e=="object"&&"value"in e?oe(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function Je(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function De(e){return typeof e=="boolean"||e==="true"||e==="false"}function mt(e,n,t,s,r,o,i,a){if(!o)return;const u=n.includes("lazy"),d=n.includes("trim"),g=n.includes("number"),h=()=>{if(l.isReactiveState(e)){const y=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof y=="object"&&y!==null?y[a]:y}const v=o?._state||o;return l.getNestedValue(v,e)},p=h();let A="text";i instanceof HTMLInputElement?A=s?.type||i.type||"text":i instanceof HTMLSelectElement?A="select":i instanceof HTMLTextAreaElement&&(A="textarea");const N=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,c=N?A==="checkbox"||A==="radio"?"checked":"value":a??"modelValue";if(A==="checkbox")if(Array.isArray(p))t[c]=p.includes(String(i?.getAttribute("value")??s?.value??""));else{const v=i?.getAttribute("true-value")??!0;t[c]=p===v}else if(A==="radio")t[c]=p===(s?.value??"");else if(A==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const v=Array.isArray(p)?p.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(y=>{y.selected=v.includes(y.value)})},0),t[c]=Array.isArray(p)?p:[]}else t[c]=p;else{!N&&l.isReactiveState(e)?t[c]=e:t[c]=p;try{const v=l.toKebab(c);s&&(s[v]=p)}catch{}}const E=u||A==="checkbox"||A==="radio"||A==="select"?"change":"input",S=v=>{if(v.isComposing||r._isComposing)return;const y=globalThis.process,k=!!y&&y.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(v.isTrusted===!1&&!k)return;const C=v.target;if(!C||C._modelUpdating)return;let L=C.value;if(A==="checkbox"){const f=h();if(Array.isArray(f)){const b=C.getAttribute("value")??"",w=Array.from(f);if(C.checked)w.includes(b)||w.push(b);else{const R=w.indexOf(b);R>-1&&w.splice(R,1)}L=w}else{const b=C.getAttribute("true-value")??!0,w=C.getAttribute("false-value")??!1;L=C.checked?b:w}}else if(A==="radio")L=C.getAttribute("value")??C.value;else if(A==="select"&&C.multiple)L=Array.from(C.selectedOptions).map(f=>f.value);else if(d&&typeof L=="string"&&(L=L.trim()),g){const f=Number(L);isNaN(f)||(L=f)}const m=h();if(we(L,m)){C._modelUpdating=!0;try{Ke(l.isReactiveState(e),e,L,o,a),Te(o,l.isReactiveState(e),e,L),C&&ht(C,c,L)}finally{setTimeout(()=>C._modelUpdating=!1,0)}}};if(N){if(r[E]){const v=r[E];i&&Z.removeListener(i,E,v)}r[E]=S}else{const v=`update:${l.toKebab(c)}`,y=`update:${c}`;if(r[v]){const k=r[v];i&&Z.removeListener(i,v,k)}if(r[y]){const k=r[y];i&&Z.removeListener(i,y,k)}if(r[v]=k=>{const C=k.detail;let L=C!==void 0?C:void 0;if(L===void 0){const f=k.target;if(f&&typeof f=="object"&&"value"in f)try{L=f.value}catch{L=void 0}}const m=yt(l.isReactiveState(e),e,o,a);if(we(L,m)){Ke(l.isReactiveState(e),e,L,o,a),Te(o,l.isReactiveState(e),e,L);const f=k.target;f&&Ve(f,c,l.isReactiveState(e)?e:L,l.isReactiveState(e))}},l.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let k;try{k=Reflect.ownKeys(e.value)}catch{k=Object.keys(e.value)}const C=k.filter(L=>typeof L=="string"&&!String(L).startsWith("_")&&L!=="constructor");for(const L of C){const m=String(L),_=`update:${l.toKebab(m)}`,f=`update:${m}`;r[_]||(r[_]=b=>{const w=b.detail!==void 0?b.detail:b.target?.value,R=l.isReactiveState(e)?e.value[m]:l.getNestedValue(o?._state||o,e);if(!we(w,R))return;if(l.isReactiveState(e)){const I={...e.value};I[m]=w,e.value=I}else l.setNestedValue(o?._state||o,e,w);Te(o,l.isReactiveState(e),e,w);const j=b.currentTarget||i||b.target;j&&Ve(j,c,l.isReactiveState(e)?e:w,l.isReactiveState(e))},r[f]=r[_])}}r[y]=r[v]}(A==="text"||A==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=v=>{r._isComposing=!1;const y=v.target;y&&setTimeout(()=>{const k=y.value,C=o?._state||o,L=l.getNestedValue(C,e);let m=k;if(d&&(m=m.trim()),g){const f=Number(m);isNaN(f)||(m=f)}if(we(m,L)){y._modelUpdating=!0;try{l.setNestedValue(C,e,m),Te(o,l.isReactiveState(e),e,m)}finally{setTimeout(()=>y._modelUpdating=!1,0)}}},0)})}function gt(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=Ae(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 bt(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(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 Ae(e,n){return pt.evaluate(e,n)}function vt(e,n,t,s){let r;if(typeof e=="string"){if(!t)return;r=Ae(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,g]of Object.entries(r))g&&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 St(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(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,p=>`-${p.toLowerCase()}`),g=["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 h=String(u);typeof u=="number"&&g.includes(d)&&(h=`${u}px`),i.push(`${d}: ${h}`)}r=i.join("; ")+(i.length>0?";":"")}const o=String(n.style||"");n.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function Et(e,n,t){let s=e;typeof e=="string"&&t&&(s=Ae(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:g,arg:h}=u;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),A=p.length>1?p[1]:h;mt(d,g,r,o,i,n,t,A);continue}switch(a){case"bind":gt(d,r,o,n,t);break;case"show":bt(d,o,n);break;case"class":vt(d,o,n,s);break;case"style":St(d,o,n);break;case"ref":Et(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 g=!1;try{g=l.isReactiveState(u)}catch{g=!1}if(!d&&!g)try{o.disabled=u,delete r.disabled;const h=globalThis;h.__VDOM_DISABLED_PROMOTIONS||(h.__VDOM_DISABLED_PROMOTIONS=[]),h.__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 fe(e){return e?e.split(/\s+/).filter(Boolean):[]}function ue(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 ce(e,n){if(n.length===0)return;const t=n.filter(Boolean);t.length>0&&e.classList.remove(...t)}let Pe=!1;async function Ct(e,n,t=10){if(!Pe){if(!e.isConnected){x.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){Pe=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}Pe=!0,x.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function At(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 Xe(e,n){return new Promise(t=>{const s=n??At(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(N){x.devError("Transition onBeforeEnter error:",N)}if(!r)return s?.onEnter?new Promise(N=>{const T=s.onEnter;typeof T=="function"?T(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(c){x.devError("Transition onAfterEnter error:",c)}N()}):N()}):void 0;const i=fe(t?.enterFrom),a=fe(t?.enterActive),u=fe(t?.enterTo);ue(e,i),e.offsetHeight,ue(e,a),e.offsetHeight;let d;if(s?.onEnter){const N=new Promise(T=>{d=T});try{const T=s.onEnter;typeof T=="function"&&T(e,()=>{d&&d()})}catch(T){x.devError("Transition onEnter error:",T)}d&&await N}await new Promise(N=>requestAnimationFrame(()=>N(void 0))),e.offsetHeight;const g=window.getComputedStyle(e),h=g.transform,p=g.opacity;ce(e,i),h&&h!=="none"&&(e.style.transform=h),p&&p!==""&&(e.style.opacity=p),e.offsetHeight,await new Promise(N=>requestAnimationFrame(()=>N(void 0))),e.style.transform="",e.style.opacity="",ue(e,u),e.offsetHeight,await new Promise(N=>requestAnimationFrame(()=>N(void 0)));let A;if(typeof o=="number"?A=o:o&&typeof o=="object"&&"enter"in o&&(A=o.enter),await Xe(e,A),ce(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(N){x.devError("Transition onAfterEnter error:",N)}}async function xe(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(h){x.devError("Transition onBeforeLeave error:",h)}if(!r)return s?.onLeave?new Promise(h=>{const p=s.onLeave;typeof p=="function"?p(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(A){x.devError("Transition onAfterLeave error:",A)}h()}):h()}):void 0;const i=fe(t?.leaveFrom),a=fe(t?.leaveActive),u=fe(t?.leaveTo);ue(e,i),e.offsetHeight,ue(e,a);let d;if(s?.onLeave){const h=new Promise(p=>{d=p});try{const p=s.onLeave;typeof p=="function"&&p(e,()=>{d&&d()})}catch(p){x.devError("Transition onLeave error:",p)}d&&await h}await new Promise(h=>requestAnimationFrame(()=>h(void 0))),await Ct(e,[...i,...a]),ce(e,i),ue(e,u);let g;if(typeof o=="number"?g=o:o&&typeof o=="object"&&"leave"in o&&(g=o.leave),await Xe(e,g),ce(e,a),ce(e,u),ce(e,i),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(h){x.devError("Transition onAfterLeave error:",h)}}const Qe=new WeakMap,et=new WeakMap;function Ne(e){if(!e)return;const n=Qe.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{Qe.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 kt(e){if(!e)return;const n=et.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function _t(e,n){try{et.set(e,n)}catch{}try{e._transitionGroup=n}catch{}}function ie(e,n){if(n){if(e instanceof Element){Z.cleanup(e);const t=[];for(const s in n)n[s]===e&&t.push(s);for(const s of t)delete n[s]}if(e.hasChildNodes()){const t=e.childNodes;for(let s=t.length-1;s>=0;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 Ie(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 h=i.tag||"node",A=[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(N=>N!=null)??"";a=A?`${n}:${h}:${A}`:`${n}:${h}`}let u=a,d=1;for(;o.has(u);)u=`${a}#${d++}`;o.add(u);let g=i.children;return Array.isArray(g)&&(g=Ie(g,u)),{...i,key:u,children:g}})}const t=e,s=t.props?.key??t.key??n;let r=t.children;return Array.isArray(r)&&(r=Ie(r,s)),{...t,key:s,children:r}}function Ue(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={...o||{},...i.attrs||{}},d=n.props??{},g=a,h=!!(t?.isCustomElement??n?.isCustomElement??!1);let p=!1;for(const c in{...d,...g}){const E=d[c],S=g[c];let v=E,y=S;if(l.safe(()=>{(l.isReactiveState(E)||ve(E))&&(v=E.value)}),l.safe(()=>{(l.isReactiveState(S)||ve(S))&&(y=S.value)}),!(E===S&&v===y))if(p=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const k=He(S),C=k==null?"":String(k);e.value!==C&&(e.value=C)}else if(c==="checked"&&e instanceof HTMLInputElement){const k=He(S);e.checked=!!k}else if(c.startsWith("on")&&typeof S=="function"){const k=Je(c);typeof E=="function"&&Z.removeListener(e,k,E),typeof S=="function"&&Z.addListener(e,k,S);try{if(k&&k.startsWith("update:")){const C=k.split(":",2)[1],L=g[C];let m=[];try{if(l.isReactiveState(L)){const f=L.value;m=f&&typeof f=="object"?Object.keys(f):[]}else L&&typeof L=="object"&&(m=Object.keys(L))}catch{m=[]}const _=m.filter(f=>typeof f=="string"&&!f.startsWith("_")&&f!=="constructor");for(const f of _){const b=`update:${f}`,w=R=>{const O=R.detail!==void 0?R.detail:R.target instanceof HTMLInputElement||R.target instanceof HTMLTextAreaElement||R.target instanceof HTMLSelectElement?R.target.value:void 0,I={...l.isReactiveState(L)?L.value||{}:g[C]||{},[f]:O};try{typeof S=="function"&&S({detail:I})}catch{}};l.safe(()=>{Z.addListener(e,b,w)})}}}catch{}}else if(S==null)l.removeAttributeSmart(e,c);else{const k=t?.isCustomElement??n?.isCustomElement??!1;if(k||c in e)try{e[c]=S,c==="disabled"&&S===!1&&!k&&q(e)&&l.removeAttributeSmart(e,"disabled")}catch{}else S===!1&&l.removeAttributeSmart(e,c)}}for(const[c,E]of Object.entries(i.listeners||{})){Z.addListener(e,c,E);try{const S=e&&e.parentElement;S&&S!==e&&Z.addListener(S,c,E)}catch{}}const A={...n.attrs??{}},N=u,T=i&&i.attrs||{};if(Object.prototype.hasOwnProperty.call(T,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(A.class=c)}if(Object.prototype.hasOwnProperty.call(T,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(A.style=c)}try{if(Object.prototype.hasOwnProperty.call(T,"class")&&T.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(A.class=c)}if(Object.prototype.hasOwnProperty.call(T,"style")&&T.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(A.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==A.class&&(A.class=c)}catch{}}}catch{}}catch{}for(const c in{...A,...N}){const E=A[c],S=N[c];let v=E,y=S;if(l.isReactiveState(E)&&(v=E.value),l.isReactiveState(S)&&(y=S.value),v!==y)if(p=!0,y==null||y===!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=y??""});continue}else if(e instanceof HTMLSelectElement){l.safe(()=>{e.value=y??""});continue}else if(e instanceof HTMLProgressElement){l.safe(()=>{e.value=Number(y)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){l.safe(()=>{e.checked=!!y});continue}if(c==="style"){const C=l.safeSerializeAttr(y);C!==null&&l.setAttributeSmart(e,c,String(C)),X(n,c,y);continue}if(c==="class"){const C=l.safeSerializeAttr(y);C!==null&&l.setAttributeSmart(e,c,String(C)),X(n,c,y);continue}if(c==="disabled"&&q(e)){l.safe(()=>{const C=oe(y);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=C)}),oe(y)?l.safe(()=>{l.setAttributeSmart(e,c,"")}):l.safe(()=>{l.removeAttributeSmart(e,c)});continue}const k=e.namespaceURI==="http://www.w3.org/2000/svg";if(h&&!k&&c.includes("-"))if(l.isClassLikeAttr(c)){const C=l.safeSerializeAttr(S??y);if(C!==null){try{l.setAttributeSmart(e,c,String(C))}catch{}X(n,c,y)}}else{const C=l.toCamel(c);try{const L=e;L[C]=l.isReactiveState(S)?S:y,X(n,c,y)}catch{const L=l.safeSerializeAttr(S??y);L!==null&&l.setAttributeSmart(e,c,String(L))}}else if(!k&&c in e)try{const C=e;C[c]=l.isReactiveState(S)?S:y,X(n,c,y)}catch{const C=l.safeSerializeAttr(y);C!==null&&(l.setAttributeSmart(e,c,String(C)),X(n,c,y))}else{const C=l.safeSerializeAttr(y);C!==null&&(l.setAttributeSmart(e,c,String(C)),X(n,c,y))}}}try{if(q(e)){const c=a.disabled;let E;try{const v=Object.prototype.hasOwnProperty.call(i.props||{},"disabled"),y=c&&typeof c=="object"&&"value"in c;let k=!1;l.safe(()=>{k=!!l.isReactiveState(c)});const C=De(c);k||y||v||C?E=c:E=u.disabled}catch{E=u.disabled}const S=oe(E);l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=S)}),S?l.safe(()=>{l.setAttributeSmart(e,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(e,"disabled")})}}catch{}if(h&&p){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,E=Array.isArray(c.children)?c.children:[],S=document.createTextNode(""),v=document.createTextNode("");c.key!=null&&(V(S,`${c.key}:start`),V(v,`${c.key}:end`)),c._startNode=S,c._endNode=v;const y=document.createDocumentFragment();y.appendChild(S);for(const k of E){const C=U(k,n,t,s);if(c.key!=null&&C instanceof Element&&!C.hasAttribute("data-anchor-key")){const L=k;L&&typeof L=="object"&&L.key!=null||V(C,String(c.key))}y.appendChild(C)}return y.appendChild(v),y}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&&_t(a,e.props?._transitionGroup);const{props:u={},attrs:d={},directives:g={}}=e.props??{},h=Ye(g,n,a instanceof HTMLElement?a:void 0,d),p={...u,...h.props},A={...d,...h.attrs};try{const c=(A&&A.class)??(p&&p.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),E=l.safeSerializeAttr(c);if(E!==null){const S=String(E).trim();S&&l.setAttributeSmart(a,"class",S)}}catch{}try{if(p.disabled!==void 0&&a&&q(a)){const c=p.disabled,E=c&&typeof c=="object"&&"value"in c;let S=!1;try{S=l.isReactiveState(c)}catch{S=!1}!E&&!S&&l.safe(()=>{A.disabled=c,delete p.disabled})}}catch{}const N=a.namespaceURI==="http://www.w3.org/2000/svg";for(const c in A){const E=A[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const S=He(E);if(typeof S=="boolean")S?l.setAttributeSmart(a,c,""):l.safe(()=>{l.removeAttributeSmart(a,c)});else if(S!=null){if(c==="disabled"&&q(a)){const v=p.disabled,y=De(v)?v:S,k=oe(y);l.safe(()=>{a.disabled=k}),k?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}if(!N&&c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLProgressElement))try{a instanceof HTMLProgressElement?a.value=Number(S):a.value=String(S??"")}catch{const v=l.safeSerializeAttr(S);v!==null&&l.setAttributeSmart(a,c,String(v))}else if(!N&&c==="checked"&&a instanceof HTMLInputElement)try{a.checked=!!S}catch{const v=l.safeSerializeAttr(S);v!==null&&l.setAttributeSmart(a,c,String(v))}else if(!N&&c in a)try{a[c]=S,c==="disabled"&&S===!1&&q(a)&&l.removeAttributeSmart(a,"disabled"),X(e.props,c,S)}catch{const v=l.safeSerializeAttr(S);v!==null&&l.setAttributeSmart(a,c,String(v))}else if((e.props?.isCustomElement??!1)&&!N&&c.includes("-")){const y=l.toCamel(c);try{a[y]=S}catch{const k=l.safeSerializeAttr(S);k!==null&&l.setAttributeSmart(a,c,String(k))}}else{const y=l.safeSerializeAttr(S);y!==null&&l.setAttributeSmart(a,c,String(y))}}}for(const c in p){const E=p[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)){const S=typeof E=="object"&&E!==null&&ve(E)?E.value:E;l.safe(()=>{a.value=String(S??"")})}else if(c.startsWith("on")&&typeof E=="function"){const S=Je(c),v=S.includes(":")?(()=>{const y=S.split(":"),k=y[1];if(k.includes("-")){const C=k.split("-").map((L,m)=>m===0?L:L.charAt(0).toUpperCase()+L.slice(1)).join("");return`${y[0]}:${C}`}else{const C=k.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${y[0]}:${C}`}})():S;h.listeners&&(h.listeners[S]||h.listeners[v])||Z.addListener(a,S,E)}else{if(c.startsWith("on")&&E===void 0)continue;if(E==null||E===!1)l.removeAttributeSmart(a,c);else{const S=e.props?.isCustomElement??!1,v=typeof E=="object"&&E!==null&&l.isReactiveState(E)?E:ve(E)&&typeof E.value<"u"?E.value:E;if(c==="class"||c==="style"){try{const y=l.safeSerializeAttr(v);y!==null&&l.setAttributeSmart(a,c,String(y))}catch{}continue}if(S||c in a)try{const y=typeof E=="object"&&E!==null&&l.isReactiveState(E)?E:ve(E)?E.value:E;if(c==="disabled"&&q(a)){const k=p.disabled!==void 0?p.disabled:y,C=oe(k);l.safe(()=>{a.disabled=C}),C?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}try{if(typeof a[c]=="boolean"){let C=y;typeof y=="string"?y==="false"?C=!1:y==="true"?C=!0:C=!!y&&y!=="":C=!!y,a[c]=C}else a[c]=y}catch{a[c]=y}}catch{}}}}for(const[c,E]of Object.entries(h.listeners||{}))Z.addListener(a,c,E);const T={...e,props:{...e.props,...h.props}};ge(T,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 E of e.children)a.appendChild(U(E,n,t,c))}else typeof e.children=="string"&&(a.textContent=e.children);try{if(a instanceof HTMLSelectElement&&A&&Object.prototype.hasOwnProperty.call(A,"value"))try{a.value=String(A.value??"")}catch{}}catch{}try{if(q(a)){const c=p.disabled,E=A.disabled,S=c&&typeof c=="object"&&"value"in c;let v=!1;try{v=!!l.isReactiveState(c)}catch{v=!1}const k=v||S||De(c)?c:E,C=oe(k);l.safe(()=>{a.disabled=C}),C?l.safe(()=>{l.setAttributeSmart(a,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(a,"disabled")})}}catch{}return a}function wt(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 T=0;T<o.length;T++)i.push(o[T]);const a=Array.isArray(n)?n:[],u=kt(e);if(u){const T=v=>{if(typeof v=="string")return v.startsWith("each-")?v.substring(5):v;if(typeof v=="number")return String(v)},c=[],E=[];for(const v of t)if(v&&v.tag==="#anchor"){const y=Array.isArray(v.children)?v.children:[];for(const k of y){const C=T(k.key??v.key??"unknown");c.push({...k,key:C})}}else v&&c.push({...v,key:T(v.key)});for(const v of a)if(v&&v.tag==="#anchor"){const y=Array.isArray(v.children)?v.children:[];for(const k of y){const C=T(k.key??v.key??"unknown");E.push({...k,key:C})}}else v&&E.push({...v,key:T(v.key)});if(c.some(v=>v&&v.key!=null)||E.some(v=>v&&v.key!=null)){const v=new Map,y=new Map;for(const f of E)if(f&&f.key!=null){const b=String(f.key);v.set(b,f)}for(let f=0;f<i.length;f++){const b=i[f];let w=Ne(b);if(w=T(w),w!=null&&b instanceof Element&&b.nodeType===Node.ELEMENT_NODE){let R=typeof w=="string"&&w.includes(":")?w.substring(0,w.lastIndexOf(":")):w;R=String(R),y.set(R,b)}}const k=new Set,C=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 w=b.getBoundingClientRect();C.set(b,w)}}const m=[];for(const f of c){let b=f.key;if(b==null)continue;b=String(b);const w=v.get(b);let R=y.get(b);if(R&&w){const O=be(R,w,f,s);k.add(R);const j=String(b);V(O,j),m.push({node:O,key:b,newVNode:f,oldVNode:w,isNew:!1})}else{R=U(f,s,void 0,e instanceof Element?e.namespaceURI??null:null),V(R,String(b)),e.appendChild(R);const O=L||u.appear===!0;R instanceof HTMLElement&&O&&me(R,u).catch(j=>{x.devError("Enter transition error:",j)}),m.push({node:R,key:b,newVNode:f,isNew:!0})}}const _=[];for(let f=0;f<i.length;f++){const b=i[f],w=Ne(b);if(!k.has(b)&&w!=null&&b instanceof HTMLElement){const O=xe(b,u).then(()=>{e.contains(b)&&e.removeChild(b)}).catch(j=>{x.devError("Leave transition error:",j),e.contains(b)&&e.removeChild(b)});_.push(O)}}if(_.length===0){let f=e.firstChild;for(const{node:b}of m)b!==f&&e.insertBefore(b,f),f=b.nextSibling;if(u.moveClass&&C.size>0){const b=[];for(const{node:w,isNew:R}of m)if(!R&&w instanceof HTMLElement){const O=C.get(w);if(O){const j=w.getBoundingClientRect(),I=O.left-j.left,M=O.top-j.top;if(I!==0||M!==0){const z=u.moveClass.split(/\s+/).filter(D=>D);b.push({node:w,deltaX:I,deltaY:M,moveClasses:z})}}}if(b.length>0){for(const{node:w,deltaX:R,deltaY:O}of b)w.style.transform=`translate(${R}px, ${O}px)`,w.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:w,moveClasses:R}of b)for(const O of R)w.classList.add(O);requestAnimationFrame(()=>{const w=u.moveClass||"",R=w.match(/duration-(\d+)/),O=R?`${R[1]}ms`:"300ms",j=w.match(/ease-(out|in|in-out|linear)/),I=j?`ease-${j[1]}`:"ease-out";for(const{node:M}of b)M.style.transition=`transform ${O} ${I}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of b){M.style.removeProperty("transform");const D=()=>{for(const Q of z)M.classList.remove(Q);M.style.removeProperty("transition"),M.removeEventListener("transitionend",D),M.removeEventListener("transitioncancel",D)};M.addEventListener("transitionend",D,{once:!0}),M.addEventListener("transitioncancel",D,{once:!0})}})})})})}}}return}}const d=new Map;for(const T of a)T&&T.key!=null&&d.set(T.key,T);const g=new Map;for(let T=0;T<i.length;T++){const c=i[T],E=Ne(c);E!=null&&g.set(E,c)}const h=new Set;let p=e.firstChild;function A(T,c){let E=T;for(;E&&(h.add(E),E!==c);)E=E.nextSibling}function N(T,c,E,S,v,y=!0){const k=[];let C=T.nextSibling;for(;C&&C!==c;)k.push(C),C=C.nextSibling;const L=Array.isArray(E)?E:[];if(S.some(_=>_&&_.key!=null)||L.some(_=>_&&_.key!=null)){const _=new Map,f=new Map;for(const O of L)O&&O.key!=null&&_.set(O.key,O);for(const O of k){const j=Ne(O);j!=null&&f.set(j,O)}const b=v&&v.state==="visible"&&L.length===0&&S.length>0,w=new Set;let R=T.nextSibling;for(const O of S){let j;if(O.key!=null&&f.has(O.key)){const I=_.get(O.key);j=be(f.get(O.key),I,O,s),w.add(j),v&&j instanceof HTMLElement&&b&&v.appear&&me(j,v).catch(M=>{x.devError("Transition enter error (appear):",M)}),j!==R&&e.contains(j)&&e.insertBefore(j,R)}else j=U(O,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore(j,R),w.add(j),v&&j instanceof HTMLElement&&y&&me(j,v).catch(I=>{x.devError("Transition enter error:",I)});R=j.nextSibling}for(const O of k)!w.has(O)&&e.contains(O)&&(v&&O instanceof HTMLElement&&y?xe(O,v).then(()=>{e.contains(O)&&e.removeChild(O)}).catch(j=>{x.devError("Transition leave error:",j),e.contains(O)&&e.removeChild(O)}):e.removeChild(O))}else{const _=Math.min(L.length,S.length);for(let f=0;f<_;f++){const b=L[f],w=S[f],R=be(k[f],b,w,s);R!==k[f]&&(e.insertBefore(R,k[f]),e.removeChild(k[f]))}for(let f=_;f<S.length;f++){const b=U(S[f],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(b,c),v&&b instanceof HTMLElement&&y&&me(b,v).catch(w=>{x.devError("Transition enter error:",w)})}for(let f=_;f<k.length;f++){const b=k[f];v&&b instanceof HTMLElement&&y?xe(b,v).then(()=>{e.contains(b)&&e.removeChild(b)}).catch(w=>{x.devError("Transition leave error:",w),e.contains(b)&&e.removeChild(b)}):e.removeChild(b)}}}for(const T of t){let c;if(T.tag==="#anchor"){const E=T.key,S=`${E}:start`,v=`${E}:end`;let y=g.get(S),k=g.get(v);const C=Array.isArray(T.children)?T.children:[];if(y||(y=document.createTextNode(""),V(y,S)),k||(k=document.createTextNode(""),V(k,v)),T._startNode=y,T._endNode=k,!e.contains(y)||!e.contains(k)){e.insertBefore(y,p);const L=T._transition,_=!(L&&L.state==="visible"&&C.length>0)||L.appear;for(const f of C){const b=U(f,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(b,p),L&&b instanceof HTMLElement&&_&&me(b,L).catch(w=>{x.devError("Transition enter error:",w)})}e.insertBefore(k,p)}else{const L=T._transition,_=d.get(E)._transition,f=_&&_.state!==L?.state,b=L&&L.state==="visible"&&C.length>0&&!f,w=f||!b||L?.appear===!0;N(y,k,d.get(E)?.children,C,L,w)}A(y,k),p=k.nextSibling;continue}if(T.key!=null&&g.has(T.key)){const E=d.get(T.key);c=be(g.get(T.key),E,T,s,r),h.add(c),c!==p&&e.contains(c)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(c,p))}else c=U(T,s,r,e instanceof Element?e.namespaceURI??null:null),p&&!e.contains(p)&&(p=null),e.insertBefore(c,p),h.add(c);p=c.nextSibling}for(let T=0;T<i.length;T++){const c=i[T];!h.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 g=document.createDocumentFragment();g.appendChild(u);for(const h of a){const p=U(h,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);g.appendChild(p)}return g.appendChild(d),e.parentNode?.replaceChild(g,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 g of i)d.appendChild(U(g,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 Ue(i,n.props||{},t.props||{},s),wt(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 Ue(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 tt(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=Ie(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 g=0;g<e.childNodes.length;g++){const h=e.childNodes[g];h!==a&&h.nodeName!=="STYLE"&&(ie(h,s),u.push(h))}u.forEach(g=>e.removeChild(g));const d=r&&typeof r=="object"&&r.props?{...r,props:{...r.props,attrs:r.props.attrs?{...r.props.attrs}:void 0,props:r.props.props?{...r.props.props}:void 0}}:r;e._prevVNode=d,e._prevDom=a}const Se=[],Fe=new WeakMap,de=new WeakMap;function Tt(e,n){de.has(e)||de.set(e,new Set),de.get(e).add(n)}function Nt(e,n){const t=de.get(e);t&&(t.delete(n),t.size===0&&de.delete(e))}function Lt(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),qe(e,d,t,s,r),a(e.innerHTML)}).catch(d=>{o(!1),i(d instanceof Error?d:new Error(String(d)))});return}qe(e,u,t,s,r),a(e.innerHTML)}catch(u){i(u instanceof Error?u:new Error(String(u)))}finally{Se.pop()}}}function qe(e,n,t,s,r){if(e)try{tt(e,Array.isArray(n)?n:[n],t,s),r(e.innerHTML)}catch(o){throw x.devError("Error during VDOM rendering:",o),o}}function Rt(e,n,t,s,r,o,i){o!==null&&clearTimeout(o);const d=Date.now()-n<16,g=(()=>{try{return typeof window<"u"&&!!window.Cypress}catch{return!1}})(),h=(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"&&!g}catch{return!1}})(),p=h||g;if(d){const T=t+1;r(T);const c=p?50:10,E=p?100:25,S=h?12:50;if(T===c&&!p)x.devWarn(`⚠️ Component rendering frequently. Performance may be impacted.
2
+ Common causes:
3
+ • State updates during render cycle
4
+ • Event handlers with immediate function calls
5
+ • Missing effect dependencies`);else if(T===E&&!p)x.devWarn(`⚠️ Component is re-rendering rapidly. Applying throttling.
6
+ This might indicate:
7
+ • Event handler calling function immediately: @click="\${fn()}" should be @click="\${fn}"
8
+ • State modification during render
9
+ • Missing dependencies in computed/watch`);else if(T>=S){x.devError(`🛑 Infinite render loop detected. Stopping to prevent browser freeze.
10
+ Possible causes:
11
+ • State updates triggering immediate re-renders
12
+ • Computed values changing during evaluation
13
+ • Circular dependencies in reactive system`),i(null);return}}else r(0);let A=0;p||(t>=40?A=500:t>=25?A=100:t>=15&&(A=16));const N=()=>{s(Date.now());try{e()}catch(T){x.devError("Error during render execution:",T)}finally{i(null)}};if(A>0){const T=setTimeout(N,A);i(T)}else p?N():(i({}),queueMicrotask(N))}function Ot(e,n){let t=n;try{const s=de.get(e);if(s?.size)for(const r of s)try{const o=r.lastHtmlStringForJitCSS;o?.trim()&&(t+=`
14
+ `+o)}catch{}else{const r=e.querySelectorAll("*");for(const o of r)try{const i=o.lastHtmlStringForJitCSS;i?.trim()&&(t+=`
15
+ `+i)}catch{}}}catch{}return t}function Ge(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype}function Ze(e,n){let t=e.querySelector("style[data-cer-runtime]");t||(t=document.createElement("style"),l.setAttributeSmart(t,"data-cer-runtime","true"),e.appendChild(t));try{t.textContent=n}catch{}}function Mt(e,n,t,s,r){if(!e)return;const o=Ot(e,t);if(Fe.get(e)===o)return;Fe.set(e,o);const a=B.jitCSS(o),u=B.getProseSheet(),d=n._computedStyle;if(!a?.trim()&&!d&&!u){if(r(null),Ge(e))e.adoptedStyleSheets=[B.getBaseResetSheet(),B.getTransitionStyleSheet()];else{const E=B.minifyCSS(B.baseReset),S=B.getTransitionStyleSheet();let v="";try{S?.cssRules&&(v=Array.from(S.cssRules).map(k=>k.cssText).join(`
16
+ `))}catch{v=""}const y=B.minifyCSS(`${E}
17
+ ${v}`);Ze(e,y);try{e.adoptedStyleSheets=[B.getBaseResetSheet(),B.getTransitionStyleSheet()]}catch{}}return}let g="";if(d&&(g+=d+`
18
+ `),a&&(g+=a+`
19
+ `),g=B.sanitizeCSS(g),g=B.minifyCSS(g),Ge(e)){let c=s;c||(c=new CSSStyleSheet);try{c.replaceSync(g);const E=[B.getBaseResetSheet(),B.getTransitionStyleSheet()];u&&E.push(u),E.push(c),e.adoptedStyleSheets=E,r(c);return}catch{}}const p=B.minifyCSS(B.baseReset),A=B.getTransitionStyleSheet();let N="";try{A?.cssRules&&(N=Array.from(A.cssRules).map(c=>c.cssText).join(`
20
+ `))}catch{N=""}const T=B.minifyCSS(`${p}
21
+ ${N}
22
+ ${g}`);Ze(e,T);try{const c=[B.getBaseResetSheet(),B.getTransitionStyleSheet()];if(u&&c.push(u),typeof CSSStyleSheet<"u")try{const E=new CSSStyleSheet;E.replaceSync(g),c.push(E)}catch{c.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=c}catch{}r(null)}function jt(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=le.get(e)||n,this._componentId=`${e}-${crypto.randomUUID()}`;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 g=o.indexOf(":");if(g>0){const h=o.substring(0,g),p=o.substring(g+1),A=p.includes("-")?`${h}:${p.split("-").map((N,T)=>T===0?N:N.charAt(0).toUpperCase()+N.slice(1)).join("")}`:`${h}:${p.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;A!==o&&l.safe(()=>{this.dispatchEvent(new CustomEvent(A,u))})}return!d.defaultPrevented});const r=le.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&&Tt(t,this),this._applyProps(n),this._requestRender(),ft(n,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&Nt(t,this),ut(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(),dt(n,t,s,r,this.context)})}static get observedAttributes(){return n.props?Object.keys(n.props).map(l.toKebab):[]}_render(t){this._runLogicWithinErrorBoundary(t,()=>{Lt(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(()=>{Rt(()=>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,()=>{Mt(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]"}x.devError(`Error rendering component <${o}> (id=${i}):`,r),x.devError("Component props snapshot:",a),x.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{}if(t.onError&&t.onError(r,this.context),this.tagName.toLowerCase()!=="cer-error-boundary"){let o=this.parentElement;if(!o){const i=this.getRootNode();i instanceof ShadowRoot&&(o=i.host.parentElement)}for(;o;){if(o.tagName.toLowerCase()==="cer-error-boundary"){o._cerHandleChildError?.(r);break}let i=o.parentElement;if(!i){const a=o.getRootNode();a instanceof ShadowRoot&&(i=a.host.parentElement)}o=i}}}}_initContext(t){try{let s=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,u,d){const g=Reflect.get(a,u,d);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...p){const A=g.apply(a,p);if(!r._initializing){const N=i||"root";r._triggerWatchers(N,a),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return A}:g},set(a,u,d){if(a[String(u)]=d,!r._initializing){const g=i?`${i}.${String(u)}`:String(u);r._triggerWatchers(g,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 g=i?`${i}.${String(u)}`:String(u);return a[String(u)]=s(d,g),r._initializing||(r._triggerWatchers(g,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,()=>{ot(this.context,this._watchers,{})})}_triggerWatchers(t,s){at(this.context,this._watchers,t,s)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{lt(this,t,this.context)})}}}function Pt(){return l.isDiscoveryRender()}let $=null;function Re(e){$=e}function Le(){$=null}function xt(){return $}function $t(){if(!$)throw new Error("useEmit must be called during component render");if(l.isDiscoveryRender())return()=>!1;const e=$.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 ae(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function Ht(e){if(!$)throw new Error("useOnConnected must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onConnected||(n.onConnected=[]),n.onConnected.push(e)}function Dt(e){if(!$)throw new Error("useOnDisconnected must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onDisconnected||(n.onDisconnected=[]),n.onDisconnected.push(e)}function It(e){if(!$)throw new Error("useOnAttributeChanged must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onAttributeChanged||(n.onAttributeChanged=[]),n.onAttributeChanged.push(e)}function Wt(e){if(!$)throw new Error("useOnError must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onError||(n.onError=[]),n.onError.push(t=>{try{t instanceof Error?e(t):e(new Error(String(t)))}catch{}})}function Bt(e){if(!$)throw new Error("useProps must be called during component render");ae($);const n=$._hookCallbacks;n.props={...n.props||{},...e};const t=$;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 g=l.toKebab(o),h=d.getAttribute(g);if(h!==null){const p=typeof e[o];return p==="boolean"?h===""||h==="true":p==="number"?Number(h):h}if(typeof d[o]<"u"){const p=d[o];if(l.isReactiveState(p)||p&&typeof p=="object"&&"value"in p&&!(p instanceof Node))return p.value;const A=typeof e[o];if(!(A==="string"&&p&&typeof p=="object"))return A==="boolean"&&typeof p=="string"?p===""||p==="true":p}}}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 g=o.replace(/([A-Z])/g,"-$1").toLowerCase(),h=u.getAttribute(g);if(h!==null)return typeof i=="boolean"?h===""||h==="true":typeof i=="number"?Number(h):h}const d=u[o];if(typeof d<"u"&&d!==""){const g=d&&typeof d=="object"&&"value"in d&&!(d instanceof Node);if(!(typeof i=="string"&&d&&typeof d=="object"&&!g&&!l.isReactiveState(d)))return typeof i=="boolean"&&i===!1&&d===""?i:l.isReactiveState(d)||g?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 zt(e){if(!$)throw new Error("useStyle must be called during component render");if(!l.isDiscoveryRender()){ae($);try{const n=e();Object.defineProperty($,"_computedStyle",{value:n,writable:!0,enumerable:!1,configurable:!0})}catch(n){x.devWarn("Error in useStyle callback:",n),Object.defineProperty($,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}}const Ee=Symbol.for("@cer/provides");function Kt(e,n){if(!$)throw new Error("provide must be called during component render");if(l.isDiscoveryRender())return;const t=$;t[Ee]||Object.defineProperty(t,Ee,{value:new Map,writable:!1,enumerable:!1,configurable:!0}),t[Ee].set(e,n)}function Vt(e,n){if(!$)throw new Error("inject must be called during component render");if(l.isDiscoveryRender())return n;try{const t=$._host;if(t){let s=t.parentNode;for(s||(s=t.getRootNode());s;)if(s instanceof ShadowRoot){const r=s.host,o=r.context;if(o){const a=o[Ee];if(a?.has(e))return a.get(e)}if(s=r.parentNode??r.getRootNode(),s===document||s===r)break}else{if(s instanceof Element){const i=s.context;if(i){const a=i[Ee];if(a?.has(e))return a.get(e)}}const r=s;if(s=s.parentNode??s.getRootNode?.(),s===document||s===r)break}}}catch{}return n}function Ut(e){return n=>{const t=n??$;if(!t)throw new Error("createComposable: no component context available. Pass a context explicitly or call inside a render function.");const s=$;Re(t);try{return e()}finally{s?Re(s):Le()}}}function Ft(e){if(!$)throw new Error("useExpose must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.expose={...n.expose??{},...e};const t=$._host;if(t)for(const[s,r]of Object.entries(e))try{t[s]=r}catch{}}function qt(){if(!$)throw new Error("useSlots must be called during component render");if(l.isDiscoveryRender())return{has:()=>!1,getNodes:()=>[],names:()=>[]};const e=$._host;return{has(n){return e?!n||n==="default"?Array.from(e.children).some(t=>!t.hasAttribute("slot")):Array.from(e.children).some(t=>t.getAttribute("slot")===n):!1},getNodes(n){return e?!n||n==="default"?Array.from(e.children).filter(t=>!t.hasAttribute("slot")):Array.from(e.children).filter(t=>t.getAttribute("slot")===n):[]},names(){if(!e)return[];const n=new Set;for(const t of Array.from(e.children)){const s=t.getAttribute("slot");n.add(s??"default")}return Array.from(n)}}}function Gt(e,n){it();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}-${crypto.randomUUID()}`;l.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Object.defineProperty(o,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!0}),Re(o);let u;try{u=n()}catch(d){try{const h=i._hookCallbacks?.onError;if(Array.isArray(h))for(const p of h)try{p(d)}catch{}else if(typeof h=="function")try{h(d)}catch{}}catch{}try{const g=i._host;if(g?.parentElement){let h=g.parentElement;for(;h;){if(h.tagName.toLowerCase()==="cer-error-boundary"){h._cerHandleChildError?.(d);break}let p=h.parentElement;if(!p){const A=h.getRootNode();A instanceof ShadowRoot&&(p=A.host.parentElement)}h=p}}}catch{}throw d}if(i._hookCallbacks){const d=i._hookCallbacks;if(d.onConnected){const g=d.onConnected;s.onConnected=h=>{for(const p of g)try{p(h)}catch{}}}if(d.onDisconnected){const g=d.onDisconnected;s.onDisconnected=h=>{for(const p of g)try{p(h)}catch{}}}if(d.onAttributeChanged){const g=d.onAttributeChanged;s.onAttributeChanged=(h,p,A,N)=>{for(const T of g)try{T(h,p,A,N)}catch{}}}if(d.onError){const g=d.onError;s.onError=h=>{for(const p of g)try{p(h)}catch{}}}if(d.props){const g=d.props;r.props=Object.fromEntries(Object.entries(g).map(([h,p])=>[h,{type:typeof p=="boolean"?Boolean:typeof p=="number"?Number:typeof p=="string"?String:Function,default:p}])),le.set(t,r)}}return u}finally{Le(),l.reactiveSystem.clearCurrentComponent()}}};if(le.set(t,r),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};Re(o),l.beginDiscoveryRender();try{n()}catch(i){try{const u=o?._hookCallbacks?.onError;if(Array.isArray(u))for(const d of u)try{d(i)}catch{}else if(typeof u=="function")try{u(i)}catch{}x.devError(`Error during component discovery render <${t}>:`,i),x.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw l.endDiscoveryRender(),Le(),i}if(l.endDiscoveryRender(),Le(),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}])),le.set(t,r)}}catch{}customElements.get(t)||customElements.define(t,jt(t,r))}}function ee(e,n={},t,s){const r=s??n.key;return{tag:e,key:r,props:n,children:t}}function Ce(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function se(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Ce(e)}function Zt(e,n){return e.key!=null?e:{...e,key:n}}class Jt{map=new Map;maxSize;accessOrder=new Map;accessCounter=0;constructor(n){this.maxSize=Math.max(1,n)}get(n){const t=this.map.get(n);if(t!==void 0)return this.accessOrder.set(n,++this.accessCounter),t}set(n,t){const s=this.map.has(n);this.map.set(n,t),this.accessOrder.set(n,++this.accessCounter),!s&&this.map.size>this.maxSize&&this.evictLRU()}evictLRU(){let n,t=1/0;for(const[s,r]of this.accessOrder)r<t&&(t=r,n=s);n!==void 0&&(this.map.delete(n),this.accessOrder.delete(n))}has(n){return this.map.has(n)}clear(){this.map.clear(),this.accessOrder.clear(),this.accessCounter=0}get size(){return this.map.size}}const Yt=()=>{if(typeof navigator<"u"&&"deviceMemory"in navigator){const n=navigator.deviceMemory;if(n)return Math.min(1e3,Math.max(200,n*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"}catch{return!1}})()?100:500},$e=new Jt(Yt());function Xt(e,n){if(e==null){x.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"&&x.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"&&x.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 Qt(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],g=u[2];let h="";for(let c=3;c<u.length;c++)if(u[c]!==void 0){h=u[c];break}h.length>=2&&(h[0]==='"'&&h[h.length-1]==='"'||h[0]==="'"&&h[h.length-1]==="'")&&(h=h.slice(1,-1));const p=!/=/.test(u[0]),A=h.match(/^{{(\d+)}}$/);let N=p?!0:A?n[Number(A[1])]??null:h;A||(N==="true"?N=!0:N==="false"?N=!1:N==="null"?N=null:isNaN(Number(N))||(N=Number(N)));const T=["model","bind","show","class","style","ref","when"];if(d===":"){const[c,E]=g.split(":"),[S,...v]=c.split(".");if(T.includes(S)){const y=[...v],k=S==="model"&&E?`model:${E}`:S;o[k]={value:N,modifiers:y,arg:E}}else if(g==="disabled"){let y=N;y&&l.isReactiveState(y)&&(y=y.value);const k=typeof y;if(y===""||k==="boolean"||k==="string"&&(y==="true"||y==="false")||y==null||k==="number")s[g]=y;else{let m=N;m&&l.isReactiveState(m)&&(m=m.value),r[g]=m}i.push(g)}else{let y=N;y&&l.isReactiveState(y)&&(y=y.value),r[g]=y,i.push(g)}}else if(d==="@"){const[c,...E]=g.split("."),S=E;Xt(N,c);const v=typeof N=="function"?N:typeof t[N]=="function"?t[N]:void 0;if(v){const y=C=>{if(S.includes("prevent")&&C.preventDefault(),S.includes("stop")&&C.stopPropagation(),!(S.includes("self")&&C.target!==C.currentTarget))return S.includes("once")&&C.currentTarget?.removeEventListener(c,y),v(C)},k="on"+c.charAt(0).toUpperCase()+c.slice(1);s[k]=y}}else g==="ref"?s.ref=N:r[g]=N}return{props:s,attrs:r,directives:o,bound:i}}function We(e){if(!se(e)||Ce(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?We(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?We(s):s);return{...e,children:t}}return e}function en(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=$e.get(i);if(f)return f}function a(f,b){return ee("#text",{},f,b)}function u(f,b,w=!1){let R=typeof f=="string"?l.decodeEntities(f):f;return!w&&typeof R=="string"&&/[\r\n]/.test(R)&&(R=R.replace(/\s+/g," ")),ee("#text",{},R,b)}let d="";for(let f=0;f<e.length;f++)d+=e[f],f<n.length&&(d+=`{{${f}}}`);const g=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,h=[];let p,A=[],N=null,T={},c,E=0;const S=[],v=new Set(["pre","code","textarea","script","style"]);function y(){if(N&&v.has(N.toLowerCase()))return!0;for(const f of h)if(v.has(f.tag.toLowerCase()))return!0;return!1}function k(f){if(!f||typeof f!="object"||Ce(f))return;const b=f,w=T;if(b.props||b.attrs){const R=b;R.props&&(w.props||(w.props={}),Object.assign(w.props,R.props)),R.attrs&&(w.attrs||(w.attrs={}),Object.keys(R.attrs).forEach(O=>{if(O==="style"&&w.attrs.style){const j=String(w.attrs.style).replace(/;?\s*$/,""),I=String(R.attrs.style).replace(/^;?\s*/,"");w.attrs.style=j+"; "+I}else if(O==="class"&&w.attrs.class){const j=String(w.attrs.class).trim().split(/\s+/).filter(Boolean),I=String(R.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...j,...I])];w.attrs.class=M.join(" ")}else w.attrs[O]=R.attrs[O]}))}else w.props||(w.props={}),Object.assign(w.props,b)}function C(f,b){const w=N?A:S;if(Ce(f)){const R=f.key??b,O=f.children;w.push({...f,key:R,children:O});return}if(se(f)){w.push(Zt(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let R=0;R<f.length;R++){const O=f[R];Ce(O)||se(O)||Array.isArray(O)?C(O,`${b}-${R}`):O!==null&&typeof O=="object"?l.isUnsafeHTML(O)?w.push(ee("#raw",{},O.__rawHTML,`${b}-${R}`)):k(O):w.push(a(String(O),`${b}-${R}`))}return}if(f!==null&&typeof f=="object"){if(l.isUnsafeHTML(f)){const R=f.__rawHTML??"";w.push(ee("#raw",{},R,b));return}k(f);return}w.push(a(String(f),b))}const L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;p=g.exec(d);)if(!(p[0].startsWith("<!--")&&p[0].endsWith("-->"))){if(p[1]){const f=p[1],b=p[0][1]==="/",w=p[0][p[0].length-2]==="/"||L.has(f),{props:R,attrs:O,directives:j,bound:I}=Qt(p[2]||"",n,r??{}),M={props:{},attrs:{}};for(const z in R)M.props[z]=R[z];for(const z in O)M.attrs[z]=O[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"]},D=f.toLowerCase(),Q=z[D]??[];if(M.attrs){for(const H of Q)if(I&&I.includes(H)&&H in M.attrs&&!(M.props&&H in M.props)){let P=M.attrs[H];if(P&&l.isReactiveState(P))P=P.value,M.props[H]=P,delete M.attrs[H];else if(P&&typeof P=="object"&&"value"in P&&!(P instanceof Node))try{const W=P.value;M.props[H]=(D==="select"||D==="option")&&H==="value"?String(W):W,delete M.attrs[H]}catch{}else{const W=typeof P;if(H==="disabled")(P===""||W==="boolean"||W==="string"&&(P==="true"||P==="false")||P==null||W==="number")&&(M.props[H]=P,delete M.attrs[H]);else if(P===""||W==="string"||W==="number"||W==="boolean"||P==null){const G=(D==="select"||D==="option")&&H==="value"?String(P):P;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 P of I)if(P in M.attrs&&!(M.props&&P in M.props)){const W=P.includes("-")?l.toCamel(P):P,G=M.attrs[P];if(M.props[W]=G,H.has(P)||l.isClassLikeAttr(P))try{const _e=l.safeSerializeAttr(M.attrs[P]);_e===null?delete M.attrs[P]:M.attrs[P]=_e}catch{delete M.attrs[P]}else delete M.attrs[P]}}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(j&&Object.keys(j).some(z=>z==="model"||z.startsWith("model:")))try{const D=globalThis[Symbol.for("cer.registry")],Q=!!(D&&typeof D.has=="function"&&D.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(j)){if(G!=="model"&&!G.startsWith("model:"))continue;const ke=j[G],_e=ke.arg??(G.includes(":")?G.split(":",2)[1]:void 0),K=ke.value,Oe=_e??"modelValue",Be=l.getNestedValue,nt=l.setNestedValue,pe=r?._state||r;let Y;typeof K=="string"&&pe?Y=Be(pe,K):Y=K,M.props[Oe]=Y;try{const te=l.toKebab(Oe);M.attrs||(M.attrs={}),Y!=null&&(typeof Y=="string"||typeof Y=="number"||typeof Y=="boolean")&&(M.attrs[te]=Y)}catch{}M.isCustomElement=!0;const ze=`update:${l.toKebab(Oe)}`.replace(/-([a-z])/g,(te,J)=>J.toUpperCase()),rt="on"+ze.charAt(0).toUpperCase()+ze.slice(1);M.props[rt]=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=Be(pe||{},typeof K=="string"?K:String(K));if(Array.isArray(J)&&Array.isArray(ne)?JSON.stringify([...J].sort())!==JSON.stringify([...ne].sort()):J!==ne){nt(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 j[G]}}catch{}if(Object.keys(j).length>0&&(M.directives={...j}),b){const z=A.some(H=>typeof H=="object"&&H.tag!=="#text");let D=A;if(z&&A.length>0){let H=0;for(;H<A.length;){const W=A[H];if(!se(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;H++}let P=A.length-1;for(;P>=0;){const W=A[P];if(!se(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;P--}H===0&&P===A.length-1?D=A:H>P?D=[]:D=A.slice(H,P+1)}const Q=ee(N,T,D.length===1&&se(D[0])&&D[0].tag==="#text"?typeof D[0].children=="string"?D[0].children:"":D.length?D:void 0,c),F=h.pop();F?(N=F.tag,T=F.props,c=F.key,A=F.children,A.push(Q)):(S.push(Q),N=null,T={},c=void 0,A=[])}else w?N?A.push(ee(f,M,void 0,void 0)):S.push(ee(f,M,void 0,void 0)):(N&&h.push({tag:N,props:T,children:A,key:c}),N=f,T=M,A=[])}else if(typeof p[3]<"u"){const f=Number(p[3]),b=n[f],w=`interp-${f}`;C(b,w)}else if(p[4]){const f=p[4],b=N?A:S,w=f.split(/({{\d+}})/);for(const R of w){if(!R)continue;const O=R.match(/^{{(\d+)}}$/);if(O){const j=Number(O[1]),I=n[j],M=`interp-${j}`;C(I,M)}else{const j=`text-${E++}`,I=y();b.push(u(R,j,I))}}}}const _=S.filter(f=>se(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0).map(f=>We(f));if(_.length===1){const f=_[0];return o&&i&&$e.set(i,f),f}else if(_.length>1){const f=_;return o&&i&&$e.set(i,f),f}return ee("div",{},"","fallback-root")}function tn(e,...n){if(l.isDiscoveryRender())return[];const t=n[n.length-1],s=typeof t=="object"&&t&&!Array.isArray(t)?t:void 0;return en(e,n,s)}exports.component=Gt;exports.createComposable=Ut;exports.getCurrentComponentContext=xt;exports.html=tn;exports.inject=Vt;exports.isDiscoveryRender=Pt;exports.provide=Kt;exports.useEmit=$t;exports.useExpose=Ft;exports.useOnAttributeChanged=It;exports.useOnConnected=Ht;exports.useOnDisconnected=Dt;exports.useOnError=Wt;exports.useProps=Bt;exports.useSlots=qt;exports.useStyle=zt;exports.vdomRenderer=tt;
23
+ //# sourceMappingURL=template-compiler-CA4YRaBu.cjs.map