nuclo 0.2.1 → 0.2.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"modifierProcessor.d.ts","sourceRoot":"","sources":["../../src/core/modifierProcessor.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACtE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AA2BvB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,EAChE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACX,IAAI,GAAG,IAAI,CA4Eb"}
1
+ {"version":3,"file":"modifierProcessor.d.ts","sourceRoot":"","sources":["../../src/core/modifierProcessor.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACtE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AAqDvB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,EAChE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACX,IAAI,GAAG,IAAI,CA6Eb"}
@@ -1 +1 @@
1
- {"version":3,"file":"reactiveAttributes.d.ts","sourceRoot":"","sources":["../../src/core/reactiveAttributes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAgD,MAAM,mBAAmB,CAAC;AA8EzG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,SAAS,cAAc,EACvE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACnC,IAAI,CAkBN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAuBhE"}
1
+ {"version":3,"file":"reactiveAttributes.d.ts","sourceRoot":"","sources":["../../src/core/reactiveAttributes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAgD,MAAM,mBAAmB,CAAC;AA8EzG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,SAAS,cAAc,EACvE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACnC,IAAI,CAkBN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CA6BhE"}
@@ -1,6 +1,15 @@
1
1
  /**
2
2
  * Shared types and registries for reactive nodes.
3
3
  * Single source of truth — imported by reactiveText.ts and reactiveAttributes.ts.
4
+ *
5
+ * Registry structure: the iteration sets only hold WeakRefs; the actual info
6
+ * records live in WeakMaps keyed by the node. Info records may strongly
7
+ * reference the node (e.g. attribute applyValue closures capture the
8
+ * element), so storing them in a strongly-held map would pin the node in
9
+ * memory forever. With WeakMap storage the whole record is collectible as
10
+ * soon as the node is unreachable, and the FinalizationRegistry prunes the
11
+ * leftover WeakRef from the iteration set. The notify passes also prune
12
+ * dead/disconnected entries as they iterate.
4
13
  */
5
14
  export type TextResolver = () => Primitive;
6
15
  export interface ReactiveTextNodeInfo {
@@ -17,9 +26,9 @@ export interface ReactiveElementInfo {
17
26
  attributeResolvers: Map<string, AttributeResolverRecord>;
18
27
  }
19
28
  /**
20
- * Stores weak references to reactive text nodes for iteration during updates.
29
+ * Iteration set of weak references to reactive text nodes.
21
30
  */
22
- export declare const reactiveTextNodes: Map<WeakRef<Text>, ReactiveTextNodeInfo>;
31
+ export declare const reactiveTextNodes: Set<WeakRef<Text>>;
23
32
  /**
24
33
  * WeakMap for O(1) lookups of reactive text node info by node reference.
25
34
  */
@@ -28,9 +37,9 @@ export declare const reactiveTextNodesByNode: WeakMap<Text, {
28
37
  info: ReactiveTextNodeInfo;
29
38
  }>;
30
39
  /**
31
- * Stores weak references to reactive elements for iteration during updates.
40
+ * Iteration set of weak references to reactive elements.
32
41
  */
33
- export declare const reactiveElements: Map<WeakRef<Element>, ReactiveElementInfo>;
42
+ export declare const reactiveElements: Set<WeakRef<Element>>;
34
43
  /**
35
44
  * WeakMap for O(1) lookups of reactive element info by element reference.
36
45
  */
@@ -47,11 +56,11 @@ export declare function registerReactiveTextNode(node: Text, info: ReactiveTextN
47
56
  */
48
57
  export declare function registerReactiveElement(element: Element, info: ReactiveElementInfo): void;
49
58
  /**
50
- * Removes a reactive text node's WeakRef entry from the iteration map.
59
+ * Removes a reactive text node's WeakRef entry from the iteration set.
51
60
  */
52
61
  export declare function removeReactiveTextNodeRef(ref: WeakRef<Text>): void;
53
62
  /**
54
- * Removes a reactive element's WeakRef entry from the iteration map.
63
+ * Removes a reactive element's WeakRef entry from the iteration set.
55
64
  */
56
65
  export declare function removeReactiveElementRef(ref: WeakRef<Element>): void;
57
66
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reactiveCleanup.d.ts","sourceRoot":"","sources":["../../src/core/reactiveCleanup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,0CAAiD,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,uBAAuB;SAA4B,OAAO,CAAC,IAAI,CAAC;UAAQ,oBAAoB;EAAK,CAAC;AAE/G;;GAEG;AACH,eAAO,MAAM,gBAAgB,4CAAmD,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,sBAAsB;SAA+B,OAAO,CAAC,OAAO,CAAC;UAAQ,mBAAmB;EAAK,CAAC;AAEnH;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAIrF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAIzF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAMxD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM7D"}
1
+ {"version":3,"file":"reactiveCleanup.d.ts","sourceRoot":"","sources":["../../src/core/reactiveCleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,oBAA2B,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,uBAAuB;SAA4B,OAAO,CAAC,IAAI,CAAC;UAAQ,oBAAoB;EAAK,CAAC;AAE/G;;GAEG;AACH,eAAO,MAAM,gBAAgB,uBAA8B,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,sBAAsB;SAA+B,OAAO,CAAC,OAAO,CAAC;UAAQ,mBAAmB;EAAK,CAAC;AAUnH;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAYrF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAKzF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAMxD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"reactiveText.d.ts","sourceRoot":"","sources":["../../src/core/reactiveText.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAgC9G;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAoCjE"}
1
+ {"version":3,"file":"reactiveText.d.ts","sourceRoot":"","sources":["../../src/core/reactiveText.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAgC9G;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CA2CjE"}
@@ -4,18 +4,41 @@
4
4
  * During hydration the component tree is built against an existing DOM tree
5
5
  * (produced by SSR). Instead of creating new nodes, factories claim existing
6
6
  * children from their parent element by advancing a cursor.
7
+ *
8
+ * The cursor is a *node pointer* (the next unclaimed child), not an index.
9
+ * Indexed childNodes access is O(n) after any tree/attribute mutation in
10
+ * jsdom (live NodeList re-materialization) which made hydration O(n²);
11
+ * firstChild/nextSibling pointers are O(1) in every DOM implementation.
7
12
  */
8
13
  export declare function isHydrating(): boolean;
9
14
  export declare function startHydration(): void;
10
15
  export declare function endHydration(): void;
11
16
  /**
12
- * Returns the current cursor position for a parent node.
17
+ * Runs a callback with hydration temporarily disabled, restoring the previous
18
+ * state afterwards. Used when a server/client mismatch forces a subtree to be
19
+ * rendered fresh in the middle of a hydration pass — fresh rendering must not
20
+ * claim nodes from the surrounding SSR DOM.
21
+ */
22
+ export declare function runWithoutHydration<T>(fn: () => T): T;
23
+ /**
24
+ * Returns the next unclaimed child of a parent node (or null at the end)
25
+ * without advancing the cursor.
13
26
  */
14
- export declare function getCursor(parent: Node): number;
27
+ export declare function peekChild(parent: Node): Node | null;
15
28
  /**
16
- * Sets the cursor position for a parent node.
29
+ * Sets the cursor to a specific child node (or null for "past the end").
30
+ */
31
+ export declare function setCursor(parent: Node, node: Node | null): void;
32
+ /**
33
+ * Advances the cursor past whitespace-only text nodes.
34
+ *
35
+ * Nuclo's own SSR output never produces bare whitespace text nodes (text
36
+ * children are always preceded by a `<!-- text-N -->` marker), so unmarked
37
+ * whitespace comes from the surrounding template or an HTML
38
+ * formatter/minifier. Skipping (without removing) keeps the cursor aligned
39
+ * while leaving the document's visual whitespace untouched.
17
40
  */
18
- export declare function setCursor(parent: Node, index: number): void;
41
+ export declare function skipWhitespaceText(parent: Node): void;
19
42
  /**
20
43
  * Claims the next child node from parent at the current cursor position.
21
44
  * Advances the cursor by one.
@@ -29,7 +52,9 @@ export declare function claimElement(parent: Node, tagName: string): Element | n
29
52
  /**
30
53
  * Removes unclaimed SSR children from a hydrated element.
31
54
  * Must be called after modifiers have been applied to a claimed element.
32
- * Children from [cursor, initialChildCount) are removed.
55
+ * Removes nodes from the cursor through `lastOriginalChild` (the element's
56
+ * last child before modifiers ran) — nodes appended by modifiers come after
57
+ * that boundary and are preserved.
33
58
  */
34
- export declare function cleanupUnclaimedChildren(node: Node, initialChildCount: number): void;
59
+ export declare function cleanupUnclaimedChildren(node: Node, lastOriginalChild: Node | null): void;
35
60
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/hydration/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAE9C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAOpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAO1E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAOpF"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/hydration/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,cAAc,IAAI,IAAI,CAMrC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAGnD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAE/D;AAMD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAUrD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAMpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAQ1E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CASzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/list/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAwCvD,wBAAgB,IAAI,CAAC,KAAK,EAAE,QAAQ,SAAS,cAAc,EACzD,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,GACpC,IAAI,CAwFN;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,SAAS,cAAc,GAAG,cAAc,EACvF,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACvC,UAAU,EAAE,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,EACzC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,EAC/B,KAAK,EAAE,MAAM,GACZ,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAM9B;AA0GD,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAuB5D"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/list/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAqDvD,wBAAgB,IAAI,CAAC,KAAK,EAAE,QAAQ,SAAS,cAAc,EACzD,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,GACpC,IAAI,CAkGN;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,SAAS,cAAc,GAAG,cAAc,EACvF,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACvC,UAAU,EAAE,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,EACzC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,EAC/B,KAAK,EAAE,MAAM,GACZ,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAM9B;AAkJD,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAoC5D"}
package/dist/nuclo.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t,n,r,i,a){let o=l.get(e);o||(o=new Map,l.set(e,o));let s=o.get(t);s||(s=new Set,o.set(t,s)),s.add({original:n,wrapped:r,options:i,controller:a})}function d(e,t,n){n.controller?n.controller.abort():e.removeEventListener(t,n.wrapped,n.options)}function f(e,t){let n=l.get(e);if(n)if(t){let r=n.get(t);if(r){for(let n of r)d(e,t,n);n.delete(t)}}else{for(let[t,r]of n)for(let n of r)d(e,t,n);l.delete(e)}}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=new AbortController,o=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}},l=typeof n==`boolean`?{capture:n,signal:a.signal}:{...n||{},signal:a.signal};i.addEventListener(e,o,l),u(i,e,t,o,n,a)}}const m=new Map,h=new WeakMap,g=new Map,_=new WeakMap;function ee(e,t){let n=new WeakRef(e);m.set(n,t),h.set(e,{ref:n,info:t})}function te(e,t){let n=new WeakRef(e);g.set(n,t),_.set(e,{ref:n,info:t})}function ne(e){m.delete(e)}function re(e){g.delete(e)}function ie(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function ae(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const v=new WeakMap,y=new Set,oe=new WeakMap;function se(e,t){v.set(e,t);let n=new WeakRef(e);y.add(n),oe.set(e,n)}function ce(e){v.delete(e);let t=oe.get(e);t&&(y.delete(t),oe.delete(e))}function le(){let e=[],t=[];for(let n of y){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)y.delete(e);return e}function ue(e){return v.get(e)??null}const b=`http://www.w3.org/2000/svg`;function x(e){return globalThis.document?document.createElement(e):null}function S(e,t){return globalThis.document?document.createElementNS(e,t):null}function C(e){return globalThis.document?document.createTextNode(e):null}function de(){return globalThis.document?document.createDocumentFragment():null}function fe(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function pe(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),ae(t),ce(t)}else e.nodeType===Node.TEXT_NODE?ie(e):e.nodeType===Node.COMMENT_NODE&&ce(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)pe(e.childNodes[t])}function me(e){if(!e?.parentNode)return!1;try{return pe(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function he(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function w(e){return globalThis.document?globalThis.document.createComment(e):null}function ge(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function _e(e,t){let n=w(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=w(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function ve(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;me(n),n=e}}function ye(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)he(n,e[r],t)}function be(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=C(r);if(e)t=e;else continue}else t=r;fe(e,t)}}return e}function T(e){return e?e.isConnected===!0:!1}function xe(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}const Se={};let Ce=!1;function we(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(T(n)?Oe(e.info):(re(e.ref),_.delete(n)))}n=n.parentNode}}function Te(){Ce||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,we,!0),Ce=!0)}function Ee(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return te(e,n),n}function De(e){return typeof e!=`object`||!e}function E(e,t){let n;try{n=t.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e}`,t);return}let r=De(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:Se}catch(t){s(`Failed to apply reactive attribute: ${e}`,t)}}function Oe(e){for(let[t,n]of e.attributeResolvers)E(t,n)}function D(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:Se};if(!c){E(t,i);return}Te(),Ee(e).attributeResolvers.set(t,i),E(t,i)}function ke(e){let t=[];for(let[n,r]of g){let i=n.deref();if(i===void 0){t.push(n);continue}if(!T(i)){_.delete(i),t.push(n);continue}e&&!e.contains(i)||Oe(r)}for(let e of t)re(e)}function Ae(e){return e}function je(e,t,n){let r=Ae(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function Me(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}function Ne(e,t){if(!(!e?.style||!t))for(let[n,r]of Object.entries(t))Me(e,n,r)||s(`Failed to set style property '${n}'`)}function Pe(e,t){e&&(a(t)?D(e,`style`,t,function(t){Ne(e,t)}):Ne(e,t))}const O=new WeakMap,Fe=new WeakSet;function k(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Ie(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Le(e){if(!O.has(e)){let t=new Set;e.className&&k(t,e.className),O.set(e,t)}Fe.add(e)}function Re(e){return Fe.has(e)}function ze(e,t){if(!t)return;let n=O.get(e);n||(n=new Set,O.set(e,n)),k(n,t)}function Be(e,t){let n=O.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=Ie(n);return}let r=Ie(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Ve(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;k(r,n),k(r,t),e.className=Ie(r)}else e.className=t}function He(e,t){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=C(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=C(r);if(!i)throw Error(`Failed to create text node: document not available`);return c&&ee(i,{resolver:e,lastValue:r}),i}function Ue(e){let t=[];for(let[n,r]of m){let i=n.deref();if(i===void 0){t.push(n);continue}if(!T(i)){h.delete(i),t.push(n);continue}if(e&&!e.contains(i))continue;let a;try{a=r.resolver()}catch(e){s(`Failed to update reactive text node`,e),a=void 0}let o=a===void 0?``:String(a);o!==r.lastValue&&(i.textContent=o,r.lastValue=o)}for(let e of t)ne(e)}function We(e,t,n,r=!1){if(n==null)return;if(t===`style`){Pe(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){Ve(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(a(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(Le(e),D(e,String(t),r,function(t){Be(e,String(t||``))})):D(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&Re(e)){let t=String(n||``);t&&(ze(e,t),Ve(e,t));return}i(n,r)}}function A(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];We(e,r,i,n&&r===`className`)}}const j=new WeakMap;let M=!1;const Ge=new WeakMap;function N(){return M}function Ke(){M=!0}function qe(){M=!1}function P(e){return Ge.get(e)??0}function Je(e,t){Ge.set(e,t)}function F(e){let t=P(e),n=e.childNodes[t]??null;return n&&Je(e,t+1),n}function Ye(e,t){if(!M)return null;let n=e.childNodes[P(e)];return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?F(e):null}function Xe(e,t){let n=P(e),r=t-n;for(;r-- >0;){let t=e.childNodes[n];t&&e.removeChild(t)}}function Ze(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function Qe(e){let t=P(e),n=e.childNodes[t];return!!n&&n.nodeType===8&&n.textContent?.trimStart().startsWith(`text-`)===!0}function I(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=j.get(i);if(t||(t={value:i(),error:!1},j.set(i,t)),t.error)return $e(c,()=>``);let n=t.value;if(Ze(n))return A(r,{className:()=>{let e=i();return Ze(e)?e.className:``}}),null;if(e(n)&&n!=null){if(N()&&Qe(r)){let e=r;F(e);let t=F(e);return t&&t.nodeType===3&&ee(t,{resolver:i,lastValue:t.textContent||``}),null}return $e(c,i,n)}return null}catch(e){return j.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),$e(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?et(c,a):t(a)?a:(n(a)&&A(r,a),null)}let l=i;if(e(l)){if(N()&&Qe(r)){let e=r;return F(e),F(e),null}return et(c,l)}return t(l)?l:(A(r,l),null)}function $e(e,t,n){let r=de();if(!r)throw Error(`Failed to create document fragment: document not available`);let i=w(` text-${e} `);i&&r.appendChild(i);let a=He(t,n);return r.appendChild(a),r}function et(e,t){let n=de();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=w(` text-${e} `);r&&n.appendChild(r);let i=C(String(t));return i&&n.appendChild(i),n}function L(e,t,n=0){if(!t||t.length===0)return{element:e,nextIndex:n,appended:0};let r=n,i=0,a=e;for(let n=0;n<t.length;n+=1){let o=t[n];if(o==null)continue;let s=I(e,o,r);s&&(s.parentNode!==a&&a.appendChild(s),r+=1,i+=1)}return{element:e,nextIndex:r,appended:i}}function tt(e,t){let n=x(e);return L(n,t,0),n}function nt(e,t){let n=S(b,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return L(n,t,0),n}function rt(e,...t){return function(n,r=0){let i=n,a=i?Ye(i,e):null,o=a??x(e),s=o,c=a?s.childNodes.length:0;return L(o,t,r),a&&Xe(s,c),o}}function it(e,...t){return function(n,r=0){let i=n,a=i?Ye(i,e):null,o;if(a)o=a;else{let t=S(b,e);if(!t)throw Error(`Failed to create SVG element: ${e}`);o=t}let s=o,c=a?s.childNodes.length:0;return L(o,t,r),a&&Xe(s,c),o}}function at(e){return(...t)=>rt(e,...t)}function ot(e){return(...t)=>it(e,...t)}const R=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),z=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),st=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function ct(e,t){t in e&&typeof e[t]!=`function`||(e[t]=at(t))}function lt(e,t){let n=`${t}Svg`;n in e||(e[n]=ot(t))}function ut(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<z.length;t++)lt(e,z[t]);for(let t=0;t<R.length;t++)ct(e,R[t]);e[t]=!0}}function dt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function ft(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const B=new Map;function pt(e){return Array.isArray(e)?e:Array.from(e)}function mt(e,t,n){return dt(e.renderItem(t,n),e.host,n)}function ht(e){me(e.element);let t=e;t.element=null,t.item=null}function gt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=pt(e.itemsProvider());if(ft(e.lastSyncedItems,a))return;let o=new Map,s=new Map;for(let t=0;t<e.records.length;t++){let n=e.records[t],r=s.get(n.item);r?r.push(n):s.set(n.item,[n])}for(let t=0;t<a.length;t++){let n=a[t];if(t<e.lastSyncedItems.length&&e.lastSyncedItems[t]===n){let r=e.records[t];if(r&&r.item===n){o.set(t,r);let e=s.get(n);e.splice(e.indexOf(r),1),e.length===0&&s.delete(n)}}}let c=Array(a.length),l=new Set(e.records),u=r;for(let t=a.length-1;t>=0;t--){let n=a[t],r=o.get(t);if(!r){let e=s.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&s.delete(n))}if(r)l.delete(r);else{let i=mt(e,n,t);if(!i){c[t]=null;continue}r={item:n,element:i}}c[t]=r;let d=r.element;d.nextSibling!==u&&i.insertBefore(d,u),u=d}for(let e of l)ht(e);e.records=c.filter(e=>e!==null),e.lastSyncedItems=a.slice(),c.length===0&&(e.records=[],e.lastSyncedItems=[])}function _t(e,t,n,r){return N()?yt(e,t,n,r):vt(e,t,n,r)}function vt(e,t,n,r){let{start:i,end:a}=_e(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;if(s.appendChild(i),s.appendChild(a),gt(o),c){let e={runtime:o};B.set(new WeakRef(i),e)}return o}function yt(e,t,n,r){let i=n,a=P(i),o=i.childNodes[a];if(!o||o.nodeType!==8||!o.textContent?.startsWith(`list-start-`))return vt(e,t,n,r);let s=F(i),l=P(i);for(;l<i.childNodes.length;){let e=i.childNodes[l];if(e.nodeType===8&&e.textContent===`list-end`)break;l++}let u=i.childNodes[l],d=pt(e()),f=[];for(let e=0;e<d.length;e++){let r=dt(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}Je(i,l+1);let p={itemsProvider:e,renderItem:t,startMarker:s,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};if(c){let e={runtime:p};B.set(new WeakRef(s),e)}return p}function bt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function xt(e){let t=[];for(let[n,r]of B){let i=n.deref();if(!i||!T(i)||!T(r.runtime.endMarker)){bt(r.runtime),t.push(n);continue}e&&!e.contains(i)||gt(r.runtime)}for(let e of t)B.delete(e)}function St(e,t){return function(n,r){return _t(e,t,n,r).startMarker}}function Ct(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function wt(e,t){return typeof e==`function`?Ct(e,t):!!e}function Tt(e,t,n,r){return a(e)?o(e)?(j.delete(e),I(t,e,n)):je(t,r,()=>{let r=I(t,e,n);return r&&!r.parentNode?r:null}):I(t,e,n)}function Et(e,t,n,r){let i=[];for(let a of e){let e=Tt(a,t,n,r);e&&i.push(e)}return i}const V=new Map;function Dt(e,t){for(let t=0;t<e.length;t++)if(wt(e[t].condition))return t;return t.length>0?-1:null}function Ot(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Dt(t,n);o!==e.activeIndex&&(ve(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&ye(Et(o>=0?t[o].content:n,r,i,a),a))}function kt(e){let t={runtime:e};V.set(new WeakRef(e.startMarker),t)}function At(e){let t=[];for(let[n,r]of V){let i=n.deref();if(i===void 0){t.push(n);continue}if(!T(i)||!T(r.runtime.endMarker)){t.push(n);continue}if(!(e&&!e.contains(i)))try{r.runtime.update()}catch{t.push(n)}}for(let e of t)V.delete(e)}var jt=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?N()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=_e(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Ae(e);return a.appendChild(n),a.appendChild(r),Ot(i),n}hydrateRender(e,t){let n=e,r=P(n),i=n.childNodes[r];if(!i||i.nodeType!==8||!i.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let a=F(n),o=P(n);for(;o<n.childNodes.length;){let e=n.childNodes[o];if(e.nodeType===8&&e.textContent===`when-end`)break;o++}let s=n.childNodes[o],c=Dt([...this.groups],[...this.elseContent]);if(c!==null){let n=c>=0?this.groups[c].content:this.elseContent;for(let r of n)I(e,r,t)}return Je(n,o+1),this.createRuntimeFromMarkers(e,t,a,s,c),a}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Ot(a)}};return c&&kt(a),a}};function H(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return H(e.cloneWith({condition:t,content:n}))},else:function(...t){return H(e.cloneWith(void 0,t))}})}function Mt(e,...t){return H(new jt(e,...t))}function Nt(e){try{return e.isSvg?nt(e.tagName,e.modifiers):tt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=S(b,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=x(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Pt(e){let t=ue(e);if(!t)return;let n=Ct(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=Nt(t);se(n,t),xe(e,n)}else if(!n&&r){let n=ge(t.tagName);n&&(se(n,t),xe(e,n))}}function Ft(e){if(c)try{let t=le();for(let n of t){if(!n.isConnected){ce(n);continue}e&&!e.contains(n)||Pt(n)}}catch(e){s(`Error during conditional elements update`,e)}}function It(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}const U=new Map;function Lt(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function Rt(e,t){let n=U.get(e);n||(n=new Set,U.set(e,n)),n.add(new WeakRef(t))}function zt(e){let t=Lt(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=U.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!T(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&U.delete(e)}return Array.from(n)}function Bt(...e){let t=Lt(e);return function(e){if(c&&e instanceof Element)for(let n of t)Rt(n,e)}}const Vt=[xt,At,Ft,ke,Ue,It];function Ht(...e){let t;if(e.length>0){let n=zt(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of Vt)e(t)}function Ut(e,t,n=0){let r=e(t||document.body,n);return(t||document.body).appendChild(r),r}function Wt(e,t){let n=t||document.body;Ke();try{return e(n,0)}finally{qe()}}let Gt=null;function Kt(e){Gt=e}const W=new Map,G=new Map,K=new Set,q=[],J=new Map;let Y=null,X=null,Z=0;const Q=new Map;function qt(e){for(let t of e)J.has(t)||J.set(t,[])}function Jt(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Q.set(t,r),r}catch{return null}}function Yt(e,t){try{e.insertRule(t,Z),Z++}catch{}}function Xt(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Y&&X===document&&Y.ownerNode&&Y.ownerNode.isConnected)return Y;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Y=e.sheet,X=document,Q.clear(),Z=0,!Y)return null;for(let e of q)Yt(Y,e);for(let[e,t]of J){let n=Jt(Y,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Y}function Zt(e,t){if(t===void 0)q.push(e);else{let n=J.get(t);n||(n=[],J.set(t,n)),n.push(e)}Gt?.(t===void 0?e:t+`{`+e+`}`);let n=Xt();if(n)if(t===void 0)Yt(n,e);else{let r=Q.get(t)??Jt(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function Qt(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function $(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=W.get(i);return a===void 0?(a=`n`+Qt(i),W.set(i,a),G.set(a,(e??``)+`|`+t+`|`+n),Zt(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Xt(),a)}function $t(e){return G.get(e)}function en(e,t){if(K.has(e)){Xt();return}K.add(e),Zt(t,void 0)}function tn(){let e=q.join(``);for(let[t,n]of J)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return e}function nn(){W.clear(),G.clear(),K.clear(),q.length=0,J.clear(),Q.clear(),Z=0,Y=null,X=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const rn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},an={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},on={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},sn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},cn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),ln=new Map;function un(e){let t=ln.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),ln.set(e,t)),t}function dn(e){return e.charCodeAt(0)===64?e:`@media `+e}function fn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function pn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function mn(...e){let t=new Map;for(let n of e){if(!n)continue;let e=(typeof n==`string`?n:n.className).split(` `);for(let n of e)n&&t.set($t(n)??n,n)}let n=``;for(let e of t.values())n+=(n?` `:``)+e;return pn(n)}function hn(e={}){let t=e.screens??{};qt(Object.values(t).map(dn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||cn.has(t)?String(n):n+`px`;let r=sn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push($(n,a,t,r(t,e[t])));continue}let e=rn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,fn(n,dn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,fn(n,s),a,o);continue}continue}if(c===!0){let e=on[s];if(e)for(let t in e)o.push($(n,a,t,e[t]));continue}let l=an[s];if(l!==void 0)for(let e of l)o.push($(n,a,e,r(e,c)));else{let e=un(s);o.push($(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=pn(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=on[t];if(e)for(let t in e)n(t,e[t]);continue}let a=an[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=un(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+Qt(t);return en(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;en(`g|`+n,n)}return{css:a,cx:mn,keyframes:s,globalStyle:c,theme:e}}const gn=hn({}),_n=gn.css,vn=gn.keyframes,yn=gn.globalStyle;function bn(){ut();let e=globalThis;e.list=St,e.update=Ht,e.when=Mt,e.on=p,e.scope=Bt,e.render=Ut,e.hydrate=Wt,e.createCss=hn,e.css=_n,e.cx=mn,e.keyframes=vn,e.globalStyle=yn}bn(),exports.HTML_TAGS=R,exports.SELF_CLOSING_TAGS=st,exports.SVG_TAGS=z,exports.appendChildren=be,exports.applyAttributes=A,exports.applyNodeModifier=I,exports.createComment=w,exports.createConditionalComment=ge,exports.createCss=hn,exports.createHtmlElementWithModifiers=tt,exports.createHtmlTagBuilder=at,exports.createSvgElementWithModifiers=nt,exports.createSvgTagBuilder=ot,exports.css=_n,exports.cx=mn,exports.getCssText=tn,exports.globalStyle=yn,exports.hydrate=Wt,exports.initializeRuntime=bn,exports.isBoolean=i,exports.isBrowser=c,exports.isFunction=a,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.isZeroArityFunction=o,exports.keyframes=vn,exports.list=St,exports.on=p,exports.registerGlobalTagBuilders=ut,exports.render=Ut,exports.replaceNodeSafely=xe,exports.resetStyles=nn,exports.scope=Bt,exports.setSSRCollector=Kt,exports.update=Ht,exports.when=Mt;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t,n,r,i,a){let o=l.get(e);o||(o=new Map,l.set(e,o));let s=o.get(t);s||(s=new Set,o.set(t,s)),s.add({original:n,wrapped:r,options:i,controller:a})}function d(e,t,n){n.controller?n.controller.abort():e.removeEventListener(t,n.wrapped,n.options)}function f(e,t){let n=l.get(e);if(n)if(t){let r=n.get(t);if(r){for(let n of r)d(e,t,n);n.delete(t)}}else{for(let[t,r]of n)for(let n of r)d(e,t,n);l.delete(e)}}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=new AbortController,o=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}},l=typeof n==`boolean`?{capture:n,signal:a.signal}:{...n||{},signal:a.signal};i.addEventListener(e,o,l),u(i,e,t,o,n,a)}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap,ee=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{m.delete(e)}):null,te=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{g.delete(e)}):null;function ne(e,t){let n=h.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);m.add(r),h.set(e,{ref:r,info:t}),ee?.register(e,r)}function re(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t}),te?.register(e,n)}function ie(e){m.delete(e)}function ae(e){g.delete(e)}function oe(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function se(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const ce=new WeakMap,v=new Set,le=new WeakMap,ue=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{v.delete(e)}):null;function de(e,t){ce.set(e,t);let n=new WeakRef(e);v.add(n),le.set(e,n),ue?.register(e,n)}function y(e){ce.delete(e);let t=le.get(e);t&&(v.delete(t),le.delete(e))}function fe(){let e=[],t=[];for(let n of v){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)v.delete(e);return e}function pe(e){return ce.get(e)??null}const me=`http://www.w3.org/2000/svg`;function b(e){return globalThis.document?document.createElement(e):null}function he(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function ge(){return globalThis.document?document.createDocumentFragment():null}function _e(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ve(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),se(t),y(t)}else e.nodeType===Node.TEXT_NODE?oe(e):e.nodeType===Node.COMMENT_NODE&&y(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ve(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ve(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function ye(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function be(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function xe(e,t){let n=C(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=C(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Se(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function Ce(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)ye(n,e[r],t)}function we(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=x(r);if(e)t=e;else continue}else t=r;_e(e,t)}}return e}function w(e){return e?e.isConnected===!0:!1}function Te(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}const Ee={};let De=!1;function Oe(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(w(n)?Ne(e.info):(ae(e.ref),_.delete(n)))}n=n.parentNode}}function ke(){De||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Oe,!0),De=!0)}function Ae(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return re(e,n),n}function je(e){return typeof e!=`object`||!e}function Me(e,t){let n;try{n=t.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e}`,t);return}let r=je(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:Ee}catch(t){s(`Failed to apply reactive attribute: ${e}`,t)}}function Ne(e){for(let[t,n]of e.attributeResolvers)Me(t,n)}function T(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:Ee};if(!c){Me(t,i);return}ke(),Ae(e).attributeResolvers.set(t,i),Me(t,i)}function Pe(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}if(!w(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Ne(i.info)}for(let e of t)ae(e)}function Fe(e){return e}function Ie(e,t,n){let r=Fe(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function Le(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}function Re(e,t){if(!(!e?.style||!t))for(let n in t)Le(e,n,t[n])||s(`Failed to set style property '${n}'`)}function ze(e,t){e&&(a(t)?T(e,`style`,t,function(t){Re(e,t)}):Re(e,t))}const E=new WeakMap,Be=new WeakSet;function D(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Ve(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function He(e){if(!E.has(e)){let t=new Set;e.className&&D(t,e.className),E.set(e,t)}Be.add(e)}function Ue(e){return Be.has(e)}function We(e,t){if(!t)return;let n=E.get(e);n||(n=new Set,E.set(e,n)),D(n,t)}function Ge(e,t){let n=E.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=Ve(n);return}let r=Ve(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Ke(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;D(r,n),D(r,t),e.className=Ve(r)}else e.className=t}function qe(e,t){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=x(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=x(r);if(!i)throw Error(`Failed to create text node: document not available`);return c&&ne(i,{resolver:e,lastValue:r}),i}function Je(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!w(r)){h.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)ie(e)}function Ye(e,t,n,r=!1){if(n==null)return;if(t===`style`){ze(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){Ke(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(a(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(He(e),T(e,String(t),r,function(t){Ge(e,String(t||``))})):T(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&Ue(e)){let t=String(n||``);t&&(We(e,t),Ke(e,t));return}i(n,r)}}function O(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ye(e,r,i,n&&r===`className`)}}const k=new WeakMap;let A=!1,j=new WeakMap;function M(){return A}function Xe(){A=!0,j=new WeakMap}function Ze(){A=!1}function Qe(e){let t=A;A=!1;try{return e()}finally{A=t}}function N(e){let t=j.get(e);return t===void 0?e.firstChild:t}function P(e,t){j.set(e,t)}function $e(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function F(e){let t=N(e),n=!1;for(;t&&$e(t);)t=t.nextSibling,n=!0;n&&P(e,t)}function I(e){let t=N(e);return t&&P(e,t.nextSibling),t}function et(e,t){if(!A)return null;F(e);let n=N(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?I(e):null}function tt(e,t){if(!t)return;let n=N(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}P(e,null)}function nt(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function rt(e){F(e);let t=N(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function it(e,t){let n=N(e);if(n&&n.nodeType===3)return I(e),n.textContent!==t&&(n.textContent=t),n;let r=x(t);return r?(e.insertBefore(r,n),P(e,n),r):null}function L(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=k.get(i);if(t||(t={value:i(),error:!1},k.set(i,t)),t.error)return at(c,()=>``);let n=t.value;if(nt(n))return O(r,{className:()=>{let e=i();return nt(e)?e.className:``}}),null;if(e(n)&&n!=null){if(M()&&rt(r)){let e=r;I(e);let t=String(n),a=it(e,t);return a&&ne(a,{resolver:i,lastValue:t}),null}return at(c,i,n)}return null}catch(e){return k.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),at(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?ot(c,a):t(a)?a:(n(a)&&O(r,a),null)}let l=i;if(e(l)){if(M()&&rt(r)){let e=r;return I(e),it(e,String(l)),null}return ot(c,l)}return t(l)?l:(O(r,l),null)}function at(e,t,n){let r=ge();if(!r)throw Error(`Failed to create document fragment: document not available`);let i=C(` text-${e} `);i&&r.appendChild(i);let a=qe(t,n);return r.appendChild(a),r}function ot(e,t){let n=ge();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=C(` text-${e} `);r&&n.appendChild(r);let i=x(String(t));return i&&n.appendChild(i),n}function R(e,t,n=0){if(!t||t.length===0)return{element:e,nextIndex:n,appended:0};let r=n,i=0,a=e;for(let n=0;n<t.length;n+=1){let o=t[n];if(o==null)continue;let s=L(e,o,r);s&&(s.parentNode!==a&&a.appendChild(s),r+=1,i+=1)}return{element:e,nextIndex:r,appended:i}}function st(e,t){let n=b(e);return R(n,t,0),n}function ct(e,t){let n=he(me,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return R(n,t,0),n}function lt(e,...t){return function(n,r=0){let i=n,a=i?et(i,e):null,o=a??b(e),s=o,c=a?s.lastChild:null;return R(o,t,r),a&&tt(s,c),o}}function ut(e,...t){return function(n,r=0){let i=n,a=i?et(i,e):null,o;if(a)o=a;else{let t=he(me,e);if(!t)throw Error(`Failed to create SVG element: ${e}`);o=t}let s=o,c=a?s.lastChild:null;return R(o,t,r),a&&tt(s,c),o}}function dt(e){return(...t)=>lt(e,...t)}function ft(e){return(...t)=>ut(e,...t)}const pt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),z=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),mt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function ht(e,t){t in e&&typeof e[t]!=`function`||(e[t]=dt(t))}function gt(e,t){let n=`${t}Svg`;n in e||(e[n]=ft(t))}function _t(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<z.length;t++)gt(e,z[t]);for(let t=0;t<pt.length;t++)ht(e,pt[t]);e[t]=!0}}function vt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function yt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const B=new Set,V=new WeakMap,bt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{B.delete(e)}):null;function xt(e,t){let n=new WeakRef(e);B.add(n),V.set(e,t),bt?.register(e,n)}function St(e){return Array.isArray(e)?e:Array.from(e)}function Ct(e,t,n){return vt(e.renderItem(t,n),e.host,n)}function wt(e){S(e.element);let t=e;t.element=null,t.item=null}function Tt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=St(e.itemsProvider());if(yt(e.lastSyncedItems,a))return;let o=new Map,s=new Map;for(let t=0;t<e.records.length;t++){let n=e.records[t],r=s.get(n.item);r?r.push(n):s.set(n.item,[n])}for(let t=0;t<a.length;t++){let n=a[t];if(t<e.lastSyncedItems.length&&e.lastSyncedItems[t]===n){let r=e.records[t];if(r&&r.item===n){o.set(t,r);let e=s.get(n);e.splice(e.indexOf(r),1),e.length===0&&s.delete(n)}}}let c=Array(a.length),l=new Set(e.records);for(let t=a.length-1;t>=0;t--){let n=a[t],r=o.get(t);if(!r){let e=s.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&s.delete(n))}if(r)l.delete(r);else{let i=Ct(e,n,t);if(!i){c[t]=null;continue}r={item:n,element:i}}c[t]=r}for(let e of l)wt(e);let u=r;for(let e=a.length-1;e>=0;e--){let t=c[e];if(!t)continue;let n=t.element;n.nextSibling!==u&&i.insertBefore(n,u),u=n}e.records=c.filter(e=>e!==null),e.lastSyncedItems=a.slice(),c.length===0&&(e.records=[],e.lastSyncedItems=[])}function Et(e,t,n,r){return M()?Dt(e,t,n,r):H(e,t,n,r)}function H(e,t,n,r){let{start:i,end:a}=xe(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Tt(o),c&&xt(i,o),o}function Dt(e,t,n,r){let i=n;F(i);let a=N(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return H(e,t,n,r);let o=I(i),s=0,l=N(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=C(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return H(e,t,n,r);let d=St(e()),f=[];for(let e=0;e<d.length;e++){let r=vt(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}let p=N(i);for(;p&&p!==u;){let e=p.nextSibling;S(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}P(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&xt(o,h),h}function Ot(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function kt(e){let t=[];for(let n of B){let r=n.deref();if(!r){t.push(n);continue}let i=V.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Ot(i),V.delete(r),t.push(n);continue}e&&!e.contains(r)||Tt(i)}for(let e of t)B.delete(e)}function At(e,t){return function(n,r){return Et(e,t,n,r).startMarker}}function jt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Mt(e,t){return typeof e==`function`?jt(e,t):!!e}function Nt(e,t,n,r){return a(e)?o(e)?(k.delete(e),L(t,e,n)):Ie(t,r,()=>{let r=L(t,e,n);return r&&!r.parentNode?r:null}):L(t,e,n)}function Pt(e,t,n,r){let i=[];for(let a of e){let e=Nt(a,t,n,r);e&&i.push(e)}return i}const U=new Set,W=new WeakMap,Ft=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{U.delete(e)}):null;function It(e,t){for(let t=0;t<e.length;t++)if(Mt(e[t].condition))return t;return t.length>0?-1:null}function Lt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=It(t,n);o!==e.activeIndex&&(Se(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&Ce(Pt(o>=0?t[o].content:n,r,i,a),a))}function Rt(e){let t=new WeakRef(e.startMarker);U.add(t),W.set(e.startMarker,e),Ft?.register(e.startMarker,t)}function zt(e){let t=[];for(let n of U){let r=n.deref();if(r===void 0){t.push(n);continue}let i=W.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){W.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch{W.delete(r),t.push(n)}}for(let e of t)U.delete(e)}function Bt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Vt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Ht=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?M()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=xe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Fe(e);return a.appendChild(n),a.appendChild(r),Lt(i),n.textContent=Bt(t,i.activeIndex),n}hydrateRender(e,t){let n=e;F(n);let r=N(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=I(n),a=0,o=N(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=C(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=It(this.groups,this.elseContent),u=Vt(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)L(e,r,t)}}else if(Se(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Qe(()=>{Ce(Pt(n,e,t,r),r)})}return P(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Lt(a)}};return c&&Rt(a),a}};function G(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return G(e.cloneWith({condition:t,content:n}))},else:function(...t){return G(e.cloneWith(void 0,t))}})}function Ut(e,...t){return G(new Ht(e,...t))}function Wt(e){try{return e.isSvg?ct(e.tagName,e.modifiers):st(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=he(me,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=b(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Gt(e){let t=pe(e);if(!t)return;let n=jt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=Wt(t);de(n,t),Te(e,n)}else if(!n&&r){let n=be(t.tagName);n&&(de(n,t),Te(e,n))}}function Kt(e){if(c)try{let t=fe();for(let n of t){if(!n.isConnected){y(n);continue}e&&!e.contains(n)||Gt(n)}}catch(e){s(`Error during conditional elements update`,e)}}function qt(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}const K=new Map;function Jt(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function Yt(e,t){let n=K.get(e);n||(n=new Set,K.set(e,n)),n.add(new WeakRef(t))}function Xt(e){let t=Jt(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=K.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!w(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&K.delete(e)}return Array.from(n)}function Zt(...e){let t=Jt(e);return function(e){if(c&&e instanceof Element)for(let n of t)Yt(n,e)}}const Qt=[kt,zt,Kt,Pe,Je,qt];function $t(...e){let t;if(e.length>0){let n=Xt(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of Qt)e(t)}function en(e,t,n=0){let r=e(t||document.body,n);return(t||document.body).appendChild(r),r}function tn(e,t){let n=t||document.body,r=n;Xe();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=N(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),S(e),P(r,t)}else r.appendChild(i),P(r,null)}return t}finally{Ze()}}let nn=null;function rn(e){nn=e}const an=new Map,on=new Map,sn=new Set,q=[],J=new Map;let Y=null,X=null,Z=0;const Q=new Map;function cn(e){for(let t of e)J.has(t)||J.set(t,[])}function ln(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Q.set(t,r),r}catch{return null}}function un(e,t){try{e.insertRule(t,Z),Z++}catch{}}function dn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Y&&X===document&&Y.ownerNode&&Y.ownerNode.isConnected)return Y;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Y=e.sheet,X=document,Q.clear(),Z=0,!Y)return null;for(let e of q)un(Y,e);for(let[e,t]of J){let n=ln(Y,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Y}function fn(e,t){if(t===void 0)q.push(e);else{let n=J.get(t);n||(n=[],J.set(t,n)),n.push(e)}nn?.(t===void 0?e:t+`{`+e+`}`);let n=dn();if(n)if(t===void 0)un(n,e);else{let r=Q.get(t)??ln(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function pn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function $(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=an.get(i);return a===void 0?(a=`n`+pn(i),an.set(i,a),on.set(a,(e??``)+`|`+t+`|`+n),fn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(dn(),a)}function mn(e){return on.get(e)}function hn(e,t){if(sn.has(e)){dn();return}sn.add(e),fn(t,void 0)}function gn(){let e=q.join(``);for(let[t,n]of J)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return e}function _n(){an.clear(),on.clear(),sn.clear(),q.length=0,J.clear(),Q.clear(),Z=0,Y=null,X=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const vn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},yn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},bn={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},xn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Sn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Cn=new Map;function wn(e){let t=Cn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Cn.set(e,t)),t}function Tn(e){return e.charCodeAt(0)===64?e:`@media `+e}function En(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Dn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function On(...e){let t=new Map;for(let n of e){if(!n)continue;let e=(typeof n==`string`?n:n.className).split(` `);for(let n of e)n&&t.set(mn(n)??n,n)}let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Dn(n)}function kn(e={}){let t=e.screens??{};cn(Object.values(t).map(Tn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Sn.has(t)?String(n):n+`px`;let r=xn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push($(n,a,t,r(t,e[t])));continue}let e=vn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,En(n,Tn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,En(n,s),a,o);continue}continue}if(c===!0){let e=bn[s];if(e)for(let t in e)o.push($(n,a,t,e[t]));continue}let l=yn[s];if(l!==void 0)for(let e of l)o.push($(n,a,e,r(e,c)));else{let e=wn(s);o.push($(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=Dn(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=bn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=yn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=wn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+pn(t);return hn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;hn(`g|`+n,n)}return{css:a,cx:On,keyframes:s,globalStyle:c,theme:e}}const An=kn({}),jn=An.css,Mn=An.keyframes,Nn=An.globalStyle;function Pn(){_t();let e=globalThis;e.list=At,e.update=$t,e.when=Ut,e.on=p,e.scope=Zt,e.render=en,e.hydrate=tn,e.createCss=kn,e.css=jn,e.cx=On,e.keyframes=Mn,e.globalStyle=Nn}Pn(),exports.HTML_TAGS=pt,exports.SELF_CLOSING_TAGS=mt,exports.SVG_TAGS=z,exports.appendChildren=we,exports.applyAttributes=O,exports.applyNodeModifier=L,exports.createComment=C,exports.createConditionalComment=be,exports.createCss=kn,exports.createHtmlElementWithModifiers=st,exports.createHtmlTagBuilder=dt,exports.createSvgElementWithModifiers=ct,exports.createSvgTagBuilder=ft,exports.css=jn,exports.cx=On,exports.getCssText=gn,exports.globalStyle=Nn,exports.hydrate=tn,exports.initializeRuntime=Pn,exports.isBoolean=i,exports.isBrowser=c,exports.isFunction=a,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.isZeroArityFunction=o,exports.keyframes=Mn,exports.list=At,exports.on=p,exports.registerGlobalTagBuilders=_t,exports.render=en,exports.replaceNodeSafely=Te,exports.resetStyles=_n,exports.scope=Zt,exports.setSSRCollector=rn,exports.update=$t,exports.when=Ut;
2
2
  //# sourceMappingURL=nuclo.cjs.map