nuclo 0.1.43 → 0.1.45

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":"conditionalRenderer.d.ts","sourceRoot":"","sources":["../../src/core/conditionalRenderer.ts"],"names":[],"mappings":"AAMA,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,cAAc,EACtE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,MAAM,OAAO,EACxB,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,GACxD,eAAe,CAAC,QAAQ,CAAC,GAAG,OAAO,CAoBrC;AAWD,wBAAgB,2BAA2B,CAAC,QAAQ,SAAS,cAAc,EACzE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,GACxD;IACD,SAAS,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;CAChE,CAWA"}
1
+ {"version":3,"file":"conditionalRenderer.d.ts","sourceRoot":"","sources":["../../src/core/conditionalRenderer.ts"],"names":[],"mappings":"AAOA,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,cAAc,EACtE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,MAAM,OAAO,EACxB,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,GACxD,eAAe,CAAC,QAAQ,CAAC,GAAG,OAAO,CAuBrC;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,SAAS,cAAc,EACzE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,GACxD;IACD,SAAS,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;CAChE,CAWA"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalUpdater.d.ts","sourceRoot":"","sources":["../../src/core/conditionalUpdater.ts"],"names":[],"mappings":"AA8DA,wBAAgB,yBAAyB,IAAI,IAAI,CAchD"}
1
+ {"version":3,"file":"conditionalUpdater.d.ts","sourceRoot":"","sources":["../../src/core/conditionalUpdater.ts"],"names":[],"mappings":"AAiDA,wBAAgB,yBAAyB,IAAI,IAAI,CAchD"}
@@ -1 +1 @@
1
- {"version":3,"file":"modifierProcessor.d.ts","sourceRoot":"","sources":["../../src/core/modifierProcessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACrE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AAExB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,EAC/D,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACZ,IAAI,GAAG,IAAI,CAoDb"}
1
+ {"version":3,"file":"modifierProcessor.d.ts","sourceRoot":"","sources":["../../src/core/modifierProcessor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACrE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AAExB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,EAC/D,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACZ,IAAI,GAAG,IAAI,CAoDb"}
@@ -1,8 +1,80 @@
1
1
  type TextResolver = () => Primitive;
2
2
  type AttributeResolver = () => unknown;
3
+ /**
4
+ * Creates a reactive text node that automatically updates when its resolver function changes.
5
+ *
6
+ * The text node will be registered for reactive updates and its content will be synchronized
7
+ * whenever notifyReactiveTextNodes() is called.
8
+ *
9
+ * @param resolver - Function that returns the text content (string, number, boolean, etc.)
10
+ * @param preEvaluated - Optional pre-evaluated value to avoid calling resolver immediately
11
+ * @returns A Text node that will reactively update its content
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const count = signal(0);
16
+ * const textNode = createReactiveTextNode(() => `Count: ${count.value}`);
17
+ * // Later, when count changes and notifyReactiveTextNodes() is called,
18
+ * // the text content automatically updates
19
+ * ```
20
+ */
3
21
  export declare function createReactiveTextNode(resolver: TextResolver, preEvaluated?: unknown): Text | DocumentFragment;
22
+ /**
23
+ * Registers a reactive attribute resolver for an element.
24
+ *
25
+ * The resolver will be called whenever the element receives an 'update' event,
26
+ * allowing attributes to reactively update based on application state.
27
+ *
28
+ * @param element - The DOM element to make reactive
29
+ * @param key - The attribute name being made reactive (e.g., 'class', 'style', 'disabled')
30
+ * @param resolver - Function that returns the new attribute value
31
+ * @param applyValue - Callback that applies the resolved value to the element
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const isActive = signal(false);
36
+ * const button = document.createElement('button');
37
+ * registerAttributeResolver(
38
+ * button,
39
+ * 'class',
40
+ * () => isActive.value ? 'active' : 'inactive',
41
+ * (value) => button.className = String(value)
42
+ * );
43
+ * ```
44
+ */
4
45
  export declare function registerAttributeResolver<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, key: string, resolver: AttributeResolver, applyValue: (value: unknown) => void): void;
46
+ /**
47
+ * Updates all registered reactive text nodes.
48
+ *
49
+ * Iterates through all reactive text nodes, re-evaluates their resolver functions,
50
+ * and updates their content if it has changed. Automatically cleans up disconnected nodes.
51
+ *
52
+ * This function should be called after state changes to synchronize the DOM with application state.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * // After updating application state
57
+ * count.value++;
58
+ * notifyReactiveTextNodes(); // All reactive text nodes update
59
+ * ```
60
+ */
5
61
  export declare function notifyReactiveTextNodes(): void;
62
+ /**
63
+ * Updates all registered reactive elements by re-evaluating their attribute resolvers.
64
+ *
65
+ * Iterates through all reactive elements and triggers their registered attribute resolvers
66
+ * to update. Automatically cleans up disconnected elements and their event listeners.
67
+ *
68
+ * This function should be called after state changes to synchronize element attributes
69
+ * with application state.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * // After updating application state
74
+ * isActive.value = true;
75
+ * notifyReactiveElements(); // All reactive attributes update
76
+ * ```
77
+ */
6
78
  export declare function notifyReactiveElements(): void;
7
79
  export {};
8
80
  //# sourceMappingURL=reactive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactive.d.ts","sourceRoot":"","sources":["../../src/core/reactive.ts"],"names":[],"mappings":"AAGA,KAAK,YAAY,GAAG,MAAM,SAAS,CAAC;AACpC,KAAK,iBAAiB,GAAG,MAAM,OAAO,CAAC;AAuCvC,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAY9G;AAED,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,CAmBN;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAiB9C;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
1
+ {"version":3,"file":"reactive.d.ts","sourceRoot":"","sources":["../../src/core/reactive.ts"],"names":[],"mappings":"AAGA,KAAK,YAAY,GAAG,MAAM,SAAS,CAAC;AACpC,KAAK,iBAAiB,GAAG,MAAM,OAAO,CAAC;AAuCvC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAY9G;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;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,CAmBN;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAiB9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"styleManager.d.ts","sourceRoot":"","sources":["../../src/core/styleManager.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACpD,KAAK,aAAa,GAAG,MAAM,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,cAAc,EAChE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GACzC,IAAI,CAeN;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,cAAc,EACjE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,UAAU,EAAE,eAAe,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,GAC7D,IAAI,CAgBN"}
1
+ {"version":3,"file":"styleManager.d.ts","sourceRoot":"","sources":["../../src/core/styleManager.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACpD,KAAK,aAAa,GAAG,MAAM,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,cAAc,EAChE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GACzC,IAAI,CAeN;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,cAAc,EACjE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,UAAU,EAAE,eAAe,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,GAC7D,IAAI,CAiBN"}
package/dist/index.d.ts CHANGED
@@ -6,10 +6,11 @@ export { list } from "./list";
6
6
  export { when } from "./when";
7
7
  export { update } from "./core/updateController";
8
8
  export { applyAttributes } from "./core/attributeManager";
9
- export { appendChildren } from "./utility/dom";
9
+ export { appendChildren, createComment, createConditionalComment, replaceNodeSafely } from "./utility/dom";
10
10
  export { on } from "./utility/on";
11
11
  export { render } from "./utility/render";
12
- export { isBoolean, isFunction, isNode, isObject, isPrimitive, isTagLike } from "./utility/typeGuards";
12
+ export { isBoolean, isFunction, isNode, isObject, isPrimitive, isTagLike, isZeroArityFunction } from "./utility/typeGuards";
13
13
  export { isBrowser } from "./utility/environment";
14
+ export { createElementWithModifiers } from "./internal/applyModifiers";
14
15
  import "./core/runtimeBootstrap";
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5H,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,yBAAyB,CAAC"}
@@ -25,4 +25,9 @@ export declare function applyModifiers<TTagName extends ElementTagName>(element:
25
25
  * Discards meta information.
26
26
  */
27
27
  export declare function applyModifiersAndReturn<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, modifiers: ReadonlyArray<NodeModifier<TTagName>>, startIndex?: number): ExpandedElement<TTagName>;
28
+ /**
29
+ * Creates an element with the specified tag name and applies modifiers to it.
30
+ * Centralizes element creation logic used across conditionalRenderer and conditionalUpdater.
31
+ */
32
+ export declare function createElementWithModifiers<TTagName extends ElementTagName>(tagName: TTagName, modifiers: ReadonlyArray<NodeModifier<TTagName>>): ExpandedElement<TTagName>;
28
33
  //# sourceMappingURL=applyModifiers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"applyModifiers.d.ts","sourceRoot":"","sources":["../../src/internal/applyModifiers.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACrE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AAExB,MAAM,WAAW,oBAAoB,CAAC,QAAQ,SAAS,cAAc;IACnE;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,SAAS,cAAc,EAC5D,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAChD,UAAU,SAAI,GACb,oBAAoB,CAAC,QAAQ,CAAC,CA8BhC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,cAAc,EACrE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAChD,UAAU,SAAI,GACb,eAAe,CAAC,QAAQ,CAAC,CAG3B"}
1
+ {"version":3,"file":"applyModifiers.d.ts","sourceRoot":"","sources":["../../src/internal/applyModifiers.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACrE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AAExB,MAAM,WAAW,oBAAoB,CAAC,QAAQ,SAAS,cAAc;IACnE;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,SAAS,cAAc,EAC5D,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAChD,UAAU,SAAI,GACb,oBAAoB,CAAC,QAAQ,CAAC,CA8BhC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,cAAc,EACrE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAChD,UAAU,SAAI,GACb,eAAe,CAAC,QAAQ,CAAC,CAG3B;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,SAAS,cAAc,EACxE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GAC/C,eAAe,CAAC,QAAQ,CAAC,CAI3B"}
package/dist/nuclo.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function t(e){return e instanceof Node}function n(e){return"object"==typeof e&&null!==e}function r(e){return n(e)&&"tagName"in e}function o(e){return"function"==typeof e}function i(e,t){"undefined"!=typeof console&&console.error(`nuclo: ${e}`,t)}function c(e,t){try{return e()}catch(e){return i("Operation failed",e),t}}const u="undefined"!=typeof window&&"undefined"!=typeof document;function s(e){if(!e?.parentNode)return!1;try{return e.parentNode.removeChild(e),!0}catch{return!1}}function a(e){if(!u)return null;try{return document.createComment(e)}catch{return null}}function l(e){if(!u)throw new Error("Cannot create comment in non-browser environment");const t=a(`${e}-${Math.random().toString(36).slice(2)}`);if(!t)throw new Error("Failed to create comment");return t}function d(e){const t=a(`${e}-end`);if(!t)throw new Error("Failed to create end comment");return{start:l(`${e}-start`),end:t}}function f(e){return!!e&&("boolean"==typeof e.isConnected?e.isConnected:document.contains(e))}const p=new Map,h=new Map;function m(e,t){t.attributeResolvers.forEach(({resolver:e,applyValue:t},n)=>{try{t(c(e))}catch(e){i(`Failed to update reactive attribute: ${n}`,e)}})}function g(e,t,n,r){if(!(e instanceof Element&&t&&"function"==typeof n))return void i("Invalid parameters for registerAttributeResolver");const o=function(e){let t=h.get(e);return t||(t={attributeResolvers:new Map},h.set(e,t)),t}(e);o.attributeResolvers.set(t,{resolver:n,applyValue:r});try{r(c(n))}catch(e){i("Failed to apply initial attribute value",e)}if(!o.updateListener){const t=()=>m(0,o);e.addEventListener("update",t),o.updateListener=t}}function y(e,t){if(e?.style&&t)for(const[n,r]of Object.entries(t))if(null==r||""===r)e.style.removeProperty(n),e.style[n]="";else try{e.style[n]=String(r)}catch{}}function b(e,t,n){if(null==n)return;if("style"===t)return i=n,void((r=e)&&(o(i)?g(r,"style",()=>{try{return i()}catch{return null}},e=>{y(r,e)}):y(r,i)));var r,i;const c=n=>{null!=n&&(t in e?e[t]=n:e instanceof Element&&e.setAttribute(String(t),String(n)))};o(n)&&0===n.length?g(e,String(t),n,c):c(n)}function v(e,t){if(t)for(const n of Object.keys(t)){b(e,n,t[n])}}const x=new WeakMap;function C(e){const{value:t,error:n}=function(e){const t=x.get(e);if(t)return t;try{const t={value:e(),error:!1};return x.set(e,t),t}catch{const t={value:void 0,error:!0};return x.set(e,t),t}}(e);return!n&&"boolean"==typeof t}function E(e,r,i){if(!o(e)||0!==e.length||!C(e))return!1;const c=r.filter((e,t)=>t!==i);if(0===c.length)return!1;return c.some(e=>n(e)||t(e)||o(e)&&e.length>0)}function w(r,c,u){if(null==c)return null;if(o(c)){if(0===c.length)try{let t=x.get(c);if(!t){t={value:c(),error:!1},x.set(c,t)}if(t.error)return M(u,()=>"");const n=t.value;return e(n)&&null!=n?M(u,c,n):null}catch(e){return x.set(c,{value:void 0,error:!0}),i("Error evaluating reactive text function:",e),M(u,()=>"")}const o=c(r,u);return null==o?null:e(o)?S(u,o):t(o)?o:(n(o)&&v(r,o),null)}const s=c;return null==s?null:e(s)?S(u,s):t(s)?s:(n(s)&&v(r,s),null)}function M(e,t,n){const r=document.createDocumentFragment(),o=document.createComment(` text-${e} `),u=function(e,t){if("function"!=typeof e)return i("Invalid resolver provided to createReactiveTextNode"),document.createTextNode("");const n=arguments.length>1?t:c(e,""),r=void 0===n?"":String(n),o=document.createTextNode(r);return p.set(o,{resolver:e,lastValue:r}),o}(t,n);return r.appendChild(o),r.appendChild(u),r}function S(e,t){const n=document.createDocumentFragment(),r=document.createComment(` text-${e} `),o=document.createTextNode(String(t));return n.appendChild(r),n.appendChild(o),n}const N=new Set;function k(e,t){e._conditionalInfo=t,N.add(e)}function T(e,t,n=0){if(!t||0===t.length)return{element:e,nextIndex:n,appended:0};let r=n,o=0;const i=e;for(let n=0;n<t.length;n+=1){const c=t[n];if(null==c)continue;const u=w(e,c,r);u&&(u.parentNode!==i&&i.appendChild(u),r+=1,o+=1)}return{element:e,nextIndex:r,appended:o}}function I(e,t){const n=document.createElement(e);return T(n,t,0),n}function L(e){const t=function(e){for(let t=0;t<e.length;t+=1)if(E(e[t],e,t))return t;return-1}(e);return-1===t?{condition:null,otherModifiers:e}:{condition:e[t],otherModifiers:e.filter((e,n)=>n!==t)}}function F(e,...t){return(n,r)=>{const{condition:o,otherModifiers:i}=L(t);if(o)return function(e,t,n){const r=t();if(!u)return r?I(e,n):document.createComment(`conditional-${e}-ssr`);const o={condition:t,tagName:e,modifiers:n};if(r){const t=I(e,n);return k(t,o),t}const i=document.createComment(`conditional-${e}-hidden`);return k(i,o),i}(e,o,i);const c=document.createElement(e);return T(c,i,r),c}}function $(e){return(...t)=>F(e,...t)}const B=["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"];function _(e=globalThis){const t="__nuclo_tags_registered";e[t]||(B.forEach(t=>function(e,t){t in e||(e[t]=$(t))}(e,t)),e[t]=!0)}const G=new Set;function O(e,t,n){return function(e,t,n){if(o(e)){const o=e(t,n);return o&&r(o)?o:null}return e&&r(e)?e:null}(e.renderItem(t,n),e.host,n)}function j(e){s(e.element)}function A(e){const{host:t,startMarker:n,endMarker:r}=e,o=n.parentNode??t,i=e.itemsProvider();if(function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if((n in e?e[n]:void 0)!==(n in t?t[n]:void 0))return!1;return!0}(e.lastSyncedItems,i))return;const c=new Map,u=new Map;e.records.forEach(e=>{const t=u.get(e.item);t?t.push(e):u.set(e.item,[e])}),i.forEach((t,n)=>{if(n<e.lastSyncedItems.length&&e.lastSyncedItems[n]===t){const r=e.records[n];if(r&&r.item===t){c.set(n,r);const e=u.get(t);if(e){const n=e.indexOf(r);n>=0&&(e.splice(n,1),0===e.length&&u.delete(t))}}}});const s=[],a=new Set(e.records);let l=r;for(let t=i.length-1;t>=0;t--){const n=i[t];let r=c.get(t);if(!r){const e=u.get(n);e&&e.length>0&&(r=e.shift(),0===e.length&&u.delete(n))}if(r)a.delete(r);else{const o=O(e,n,t);if(!o)continue;r={item:n,element:o}}s.unshift(r);const d=r.element;d.nextSibling!==l&&o.insertBefore(d,l),l=d}a.forEach(j),e.records=s,e.lastSyncedItems=[...i]}function D(e,t){return(n,r)=>{const o=function(e,t,n){const{start:r,end:o}=d("list"),i={itemsProvider:e,renderItem:t,startMarker:r,endMarker:o,records:[],host:n,lastSyncedItems:[]},c=n;return c.appendChild(r),c.appendChild(o),G.add(i),A(i),i}(e,t,n);return o.startMarker}}function P(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function R(e,t){return"function"==typeof e?P(e,t):Boolean(e)}const V=new Set;function q(e){const{groups:t,elseContent:n,host:r,index:i,endMarker:c}=e;let u=null;for(let e=0;e<t.length;e++)if(R(t[e].condition)){u=e;break}if(null===u&&n.length&&(u=-1),u===e.activeIndex)return;if(function(e,t){let n=e.nextSibling;for(;n&&n!==t;){const e=n.nextSibling;s(n),n=e}}(e.startMarker,e.endMarker),e.activeIndex=u,null===u)return;const a=[],l=e=>{for(const t of e){if(o(t)){if(0===t.length){x.delete(t);const e=w(r,t,i);e&&a.push(e);continue}const e=r,n=e.appendChild;e.appendChild=function(t){return e.insertBefore(t,c)};try{const e=w(r,t,i);e&&!e.parentNode&&a.push(e)}finally{e.appendChild=n}continue}const e=w(r,t,i);e&&a.push(e)}};u>=0?l(t[u].content):-1===u&&l(n),function(e,t){const n=t.parentNode;n&&e.forEach(e=>function(e,t,n){if(!e||!t)return!1;try{return e.insertBefore(t,n),!0}catch{return!1}}(n,e,t))}(a,c)}class z{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){if(!u)return document.createComment("when-ssr");const{start:n,end:r}=d("when"),o={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:null,update:()=>q(o)};V.add(o);const i=e;return i.appendChild(n),i.appendChild(r),q(o),n}}function H(e){return Object.assign((t,n)=>e.render(t,n),{when:(t,...n)=>(e.when(t,...n),H(e)),else:(...t)=>(e.else(...t),H(e))})}function W(e,...t){return H(new z(e,...t))}function J(e,t){if(e.parentNode)try{e.parentNode.replaceChild(t,e)}catch(e){console.error("Error replacing conditional node:",e)}}function K(e){const t=function(e){return e._conditionalInfo??null}(e);if(!t)return;const n=P(t.condition,e=>{console.error("Error evaluating conditional condition:",e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){const n=function(e){const t=document.createElement(e.tagName);try{T(t,e.modifiers,0)}catch(t){console.error(`Error applying modifiers in conditional element "${e.tagName}":`,t)}return t}(t);k(n,t),J(e,n)}else if(!n&&r){const n=function(e){return document.createComment(`conditional-${e.tagName}-hidden`)}(t);k(n,t),J(e,n)}}const Q=[function(){G.forEach(e=>{e.startMarker.isConnected&&e.endMarker.isConnected?A(e):G.delete(e)})},function(){V.forEach(e=>{try{e.update()}catch(t){V.delete(e)}})},function(){if(u)try{N.forEach(e=>{e.isConnected?K(e):function(e){N.delete(e)}(e)})}catch(e){console.error("Error during conditional elements update:",e)}},function(){h.forEach((e,t)=>{if(!f(t))return e.updateListener&&t.removeEventListener("update",e.updateListener),void h.delete(t);m(0,e)})},function(){p.forEach((e,t)=>{if(f(t))try{const n=c(e.resolver),r=void 0===n?"":String(n);r!==e.lastValue&&(t.textContent=r,e.lastValue=r)}catch(e){i("Failed to update reactive text node",e)}else p.delete(t)})},function(){if("undefined"==typeof document)return;const e=document.body?[document.body,document]:[document];for(const t of e)try{t.dispatchEvent(new Event("update",{bubbles:!0}))}catch(e){console.error("Error dispatching global update event:",e)}}];function U(){for(const e of Q)e()}function X(e,t,n){return r=>{const o=r;if(!o||"function"!=typeof o.addEventListener)return;o.addEventListener(e,n=>{try{t.call(o,n)}catch(t){"undefined"!=typeof console&&console.error&&console.error(`[nuclo:on] Error in '${e}' listener:`,t)}},n)}}function Y(e,t,n=0){const r=e(t||document.body,n);return(t||document.body).appendChild(r),r}function Z(){if(_(),"undefined"!=typeof globalThis){const e=globalThis;e.list=D,e.update=U,e.when=W,e.on=X,e.render=Y}}"undefined"!=typeof globalThis&&Z(),exports.HTML_TAGS=B,exports.SELF_CLOSING_TAGS=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],exports.SVG_TAGS=["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"],exports.appendChildren=function(e,...t){return e?(t.forEach(t=>{if(null!=t){let n;if("string"==typeof t){const e=function(e){if(!u)return null;try{return document.createTextNode(String(e))}catch{return null}}(t);if(!e)return;n=e}else n=t;!function(e,t){if(!e||!t)return!1;try{return e.appendChild(t),!0}catch{return!1}}(e,n)}}),e):e},exports.applyAttributes=v,exports.applyNodeModifier=w,exports.createElementFactory=F,exports.createTagBuilder=$,exports.initializeRuntime=Z,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isBrowser=u,exports.isFunction=o,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.list=D,exports.on=X,exports.registerGlobalTagBuilders=_,exports.render=Y,exports.update=U,exports.when=W;
1
+ "use strict";function e(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function t(e){return e instanceof Node}function n(e){return"object"==typeof e&&null!==e}function r(e){return n(e)&&"tagName"in e}function o(e){return"function"==typeof e}function i(e){return o(e)&&0===e.length}function c(e,t){"undefined"!=typeof console&&console.error(`nuclo: ${e}`,t)}function u(e,t){try{return e()}catch(e){return c("Operation failed",e),t}}const a="undefined"!=typeof window&&"undefined"!=typeof document;function s(e){if(!e?.parentNode)return!1;try{return e.parentNode.removeChild(e),!0}catch(e){return c("Failed to remove child node",e),!1}}function l(e){if(!a)return null;try{return document.createComment(e)}catch(e){return c("Failed to create comment node",e),null}}function d(e){return l(e)}function f(e,t="hidden"){try{return document.createComment(`conditional-${e}-${t}`)}catch(e){return c("Failed to create conditional comment",e),null}}function p(e){if(!a)throw new Error("Cannot create comment in non-browser environment");const t=l(`${e}-${Math.random().toString(36).slice(2)}`);if(!t)throw new Error("Failed to create comment");return t}function h(e){const t=l(`${e}-end`);if(!t)throw new Error("Failed to create end comment");return{start:p(`${e}-start`),end:t}}function m(e,t){const n=t.parentNode;n&&e.forEach(e=>function(e,t,n){if(!e||!t)return!1;try{return e.insertBefore(t,n),!0}catch(e){return c("Failed to insert node before reference",e),!1}}(n,e,t))}function g(e){return!!e&&("boolean"==typeof e.isConnected?e.isConnected:!(!a||"undefined"==typeof document)&&document.contains(e))}function y(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c("Error replacing conditional node",e),!1}}const b=new Map,v=new Map;function x(e,t){t.attributeResolvers.forEach(({resolver:e,applyValue:t},n)=>{try{t(u(e))}catch(e){c(`Failed to update reactive attribute: ${n}`,e)}})}function E(e,t,n,r){if(!(e instanceof Element&&t&&"function"==typeof n))return void c("Invalid parameters for registerAttributeResolver");const o=function(e){let t=v.get(e);return t||(t={attributeResolvers:new Map},v.set(e,t)),t}(e);o.attributeResolvers.set(t,{resolver:n,applyValue:r});try{r(u(n))}catch(e){c("Failed to apply initial attribute value",e)}if(!o.updateListener){const t=()=>x(0,o);e.addEventListener("update",t),o.updateListener=t}}function C(e,t,n){try{if(null==n||""===n)return e.style[t]="",!0;const r=String(n);return e.style[t]=r,!0}catch{return!1}}function w(e,t){if(e?.style&&t)for(const[n,r]of Object.entries(t)){C(e,n,r)||c(`Failed to set style property '${n}'`)}}function M(e,t,n){if(null==n)return;if("style"===t)return i=n,void((r=e)&&(o(i)?E(r,"style",()=>{try{return i()}catch(e){return c("Error in style resolver function",e),null}},e=>{w(r,e)}):w(r,i)));var r,i;const u=n=>{null!=n&&(t in e?e[t]=n:e instanceof Element&&e.setAttribute(String(t),String(n)))};o(n)&&0===n.length?E(e,String(t),n,u):u(n)}function S(e,t){if(t)for(const n of Object.keys(t)){M(e,n,t[n])}}const N=new WeakMap;function k(e){const{value:t,error:n}=function(e){const t=N.get(e);if(t)return t;try{const t={value:e(),error:!1};return N.set(e,t),t}catch{const t={value:void 0,error:!0};return N.set(e,t),t}}(e);return!n&&"boolean"==typeof t}function F(e,r,i){if(!o(e)||0!==e.length||!k(e))return!1;const c=r.filter((e,t)=>t!==i);if(0===c.length)return!1;return c.some(e=>n(e)||t(e)||o(e)&&e.length>0)}function T(r,u,a){if(null==u)return null;if(o(u)){if(i(u))try{let t=N.get(u);if(!t){t={value:u(),error:!1},N.set(u,t)}if(t.error)return I(a,()=>"");const n=t.value;return e(n)&&null!=n?I(a,u,n):null}catch(e){return N.set(u,{value:void 0,error:!0}),c("Error evaluating reactive text function:",e),I(a,()=>"")}const o=u(r,a);return null==o?null:e(o)?L(a,o):t(o)?o:(n(o)&&S(r,o),null)}const s=u;return null==s?null:e(s)?L(a,s):t(s)?s:(n(s)&&S(r,s),null)}function I(e,t,n){const r=document.createDocumentFragment(),o=d(` text-${e} `);o&&r.appendChild(o);const i=function(e,t){if("function"!=typeof e)return c("Invalid resolver provided to createReactiveTextNode"),document.createTextNode("");const n=arguments.length>1?t:u(e,""),r=void 0===n?"":String(n),o=document.createTextNode(r);return b.set(o,{resolver:e,lastValue:r}),o}(t,n);return r.appendChild(i),r}function L(e,t){const n=document.createDocumentFragment(),r=d(` text-${e} `);r&&n.appendChild(r);const o=document.createTextNode(String(t));return n.appendChild(o),n}const $=new Set;function B(e,t){e._conditionalInfo=t,$.add(e)}function _(e,t,n=0){if(!t||0===t.length)return{element:e,nextIndex:n,appended:0};let r=n,o=0;const i=e;for(let n=0;n<t.length;n+=1){const c=t[n];if(null==c)continue;const u=T(e,c,r);u&&(u.parentNode!==i&&i.appendChild(u),r+=1,o+=1)}return{element:e,nextIndex:r,appended:o}}function G(e,t){const n=document.createElement(e);return _(n,t,0),n}function O(e){const t=function(e){for(let t=0;t<e.length;t+=1)if(F(e[t],e,t))return t;return-1}(e);return-1===t?{condition:null,otherModifiers:e}:{condition:e[t],otherModifiers:e.filter((e,n)=>n!==t)}}function j(e,...t){return(n,r)=>{const{condition:o,otherModifiers:i}=O(t);if(o)return function(e,t,n){const r=t();if(!a)return r?G(e,n):f(e,"ssr");const o={condition:t,tagName:e,modifiers:n};if(r){const t=G(e,n);return B(t,o),t}const i=f(e);if(!i)throw new Error(`Failed to create conditional comment for ${e}`);return B(i,o),i}(e,o,i);const c=document.createElement(e);return _(c,i,r),c}}function A(e){return(...t)=>j(e,...t)}const D=["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"];function R(e=globalThis){const t="__nuclo_tags_registered";e[t]||(D.forEach(t=>function(e,t){t in e||(e[t]=A(t))}(e,t)),e[t]=!0)}const P=new Set;function V(e,t,n){return function(e,t,n){if(o(e)){const o=e(t,n);return o&&r(o)?o:null}return e&&r(e)?e:null}(e.renderItem(t,n),e.host,n)}function q(e){s(e.element)}function W(e){const{host:t,startMarker:n,endMarker:r}=e,o=n.parentNode??t,i=e.itemsProvider();if(function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if((n in e?e[n]:void 0)!==(n in t?t[n]:void 0))return!1;return!0}(e.lastSyncedItems,i))return;const c=new Map,u=new Map;e.records.forEach(e=>{const t=u.get(e.item);t?t.push(e):u.set(e.item,[e])}),i.forEach((t,n)=>{if(n<e.lastSyncedItems.length&&e.lastSyncedItems[n]===t){const r=e.records[n];if(r&&r.item===t){c.set(n,r);const e=u.get(t);if(e){const n=e.indexOf(r);n>=0&&(e.splice(n,1),0===e.length&&u.delete(t))}}}});const a=[],s=new Set(e.records);let l=r;for(let t=i.length-1;t>=0;t--){const n=i[t];let r=c.get(t);if(!r){const e=u.get(n);e&&e.length>0&&(r=e.shift(),0===e.length&&u.delete(n))}if(r)s.delete(r);else{const o=V(e,n,t);if(!o)continue;r={item:n,element:o}}a.unshift(r);const d=r.element;d.nextSibling!==l&&o.insertBefore(d,l),l=d}s.forEach(q),e.records=a,e.lastSyncedItems=[...i]}function z(e,t){return(n,r)=>{const o=function(e,t,n){const{start:r,end:o}=h("list"),i={itemsProvider:e,renderItem:t,startMarker:r,endMarker:o,records:[],host:n,lastSyncedItems:[]},c=n;return c.appendChild(r),c.appendChild(o),P.add(i),W(i),i}(e,t,n);return o.startMarker}}function H(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Z(e,t){return"function"==typeof e?H(e,t):Boolean(e)}const J=new Set;function K(e,t,n,r){return o(e)?i(e)?(N.delete(e),T(t,e,n)):function(e,t,n){const r=e,o=r.appendChild.bind(r),i=r.insertBefore.bind(r);r.appendChild=function(e){return i(e,t)};try{return n()}finally{r.appendChild=o}}(t,r,()=>{const r=T(t,e,n);return r&&!r.parentNode?r:null}):T(t,e,n)}function Q(e){const{groups:t,elseContent:n,host:r,index:o,endMarker:i}=e,c=function(e,t){for(let t=0;t<e.length;t++)if(Z(e[t].condition))return t;return t.length>0?-1:null}(t,n);if(c===e.activeIndex)return;if(function(e,t){let n=e.nextSibling;for(;n&&n!==t;){const e=n.nextSibling;s(n),n=e}}(e.startMarker,e.endMarker),e.activeIndex=c,null===c)return;const u=function(e,t,n,r){const o=[];for(const i of e){const e=K(i,t,n,r);e&&o.push(e)}return o}(c>=0?t[c].content:n,r,o,i);m(u,i)}class U{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){if(!a){return d("when-ssr")||null}const{start:n,end:r}=h("when"),o={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:null,update:()=>Q(o)};J.add(o);const i=e;return i.appendChild(n),i.appendChild(r),Q(o),n}}function X(e){return Object.assign((t,n)=>e.render(t,n),{when:(t,...n)=>(e.when(t,...n),X(e)),else:(...t)=>(e.else(...t),X(e))})}function Y(e,...t){return X(new U(e,...t))}function ee(e){const t=function(e){return e._conditionalInfo??null}(e);if(!t)return;const n=H(t.condition,e=>{c("Error evaluating conditional condition",e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){const n=function(e){try{return G(e.tagName,e.modifiers)}catch(t){return c(`Error applying modifiers in conditional element "${e.tagName}"`,t),document.createElement(e.tagName)}}(t);B(n,t),y(e,n)}else if(!n&&r){const n=f(t.tagName);n&&(B(n,t),y(e,n))}}const te=[function(){P.forEach(e=>{e.startMarker.isConnected&&e.endMarker.isConnected?W(e):P.delete(e)})},function(){J.forEach(e=>{try{e.update()}catch(t){J.delete(e)}})},function(){if(a)try{$.forEach(e=>{e.isConnected?ee(e):function(e){$.delete(e)}(e)})}catch(e){c("Error during conditional elements update",e)}},function(){v.forEach((e,t)=>{if(!g(t))return e.updateListener&&t.removeEventListener("update",e.updateListener),void v.delete(t);x(0,e)})},function(){b.forEach((e,t)=>{if(g(t))try{const n=u(e.resolver),r=void 0===n?"":String(n);r!==e.lastValue&&(t.textContent=r,e.lastValue=r)}catch(e){c("Failed to update reactive text node",e)}else b.delete(t)})},function(){if("undefined"==typeof document)return;const e=document.body?[document.body,document]:[document];for(const t of e)try{t.dispatchEvent(new Event("update",{bubbles:!0}))}catch(e){c("Error dispatching global update event",e)}}];function ne(){for(const e of te)e()}function re(e,t,n){return r=>{const o=r;if(!o||"function"!=typeof o.addEventListener)return;o.addEventListener(e,n=>{try{t.call(o,n)}catch(t){c(`Error in '${e}' listener`,t)}},n)}}function oe(e,t,n=0){const r=e(t||document.body,n);return(t||document.body).appendChild(r),r}function ie(){if(R(),"undefined"!=typeof globalThis){const e=globalThis;e.list=z,e.update=ne,e.when=Y,e.on=re,e.render=oe}}"undefined"!=typeof globalThis&&ie(),exports.HTML_TAGS=D,exports.SELF_CLOSING_TAGS=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],exports.SVG_TAGS=["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"],exports.appendChildren=function(e,...t){return e?(t.forEach(t=>{if(null!=t){let n;if("string"==typeof t){const e=function(e){if(!a)return null;try{return document.createTextNode(String(e))}catch(e){return c("Failed to create text node",e),null}}(t);if(!e)return;n=e}else n=t;!function(e,t){if(!e||!t)return!1;try{return e.appendChild(t),!0}catch(e){return c("Failed to append child node",e),!1}}(e,n)}}),e):e},exports.applyAttributes=S,exports.applyNodeModifier=T,exports.createComment=d,exports.createConditionalComment=f,exports.createElementFactory=j,exports.createElementWithModifiers=G,exports.createTagBuilder=A,exports.initializeRuntime=ie,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isBrowser=a,exports.isFunction=o,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.isZeroArityFunction=i,exports.list=z,exports.on=re,exports.registerGlobalTagBuilders=R,exports.render=oe,exports.replaceNodeSafely=y,exports.update=ne,exports.when=Y;
2
2
  //# sourceMappingURL=nuclo.cjs.map