nuclo 0.1.55 → 0.1.57
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.
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.js +1 -1
- package/dist/nuclo.js.map +1 -1
- package/dist/nuclo.umd.js +1 -1
- package/dist/nuclo.umd.js.map +1 -1
- package/dist/style/cssGenerator.d.ts +4 -2
- package/dist/style/cssGenerator.d.ts.map +1 -1
- package/dist/style/index.d.ts +1 -1
- package/dist/style/index.d.ts.map +1 -1
- package/dist/style/styleQueries.d.ts +8 -0
- package/dist/style/styleQueries.d.ts.map +1 -0
- package/package.json +3 -3
- package/types/features/style.d.ts +42 -4
- package/dist/style/breakpoints.d.ts +0 -7
- package/dist/style/breakpoints.d.ts.map +0 -1
package/dist/nuclo.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuclo.cjs","sources":["../src/utility/typeGuards.ts","../src/utility/errorHandler.ts","../src/utility/environment.ts","../src/utility/dom.ts","../src/core/reactiveText.ts","../src/core/reactiveAttributes.ts","../src/utility/domTypeHelpers.ts","../src/core/styleManager.ts","../src/core/classNameMerger.ts","../src/core/attributeManager.ts","../src/utility/modifierPredicates.ts","../src/core/modifierProcessor.ts","../src/utility/conditionalInfo.ts","../src/internal/applyModifiers.ts","../src/core/conditionalRenderer.ts","../src/core/elementFactory.ts","../src/core/tagRegistry.ts","../src/list/runtime.ts","../src/utility/renderables.ts","../src/utility/arrayUtils.ts","../src/list/renderer.ts","../src/utility/conditions.ts","../src/when/renderer.ts","../src/when/runtime.ts","../src/when/builder.ts","../src/when/index.ts","../src/core/conditionalUpdater.ts","../src/core/updateController.ts","../src/utility/events.ts","../src/utility/on.ts","../src/utility/render.ts","../src/style/styleProperties.ts","../src/style/styleCache.ts","../src/style/cssGenerator.ts","../src/style/styleBuilder.ts","../src/style/breakpoints.ts","../src/core/runtimeBootstrap.ts"],"sourcesContent":["export function isPrimitive(value: unknown): value is Primitive {\n return value === null || (typeof value !== \"object\" && typeof value !== \"function\");\n}\n\nexport function isNode<T>(value: T): value is T & Node {\n return value instanceof Node;\n}\n\nexport function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null;\n}\n\nexport function isTagLike<T>(value: T): value is T & { tagName?: string } {\n return isObject(value) && \"tagName\" in (value as object);\n}\n\nexport function isBoolean(value: unknown): value is boolean {\n return typeof value === \"boolean\";\n}\n\nexport function isFunction<T extends Function>(value: unknown): value is T {\n return typeof value === \"function\";\n}\n\nexport function isZeroArityFunction(value: unknown): value is () => unknown {\n return isFunction(value) && (value as Function).length === 0;\n}\n","/**\n * Simplified error handling for nuclo - reduced complexity for smaller bundle size\n */\n\n// Basic error logging - no complex context tracking\nexport function logError(message: string, error?: Error | unknown): void {\n if (typeof console !== 'undefined') {\n console.error(`nuclo: ${message}`, error);\n }\n}\n\n// Simplified safe execution - no complex context\nexport function safeExecute<T>(fn: () => T, fallback?: T): T | undefined {\n try {\n return fn();\n } catch (error) {\n logError(\"Operation failed\", error);\n return fallback;\n }\n}\n\n// Basic DOM error handler\nexport function handleDOMError(error: Error | unknown, operation: string): void {\n logError(`DOM ${operation} failed`, error);\n}","/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","import { isBrowser } from \"./environment\";\nimport { logError } from \"./errorHandler\";\n\nfunction safeAppendChild(parent: Element | Node, child: Node): boolean {\n if (!parent || !child) return false;\n try {\n parent.appendChild(child);\n return true;\n } catch (error) {\n logError('Failed to append child node', error);\n return false;\n }\n}\n\nexport function safeRemoveChild(child: Node): boolean {\n if (!child?.parentNode) return false;\n try {\n child.parentNode.removeChild(child);\n return true;\n } catch (error) {\n logError('Failed to remove child node', error);\n return false;\n }\n}\n\nfunction safeInsertBefore(parent: Node, newNode: Node, referenceNode: Node | null): boolean {\n if (!parent || !newNode) return false;\n try {\n parent.insertBefore(newNode, referenceNode);\n return true;\n } catch (error) {\n logError('Failed to insert node before reference', error);\n return false;\n }\n}\n\nfunction createTextNodeSafely(text: string | number | boolean): Text | null {\n if (!isBrowser) return null;\n try {\n return document.createTextNode(String(text));\n } catch (error) {\n logError('Failed to create text node', error);\n return null;\n }\n}\n\nfunction createCommentSafely(text: string): Comment | null {\n if (!isBrowser) return null;\n try {\n return document.createComment(text);\n } catch (error) {\n logError('Failed to create comment node', error);\n return null;\n }\n}\n\n/**\n * Creates a comment node safely with error handling.\n * Exported for use across the codebase.\n */\nexport function createComment(text: string): Comment | null {\n return createCommentSafely(text);\n}\n\n/**\n * Creates a conditional comment placeholder node.\n * In SSR environments, this will still work because we bypass the isBrowser check.\n */\nexport function createConditionalComment(tagName: string, suffix: string = \"hidden\"): Comment | null {\n // For SSR, we need to create comments even when isBrowser is false\n // This function intentionally skips the isBrowser check for SSR compatibility\n try {\n return document.createComment(`conditional-${tagName}-${suffix}`);\n } catch (error) {\n logError('Failed to create conditional comment', error);\n return null;\n }\n}\n\nexport function createMarkerComment(prefix: string): Comment {\n if (!isBrowser) {\n throw new Error(\"Cannot create comment in non-browser environment\");\n }\n const comment = createCommentSafely(`${prefix}-${Math.random().toString(36).slice(2)}`);\n if (!comment) {\n throw new Error(\"Failed to create comment\");\n }\n return comment;\n}\n\nexport function createMarkerPair(prefix: string): { start: Comment; end: Comment } {\n const endComment = createCommentSafely(`${prefix}-end`);\n if (!endComment) {\n throw new Error(\"Failed to create end comment\");\n }\n return {\n start: createMarkerComment(`${prefix}-start`),\n end: endComment\n };\n}\n\nexport function clearBetweenMarkers(startMarker: Comment, endMarker: Comment): void {\n let current = startMarker.nextSibling;\n while (current && current !== endMarker) {\n const next = current.nextSibling;\n safeRemoveChild(current);\n current = next;\n }\n}\n\nexport function insertNodesBefore(nodes: Node[], referenceNode: Node): void {\n const parent = referenceNode.parentNode;\n if (parent) {\n nodes.forEach(node => safeInsertBefore(parent, node, referenceNode));\n }\n}\n\nexport function appendChildren(\n parent: Element | Node,\n ...children: Array<Element | Node | string | null | undefined>\n): Element | Node {\n if (!parent) return parent;\n\n children.forEach((child) => {\n if (child != null) {\n let nodeToAppend: Node;\n\n if (typeof child === \"string\") {\n const textNode = createTextNodeSafely(child);\n if (textNode) {\n nodeToAppend = textNode;\n } else {\n return;\n }\n } else {\n nodeToAppend = child as Node;\n }\n\n safeAppendChild(parent, nodeToAppend);\n }\n });\n\n return parent;\n}\n\nexport function isNodeConnected(node: Node | null | undefined): boolean {\n if (!node) return false;\n\n // Prefer the built-in isConnected property\n if (typeof node.isConnected === \"boolean\") {\n return node.isConnected;\n }\n\n // Fallback for older browsers (only if in browser environment)\n if (isBrowser && typeof document !== 'undefined') {\n return document.contains(node);\n }\n\n // In SSR or when document is not available, assume disconnected\n return false;\n}\n\n/**\n * Safely replaces an old node with a new node in the DOM.\n * Returns true on success, false on failure (and logs the error).\n */\nexport function replaceNodeSafely(oldNode: Node, newNode: Node): boolean {\n if (!oldNode?.parentNode) return false;\n try {\n oldNode.parentNode.replaceChild(newNode, oldNode);\n return true;\n } catch (error) {\n logError(\"Error replacing conditional node\", error);\n return false;\n }\n}\n","import { logError, safeExecute } from \"../utility/errorHandler\";\nimport { isNodeConnected } from \"../utility/dom\";\n\ntype TextResolver = () => Primitive;\n\ninterface ReactiveTextNodeInfo {\n resolver: TextResolver;\n lastValue: string;\n}\n\nconst reactiveTextNodes = new Map<Text, ReactiveTextNodeInfo>();\n\n/**\n * Creates a reactive text node that automatically updates when its resolver function changes.\n *\n * The text node will be registered for reactive updates and its content will be synchronized\n * whenever notifyReactiveTextNodes() is called.\n *\n * @param resolver - Function that returns the text content (string, number, boolean, etc.)\n * @param preEvaluated - Optional pre-evaluated value to avoid calling resolver immediately\n * @returns A Text node that will reactively update its content\n *\n * @example\n * ```ts\n * const count = signal(0);\n * const textNode = createReactiveTextNode(() => `Count: ${count.value}`);\n * // Later, when count changes and notifyReactiveTextNodes() is called,\n * // the text content automatically updates\n * ```\n */\nexport function createReactiveTextNode(resolver: TextResolver, preEvaluated?: unknown): Text | DocumentFragment {\n if (typeof resolver !== \"function\") {\n logError(\"Invalid resolver provided to createReactiveTextNode\");\n return document.createTextNode(\"\");\n }\n\n const initial = arguments.length > 1 ? preEvaluated : safeExecute(resolver, \"\");\n const str = initial === undefined ? \"\" : String(initial);\n const txt = document.createTextNode(str);\n\n reactiveTextNodes.set(txt, { resolver, lastValue: str });\n return txt;\n}\n\n/**\n * Updates all registered reactive text nodes.\n *\n * Iterates through all reactive text nodes, re-evaluates their resolver functions,\n * and updates their content if it has changed. Automatically cleans up disconnected nodes.\n *\n * This function should be called after state changes to synchronize the DOM with application state.\n *\n * @example\n * ```ts\n * // After updating application state\n * count.value++;\n * notifyReactiveTextNodes(); // All reactive text nodes update\n * ```\n */\nexport function notifyReactiveTextNodes(): void {\n reactiveTextNodes.forEach((info, node) => {\n if (!isNodeConnected(node)) {\n reactiveTextNodes.delete(node);\n return;\n }\n try {\n const raw = safeExecute(info.resolver);\n const newVal = raw === undefined ? \"\" : String(raw);\n if (newVal !== info.lastValue) {\n node.textContent = newVal;\n info.lastValue = newVal;\n }\n } catch (e) {\n logError(\"Failed to update reactive text node\", e);\n }\n });\n}\n","import { logError, safeExecute } from \"../utility/errorHandler\";\nimport { isNodeConnected } from \"../utility/dom\";\n\ntype AttributeResolver = () => unknown;\n\ninterface AttributeResolverRecord {\n resolver: AttributeResolver;\n applyValue: (value: unknown) => void;\n}\n\ninterface ReactiveElementInfo {\n attributeResolvers: Map<string, AttributeResolverRecord>;\n updateListener?: EventListener;\n}\n\nconst reactiveElements = new Map<Element, ReactiveElementInfo>();\n\nfunction ensureElementInfo(el: Element): ReactiveElementInfo {\n let info = reactiveElements.get(el);\n if (!info) {\n info = { attributeResolvers: new Map() };\n reactiveElements.set(el, info);\n }\n return info;\n}\n\nfunction applyAttributeResolvers(el: Element, info: ReactiveElementInfo): void {\n info.attributeResolvers.forEach(({ resolver, applyValue }, key) => {\n try {\n applyValue(safeExecute(resolver));\n } catch (e) {\n logError(`Failed to update reactive attribute: ${key}`, e);\n }\n });\n}\n\n/**\n * Registers a reactive attribute resolver for an element.\n *\n * The resolver will be called whenever the element receives an 'update' event,\n * allowing attributes to reactively update based on application state.\n *\n * @param element - The DOM element to make reactive\n * @param key - The attribute name being made reactive (e.g., 'class', 'style', 'disabled')\n * @param resolver - Function that returns the new attribute value\n * @param applyValue - Callback that applies the resolved value to the element\n *\n * @example\n * ```ts\n * const isActive = signal(false);\n * const button = document.createElement('button');\n * registerAttributeResolver(\n * button,\n * 'class',\n * () => isActive.value ? 'active' : 'inactive',\n * (value) => button.className = String(value)\n * );\n * ```\n */\nexport function registerAttributeResolver<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n key: string,\n resolver: AttributeResolver,\n applyValue: (value: unknown) => void\n): void {\n if (!(element instanceof Element) || !key || typeof resolver !== \"function\") {\n logError(\"Invalid parameters for registerAttributeResolver\");\n return;\n }\n const info = ensureElementInfo(element as Element);\n info.attributeResolvers.set(key, { resolver, applyValue });\n\n try {\n applyValue(safeExecute(resolver));\n } catch (e) {\n logError(\"Failed to apply initial attribute value\", e);\n }\n\n if (!info.updateListener) {\n const listener: EventListener = () => applyAttributeResolvers(element as Element, info);\n (element as Element).addEventListener(\"update\", listener);\n info.updateListener = listener;\n }\n}\n\n/**\n * Updates all registered reactive elements by re-evaluating their attribute resolvers.\n *\n * Iterates through all reactive elements and triggers their registered attribute resolvers\n * to update. Automatically cleans up disconnected elements and their event listeners.\n *\n * This function should be called after state changes to synchronize element attributes\n * with application state.\n *\n * @example\n * ```ts\n * // After updating application state\n * isActive.value = true;\n * notifyReactiveElements(); // All reactive attributes update\n * ```\n */\nexport function notifyReactiveElements(): void {\n reactiveElements.forEach((info, el) => {\n if (!isNodeConnected(el)) {\n if (info.updateListener) el.removeEventListener(\"update\", info.updateListener);\n reactiveElements.delete(el);\n return;\n }\n applyAttributeResolvers(el, info);\n });\n}\n","/**\n * Type-safe DOM helper utilities to reduce type assertions across the codebase.\n * These helpers provide proper typing for DOM operations while maintaining runtime safety.\n */\n\n/**\n * Safely casts an Element-like object to Node & ParentNode interface.\n * This is a common pattern needed when working with DOM manipulation.\n *\n * @param element - The element to cast\n * @returns The element typed as Node & ParentNode\n */\nexport function asParentNode<T extends Element | object>(element: T): Node & ParentNode {\n return element as unknown as Node & ParentNode;\n}\n\n/**\n * Creates a scoped DOM insertion context that temporarily redirects appendChild\n * to insertBefore at a specific reference node. This is useful for inserting\n * content at specific positions in the DOM tree.\n *\n * @param host - The host element\n * @param referenceNode - The node before which new nodes should be inserted\n * @param callback - Function to execute with the scoped context\n * @returns The result of the callback\n */\nexport function withScopedInsertion<T, THost extends Element | object>(\n host: THost,\n referenceNode: Node,\n callback: () => T\n): T {\n const parent = asParentNode(host);\n const originalAppend = parent.appendChild.bind(parent);\n const originalInsert = parent.insertBefore.bind(parent);\n\n // Temporarily override appendChild to insert before the reference node\n // TypeScript doesn't like this override but it's safe at runtime\n (parent as unknown as Record<string, unknown>).appendChild = function(node: Node): Node {\n return originalInsert(node, referenceNode);\n };\n\n try {\n return callback();\n } finally {\n // Restore original method\n (parent as unknown as Record<string, unknown>).appendChild = originalAppend;\n }\n}\n\n/**\n * Type-safe wrapper for setting CSS style properties.\n * Provides better error handling than direct CSSStyleDeclaration access.\n * Supports both camelCase and kebab-case property names.\n *\n * @param element - The element to apply styles to\n * @param property - The CSS property name (camelCase or kebab-case)\n * @param value - The value to set (string, number, or null to remove)\n * @returns true if the style was applied successfully, false otherwise\n */\nexport function setStyleProperty(\n element: HTMLElement,\n property: string,\n value: string | number | null\n): boolean {\n try {\n if (value === null || value === undefined || value === '') {\n // Use bracket notation to remove property (works with camelCase)\n (element.style as unknown as Record<string, string>)[property] = '';\n return true;\n }\n\n // Convert value to string first (might throw if toString() throws)\n const stringValue = String(value);\n // Use bracket notation to set property (works with camelCase)\n (element.style as unknown as Record<string, string>)[property] = stringValue;\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Type-safe wrapper for reading CSS style properties.\n *\n * @param element - The element to read styles from\n * @param property - The CSS property name\n * @returns The computed style value or empty string if not found\n */\nexport function getStyleProperty(\n element: HTMLElement,\n property: string\n): string {\n try {\n return element.style.getPropertyValue(property);\n } catch {\n return '';\n }\n}\n","import { isFunction } from \"../utility/typeGuards\";\nimport { registerAttributeResolver } from \"./reactive\";\nimport { setStyleProperty } from \"../utility/domTypeHelpers\";\nimport { logError } from \"../utility/errorHandler\";\n\ntype StyleAssignment = Partial<CSSStyleDeclaration>;\ntype StyleResolver = () => StyleAssignment | null | undefined;\n\n/**\n * Simplified style management - basic functionality with minimal overhead\n */\nexport function assignInlineStyles<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n styles: StyleAssignment | null | undefined,\n): void {\n if (!element?.style || !styles) return;\n\n for (const [property, value] of Object.entries(styles)) {\n const success = setStyleProperty(\n element as HTMLElement,\n property,\n value as string | number | null\n );\n\n if (!success) {\n // Don't try to stringify value in error message as it might throw\n logError(`Failed to set style property '${property}'`);\n }\n }\n}\n\nexport function applyStyleAttribute<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n styleValue: StyleAssignment | StyleResolver | null | undefined\n): void {\n if (!element) return;\n\n if (isFunction(styleValue)) {\n registerAttributeResolver(element, 'style', () => {\n try {\n return styleValue();\n } catch (error) {\n logError('Error in style resolver function', error);\n return null;\n }\n }, (resolvedStyles) => {\n assignInlineStyles(element, resolvedStyles as StyleAssignment);\n });\n } else {\n assignInlineStyles(element, styleValue);\n }\n}","const REACTIVE_CLASSNAME_KEY = '__nuclo_reactive_className__';\nconst STATIC_CLASSNAME_KEY = '__nuclo_static_className__';\n\n// Mark element as having a reactive className and capture static classes\nexport function initReactiveClassName(el: HTMLElement): void {\n\tif (!(el as any)[STATIC_CLASSNAME_KEY]) {\n\t\t(el as any)[STATIC_CLASSNAME_KEY] = new Set(el.className.split(' ').filter(c => c));\n\t}\n\t(el as any)[REACTIVE_CLASSNAME_KEY] = true;\n}\n\n// Check if element has a reactive className\nexport function hasReactiveClassName(el: HTMLElement): boolean {\n\treturn !!(el as any)[REACTIVE_CLASSNAME_KEY];\n}\n\n// Get static classes set for the element\nfunction getStaticClasses(el: HTMLElement): Set<string> {\n\treturn (el as any)[STATIC_CLASSNAME_KEY] as Set<string>;\n}\n\n// Add static classes to the element\nexport function addStaticClasses(el: HTMLElement, className: string): void {\n\tif (!className) return;\n\n\tif (!(el as any)[STATIC_CLASSNAME_KEY]) {\n\t\t(el as any)[STATIC_CLASSNAME_KEY] = new Set();\n\t}\n\n\tclassName.split(' ').filter(c => c).forEach(c => {\n\t\t((el as any)[STATIC_CLASSNAME_KEY] as Set<string>).add(c);\n\t});\n}\n\n// Merge reactive className with static classes\nexport function mergeReactiveClassName(el: HTMLElement, reactiveClassName: string): void {\n\tconst staticClasses = getStaticClasses(el);\n\n\t// Combine static classes with reactive className\n\tif (staticClasses && staticClasses.size > 0 && reactiveClassName) {\n\t\tconst allClasses = new Set(staticClasses);\n\t\treactiveClassName.split(' ').filter(c => c).forEach(c => allClasses.add(c));\n\t\tel.className = Array.from(allClasses).join(' ');\n\t} else if (reactiveClassName) {\n\t\tel.className = reactiveClassName;\n\t} else if (staticClasses && staticClasses.size > 0) {\n\t\tel.className = Array.from(staticClasses).join(' ');\n\t} else {\n\t\tel.className = '';\n\t}\n}\n\n// Merge static className (for non-reactive className attributes)\nexport function mergeStaticClassName(el: HTMLElement, newClassName: string): void {\n\tif (!newClassName) return;\n\n\tconst currentClassName = el.className;\n\n\t// If there's already a className, merge them (avoid duplicates)\n\tif (currentClassName && currentClassName !== newClassName) {\n\t\tconst existing = new Set(currentClassName.split(' ').filter(c => c));\n\t\tconst newClasses = newClassName.split(' ').filter(c => c);\n\t\tnewClasses.forEach(c => existing.add(c));\n\t\tel.className = Array.from(existing).join(' ');\n\t} else {\n\t\tel.className = newClassName;\n\t}\n}\n","import { isFunction } from \"../utility/typeGuards\";\nimport { registerAttributeResolver, createReactiveTextNode } from \"./reactive\";\nimport { applyStyleAttribute } from \"./styleManager\";\nimport {\n\tinitReactiveClassName,\n\thasReactiveClassName,\n\taddStaticClasses,\n\tmergeReactiveClassName,\n\tmergeStaticClassName\n} from \"./classNameMerger\";\n\ntype AttributeKey<TTagName extends ElementTagName> = keyof ExpandedElementAttributes<TTagName>;\ntype AttributeCandidate<TTagName extends ElementTagName> =\n ExpandedElementAttributes<TTagName>[AttributeKey<TTagName>];\n\nfunction applySingleAttribute<TTagName extends ElementTagName>(\n el: ExpandedElement<TTagName>,\n key: AttributeKey<TTagName>,\n raw: AttributeCandidate<TTagName> | undefined,\n shouldMergeClassName = false,\n): void {\n if (raw == null) return;\n\n if (key === \"style\") {\n applyStyleAttribute(el, raw as ExpandedElementAttributes<TTagName>[\"style\"]);\n return;\n }\n\n const setValue = (v: unknown, merge = false): void => {\n if (v == null) return;\n\n // Special handling for className to merge instead of replace (only for non-reactive updates)\n if (key === 'className' && el instanceof HTMLElement && merge) {\n mergeStaticClassName(el, String(v));\n return;\n }\n\n // SVG elements should always use setAttribute for most attributes\n // because many SVG properties are read-only\n const isSVGElement = el instanceof Element && el.namespaceURI === 'http://www.w3.org/2000/svg';\n\n if (isSVGElement) {\n // Always use setAttribute for SVG elements\n el.setAttribute(String(key), String(v));\n } else if (key in el) {\n // For HTML elements, try to set as property first\n try {\n (el as Record<string, unknown>)[key as string] = v;\n } catch {\n // If property is read-only, fall back to setAttribute\n if (el instanceof Element) {\n el.setAttribute(String(key), String(v));\n }\n }\n } else if (el instanceof Element) {\n el.setAttribute(String(key), String(v));\n }\n };\n\n if (isFunction(raw) && raw.length === 0) {\n // Type narrowing: zero-arity function that returns an attribute value\n const resolver = raw as () => AttributeCandidate<TTagName>;\n\n // For reactive className, we need to track which classes are reactive\n // so we can preserve static classes when the reactive className changes\n if (key === 'className' && el instanceof HTMLElement) {\n initReactiveClassName(el);\n\n registerAttributeResolver(el, String(key), resolver, (v) => {\n mergeReactiveClassName(el, String(v || ''));\n });\n } else {\n registerAttributeResolver(el, String(key), resolver, (v) => {\n setValue(v, false);\n });\n }\n } else {\n // Static attributes should merge classNames\n // For className, if there's already a reactive className, add to static classes\n if (key === 'className' && el instanceof HTMLElement) {\n if (hasReactiveClassName(el)) {\n // There's already a reactive className, add this to static classes\n const newClassName = String(raw || '');\n if (newClassName) {\n addStaticClasses(el, newClassName);\n // Also update the current className immediately\n const currentClasses = new Set(el.className.split(' ').filter(c => c));\n newClassName.split(' ').filter(c => c).forEach(c => currentClasses.add(c));\n el.className = Array.from(currentClasses).join(' ');\n }\n return;\n }\n }\n setValue(raw, shouldMergeClassName);\n }\n}\n\nexport function applyAttributes<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n attributes: ExpandedElementAttributes<TTagName>,\n mergeClassName = true,\n): void {\n if (!attributes) return;\n for (const k of Object.keys(attributes) as Array<AttributeKey<TTagName>>) {\n const value = (attributes as Record<string, unknown>)[k as string] as\n AttributeCandidate<TTagName> | undefined;\n // Only merge className for non-className keys OR when explicitly enabled for className\n const shouldMerge = mergeClassName && k === 'className';\n applySingleAttribute(element, k, value, shouldMerge);\n }\n}\n\nexport { createReactiveTextNode } from \"./reactive\";\n","import { isFunction, isNode, isObject } from \"./typeGuards\";\n\ntype BooleanCondition = () => boolean;\ntype ZeroArityFunction = () => unknown;\n\nconst modifierProbeCache = new WeakMap<ZeroArityFunction, { value: unknown; error: boolean }>();\n\nfunction probeOnce(fn: ZeroArityFunction): { value: unknown; error: boolean } {\n const cached = modifierProbeCache.get(fn);\n if (cached) {\n return cached;\n }\n try {\n const value = fn();\n const record = { value, error: false };\n modifierProbeCache.set(fn, record);\n return record;\n } catch {\n const record = { value: undefined, error: true };\n modifierProbeCache.set(fn, record);\n return record;\n }\n}\n\nfunction isBooleanFunction(fn: ZeroArityFunction): fn is BooleanCondition {\n const { value, error } = probeOnce(fn);\n if (error) return false;\n return typeof value === \"boolean\";\n}\n\nexport function isConditionalModifier(\n modifier: unknown,\n allModifiers: unknown[],\n currentIndex: number\n): modifier is BooleanCondition {\n if (!isFunction(modifier) || modifier.length !== 0) {\n return false;\n }\n\n // After checking length === 0, we know it's a ZeroArityFunction\n const zeroArityFn = modifier as ZeroArityFunction;\n if (!isBooleanFunction(zeroArityFn)) {\n return false;\n }\n\n const otherModifiers = allModifiers.filter((_, index) => index !== currentIndex);\n if (otherModifiers.length === 0) return false;\n\n const hasAttributesOrElements = otherModifiers.some((mod) => {\n if (isObject(mod) || isNode(mod)) return true;\n if (isFunction(mod) && mod.length > 0) return true;\n return false;\n });\n\n return hasAttributesOrElements;\n}\n\nexport function findConditionalModifier(modifiers: unknown[]): number {\n for (let i = 0; i < modifiers.length; i += 1) {\n if (isConditionalModifier(modifiers[i], modifiers, i)) {\n return i;\n }\n }\n return -1;\n}\n\nexport { modifierProbeCache };\n","import { applyAttributes } from \"./attributeManager\";\nimport { createReactiveTextNode } from \"./reactive\";\nimport { logError } from \"../utility/errorHandler\";\nimport { isFunction, isNode, isObject, isPrimitive, isZeroArityFunction } from \"../utility/typeGuards\";\nimport { modifierProbeCache } from \"../utility/modifierPredicates\";\nimport { createComment } from \"../utility/dom\";\n\nexport { isConditionalModifier, findConditionalModifier } from \"../utility/modifierPredicates\";\n\nexport type NodeModifier<TTagName extends ElementTagName = ElementTagName> =\n | NodeMod<TTagName>\n | NodeModFn<TTagName>;\n\nexport function applyNodeModifier<TTagName extends ElementTagName>(\n parent: ExpandedElement<TTagName>,\n modifier: NodeModifier<TTagName>,\n index: number,\n): Node | null {\n if (modifier == null) return null;\n\n if (isFunction(modifier)) {\n // Handle zero-argument functions (reactive text or reactive className)\n if (isZeroArityFunction(modifier)) {\n try {\n let record = modifierProbeCache.get(modifier);\n if (!record) {\n const value = (modifier as () => unknown)();\n record = { value, error: false };\n modifierProbeCache.set(modifier, record);\n }\n if (record.error) {\n return createReactiveTextFragment(index, () => \"\");\n }\n const v = record.value;\n\n // Check if the returned value is a className object from cn()\n // Must be a plain object with className property, not a Node or other object\n if (isObject(v) && !isNode(v) && 'className' in v && typeof v.className === 'string' && Object.keys(v).length === 1) {\n // Create a wrapper function that extracts className from the modifier result\n const originalModifier = modifier as () => unknown;\n const classNameFn = () => {\n const result = originalModifier();\n return (result as unknown as { className: string }).className;\n };\n applyAttributes(parent, { className: classNameFn } as ExpandedElementAttributes<TTagName>);\n return null;\n }\n\n if (isPrimitive(v) && v != null) {\n return createReactiveTextFragment(index, modifier as () => Primitive, v);\n }\n return null;\n } catch (error) {\n modifierProbeCache.set(modifier, { value: undefined, error: true });\n logError(\"Error evaluating reactive text function:\", error);\n return createReactiveTextFragment(index, () => \"\");\n }\n }\n\n // Handle NodeModFn functions\n const produced = modifier(parent, index);\n if (produced == null) return null;\n if (isPrimitive(produced)) {\n return createStaticTextFragment(index, produced);\n }\n if (isNode(produced)) return produced;\n if (isObject(produced)) {\n applyAttributes(parent, produced as ExpandedElementAttributes<TTagName>);\n }\n return null;\n }\n\n // Handle non-function modifiers\n const candidate = modifier as NodeMod<TTagName>;\n if (candidate == null) return null;\n if (isPrimitive(candidate)) {\n return createStaticTextFragment(index, candidate);\n }\n if (isNode(candidate)) return candidate;\n if (isObject(candidate)) {\n applyAttributes(parent, candidate as ExpandedElementAttributes<TTagName>);\n }\n return null;\n}\n\nfunction createReactiveTextFragment(\n index: number,\n resolver: () => Primitive,\n preEvaluated?: unknown\n): DocumentFragment {\n const fragment = document.createDocumentFragment();\n const comment = createComment(` text-${index} `);\n if (comment) fragment.appendChild(comment);\n const textNode = createReactiveTextNode(resolver, preEvaluated);\n fragment.appendChild(textNode);\n return fragment;\n}\n\nfunction createStaticTextFragment(index: number, value: Primitive): DocumentFragment {\n const fragment = document.createDocumentFragment();\n const comment = createComment(` text-${index} `);\n if (comment) fragment.appendChild(comment);\n const textNode = document.createTextNode(String(value));\n fragment.appendChild(textNode);\n return fragment;\n}\n","export interface ConditionalInfo<TTagName extends ElementTagName = ElementTagName> {\n condition: () => boolean;\n tagName: TTagName;\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>;\n}\n\ninterface NodeWithConditionalInfo extends Node {\n _conditionalInfo?: ConditionalInfo<keyof HTMLElementTagNameMap>;\n}\n\n/**\n * Registry of all nodes that have conditional info attached.\n * This enables O(nConditionals) updates instead of a full DOM tree walk.\n */\nconst activeConditionalNodes = new Set<Node>();\n\n/**\n * Attach conditional info to a node and register it.\n */\nexport function storeConditionalInfo<TTagName extends ElementTagName>(\n node: Node,\n info: ConditionalInfo<TTagName>\n): void {\n (node as NodeWithConditionalInfo)._conditionalInfo = info as ConditionalInfo<keyof HTMLElementTagNameMap>;\n activeConditionalNodes.add(node);\n}\n\n/**\n * Explicit unregister helper (optional use on teardown if needed).\n */\nexport function unregisterConditionalNode(node: Node): void {\n activeConditionalNodes.delete(node);\n}\n\n/**\n * Returns a readonly view of currently tracked conditional nodes.\n */\nexport function getActiveConditionalNodes(): ReadonlySet<Node> {\n return activeConditionalNodes;\n}\n\nexport function hasConditionalInfo(node: Node): boolean {\n return Boolean((node as NodeWithConditionalInfo)._conditionalInfo);\n}\n\nexport function getConditionalInfo(node: Node): ConditionalInfo<keyof HTMLElementTagNameMap> | null {\n return (node as NodeWithConditionalInfo)._conditionalInfo ?? null;\n}\n","/**\n * Shared helper for applying an array of modifiers to an element.\n * Consolidates the previously duplicated logic in several modules:\n * - conditionalRenderer\n * - conditionalUpdater\n * - elementFactory\n *\n * Goal: single, optimized, well‑typed implementation.\n *\n * A \"modifier\" can:\n * - Return (or be) primitives → appended as text\n * - Return (or be) Node → appended (if not already a child)\n * - Return (or be) attribute objects → merged into element\n * - Be a NodeModFn invoked with (parent, index)\n * - Be a zero‑arg function producing reactive text (handled upstream in applyNodeModifier)\n *\n * Indexing:\n * - startIndex allows callers to continue an index sequence if needed.\n * - Every successfully rendered child Node increments the local index.\n */\nimport { applyNodeModifier } from \"../core/modifierProcessor\";\n\nexport type NodeModifier<TTagName extends ElementTagName = ElementTagName> =\n | NodeMod<TTagName>\n | NodeModFn<TTagName>;\n\nexport interface ApplyModifiersResult<TTagName extends ElementTagName> {\n /**\n * The element passed in (for fluent patterns if desired).\n */\n element: ExpandedElement<TTagName>;\n /**\n * The next index after processing (startIndex + rendered children count).\n */\n nextIndex: number;\n /**\n * Number of child nodes appended (not counting attributes-only modifiers).\n */\n appended: number;\n}\n\n/**\n * Applies modifiers to an element, appending newly produced Nodes while avoiding\n * duplicate DOM insertions (i.e. only appends if parentNode differs).\n *\n * Returns meta information that callers can use for continuation indexing.\n */\nexport function applyModifiers<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>,\n startIndex = 0\n): ApplyModifiersResult<TTagName> {\n if (!modifiers || modifiers.length === 0) {\n return { element, nextIndex: startIndex, appended: 0 };\n }\n\n let localIndex = startIndex;\n let appended = 0;\n const parentNode = element as unknown as Node & ParentNode;\n\n for (let i = 0; i < modifiers.length; i += 1) {\n const mod = modifiers[i];\n // Fast null/undefined skip\n if (mod == null) continue;\n\n const produced = applyNodeModifier(element, mod, localIndex);\n if (!produced) continue;\n\n // Only append if the node isn't already where we expect\n if (produced.parentNode !== parentNode) {\n parentNode.appendChild(produced);\n }\n localIndex += 1;\n appended += 1;\n }\n\n return {\n element,\n nextIndex: localIndex,\n appended\n };\n}\n\n/**\n * Convenience helper: apply modifiers and return the element (fluent style).\n * Discards meta information.\n */\nexport function applyModifiersAndReturn<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>,\n startIndex = 0\n): ExpandedElement<TTagName> {\n applyModifiers(element, modifiers, startIndex);\n return element;\n}\n\n/**\n * Creates an element with the specified tag name and applies modifiers to it.\n * Centralizes element creation logic used across conditionalRenderer and conditionalUpdater.\n */\nexport function createElementWithModifiers<TTagName extends ElementTagName>(\n tagName: TTagName,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>\n): ExpandedElement<TTagName> {\n const el = document.createElement(tagName) as ExpandedElement<TTagName>;\n applyModifiers(el, modifiers, 0);\n return el;\n}","import { findConditionalModifier } from \"./modifierProcessor\";\nimport { isBrowser } from \"../utility/environment\";\nimport { storeConditionalInfo } from \"../utility/conditionalInfo\";\nimport type { ConditionalInfo } from \"../utility/conditionalInfo\";\nimport { createElementWithModifiers, type NodeModifier } from \"../internal/applyModifiers\";\nimport { createConditionalComment } from \"../utility/dom\";\n\nexport function createConditionalElement<TTagName extends ElementTagName>(\n tagName: TTagName,\n condition: () => boolean,\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): ExpandedElement<TTagName> | Comment {\n const passed = condition();\n\n if (!isBrowser) {\n return passed\n ? createElementWithModifiers(tagName, modifiers as ReadonlyArray<NodeModifier<TTagName>>)\n : (createConditionalComment(tagName, \"ssr\") as unknown as ExpandedElement<TTagName>);\n }\n\n const conditionalInfo: ConditionalInfo<TTagName> = { condition, tagName, modifiers };\n\n if (passed) {\n const el = createElementWithModifiers(tagName, modifiers as ReadonlyArray<NodeModifier<TTagName>>);\n storeConditionalInfo(el as Node, conditionalInfo);\n return el;\n }\n\n const comment = createConditionalComment(tagName);\n if (!comment) {\n throw new Error(`Failed to create conditional comment for ${tagName}`);\n }\n storeConditionalInfo(comment as Node, conditionalInfo);\n return comment as unknown as ExpandedElement<TTagName>;\n}\n\nexport function processConditionalModifiers<TTagName extends ElementTagName>(\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): {\n condition: (() => boolean) | null;\n otherModifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>;\n} {\n const conditionalIndex = findConditionalModifier(modifiers);\n\n if (conditionalIndex === -1) {\n return { condition: null, otherModifiers: modifiers };\n }\n\n return {\n condition: modifiers[conditionalIndex] as () => boolean,\n otherModifiers: modifiers.filter((_, index) => index !== conditionalIndex)\n };\n}\n","import { createConditionalElement, processConditionalModifiers } from \"./conditionalRenderer\";\nimport { applyModifiers, type NodeModifier } from \"../internal/applyModifiers\";\nimport { SVG_TAGS } from \"./tagRegistry\";\n\n/**\n * Checks if a tag name is an SVG tag.\n */\nfunction isSVGTag(tagName: string): tagName is keyof SVGElementTagNameMap {\n return (SVG_TAGS as readonly string[]).includes(tagName);\n}\n\n/**\n * Creates an element with proper namespace handling for SVG elements.\n */\nfunction createElementWithNamespace<TTagName extends ElementTagName>(\n tagName: TTagName\n): Element {\n if (isSVGTag(tagName)) {\n return document.createElementNS('http://www.w3.org/2000/svg', tagName);\n }\n return document.createElement(tagName);\n}\n\nexport function createElementFactory<TTagName extends ElementTagName>(\n tagName: TTagName,\n ...modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): NodeModFn<TTagName> {\n return (parent: ExpandedElement<TTagName>, index: number): ExpandedElement<TTagName> => {\n const { condition, otherModifiers } = processConditionalModifiers(modifiers);\n\n if (condition) {\n return createConditionalElement(tagName, condition, otherModifiers) as ExpandedElement<TTagName>;\n }\n\n const el = createElementWithNamespace(tagName) as ExpandedElement<TTagName>;\n applyModifiers(el, otherModifiers as ReadonlyArray<NodeModifier<TTagName>>, index);\n return el;\n };\n}\n\nexport function createTagBuilder<TTagName extends ElementTagName>(\n tagName: TTagName,\n): (...modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>) => NodeModFn<TTagName> {\n return (...mods) => createElementFactory(tagName, ...mods);\n}","import { createTagBuilder } from \"./elementFactory\";\n\nexport const HTML_TAGS = [\n \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"base\",\n \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\",\n \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\", \"details\",\n \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\",\n \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\",\n \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\", \"img\", \"input\", \"ins\",\n \"kbd\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"menu\",\n \"meta\", \"meter\", \"nav\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\",\n \"output\", \"p\", \"picture\", \"pre\", \"progress\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\",\n \"samp\", \"script\", \"search\", \"section\", \"select\", \"slot\", \"small\", \"source\",\n \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\",\n \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\",\n \"track\", \"u\", \"ul\", \"var\", \"video\", \"wbr\",\n] as const satisfies ReadonlyArray<ElementTagName>;\n\nexport const SVG_TAGS = [\n \"a\", \"animate\", \"animateMotion\", \"animateTransform\", \"circle\", \"clipPath\",\n \"defs\", \"desc\", \"ellipse\", \"feBlend\", \"feColorMatrix\", \"feComponentTransfer\",\n \"feComposite\", \"feConvolveMatrix\", \"feDiffuseLighting\", \"feDisplacementMap\",\n \"feDistantLight\", \"feDropShadow\", \"feFlood\", \"feFuncA\", \"feFuncB\", \"feFuncG\",\n \"feFuncR\", \"feGaussianBlur\", \"feImage\", \"feMerge\", \"feMergeNode\", \"feMorphology\",\n \"feOffset\", \"fePointLight\", \"feSpecularLighting\", \"feSpotLight\", \"feTile\",\n \"feTurbulence\", \"filter\", \"foreignObject\", \"g\", \"image\", \"line\", \"linearGradient\",\n \"marker\", \"mask\", \"metadata\", \"mpath\", \"path\", \"pattern\", \"polygon\", \"polyline\",\n \"radialGradient\", \"rect\", \"script\", \"set\", \"stop\", \"style\", \"svg\", \"switch\",\n \"symbol\", \"text\", \"textPath\", \"title\", \"tspan\", \"use\", \"view\",\n] as const satisfies ReadonlyArray<keyof SVGElementTagNameMap>;\n\nexport const SELF_CLOSING_TAGS = [\n \"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\",\n \"source\", \"track\", \"wbr\",\n] as const satisfies ReadonlyArray<ElementTagName>;\n\nfunction registerHtmlTag(target: Record<string, unknown>, tagName: ElementTagName): void {\n // Don't overwrite non-function properties (safety check)\n if (tagName in target && typeof target[tagName] !== 'function') {\n return;\n }\n // Register HTML tags - they override SVG tags with same name\n target[tagName] = createTagBuilder(tagName);\n}\n\nfunction registerSvgTag(target: Record<string, unknown>, tagName: keyof SVGElementTagNameMap): void {\n // Some SVG tags conflict with HTML tags or DOM globals\n // Use suffix convention: a_svg, script_svg, style_svg, title_svg, text_svg, stop_\n const conflictingTags = ['a', 'script', 'style', 'title', 'text'];\n const globalConflicts = ['stop']; // 'stop' conflicts with DOM stop property\n\n let exportName: string = tagName;\n if (conflictingTags.includes(tagName)) {\n exportName = `${tagName}_svg`;\n } else if (globalConflicts.includes(tagName)) {\n exportName = `${tagName}_`;\n }\n\n if (!(exportName in target)) {\n target[exportName] = createTagBuilder(tagName as ElementTagName);\n }\n}\n\nexport function registerGlobalTagBuilders(target: Record<string, unknown> = globalThis): void {\n const marker = \"__nuclo_tags_registered\";\n if ((target as Record<string, boolean>)[marker]) return;\n\n // Register SVG tags first with special names for conflicts\n SVG_TAGS.forEach((tagName) => registerSvgTag(target, tagName));\n\n // Then register HTML tags - these will take precedence for conflicting names\n // So 'a' will be HTML by default, and 'a_svg' will be available for SVG anchors\n HTML_TAGS.forEach((tagName) => registerHtmlTag(target, tagName));\n\n (target as Record<string, boolean>)[marker] = true;\n}\n","import { createMarkerPair, safeRemoveChild } from \"../utility/dom\";\nimport { arraysEqual } from \"../utility/arrayUtils\";\nimport { resolveRenderable } from \"../utility/renderables\";\nimport type { ListRenderer, ListRuntime, ListItemRecord, ListItemsProvider } from \"./types\";\n\nconst activeListRuntimes = new Set<ListRuntime<unknown, keyof HTMLElementTagNameMap>>();\n\nfunction renderItem<TItem, TTagName extends ElementTagName>(\n runtime: ListRuntime<TItem, TTagName>,\n item: TItem,\n index: number,\n): ExpandedElement<TTagName> | null {\n const result = runtime.renderItem(item, index);\n return resolveRenderable<TTagName>(result, runtime.host, index);\n}\n\nfunction remove<TItem, TTagName extends ElementTagName>(record: ListItemRecord<TItem, TTagName>): void {\n safeRemoveChild(record.element as unknown as Node);\n}\n\nexport function sync<TItem, TTagName extends ElementTagName>(\n runtime: ListRuntime<TItem, TTagName>\n): void {\n const { host, startMarker, endMarker } = runtime;\n const parent = (startMarker.parentNode ?? (host as unknown as Node & ParentNode)) as\n Node & ParentNode;\n\n const currentItems = runtime.itemsProvider();\n\n if (arraysEqual(runtime.lastSyncedItems, currentItems)) return;\n\n const recordsByPosition = new Map<number, ListItemRecord<TItem, TTagName>>();\n const availableRecords = new Map<TItem, ListItemRecord<TItem, TTagName>[]>();\n\n runtime.records.forEach((record) => {\n const items = availableRecords.get(record.item);\n if (items) {\n items.push(record);\n } else {\n availableRecords.set(record.item, [record]);\n }\n });\n\n currentItems.forEach((item, newIndex) => {\n if (\n newIndex < runtime.lastSyncedItems.length &&\n runtime.lastSyncedItems[newIndex] === item\n ) {\n const existingRecord = runtime.records[newIndex];\n if (existingRecord && existingRecord.item === item) {\n recordsByPosition.set(newIndex, existingRecord);\n const items = availableRecords.get(item);\n if (items) {\n const recordIndex = items.indexOf(existingRecord);\n if (recordIndex >= 0) {\n items.splice(recordIndex, 1);\n if (items.length === 0) {\n availableRecords.delete(item);\n }\n }\n }\n }\n }\n });\n\n const newRecords: Array<ListItemRecord<TItem, TTagName>> = [];\n const elementsToRemove = new Set<ListItemRecord<TItem, TTagName>>(runtime.records);\n let nextSibling: Node = endMarker;\n\n for (let i = currentItems.length - 1; i >= 0; i--) {\n const item = currentItems[i];\n let record = recordsByPosition.get(i);\n\n if (!record) {\n const availableItems = availableRecords.get(item);\n if (availableItems && availableItems.length > 0) {\n record = availableItems.shift()!;\n if (availableItems.length === 0) {\n availableRecords.delete(item);\n }\n }\n }\n\n if (record) {\n elementsToRemove.delete(record);\n } else {\n const element = renderItem(runtime, item, i);\n if (!element) continue;\n record = { item, element };\n }\n\n newRecords.unshift(record);\n\n const recordNode = record.element as unknown as Node;\n if (recordNode.nextSibling !== nextSibling) {\n parent.insertBefore(recordNode, nextSibling);\n }\n nextSibling = recordNode;\n }\n\n elementsToRemove.forEach(remove);\n\n runtime.records = newRecords;\n runtime.lastSyncedItems = [...currentItems];\n}\n\nexport function createListRuntime<TItem, TTagName extends ElementTagName = ElementTagName>(\n itemsProvider: ListItemsProvider<TItem>,\n renderItem: ListRenderer<TItem, TTagName>,\n host: ExpandedElement<TTagName>,\n): ListRuntime<TItem, TTagName> {\n const { start: startMarker, end: endMarker } = createMarkerPair(\"list\");\n\n const runtime: ListRuntime<TItem, TTagName> = {\n itemsProvider,\n renderItem,\n startMarker,\n endMarker,\n records: [],\n host,\n lastSyncedItems: [],\n };\n\n const parentNode = host as unknown as Node & ParentNode;\n parentNode.appendChild(startMarker);\n parentNode.appendChild(endMarker);\n\n activeListRuntimes.add(runtime as ListRuntime<unknown, keyof HTMLElementTagNameMap>);\n sync(runtime);\n\n return runtime;\n}\n\nexport function updateListRuntimes(): void {\n activeListRuntimes.forEach((runtime) => {\n if (!runtime.startMarker.isConnected || !runtime.endMarker.isConnected) {\n activeListRuntimes.delete(runtime);\n return;\n }\n\n sync(runtime);\n });\n}\n","import { isFunction, isTagLike } from \"./typeGuards\";\n\ntype RenderableInput<TTagName extends ElementTagName = ElementTagName> =\n | NodeModFn<TTagName>\n | ExpandedElement<TTagName>\n | Node\n | null\n | undefined;\n\nexport function resolveRenderable<TTagName extends ElementTagName = ElementTagName>(\n result: RenderableInput<TTagName>,\n host: ExpandedElement<TTagName>,\n index: number\n): ExpandedElement<TTagName> | null {\n if (isFunction(result)) {\n const element = result(host, index);\n if (element && isTagLike(element)) {\n return element as ExpandedElement<TTagName>;\n }\n return null;\n }\n\n if (result && isTagLike(result)) {\n return result as ExpandedElement<TTagName>;\n }\n\n return null;\n}\n","export function arraysEqual<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if ((i in a ? a[i] : undefined) !== (i in b ? b[i] : undefined)) return false;\n }\n return true;\n}\n","import { createListRuntime } from \"./runtime\";\nimport type { ListRenderer, ListItemsProvider } from \"./types\";\n\n/**\n * Maps items to DOM elements, keeping them in sync with changes.\n */\nexport function list<TItem, TTagName extends ElementTagName = ElementTagName>(\n itemsProvider: ListItemsProvider<TItem>,\n render: ListRenderer<TItem, TTagName>,\n): NodeModFn<TTagName> {\n return (host: ExpandedElement<TTagName>, index: number): Comment => {\n const runtime = createListRuntime(itemsProvider, render, host);\n // Return the start marker comment node\n // NodeModFn can return NodeMod | void, and Comment is a valid Node type\n return runtime.startMarker;\n };\n}\n","export type ConditionInput = boolean | (() => boolean);\n\nexport function runCondition(\n condition: () => boolean,\n onError?: (error: unknown) => void\n): boolean {\n try {\n return condition();\n } catch (error) {\n if (onError) {\n onError(error);\n return false;\n }\n throw error;\n }\n}\n\nexport function resolveCondition(\n value: ConditionInput,\n onError?: (error: unknown) => void\n): boolean {\n return typeof value === \"function\" ? runCondition(value, onError) : Boolean(value);\n}\n","import { applyNodeModifier } from \"../core/modifierProcessor\";\nimport { modifierProbeCache } from \"../utility/modifierPredicates\";\nimport { isFunction, isZeroArityFunction } from \"../utility/typeGuards\";\nimport { withScopedInsertion } from \"../utility/domTypeHelpers\";\nimport type { WhenContent } from \"./runtime\";\n\n/**\n * Renders a single content item and returns the resulting node if any.\n */\nfunction renderContentItem<TTagName extends ElementTagName>(\n item: WhenContent<TTagName>,\n host: ExpandedElement<TTagName>,\n index: number,\n endMarker: Comment\n): Node | null {\n if (!isFunction(item)) {\n return applyNodeModifier(host, item, index);\n }\n\n // Zero-arity functions need cache cleared\n if (isZeroArityFunction(item)) {\n modifierProbeCache.delete(item);\n return applyNodeModifier(host, item, index);\n }\n\n // Non-zero-arity functions need scoped insertion to insert before endMarker\n return withScopedInsertion(host, endMarker, () => {\n const maybeNode = applyNodeModifier(host, item, index);\n // Only include nodes that weren't already inserted\n return maybeNode && !maybeNode.parentNode ? maybeNode : null;\n });\n}\n\n/**\n * Renders a list of content items and collects the resulting nodes.\n */\nexport function renderContentItems<TTagName extends ElementTagName>(\n items: ReadonlyArray<WhenContent<TTagName>>,\n host: ExpandedElement<TTagName>,\n index: number,\n endMarker: Comment\n): Node[] {\n const nodes: Node[] = [];\n for (const item of items) {\n const node = renderContentItem(item, host, index, endMarker);\n if (node) {\n nodes.push(node);\n }\n }\n return nodes;\n}\n","import { clearBetweenMarkers, insertNodesBefore } from \"../utility/dom\";\nimport { resolveCondition } from \"../utility/conditions\";\nimport { renderContentItems } from \"./renderer\";\n\nexport type WhenCondition = boolean | (() => boolean);\nexport type WhenContent<TTagName extends ElementTagName = ElementTagName> =\n NodeMod<TTagName> | NodeModFn<TTagName>;\n\nexport interface WhenGroup<TTagName extends ElementTagName = ElementTagName> {\n condition: WhenCondition;\n content: WhenContent<TTagName>[];\n}\n\nexport interface WhenRuntime<TTagName extends ElementTagName = ElementTagName> {\n startMarker: Comment;\n endMarker: Comment;\n host: ExpandedElement<TTagName>;\n index: number;\n groups: WhenGroup<TTagName>[];\n elseContent: WhenContent<TTagName>[];\n /**\n * Tracks which branch is currently rendered:\n * - null: nothing rendered yet\n * - -1: else branch\n * - >=0: index of groups[]\n */\n activeIndex: number | -1 | null;\n update(): void;\n}\n\nconst activeWhenRuntimes = new Set<WhenRuntime<any>>();\n\n/**\n * Evaluates which condition branch should be active.\n * Returns the index of the first truthy condition, -1 for else branch, or null for no match.\n */\nfunction evaluateActiveCondition<TTagName extends ElementTagName>(\n groups: ReadonlyArray<WhenGroup<TTagName>>,\n elseContent: ReadonlyArray<WhenContent<TTagName>>\n): number | -1 | null {\n for (let i = 0; i < groups.length; i++) {\n if (resolveCondition(groups[i].condition)) {\n return i;\n }\n }\n return elseContent.length > 0 ? -1 : null;\n}\n\n/**\n * Main render function for when/else conditionals.\n * Evaluates conditions, clears old content, and renders the active branch.\n */\nexport function renderWhenContent<TTagName extends ElementTagName>(\n runtime: WhenRuntime<TTagName>\n): void {\n const { groups, elseContent, host, index, endMarker } = runtime;\n\n const newActive = evaluateActiveCondition(groups, elseContent);\n\n // No change needed\n if (newActive === runtime.activeIndex) return;\n\n // Clear previous content and update active index\n clearBetweenMarkers(runtime.startMarker, runtime.endMarker);\n runtime.activeIndex = newActive;\n\n // Nothing to render\n if (newActive === null) return;\n\n // Render the active branch\n const contentToRender = newActive >= 0 ? groups[newActive].content : elseContent;\n const nodes = renderContentItems(contentToRender, host, index, endMarker);\n\n insertNodesBefore(nodes, endMarker);\n}\n\n/**\n * Registers a when runtime for tracking and updates\n */\nexport function registerWhenRuntime<TTagName extends ElementTagName>(\n runtime: WhenRuntime<TTagName>\n): void {\n activeWhenRuntimes.add(runtime);\n}\n\n/**\n * Updates all active when/else conditional runtimes.\n *\n * Re-evaluates all conditional branches and re-renders if the active branch has changed.\n * Automatically cleans up runtimes that throw errors during update.\n *\n * This function should be called after state changes that affect conditional expressions.\n *\n * @example\n * ```ts\n * isLoggedIn.value = true;\n * updateWhenRuntimes(); // All when() conditionals re-evaluate\n * ```\n */\nexport function updateWhenRuntimes(): void {\n activeWhenRuntimes.forEach((runtime) => {\n try {\n runtime.update();\n } catch (error) {\n activeWhenRuntimes.delete(runtime);\n }\n });\n}\n\n/**\n * Clears all active when/else conditional runtimes.\n *\n * This is typically used for cleanup or testing purposes.\n * After calling this, no when() conditionals will be tracked for updates.\n */\nexport function clearWhenRuntimes(): void {\n activeWhenRuntimes.clear();\n}\n","import { isBrowser } from \"../utility/environment\";\nimport { createMarkerPair, createComment } from \"../utility/dom\";\nimport { asParentNode } from \"../utility/domTypeHelpers\";\nimport type { WhenCondition, WhenContent, WhenGroup, WhenRuntime } from \"./runtime\";\nimport { renderWhenContent, registerWhenRuntime } from \"./runtime\";\n\nclass WhenBuilderImpl<TTagName extends ElementTagName = ElementTagName> {\n private groups: WhenGroup<TTagName>[] = [];\n private elseContent: WhenContent<TTagName>[] = [];\n\n constructor(initialCondition: WhenCondition, ...content: WhenContent<TTagName>[]) {\n this.groups.push({ condition: initialCondition, content });\n }\n\n when(condition: WhenCondition, ...content: WhenContent<TTagName>[]): WhenBuilderImpl<TTagName> {\n this.groups.push({ condition, content });\n return this;\n }\n\n else(...content: WhenContent<TTagName>[]): WhenBuilderImpl<TTagName> {\n this.elseContent = content;\n return this;\n }\n\n render(host: ExpandedElement<TTagName>, index: number): Node | null {\n if (!isBrowser) {\n const comment = createComment(\"when-ssr\");\n return comment || null;\n }\n\n const { start: startMarker, end: endMarker } = createMarkerPair(\"when\");\n\n const runtime: WhenRuntime<TTagName> = {\n startMarker,\n endMarker,\n host,\n index,\n groups: [...this.groups],\n elseContent: [...this.elseContent],\n activeIndex: null,\n update: () => renderWhenContent(runtime),\n };\n\n registerWhenRuntime(runtime);\n\n const parent = asParentNode(host);\n parent.appendChild(startMarker);\n parent.appendChild(endMarker);\n\n renderWhenContent(runtime);\n\n return startMarker;\n }\n}\n\nexport function createWhenBuilderFunction<TTagName extends ElementTagName>(\n builder: WhenBuilderImpl<TTagName>\n): WhenBuilder<TTagName> {\n const nodeModFn = (host: ExpandedElement<TTagName>, index: number): Node | null => {\n return builder.render(host, index);\n };\n\n return Object.assign(nodeModFn, {\n when: (condition: WhenCondition, ...content: WhenContent<TTagName>[]): WhenBuilder<TTagName> => {\n builder.when(condition, ...content);\n return createWhenBuilderFunction(builder);\n },\n else: (...content: WhenContent<TTagName>[]): WhenBuilder<TTagName> => {\n builder.else(...content);\n return createWhenBuilderFunction(builder);\n },\n }) as unknown as WhenBuilder<TTagName>;\n}\n\nexport { WhenBuilderImpl };\n","import { WhenBuilderImpl, createWhenBuilderFunction } from \"./builder\";\nimport type { WhenCondition, WhenContent } from \"./runtime\";\n\nexport { updateWhenRuntimes, clearWhenRuntimes } from \"./runtime\";\n\n/**\n * Creates a conditional rendering block (when/else logic).\n *\n * Renders different content based on boolean conditions, similar to if/else statements.\n * Conditions can be static booleans or reactive functions that are re-evaluated on updates.\n *\n * @param condition - Boolean value or function returning a boolean\n * @param content - Content to render when condition is true\n * @returns A builder that allows chaining additional .when() or .else() branches\n *\n * @example\n * ```ts\n * const isLoggedIn = signal(false);\n *\n * div(\n * when(() => isLoggedIn.value,\n * span('Welcome back!')\n * )\n * .else(\n * button('Login', on('click', () => login()))\n * )\n * )\n * ```\n *\n * @example\n * ```ts\n * // Multiple conditions\n * div(\n * when(() => status.value === 'loading',\n * spinner()\n * )\n * .when(() => status.value === 'error',\n * errorMessage()\n * )\n * .else(\n * contentView()\n * )\n * )\n * ```\n */\nexport function when<TTagName extends ElementTagName = ElementTagName>(\n condition: WhenCondition,\n ...content: WhenContent<TTagName>[]\n): WhenBuilder<TTagName> {\n const builder = new WhenBuilderImpl<TTagName>(condition, ...content);\n return createWhenBuilderFunction(builder);\n}\n","import { createElementWithModifiers } from \"../internal/applyModifiers\";\nimport { isBrowser } from \"../utility/environment\";\nimport {\n ConditionalInfo,\n getConditionalInfo,\n storeConditionalInfo,\n getActiveConditionalNodes,\n unregisterConditionalNode,\n} from \"../utility/conditionalInfo\";\nimport { runCondition } from \"../utility/conditions\";\nimport { replaceNodeSafely, createConditionalComment } from \"../utility/dom\";\nimport { logError } from \"../utility/errorHandler\";\n\nfunction createElementFromConditionalInfo<TTagName extends ElementTagName>(\n conditionalInfo: ConditionalInfo<TTagName>\n): ExpandedElement<TTagName> {\n try {\n return createElementWithModifiers(conditionalInfo.tagName, conditionalInfo.modifiers);\n } catch (error) {\n logError(`Error applying modifiers in conditional element \"${conditionalInfo.tagName}\"`, error);\n // Return a basic element without modifiers as fallback\n return document.createElement(conditionalInfo.tagName) as ExpandedElement<TTagName>;\n }\n}\n\nfunction updateConditionalNode(node: Element | Comment): void {\n const conditionalInfo = getConditionalInfo(node);\n if (!conditionalInfo) {\n return;\n }\n\n const shouldShow = runCondition(conditionalInfo.condition, (error) => {\n logError(\"Error evaluating conditional condition\", error);\n });\n const isElement = node.nodeType === Node.ELEMENT_NODE;\n\n if (shouldShow && !isElement) {\n const element = createElementFromConditionalInfo(conditionalInfo);\n storeConditionalInfo(element as Node, conditionalInfo);\n replaceNodeSafely(node, element as Node);\n } else if (!shouldShow && isElement) {\n const comment = createConditionalComment(conditionalInfo.tagName);\n if (comment) {\n storeConditionalInfo(comment, conditionalInfo);\n replaceNodeSafely(node, comment);\n }\n }\n}\n\nexport function updateConditionalElements(): void {\n if (!isBrowser) return;\n\n try {\n getActiveConditionalNodes().forEach((node) => {\n if (!node.isConnected) {\n unregisterConditionalNode(node);\n return;\n }\n updateConditionalNode(node as Element | Comment);\n });\n } catch (error) {\n logError(\"Error during conditional elements update\", error);\n }\n}\n","import { updateListRuntimes } from \"../list/runtime\";\nimport { notifyReactiveElements, notifyReactiveTextNodes } from \"./reactive\";\nimport { updateWhenRuntimes } from \"../when\";\nimport { updateConditionalElements } from \"./conditionalUpdater\";\nimport { dispatchGlobalUpdateEvent } from \"../utility/events\";\n\nconst updaters = [\n updateListRuntimes,\n updateWhenRuntimes,\n updateConditionalElements,\n notifyReactiveElements,\n notifyReactiveTextNodes,\n dispatchGlobalUpdateEvent,\n] as const;\n\nexport function update(): void {\n for (const fn of updaters) fn();\n}\n","import { logError } from \"./errorHandler\";\n\nexport function dispatchGlobalUpdateEvent(): void {\n if (typeof document === \"undefined\") return;\n\n const targets: EventTarget[] = document.body ? [document.body, document] : [document];\n\n for (const target of targets) {\n try {\n target.dispatchEvent(new Event(\"update\", { bubbles: true }));\n } catch (error) {\n logError(\"Error dispatching global update event\", error);\n }\n }\n}\n","/**\n * Typed event listener helper.\n *\n * Usage:\n * button(\n * \"Click\",\n * on(\"click\", (e) => {\n * // e is correctly typed (e.g. MouseEvent for \"click\")\n * })\n * )\n *\n * Design notes:\n * - Returns a NodeModFn so it can be used like any other modifier.\n * - Produces no child node (returns void in the modifier body).\n * - Provides strong typing of the event object based on the DOM event name.\n */\n\nimport { logError } from \"./errorHandler\";\n\n/**\n * Overload for standard HTMLElement events (strongly typed via lib.dom.d.ts)\n */\nexport function on<\n K extends keyof HTMLElementEventMap,\n TTagName extends ElementTagName = ElementTagName\n>(\n type: K,\n listener: (ev: HTMLElementEventMap[K]) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName>;\n\n/**\n * Fallback / custom event overload (arbitrary event names or custom event types).\n * Specify a custom event type with the E generic if needed:\n * on<\"my-event\", CustomEvent<MyDetail>>(\"my-event\", e => { ... })\n */\nexport function on<\n K extends string,\n E extends Event = Event,\n TTagName extends ElementTagName = ElementTagName\n>(\n type: K,\n listener: (ev: E) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName>;\n\nexport function on<TTagName extends ElementTagName = ElementTagName>(\n type: string,\n listener: (ev: Event) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName> {\n return (parent: ExpandedElement<TTagName>): void => {\n // Type guard: verify parent is an HTMLElement with addEventListener\n if (!parent || typeof (parent as HTMLElement).addEventListener !== \"function\") {\n return;\n }\n\n const el = parent as HTMLElement;\n const wrapped = (ev: Event): void => {\n try {\n listener.call(el, ev);\n } catch (error) {\n logError(`Error in '${type}' listener`, error);\n }\n };\n\n el.addEventListener(type, wrapped as EventListener, options);\n };\n}\n\n/**\n * (Optional) Helper to detect an on()-produced modifier (placeholder for future use).\n */\nexport function isOnModifier(fn: unknown): boolean {\n return typeof fn === \"function\" && Object.prototype.hasOwnProperty.call(fn, \"__nucloOn\");\n}","/**\n * Renders a NodeModFn to a parent element by calling it and appending the result.\n *\n * @param nodeModFn The NodeModFn to render (created by tag builders like div(), h1(), etc.)\n * @param parent The parent element to render into (defaults to document.body)\n * @param index The index to pass to the NodeModFn (defaults to 0)\n * @returns The rendered element\n */\nexport function render<TTagName extends ElementTagName = ElementTagName>(\n nodeModFn: NodeModFn<TTagName>,\n parent?: Element,\n index: number = 0\n): ExpandedElement<TTagName> {\n const targetParent = (parent || document.body) as ExpandedElement<TTagName>;\n const element = nodeModFn(targetParent, index) as ExpandedElement<TTagName>;\n (parent || document.body).appendChild(element as Node);\n return element;\n}\n","// Style properties registry - defines all CSS properties that can be used\n// This allows dynamic generation of methods and functions\n\nexport interface StylePropertyDefinition {\n\t/** The method/function name (e.g., \"bg\", \"fontSize\") */\n\tname: string;\n\t/** The CSS property name (e.g., \"background-color\", \"font-size\") */\n\tcssProperty: string;\n\t/** Optional: Default value to use if none provided */\n\tdefaultValue?: string;\n\t/** Optional: Whether this is a shorthand that takes no arguments */\n\tisShorthand?: boolean;\n}\n\nexport const STYLE_PROPERTIES: readonly StylePropertyDefinition[] = [\n\t// Display\n\t{ name: \"display\", cssProperty: \"display\" },\n\t{ name: \"grid\", cssProperty: \"display\", defaultValue: \"grid\", isShorthand: true },\n\n\t// Colors\n\t{ name: \"bg\", cssProperty: \"background-color\" },\n\t{ name: \"color\", cssProperty: \"color\" },\n\t{ name: \"accentColor\", cssProperty: \"accent-color\" },\n\n\t// Typography\n\t{ name: \"fontSize\", cssProperty: \"font-size\" },\n\t{ name: \"fontWeight\", cssProperty: \"font-weight\" },\n\t{ name: \"fontFamily\", cssProperty: \"font-family\" },\n\t{ name: \"lineHeight\", cssProperty: \"line-height\" },\n\t{ name: \"letterSpacing\", cssProperty: \"letter-spacing\" },\n\t{ name: \"textAlign\", cssProperty: \"text-align\" },\n\t{ name: \"textDecoration\", cssProperty: \"text-decoration\" },\n\t{ name: \"fontStyle\", cssProperty: \"font-style\" },\n\t{ name: \"fontVariant\", cssProperty: \"font-variant\" },\n\t{ name: \"fontStretch\", cssProperty: \"font-stretch\" },\n\t{ name: \"textTransform\", cssProperty: \"text-transform\" },\n\t{ name: \"textIndent\", cssProperty: \"text-indent\" },\n\t{ name: \"textOverflow\", cssProperty: \"text-overflow\" },\n\t{ name: \"textShadow\", cssProperty: \"text-shadow\" },\n\t{ name: \"whiteSpace\", cssProperty: \"white-space\" },\n\t{ name: \"wordSpacing\", cssProperty: \"word-spacing\" },\n\t{ name: \"wordWrap\", cssProperty: \"word-wrap\" },\n\t{ name: \"overflowWrap\", cssProperty: \"overflow-wrap\" },\n\t{ name: \"textAlignLast\", cssProperty: \"text-align-last\" },\n\t{ name: \"textJustify\", cssProperty: \"text-justify\" },\n\t{ name: \"textDecorationLine\", cssProperty: \"text-decoration-line\" },\n\t{ name: \"textDecorationColor\", cssProperty: \"text-decoration-color\" },\n\t{ name: \"textDecorationStyle\", cssProperty: \"text-decoration-style\" },\n\t{ name: \"textDecorationThickness\", cssProperty: \"text-decoration-thickness\" },\n\t{ name: \"textUnderlineOffset\", cssProperty: \"text-underline-offset\" },\n\t{ name: \"verticalAlign\", cssProperty: \"vertical-align\" },\n\n\t// Layout\n\t{ name: \"position\", cssProperty: \"position\" },\n\t{ name: \"padding\", cssProperty: \"padding\" },\n\t{ name: \"paddingTop\", cssProperty: \"padding-top\" },\n\t{ name: \"paddingRight\", cssProperty: \"padding-right\" },\n\t{ name: \"paddingBottom\", cssProperty: \"padding-bottom\" },\n\t{ name: \"paddingLeft\", cssProperty: \"padding-left\" },\n\t{ name: \"margin\", cssProperty: \"margin\" },\n\t{ name: \"marginTop\", cssProperty: \"margin-top\" },\n\t{ name: \"marginRight\", cssProperty: \"margin-right\" },\n\t{ name: \"marginBottom\", cssProperty: \"margin-bottom\" },\n\t{ name: \"marginLeft\", cssProperty: \"margin-left\" },\n\t{ name: \"width\", cssProperty: \"width\" },\n\t{ name: \"height\", cssProperty: \"height\" },\n\t{ name: \"minWidth\", cssProperty: \"min-width\" },\n\t{ name: \"maxWidth\", cssProperty: \"max-width\" },\n\t{ name: \"minHeight\", cssProperty: \"min-height\" },\n\t{ name: \"maxHeight\", cssProperty: \"max-height\" },\n\t{ name: \"boxSizing\", cssProperty: \"box-sizing\" },\n\n\t// Positioning\n\t{ name: \"top\", cssProperty: \"top\" },\n\t{ name: \"right\", cssProperty: \"right\" },\n\t{ name: \"bottom\", cssProperty: \"bottom\" },\n\t{ name: \"left\", cssProperty: \"left\" },\n\t{ name: \"zIndex\", cssProperty: \"z-index\" },\n\n\t// Flexbox\n\t{ name: \"flexDirection\", cssProperty: \"flex-direction\" },\n\t{ name: \"alignItems\", cssProperty: \"align-items\" },\n\t{ name: \"justifyContent\", cssProperty: \"justify-content\" },\n\t{ name: \"gap\", cssProperty: \"gap\" },\n\t{ name: \"flexWrap\", cssProperty: \"flex-wrap\" },\n\t{ name: \"flexGrow\", cssProperty: \"flex-grow\" },\n\t{ name: \"flexShrink\", cssProperty: \"flex-shrink\" },\n\t{ name: \"flexBasis\", cssProperty: \"flex-basis\" },\n\t{ name: \"alignSelf\", cssProperty: \"align-self\" },\n\t{ name: \"alignContent\", cssProperty: \"align-content\" },\n\t{ name: \"justifySelf\", cssProperty: \"justify-self\" },\n\t{ name: \"justifyItems\", cssProperty: \"justify-items\" },\n\n\t// Grid\n\t{ name: \"gridTemplateColumns\", cssProperty: \"grid-template-columns\" },\n\t{ name: \"gridTemplateRows\", cssProperty: \"grid-template-rows\" },\n\t{ name: \"gridTemplateAreas\", cssProperty: \"grid-template-areas\" },\n\t{ name: \"gridColumn\", cssProperty: \"grid-column\" },\n\t{ name: \"gridRow\", cssProperty: \"grid-row\" },\n\t{ name: \"gridColumnStart\", cssProperty: \"grid-column-start\" },\n\t{ name: \"gridColumnEnd\", cssProperty: \"grid-column-end\" },\n\t{ name: \"gridRowStart\", cssProperty: \"grid-row-start\" },\n\t{ name: \"gridRowEnd\", cssProperty: \"grid-row-end\" },\n\t{ name: \"gridArea\", cssProperty: \"grid-area\" },\n\t{ name: \"gridAutoColumns\", cssProperty: \"grid-auto-columns\" },\n\t{ name: \"gridAutoRows\", cssProperty: \"grid-auto-rows\" },\n\t{ name: \"gridAutoFlow\", cssProperty: \"grid-auto-flow\" },\n\n\t// Borders\n\t{ name: \"border\", cssProperty: \"border\" },\n\t{ name: \"borderTop\", cssProperty: \"border-top\" },\n\t{ name: \"borderRight\", cssProperty: \"border-right\" },\n\t{ name: \"borderBottom\", cssProperty: \"border-bottom\" },\n\t{ name: \"borderLeft\", cssProperty: \"border-left\" },\n\t{ name: \"borderWidth\", cssProperty: \"border-width\" },\n\t{ name: \"borderStyle\", cssProperty: \"border-style\" },\n\t{ name: \"borderColor\", cssProperty: \"border-color\" },\n\t{ name: \"borderTopWidth\", cssProperty: \"border-top-width\" },\n\t{ name: \"borderRightWidth\", cssProperty: \"border-right-width\" },\n\t{ name: \"borderBottomWidth\", cssProperty: \"border-bottom-width\" },\n\t{ name: \"borderLeftWidth\", cssProperty: \"border-left-width\" },\n\t{ name: \"borderTopStyle\", cssProperty: \"border-top-style\" },\n\t{ name: \"borderRightStyle\", cssProperty: \"border-right-style\" },\n\t{ name: \"borderBottomStyle\", cssProperty: \"border-bottom-style\" },\n\t{ name: \"borderLeftStyle\", cssProperty: \"border-left-style\" },\n\t{ name: \"borderTopColor\", cssProperty: \"border-top-color\" },\n\t{ name: \"borderRightColor\", cssProperty: \"border-right-color\" },\n\t{ name: \"borderBottomColor\", cssProperty: \"border-bottom-color\" },\n\t{ name: \"borderLeftColor\", cssProperty: \"border-left-color\" },\n\t{ name: \"borderRadius\", cssProperty: \"border-radius\" },\n\t{ name: \"borderTopLeftRadius\", cssProperty: \"border-top-left-radius\" },\n\t{ name: \"borderTopRightRadius\", cssProperty: \"border-top-right-radius\" },\n\t{ name: \"borderBottomLeftRadius\", cssProperty: \"border-bottom-left-radius\" },\n\t{ name: \"borderBottomRightRadius\", cssProperty: \"border-bottom-right-radius\" },\n\n\t// Outline\n\t{ name: \"outline\", cssProperty: \"outline\" },\n\t{ name: \"outlineWidth\", cssProperty: \"outline-width\" },\n\t{ name: \"outlineStyle\", cssProperty: \"outline-style\" },\n\t{ name: \"outlineColor\", cssProperty: \"outline-color\" },\n\t{ name: \"outlineOffset\", cssProperty: \"outline-offset\" },\n\n\t// Background\n\t{ name: \"backgroundColor\", cssProperty: \"background-color\" },\n\t{ name: \"backgroundImage\", cssProperty: \"background-image\" },\n\t{ name: \"backgroundRepeat\", cssProperty: \"background-repeat\" },\n\t{ name: \"backgroundPosition\", cssProperty: \"background-position\" },\n\t{ name: \"backgroundSize\", cssProperty: \"background-size\" },\n\t{ name: \"backgroundAttachment\", cssProperty: \"background-attachment\" },\n\t{ name: \"backgroundClip\", cssProperty: \"background-clip\" },\n\t{ name: \"backgroundOrigin\", cssProperty: \"background-origin\" },\n\n\t// Effects\n\t{ name: \"boxShadow\", cssProperty: \"box-shadow\" },\n\t{ name: \"opacity\", cssProperty: \"opacity\" },\n\t{ name: \"transition\", cssProperty: \"transition\" },\n\t{ name: \"transitionProperty\", cssProperty: \"transition-property\" },\n\t{ name: \"transitionDuration\", cssProperty: \"transition-duration\" },\n\t{ name: \"transitionTimingFunction\", cssProperty: \"transition-timing-function\" },\n\t{ name: \"transitionDelay\", cssProperty: \"transition-delay\" },\n\n\t// Transform\n\t{ name: \"transform\", cssProperty: \"transform\" },\n\t{ name: \"transformOrigin\", cssProperty: \"transform-origin\" },\n\t{ name: \"transformStyle\", cssProperty: \"transform-style\" },\n\t{ name: \"perspective\", cssProperty: \"perspective\" },\n\t{ name: \"perspectiveOrigin\", cssProperty: \"perspective-origin\" },\n\t{ name: \"backfaceVisibility\", cssProperty: \"backface-visibility\" },\n\n\t// Animation\n\t{ name: \"animation\", cssProperty: \"animation\" },\n\t{ name: \"animationName\", cssProperty: \"animation-name\" },\n\t{ name: \"animationDuration\", cssProperty: \"animation-duration\" },\n\t{ name: \"animationTimingFunction\", cssProperty: \"animation-timing-function\" },\n\t{ name: \"animationDelay\", cssProperty: \"animation-delay\" },\n\t{ name: \"animationIterationCount\", cssProperty: \"animation-iteration-count\" },\n\t{ name: \"animationDirection\", cssProperty: \"animation-direction\" },\n\t{ name: \"animationFillMode\", cssProperty: \"animation-fill-mode\" },\n\t{ name: \"animationPlayState\", cssProperty: \"animation-play-state\" },\n\n\t// Filter\n\t{ name: \"filter\", cssProperty: \"filter\" },\n\t{ name: \"backdropFilter\", cssProperty: \"backdrop-filter\" },\n\n\t// Overflow\n\t{ name: \"overflow\", cssProperty: \"overflow\" },\n\t{ name: \"overflowX\", cssProperty: \"overflow-x\" },\n\t{ name: \"overflowY\", cssProperty: \"overflow-y\" },\n\n\t// Visibility\n\t{ name: \"visibility\", cssProperty: \"visibility\" },\n\n\t// Object fit/position\n\t{ name: \"objectFit\", cssProperty: \"object-fit\" },\n\t{ name: \"objectPosition\", cssProperty: \"object-position\" },\n\n\t// List\n\t{ name: \"listStyle\", cssProperty: \"list-style\" },\n\t{ name: \"listStyleType\", cssProperty: \"list-style-type\" },\n\t{ name: \"listStylePosition\", cssProperty: \"list-style-position\" },\n\t{ name: \"listStyleImage\", cssProperty: \"list-style-image\" },\n\n\t// Table\n\t{ name: \"borderCollapse\", cssProperty: \"border-collapse\" },\n\t{ name: \"borderSpacing\", cssProperty: \"border-spacing\" },\n\t{ name: \"captionSide\", cssProperty: \"caption-side\" },\n\t{ name: \"emptyCells\", cssProperty: \"empty-cells\" },\n\t{ name: \"tableLayout\", cssProperty: \"table-layout\" },\n\n\t// Content\n\t{ name: \"content\", cssProperty: \"content\" },\n\t{ name: \"quotes\", cssProperty: \"quotes\" },\n\t{ name: \"counterReset\", cssProperty: \"counter-reset\" },\n\t{ name: \"counterIncrement\", cssProperty: \"counter-increment\" },\n\n\t// User interface\n\t{ name: \"appearance\", cssProperty: \"appearance\" },\n\t{ name: \"userSelect\", cssProperty: \"user-select\" },\n\t{ name: \"pointerEvents\", cssProperty: \"pointer-events\" },\n\t{ name: \"resize\", cssProperty: \"resize\" },\n\t{ name: \"scrollBehavior\", cssProperty: \"scroll-behavior\" },\n\n\t// Clip\n\t{ name: \"clip\", cssProperty: \"clip\" },\n\t{ name: \"clipPath\", cssProperty: \"clip-path\" },\n\n\t// Isolation\n\t{ name: \"isolation\", cssProperty: \"isolation\" },\n\n\t// Mix blend mode\n\t{ name: \"mixBlendMode\", cssProperty: \"mix-blend-mode\" },\n\n\t// Will change\n\t{ name: \"willChange\", cssProperty: \"will-change\" },\n\n\t// Contain\n\t{ name: \"contain\", cssProperty: \"contain\" },\n\n\t// Page break\n\t{ name: \"pageBreakBefore\", cssProperty: \"page-break-before\" },\n\t{ name: \"pageBreakAfter\", cssProperty: \"page-break-after\" },\n\t{ name: \"pageBreakInside\", cssProperty: \"page-break-inside\" },\n\n\t// Break\n\t{ name: \"breakBefore\", cssProperty: \"break-before\" },\n\t{ name: \"breakAfter\", cssProperty: \"break-after\" },\n\t{ name: \"breakInside\", cssProperty: \"break-inside\" },\n\n\t// Orphans and widows\n\t{ name: \"orphans\", cssProperty: \"orphans\" },\n\t{ name: \"widows\", cssProperty: \"widows\" },\n\n\t// Column\n\t{ name: \"columnCount\", cssProperty: \"column-count\" },\n\t{ name: \"columnFill\", cssProperty: \"column-fill\" },\n\t{ name: \"columnGap\", cssProperty: \"column-gap\" },\n\t{ name: \"columnRule\", cssProperty: \"column-rule\" },\n\t{ name: \"columnRuleColor\", cssProperty: \"column-rule-color\" },\n\t{ name: \"columnRuleStyle\", cssProperty: \"column-rule-style\" },\n\t{ name: \"columnRuleWidth\", cssProperty: \"column-rule-width\" },\n\t{ name: \"columnSpan\", cssProperty: \"column-span\" },\n\t{ name: \"columnWidth\", cssProperty: \"column-width\" },\n\t{ name: \"columns\", cssProperty: \"columns\" },\n\n\t// Interaction\n\t{ name: \"cursor\", cssProperty: \"cursor\" },\n] as const;\n\n// Special methods that have custom logic beyond simple property setting\nexport const SPECIAL_METHODS = [\n\t\"bold\", // Sets font-weight: bold\n\t\"center\", // Sets justify-content: center and align-items: center\n\t\"flex\", // Can set display: flex OR flex property depending on argument\n] as const;\n","// Cache for generated classes: maps CSS property sets to class names\nconst styleCache = new Map<string, string>();\n\n// Simple hash function to generate a short hash from a string (similar to MD5 but simpler)\nexport function simpleHash(str: string): string {\n\tlet hash = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst char = str.charCodeAt(i);\n\t\thash = ((hash << 5) - hash) + char;\n\t\thash = hash & hash; // Convert to 32-bit integer\n\t}\n\t// Convert to positive hex string and take first 8 characters\n\treturn Math.abs(hash).toString(16).padStart(8, '0').substring(0, 8);\n}\n\n// Generate a cache key from a set of CSS properties\nexport function generateStyleKey(styles: Record<string, string>): string {\n\tconst sortedEntries = Object.entries(styles)\n\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t.map(([property, value]) => `${property}:${value}`)\n\t\t.join('|');\n\treturn sortedEntries;\n}\n\n// Get cached class name or return undefined\nexport function getCachedClassName(cacheKey: string): string | undefined {\n\treturn styleCache.get(cacheKey);\n}\n\n// Set cached class name\nexport function setCachedClassName(cacheKey: string, className: string): void {\n\tstyleCache.set(cacheKey, className);\n}\n\n// Check if cache has a class name\nexport function hasCachedClassName(cacheKey: string): boolean {\n\treturn styleCache.has(cacheKey);\n}\n","// Check if a class exists in the DOM\nexport function classExistsInDOM(className: string, mediaQuery?: string): boolean {\n\tconst styleSheet = document.querySelector(\"#nuclo-styles\") as HTMLStyleElement;\n\tif (!styleSheet || !styleSheet.sheet) {\n\t\treturn false;\n\t}\n\n\tif (mediaQuery) {\n\t\tconst rules = Array.from(styleSheet.sheet.cssRules || []);\n\t\tconst mediaRule = rules.find(rule => {\n\t\t\tif (rule instanceof CSSMediaRule) {\n\t\t\t\treturn rule.media.mediaText === mediaQuery;\n\t\t\t}\n\t\t\treturn false;\n\t\t}) as CSSMediaRule | undefined;\n\n\t\tif (!mediaRule) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Array.from(mediaRule.cssRules).some(rule => {\n\t\t\tif (rule instanceof CSSStyleRule) {\n\t\t\t\treturn rule.selectorText === `.${className}`;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t} else {\n\t\tconst rules = Array.from(styleSheet.sheet.cssRules || []);\n\t\treturn rules.some(rule => {\n\t\t\tif (rule instanceof CSSStyleRule) {\n\t\t\t\treturn rule.selectorText === `.${className}`;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n}\n\n// Create a CSS class with multiple styles\nexport function createCSSClassWithStyles(\n\tclassName: string,\n\tstyles: Record<string, string>,\n\tmediaQuery?: string\n): void {\n\tlet styleSheet = document.querySelector(\"#nuclo-styles\") as HTMLStyleElement;\n\n\tif (!styleSheet) {\n\t\tstyleSheet = document.createElement(\"style\");\n\t\tstyleSheet.id = \"nuclo-styles\";\n\t\tdocument.head.appendChild(styleSheet);\n\t}\n\n\tconst rules = Object.entries(styles)\n\t\t.map(([property, value]) => `${property}: ${value}`)\n\t\t.join(\"; \");\n\n\tif (mediaQuery) {\n\t\t// Create or get media query rule\n\t\tconst existingRules = Array.from(styleSheet.sheet?.cssRules || []);\n\t\tlet mediaRule: CSSMediaRule | null = null;\n\n\t\tfor (const rule of existingRules) {\n\t\t\tif (rule instanceof CSSMediaRule && rule.media.mediaText === mediaQuery) {\n\t\t\t\tmediaRule = rule;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!mediaRule) {\n\t\t\t// Find the correct insertion index: after all style rules, append media queries in order\n\t\t\t// Since we process breakpoints in registration order, we can simply append\n\t\t\t// This ensures: style rules first, then media queries in the order they're processed\n\t\t\tlet insertIndex = existingRules.length;\n\n\t\t\t// Find the last media query rule to insert after it (maintains order)\n\t\t\tfor (let i = existingRules.length - 1; i >= 0; i--) {\n\t\t\t\tif (existingRules[i] instanceof CSSMediaRule) {\n\t\t\t\t\tinsertIndex = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (existingRules[i] instanceof CSSStyleRule) {\n\t\t\t\t\t// If we hit a style rule, insert after it\n\t\t\t\t\tinsertIndex = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstyleSheet.sheet?.insertRule(`@media ${mediaQuery} {}`, insertIndex);\n\t\t\tmediaRule = styleSheet.sheet?.cssRules[insertIndex] as CSSMediaRule;\n\t\t}\n\n\t\t// Check if class already exists in this media query\n\t\tlet existingRule: CSSStyleRule | null = null;\n\t\tfor (const rule of Array.from(mediaRule.cssRules)) {\n\t\t\tif (rule instanceof CSSStyleRule && rule.selectorText === `.${className}`) {\n\t\t\t\texistingRule = rule;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (existingRule) {\n\t\t\t// Update existing rule by replacing all styles\n\t\t\t// First, clear all existing properties\n\t\t\twhile (existingRule.style.length > 0) {\n\t\t\t\texistingRule.style.removeProperty(existingRule.style[0]);\n\t\t\t}\n\t\t\t// Then set all new properties\n\t\t\tObject.entries(styles).forEach(([property, value]) => {\n\t\t\t\texistingRule!.style.setProperty(property, value);\n\t\t\t});\n\t\t} else {\n\t\t\tmediaRule.insertRule(`.${className} { ${rules} }`, mediaRule.cssRules.length);\n\t\t}\n\t} else {\n\t\t// Regular style rule (no media query)\n\t\t// Find existing rule or insert at the beginning (before media queries)\n\t\tlet existingRule: CSSStyleRule | null = null;\n\t\tlet insertIndex = 0;\n\n\t\tconst allRules = Array.from(styleSheet.sheet?.cssRules || []);\n\t\tfor (let i = 0; i < allRules.length; i++) {\n\t\t\tconst rule = allRules[i];\n\t\t\tif (rule instanceof CSSStyleRule && rule.selectorText === `.${className}`) {\n\t\t\t\texistingRule = rule;\n\t\t\t\tinsertIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Track where media queries start to insert default styles before them\n\t\t\tif (!(rule instanceof CSSMediaRule)) {\n\t\t\t\tinsertIndex = i + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (existingRule) {\n\t\t\t// Update existing rule by replacing all styles\n\t\t\t// First, clear all existing properties\n\t\t\twhile (existingRule.style.length > 0) {\n\t\t\t\texistingRule.style.removeProperty(existingRule.style[0]);\n\t\t\t}\n\t\t\t// Then set all new properties\n\t\t\tObject.entries(styles).forEach(([property, value]) => {\n\t\t\t\texistingRule!.style.setProperty(property, value);\n\t\t\t});\n\t\t} else {\n\t\t\tstyleSheet.sheet?.insertRule(`.${className} { ${rules} }`, insertIndex);\n\t\t}\n\t}\n}\n\n// Legacy function for backward compatibility\nexport function createCSSClass(className: string, styles: Record<string, string>): void {\n\tcreateCSSClassWithStyles(className, styles);\n}\n","import { STYLE_PROPERTIES, SPECIAL_METHODS, type StylePropertyDefinition } from \"./styleProperties\";\nimport { generateStyleKey, simpleHash, getCachedClassName, setCachedClassName } from \"./styleCache\";\nimport { createCSSClassWithStyles, classExistsInDOM } from \"./cssGenerator\";\n\n// Get or create a class name for a set of CSS properties\nfunction getOrCreateClassName(styles: Record<string, string>, prefix = '', mediaQuery?: string): string {\n\tconst styleKey = generateStyleKey(styles);\n\tconst cacheKey = prefix ? `${prefix}:${styleKey}` : styleKey;\n\n\tconst cached = getCachedClassName(cacheKey);\n\tif (cached) {\n\t\tconst cachedClassName = cached;\n\t\t// Verify the class exists in the DOM, recreate if not (handles test isolation)\n\t\tif (!classExistsInDOM(cachedClassName, mediaQuery)) {\n\t\t\tcreateCSSClassWithStyles(cachedClassName, styles, mediaQuery);\n\t\t}\n\t\treturn cachedClassName;\n\t}\n\n\t// Generate a hash-based class name from the style key\n\tconst hash = simpleHash(styleKey);\n\tconst className = prefix ? `n${prefix}-${hash}` : `n${hash}`;\n\tsetCachedClassName(cacheKey, className);\n\n\t// Create the CSS class with media query if provided\n\tcreateCSSClassWithStyles(className, styles, mediaQuery);\n\n\treturn className;\n}\n\n// Utility class builder for chaining CSS properties\nexport class StyleBuilder {\n\tprivate styles: Record<string, string> = {};\n\n\t// Get the accumulated styles\n\tgetStyles(): Record<string, string> {\n\t\treturn { ...this.styles };\n\t}\n\n\t// Get class name for the current styles\n\tgetClassName(prefix = '', mediaQuery?: string): string {\n\t\treturn getOrCreateClassName(this.styles, prefix, mediaQuery);\n\t}\n\n\t// Get class names as space-separated string (for backward compatibility)\n\tgetClassNames(): string[] {\n\t\treturn [this.getClassName()];\n\t}\n\n\t// Get class definitions (for backward compatibility)\n\tgetClassDefinitions(): Array<{ className: string; property: string; value: string }> {\n\t\treturn Object.entries(this.styles).map(([property, value]) => ({\n\t\t\tclassName: this.getClassName(),\n\t\t\tproperty,\n\t\t\tvalue\n\t\t}));\n\t}\n\n\t// Get class names as space-separated string\n\ttoString(): string {\n\t\treturn this.getClassName();\n\t}\n\n\t// Add a custom style\n\tadd(property: string, value: string): this {\n\t\tthis.styles[property] = value;\n\t\treturn this;\n\t}\n\n\t// Special methods with custom logic\n\tbold(): this {\n\t\tthis.styles[\"font-weight\"] = \"bold\";\n\t\treturn this;\n\t}\n\n\tcenter(): this {\n\t\tthis.styles[\"justify-content\"] = \"center\";\n\t\tthis.styles[\"align-items\"] = \"center\";\n\t\treturn this;\n\t}\n\n\tflex(value?: string): this {\n\t\tif (value !== undefined) {\n\t\t\tthis.styles[\"flex\"] = value;\n\t\t} else {\n\t\t\tthis.styles[\"display\"] = \"flex\";\n\t\t}\n\t\treturn this;\n\t}\n}\n\n// TypeScript interface declaration merging - adds types for dynamically generated methods\nexport interface StyleBuilder {\n\tdisplay(value: string): this;\n\tgrid(): this;\n\tbg(color: string): this;\n\tcolor(colorValue: string): this;\n\taccentColor(value: string): this;\n\tfontSize(size: string): this;\n\tfontWeight(value: string): this;\n\tfontFamily(value: string): this;\n\tlineHeight(value: string): this;\n\tletterSpacing(value: string): this;\n\ttextAlign(value: string): this;\n\ttextDecoration(value: string): this;\n\tfontStyle(value: string): this;\n\tfontVariant(value: string): this;\n\tfontStretch(value: string): this;\n\ttextTransform(value: string): this;\n\ttextIndent(value: string): this;\n\ttextOverflow(value: string): this;\n\ttextShadow(value: string): this;\n\twhiteSpace(value: string): this;\n\twordSpacing(value: string): this;\n\twordWrap(value: string): this;\n\toverflowWrap(value: string): this;\n\ttextAlignLast(value: string): this;\n\ttextJustify(value: string): this;\n\ttextDecorationLine(value: string): this;\n\ttextDecorationColor(value: string): this;\n\ttextDecorationStyle(value: string): this;\n\ttextDecorationThickness(value: string): this;\n\ttextUnderlineOffset(value: string): this;\n\tverticalAlign(value: string): this;\n\tposition(value: string): this;\n\tpadding(value: string): this;\n\tpaddingTop(value: string): this;\n\tpaddingRight(value: string): this;\n\tpaddingBottom(value: string): this;\n\tpaddingLeft(value: string): this;\n\tmargin(value: string): this;\n\tmarginTop(value: string): this;\n\tmarginRight(value: string): this;\n\tmarginBottom(value: string): this;\n\tmarginLeft(value: string): this;\n\twidth(value: string): this;\n\theight(value: string): this;\n\tminWidth(value: string): this;\n\tmaxWidth(value: string): this;\n\tminHeight(value: string): this;\n\tmaxHeight(value: string): this;\n\tboxSizing(value: string): this;\n\ttop(value: string): this;\n\tright(value: string): this;\n\tbottom(value: string): this;\n\tleft(value: string): this;\n\tzIndex(value: string): this;\n\tflexDirection(value: string): this;\n\talignItems(value: string): this;\n\tjustifyContent(value: string): this;\n\tgap(value: string): this;\n\tflexWrap(value: string): this;\n\tflexGrow(value: string): this;\n\tflexShrink(value: string): this;\n\tflexBasis(value: string): this;\n\talignSelf(value: string): this;\n\talignContent(value: string): this;\n\tjustifySelf(value: string): this;\n\tjustifyItems(value: string): this;\n\tgridTemplateColumns(value: string): this;\n\tgridTemplateRows(value: string): this;\n\tgridTemplateAreas(value: string): this;\n\tgridColumn(value: string): this;\n\tgridRow(value: string): this;\n\tgridColumnStart(value: string): this;\n\tgridColumnEnd(value: string): this;\n\tgridRowStart(value: string): this;\n\tgridRowEnd(value: string): this;\n\tgridArea(value: string): this;\n\tgridAutoColumns(value: string): this;\n\tgridAutoRows(value: string): this;\n\tgridAutoFlow(value: string): this;\n\tborder(value: string): this;\n\tborderTop(value: string): this;\n\tborderRight(value: string): this;\n\tborderBottom(value: string): this;\n\tborderLeft(value: string): this;\n\tborderWidth(value: string): this;\n\tborderStyle(value: string): this;\n\tborderColor(value: string): this;\n\tborderTopWidth(value: string): this;\n\tborderRightWidth(value: string): this;\n\tborderBottomWidth(value: string): this;\n\tborderLeftWidth(value: string): this;\n\tborderTopStyle(value: string): this;\n\tborderRightStyle(value: string): this;\n\tborderBottomStyle(value: string): this;\n\tborderLeftStyle(value: string): this;\n\tborderTopColor(value: string): this;\n\tborderRightColor(value: string): this;\n\tborderBottomColor(value: string): this;\n\tborderLeftColor(value: string): this;\n\tborderRadius(value: string): this;\n\tborderTopLeftRadius(value: string): this;\n\tborderTopRightRadius(value: string): this;\n\tborderBottomLeftRadius(value: string): this;\n\tborderBottomRightRadius(value: string): this;\n\toutline(value: string): this;\n\toutlineWidth(value: string): this;\n\toutlineStyle(value: string): this;\n\toutlineColor(value: string): this;\n\toutlineOffset(value: string): this;\n\tbackgroundColor(value: string): this;\n\tbackgroundImage(value: string): this;\n\tbackgroundRepeat(value: string): this;\n\tbackgroundPosition(value: string): this;\n\tbackgroundSize(value: string): this;\n\tbackgroundAttachment(value: string): this;\n\tbackgroundClip(value: string): this;\n\tbackgroundOrigin(value: string): this;\n\tboxShadow(value: string): this;\n\topacity(value: string): this;\n\ttransition(value: string): this;\n\ttransitionProperty(value: string): this;\n\ttransitionDuration(value: string): this;\n\ttransitionTimingFunction(value: string): this;\n\ttransitionDelay(value: string): this;\n\ttransform(value: string): this;\n\ttransformOrigin(value: string): this;\n\ttransformStyle(value: string): this;\n\tperspective(value: string): this;\n\tperspectiveOrigin(value: string): this;\n\tbackfaceVisibility(value: string): this;\n\tanimation(value: string): this;\n\tanimationName(value: string): this;\n\tanimationDuration(value: string): this;\n\tanimationTimingFunction(value: string): this;\n\tanimationDelay(value: string): this;\n\tanimationIterationCount(value: string): this;\n\tanimationDirection(value: string): this;\n\tanimationFillMode(value: string): this;\n\tanimationPlayState(value: string): this;\n\tfilter(value: string): this;\n\tbackdropFilter(value: string): this;\n\toverflow(value: string): this;\n\toverflowX(value: string): this;\n\toverflowY(value: string): this;\n\tvisibility(value: string): this;\n\tobjectFit(value: string): this;\n\tobjectPosition(value: string): this;\n\tlistStyle(value: string): this;\n\tlistStyleType(value: string): this;\n\tlistStylePosition(value: string): this;\n\tlistStyleImage(value: string): this;\n\tborderCollapse(value: string): this;\n\tborderSpacing(value: string): this;\n\tcaptionSide(value: string): this;\n\temptyCells(value: string): this;\n\ttableLayout(value: string): this;\n\tcontent(value: string): this;\n\tquotes(value: string): this;\n\tcounterReset(value: string): this;\n\tcounterIncrement(value: string): this;\n\tappearance(value: string): this;\n\tuserSelect(value: string): this;\n\tpointerEvents(value: string): this;\n\tresize(value: string): this;\n\tscrollBehavior(value: string): this;\n\tclip(value: string): this;\n\tclipPath(value: string): this;\n\tisolation(value: string): this;\n\tmixBlendMode(value: string): this;\n\twillChange(value: string): this;\n\tcontain(value: string): this;\n\tpageBreakBefore(value: string): this;\n\tpageBreakAfter(value: string): this;\n\tpageBreakInside(value: string): this;\n\tbreakBefore(value: string): this;\n\tbreakAfter(value: string): this;\n\tbreakInside(value: string): this;\n\torphans(value: string): this;\n\twidows(value: string): this;\n\tcolumnCount(value: string): this;\n\tcolumnFill(value: string): this;\n\tcolumnGap(value: string): this;\n\tcolumnRule(value: string): this;\n\tcolumnRuleColor(value: string): this;\n\tcolumnRuleStyle(value: string): this;\n\tcolumnRuleWidth(value: string): this;\n\tcolumnSpan(value: string): this;\n\tcolumnWidth(value: string): this;\n\tcolumns(value: string): this;\n\tcursor(value: string): this;\n}\n\n// Dynamically add methods to StyleBuilder prototype\nfunction registerStyleMethods(): void {\n\tconst proto = StyleBuilder.prototype as unknown as Record<string, unknown>;\n\n\tfor (const prop of STYLE_PROPERTIES) {\n\t\t// Skip if method already exists (e.g., special methods)\n\t\tif (prop.name in proto) continue;\n\n\t\tif (prop.isShorthand) {\n\t\t\t// Shorthand methods that use default values\n\t\t\tproto[prop.name] = function(this: StyleBuilder) {\n\t\t\t\tthis.add(prop.cssProperty, prop.defaultValue || \"\");\n\t\t\t\treturn this;\n\t\t\t};\n\t\t} else {\n\t\t\t// Regular methods that take a value\n\t\t\tproto[prop.name] = function(this: StyleBuilder, value: string) {\n\t\t\t\tthis.add(prop.cssProperty, value);\n\t\t\t\treturn this;\n\t\t\t};\n\t\t}\n\t}\n}\n\n// Register all methods on StyleBuilder\nregisterStyleMethods();\n\n// Dynamically create and export utility functions\nfunction createStyleFunction(prop: StylePropertyDefinition): (value?: string) => StyleBuilder {\n\tif (prop.isShorthand) {\n\t\treturn () => new StyleBuilder().add(prop.cssProperty, prop.defaultValue || \"\");\n\t} else {\n\t\treturn (value?: string) => new StyleBuilder().add(prop.cssProperty, value || \"\");\n\t}\n}\n\n// Create export object dynamically\nconst styleExports: Record<string, ((value?: string) => StyleBuilder)> = {};\n\n// Add regular properties\nfor (const prop of STYLE_PROPERTIES) {\n\tstyleExports[prop.name] = createStyleFunction(prop);\n}\n\n// Add special methods\nfor (const method of SPECIAL_METHODS) {\n\tif (method === \"bold\" || method === \"center\") {\n\t\tstyleExports[method] = () => new StyleBuilder()[method]();\n\t} else if (method === \"flex\") {\n\t\tstyleExports[method] = (value?: string) => new StyleBuilder().flex(value);\n\t}\n}\n\n// Export all style functions\nexport const {\n\t// Display\n\tdisplay, flex, grid,\n\t// Colors\n\tbg, color, accentColor,\n\t// Typography\n\tfontSize, fontWeight, fontFamily, lineHeight, letterSpacing,\n\ttextAlign, textDecoration, bold, fontStyle, fontVariant,\n\tfontStretch, textTransform, textIndent, textOverflow, textShadow,\n\twhiteSpace, wordSpacing, wordWrap, overflowWrap, textAlignLast,\n\ttextJustify, textDecorationLine, textDecorationColor, textDecorationStyle,\n\ttextDecorationThickness, textUnderlineOffset, verticalAlign,\n\t// Layout\n\tposition, padding, paddingTop, paddingRight, paddingBottom, paddingLeft,\n\tmargin, marginTop, marginRight, marginBottom, marginLeft,\n\twidth, height, minWidth, maxWidth, minHeight, maxHeight, boxSizing,\n\t// Positioning\n\ttop, right, bottom, left, zIndex,\n\t// Flexbox\n\tflexDirection, alignItems, justifyContent, center, gap,\n\tflexWrap, flexGrow, flexShrink, flexBasis, alignSelf,\n\talignContent, justifySelf, justifyItems,\n\t// Grid\n\tgridTemplateColumns, gridTemplateRows, gridTemplateAreas,\n\tgridColumn, gridRow, gridColumnStart, gridColumnEnd,\n\tgridRowStart, gridRowEnd, gridArea, gridAutoColumns,\n\tgridAutoRows, gridAutoFlow,\n\t// Borders\n\tborder, borderTop, borderRight, borderBottom, borderLeft,\n\tborderWidth, borderStyle, borderColor, borderTopWidth,\n\tborderRightWidth, borderBottomWidth, borderLeftWidth,\n\tborderTopStyle, borderRightStyle, borderBottomStyle, borderLeftStyle,\n\tborderTopColor, borderRightColor, borderBottomColor, borderLeftColor,\n\tborderRadius, borderTopLeftRadius, borderTopRightRadius,\n\tborderBottomLeftRadius, borderBottomRightRadius,\n\t// Outline\n\toutline, outlineWidth, outlineStyle, outlineColor, outlineOffset,\n\t// Background\n\tbackgroundColor, backgroundImage, backgroundRepeat, backgroundPosition,\n\tbackgroundSize, backgroundAttachment, backgroundClip, backgroundOrigin,\n\t// Effects\n\tboxShadow, opacity, transition, transitionProperty,\n\ttransitionDuration, transitionTimingFunction, transitionDelay,\n\t// Transform\n\ttransform, transformOrigin, transformStyle, perspective,\n\tperspectiveOrigin, backfaceVisibility,\n\t// Animation\n\tanimation, animationName, animationDuration, animationTimingFunction,\n\tanimationDelay, animationIterationCount, animationDirection,\n\tanimationFillMode, animationPlayState,\n\t// Filter\n\tfilter, backdropFilter,\n\t// Overflow\n\toverflow, overflowX, overflowY,\n\t// Visibility\n\tvisibility,\n\t// Object fit/position\n\tobjectFit, objectPosition,\n\t// List\n\tlistStyle, listStyleType, listStylePosition, listStyleImage,\n\t// Table\n\tborderCollapse, borderSpacing, captionSide, emptyCells, tableLayout,\n\t// Content\n\tcontent, quotes, counterReset, counterIncrement,\n\t// User interface\n\tappearance, userSelect, pointerEvents, resize, scrollBehavior,\n\t// Clip\n\tclip, clipPath,\n\t// Isolation\n\tisolation,\n\t// Mix blend mode\n\tmixBlendMode,\n\t// Will change\n\twillChange,\n\t// Contain\n\tcontain,\n\t// Page break\n\tpageBreakBefore, pageBreakAfter, pageBreakInside,\n\t// Break\n\tbreakBefore, breakAfter, breakInside,\n\t// Orphans and widows\n\torphans, widows,\n\t// Column\n\tcolumnCount, columnFill, columnGap, columnRule,\n\tcolumnRuleColor, columnRuleStyle, columnRuleWidth,\n\tcolumnSpan, columnWidth, columns,\n\t// Interaction\n\tcursor,\n} = styleExports as Record<string, (value?: string) => StyleBuilder>;\n","import { StyleBuilder } from \"./styleBuilder\";\nimport { generateStyleKey, simpleHash } from \"./styleCache\";\nimport { createCSSClassWithStyles } from \"./cssGenerator\";\n\n// Breakpoints type\ntype BreakpointStyles<T extends string> = Partial<Record<T, StyleBuilder>>;\n\n// Create breakpoints function\n// Accepts either Record (for backward compatibility) or Array of [name, mediaQuery] tuples (for explicit order)\nexport function createBreakpoints<T extends string>(\n\tbreakpoints: Record<T, string> | Array<[T, string]>\n) {\n\t// Convert to array format to preserve order\n\tconst breakpointsArray: Array<[T, string]> = Array.isArray(breakpoints)\n\t\t? breakpoints\n\t\t: (Object.entries(breakpoints) as Array<[T, string]>);\n\n\treturn function cn(\n\t\tdefaultStylesOrBreakpoints?: StyleBuilder | BreakpointStyles<T>,\n\t\tbreakpointStyles?: BreakpointStyles<T>\n\t): { className: string } | string {\n\t\tlet defaultStyles: StyleBuilder | undefined;\n\t\tlet styles: BreakpointStyles<T> | undefined;\n\n\t\t// Handle both signatures:\n\t\t// 1. cn({ medium: width(\"50%\") }) - single argument with breakpoints\n\t\t// 2. cn(width(\"100%\"), { medium: width(\"50%\") }) - default styles + breakpoints\n\t\tif (breakpointStyles !== undefined) {\n\t\t\t// Two-argument form\n\t\t\tdefaultStyles = defaultStylesOrBreakpoints as StyleBuilder;\n\t\t\tstyles = breakpointStyles;\n\t\t} else if (defaultStylesOrBreakpoints instanceof StyleBuilder) {\n\t\t\t// Single argument, but it's a StyleBuilder (default styles only)\n\t\t\tdefaultStyles = defaultStylesOrBreakpoints;\n\t\t\tstyles = undefined;\n\t\t} else {\n\t\t\t// Single argument with breakpoints\n\t\t\tdefaultStyles = undefined;\n\t\t\tstyles = defaultStylesOrBreakpoints as BreakpointStyles<T>;\n\t\t}\n\n\t\t// If nothing provided, return empty\n\t\tif (!defaultStyles && (!styles || Object.keys(styles).length === 0)) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// If we have breakpoints, create a single class name for all breakpoints\n\t\tif (styles && Object.keys(styles).length > 0) {\n\t\t\t// Collect all breakpoint styles in registration order\n\t\t\tconst allBreakpointStyles: Array<{ breakpointName: T; mediaQuery: string; styles: Record<string, string> }> = [];\n\n\t\t\t// Process breakpoints in the order they were registered\n\t\t\tfor (const [breakpointName, mediaQuery] of breakpointsArray) {\n\t\t\t\tconst styleBuilder = styles[breakpointName];\n\t\t\t\tif (styleBuilder) {\n\t\t\t\t\tallBreakpointStyles.push({\n\t\t\t\t\t\tbreakpointName,\n\t\t\t\t\t\tmediaQuery,\n\t\t\t\t\t\tstyles: (styleBuilder as StyleBuilder).getStyles()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Generate a combined hash from all breakpoint styles (and default styles if present)\n\t\t\tconst allStyleKeys: string[] = [];\n\n\t\t\tif (defaultStyles) {\n\t\t\t\tconst defaultStylesObj = defaultStyles.getStyles();\n\t\t\t\tallStyleKeys.push(`default:${generateStyleKey(defaultStylesObj)}`);\n\t\t\t}\n\n\t\t\tallStyleKeys.push(...allBreakpointStyles.map(({ breakpointName, styles: bpStyles }) => {\n\t\t\t\tconst styleKey = generateStyleKey(bpStyles);\n\t\t\t\treturn `${breakpointName}:${styleKey}`;\n\t\t\t}));\n\n\t\t\tconst combinedStyleKey = allStyleKeys.sort().join('||');\n\t\t\tconst combinedHash = simpleHash(combinedStyleKey);\n\t\t\tconst className = `n${combinedHash}`;\n\n\t\t\t// Apply default styles first (no media query) - these are base styles\n\t\t\tlet accumulatedStyles: Record<string, string> = {};\n\t\t\tif (defaultStyles) {\n\t\t\t\taccumulatedStyles = { ...defaultStyles.getStyles() };\n\t\t\t\tcreateCSSClassWithStyles(className, accumulatedStyles);\n\t\t\t}\n\n\t\t\t// Apply all breakpoint styles to the same class name in their respective media queries\n\t\t\t// Apply in registration order to ensure proper CSS cascade\n\t\t\t// Each breakpoint inherits from all previous breakpoints (cascading)\n\t\t\tfor (const { breakpointName, mediaQuery, styles: bpStyles } of allBreakpointStyles) {\n\t\t\t\t// Merge accumulated styles (defaults + previous breakpoints) with current breakpoint\n\t\t\t\t// This ensures each breakpoint inherits from previous ones\n\t\t\t\taccumulatedStyles = { ...accumulatedStyles, ...bpStyles };\n\t\t\t\tcreateCSSClassWithStyles(className, accumulatedStyles, mediaQuery);\n\t\t\t}\n\n\t\t\treturn { className };\n\t\t}\n\n\t\t// Only default styles (no breakpoints)\n\t\tif (defaultStyles) {\n\t\t\tconst className = defaultStyles.getClassName();\n\t\t\treturn { className };\n\t\t}\n\n\t\treturn \"\";\n\t};\n}\n","import { registerGlobalTagBuilders } from \"./tagRegistry\";\nimport { list } from \"../list\";\nimport { update } from \"./updateController\";\nimport { when } from \"../when\";\nimport { on } from \"../utility/on\";\nimport { render } from \"../utility/render\";\nimport * as styleExports from \"../style\";\n\n/**\n * Initializes the nuclo runtime by exposing tag builders and utilities.\n */\nexport function initializeRuntime(): void {\n registerGlobalTagBuilders();\n\n if (typeof globalThis !== \"undefined\") {\n const registry = globalThis as Record<string, unknown>;\n registry.list = list;\n registry.update = update;\n registry.when = when;\n registry.on = on;\n registry.render = render;\n\n // Register all style utilities globally\n // Use individual assignments to avoid errors with readonly properties (like window.top)\n for (const [key, value] of Object.entries(styleExports)) {\n try {\n registry[key] = value;\n } catch (e) {\n // Skip properties that can't be set (e.g., readonly window properties)\n }\n }\n }\n}\n\nif (typeof globalThis !== \"undefined\") {\n initializeRuntime();\n}\n"],"names":["isPrimitive","value","isNode","Node","isObject","isTagLike","isFunction","isZeroArityFunction","length","logError","message","error","console","safeExecute","fn","fallback","isBrowser","window","document","safeRemoveChild","child","parentNode","removeChild","createCommentSafely","text","createComment","createConditionalComment","tagName","suffix","createMarkerComment","prefix","Error","comment","Math","random","toString","slice","createMarkerPair","endComment","start","end","insertNodesBefore","nodes","referenceNode","parent","forEach","node","newNode","insertBefore","safeInsertBefore","isNodeConnected","isConnected","contains","replaceNodeSafely","oldNode","replaceChild","reactiveTextNodes","Map","reactiveElements","applyAttributeResolvers","el","info","attributeResolvers","resolver","applyValue","key","e","registerAttributeResolver","element","Element","get","set","ensureElementInfo","updateListener","listener","addEventListener","setStyleProperty","property","style","stringValue","String","assignInlineStyles","styles","Object","entries","REACTIVE_CLASSNAME_KEY","STATIC_CLASSNAME_KEY","mergeReactiveClassName","reactiveClassName","staticClasses","getStaticClasses","size","allClasses","Set","split","filter","c","add","className","Array","from","join","applySingleAttribute","raw","shouldMergeClassName","styleValue","resolvedStyles","setValue","v","merge","HTMLElement","newClassName","currentClassName","existing","mergeStaticClassName","namespaceURI","setAttribute","initReactiveClassName","hasReactiveClassName","addStaticClasses","currentClasses","applyAttributes","attributes","mergeClassName","k","keys","modifierProbeCache","WeakMap","isBooleanFunction","cached","record","undefined","probeOnce","isConditionalModifier","modifier","allModifiers","currentIndex","otherModifiers","_","index","some","mod","applyNodeModifier","createReactiveTextFragment","originalModifier","produced","createStaticTextFragment","candidate","preEvaluated","fragment","createDocumentFragment","appendChild","textNode","createTextNode","initial","arguments","str","txt","lastValue","createReactiveTextNode","activeConditionalNodes","storeConditionalInfo","_conditionalInfo","applyModifiers","modifiers","startIndex","nextIndex","appended","localIndex","i","createElementWithModifiers","createElement","processConditionalModifiers","conditionalIndex","findConditionalModifier","condition","createElementWithNamespace","SVG_TAGS","includes","isSVGTag","createElementNS","createElementFactory","passed","conditionalInfo","createConditionalElement","createTagBuilder","mods","HTML_TAGS","registerGlobalTagBuilders","target","globalThis","marker","exportName","registerSvgTag","registerHtmlTag","activeListRuntimes","renderItem","runtime","item","result","host","resolveRenderable","remove","sync","startMarker","endMarker","currentItems","itemsProvider","a","b","arraysEqual","lastSyncedItems","recordsByPosition","availableRecords","records","items","push","newIndex","existingRecord","recordIndex","indexOf","splice","delete","newRecords","elementsToRemove","nextSibling","availableItems","shift","unshift","recordNode","list","render","createListRuntime","runCondition","onError","resolveCondition","Boolean","renderContentItem","callback","originalAppend","bind","originalInsert","withScopedInsertion","maybeNode","activeWhenRuntimes","renderWhenContent","groups","elseContent","newActive","evaluateActiveCondition","activeIndex","current","next","clearBetweenMarkers","renderContentItems","content","WhenBuilderImpl","constructor","initialCondition","this","when","update","registerWhenRuntime","createWhenBuilderFunction","builder","assign","else","updateConditionalNode","getConditionalInfo","shouldShow","isElement","nodeType","ELEMENT_NODE","createElementFromConditionalInfo","updaters","unregisterConditionalNode","removeEventListener","newVal","textContent","targets","body","dispatchEvent","Event","bubbles","on","type","options","ev","call","nodeModFn","STYLE_PROPERTIES","name","cssProperty","defaultValue","isShorthand","SPECIAL_METHODS","styleCache","simpleHash","hash","charCodeAt","abs","padStart","substring","generateStyleKey","sort","localeCompare","map","createCSSClassWithStyles","mediaQuery","styleSheet","querySelector","id","head","rules","existingRules","sheet","cssRules","mediaRule","rule","CSSMediaRule","media","mediaText","insertIndex","CSSStyleRule","insertRule","existingRule","selectorText","removeProperty","setProperty","allRules","createCSSClass","getOrCreateClassName","styleKey","cacheKey","getCachedClassName","cachedClassName","find","classExistsInDOM","setCachedClassName","StyleBuilder","getStyles","getClassName","getClassNames","getClassDefinitions","bold","center","flex","createStyleFunction","prop","proto","prototype","registerStyleMethods","styleExports","method","display","grid","bg","color","accentColor","fontSize","fontWeight","fontFamily","lineHeight","letterSpacing","textAlign","textDecoration","fontStyle","fontVariant","fontStretch","textTransform","textIndent","textOverflow","textShadow","whiteSpace","wordSpacing","wordWrap","overflowWrap","textAlignLast","textJustify","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","verticalAlign","position","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","width","height","minWidth","maxWidth","minHeight","maxHeight","boxSizing","top","right","bottom","left","zIndex","flexDirection","alignItems","justifyContent","gap","flexWrap","flexGrow","flexShrink","flexBasis","alignSelf","alignContent","justifySelf","justifyItems","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","gridAutoColumns","gridAutoRows","gridAutoFlow","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderStyle","borderColor","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","outline","outlineWidth","outlineStyle","outlineColor","outlineOffset","backgroundColor","backgroundImage","backgroundRepeat","backgroundPosition","backgroundSize","backgroundAttachment","backgroundClip","backgroundOrigin","boxShadow","opacity","transition","transitionProperty","transitionDuration","transitionTimingFunction","transitionDelay","transform","transformOrigin","transformStyle","perspective","perspectiveOrigin","backfaceVisibility","animation","animationName","animationDuration","animationTimingFunction","animationDelay","animationIterationCount","animationDirection","animationFillMode","animationPlayState","backdropFilter","overflow","overflowX","overflowY","visibility","objectFit","objectPosition","listStyle","listStyleType","listStylePosition","listStyleImage","borderCollapse","borderSpacing","captionSide","emptyCells","tableLayout","quotes","counterReset","counterIncrement","appearance","userSelect","pointerEvents","resize","scrollBehavior","clip","clipPath","isolation","mixBlendMode","willChange","contain","pageBreakBefore","pageBreakAfter","pageBreakInside","breakBefore","breakAfter","breakInside","orphans","widows","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","cursor","createBreakpoints","breakpoints","breakpointsArray","isArray","defaultStylesOrBreakpoints","breakpointStyles","defaultStyles","allBreakpointStyles","breakpointName","styleBuilder","allStyleKeys","defaultStylesObj","bpStyles","accumulatedStyles","initializeRuntime","registry","children","nodeToAppend","createTextNodeSafely","safeAppendChild"],"mappings":"aAAM,SAAUA,EAAYC,GAC1B,OAAiB,OAAVA,GAAoC,iBAAVA,GAAuC,mBAAVA,CAChE,CAEM,SAAUC,EAAUD,GACxB,OAAOA,aAAiBE,IAC1B,CAEM,SAAUC,EAASH,GACvB,MAAwB,iBAAVA,GAAgC,OAAV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UADSkc,EAAc/M,eAEjC,CAEA,MAAO,EACR,CACD,wkGCjGgBuN,KAGd,GAFAhX,IAE0B,oBAAfE,WAA4B,CACrC,MAAM+W,EAAW/W,WACjB+W,EAASvU,KAAOA,EAChBuU,EAASxS,OAASA,GAClBwS,EAASzS,KAAOA,GAChByS,EAASjR,GAAKA,GACdiR,EAAStU,OAASA,GAIlB,IAAK,MAAOtK,EAAKhE,KAAUkF,OAAOC,QAAQ4Q,IACxC,IACE6M,EAAS5e,GAAOhE,CAClB,CAAE,MAAOiE,GAET,CAEJ,CACF,CAE0B,oBAAf4H,YACT8W,mDpBJ+B,CAC/B,OAAQ,OAAQ,KAAM,MAAO,QAAS,KAAM,MAAO,QAAS,OAAQ,OACpE,SAAU,QAAS,scbqFnBhgB,KACGkgB,GAEH,OAAKlgB,GAELkgB,EAASjgB,QAASzB,IAChB,GAAa,MAATA,EAAe,CACjB,IAAI2hB,EAEJ,GAAqB,iBAAV3hB,EAAoB,CAC7B,MAAMoI,EA5Fd,SAA8BhI,GAC5B,IAAKR,EAAW,OAAO,KACvB,IACE,OAAOE,SAASuI,eAAezE,OAAOxD,GACxC,CAAE,MAAOb,GAEP,OADAF,EAAS,6BAA8BE,GAChC,IACT,CACF,CAoFyBqiB,CAAqB5hB,GACtC,IAAIoI,EAGF,OAFAuZ,EAAevZ,CAInB,MACEuZ,EAAe3hB,GApIvB,SAAyBwB,EAAwBxB,GAC/C,IAAKwB,IAAWxB,EAAO,OAAO,EAC9B,IAEE,OADAwB,EAAO2G,YAAYnI,IACZ,CACT,CAAE,MAAOT,GAEP,OADAF,EAAS,8BAA+BE,IACjC,CACT,CACF,CA8HMsiB,CAAgBrgB,EAAQmgB,EAC1B,IAGKngB,GArBaA,CAsBtB,whFH/HM,SAAoB3C,GACxB,MAAwB,kBAAVA,CAChB"}
|
|
1
|
+
{"version":3,"file":"nuclo.cjs","sources":["../src/utility/typeGuards.ts","../src/utility/errorHandler.ts","../src/utility/environment.ts","../src/utility/dom.ts","../src/core/reactiveText.ts","../src/core/reactiveAttributes.ts","../src/utility/domTypeHelpers.ts","../src/core/styleManager.ts","../src/core/classNameMerger.ts","../src/core/attributeManager.ts","../src/utility/modifierPredicates.ts","../src/core/modifierProcessor.ts","../src/utility/conditionalInfo.ts","../src/internal/applyModifiers.ts","../src/core/conditionalRenderer.ts","../src/core/elementFactory.ts","../src/core/tagRegistry.ts","../src/list/runtime.ts","../src/utility/renderables.ts","../src/utility/arrayUtils.ts","../src/list/renderer.ts","../src/utility/conditions.ts","../src/when/renderer.ts","../src/when/runtime.ts","../src/when/builder.ts","../src/when/index.ts","../src/core/conditionalUpdater.ts","../src/core/updateController.ts","../src/utility/events.ts","../src/utility/on.ts","../src/utility/render.ts","../src/style/styleProperties.ts","../src/style/styleCache.ts","../src/style/cssGenerator.ts","../src/style/styleBuilder.ts","../src/style/styleQueries.ts","../src/core/runtimeBootstrap.ts"],"sourcesContent":["export function isPrimitive(value: unknown): value is Primitive {\n return value === null || (typeof value !== \"object\" && typeof value !== \"function\");\n}\n\nexport function isNode<T>(value: T): value is T & Node {\n return value instanceof Node;\n}\n\nexport function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null;\n}\n\nexport function isTagLike<T>(value: T): value is T & { tagName?: string } {\n return isObject(value) && \"tagName\" in (value as object);\n}\n\nexport function isBoolean(value: unknown): value is boolean {\n return typeof value === \"boolean\";\n}\n\nexport function isFunction<T extends Function>(value: unknown): value is T {\n return typeof value === \"function\";\n}\n\nexport function isZeroArityFunction(value: unknown): value is () => unknown {\n return isFunction(value) && (value as Function).length === 0;\n}\n","/**\n * Simplified error handling for nuclo - reduced complexity for smaller bundle size\n */\n\n// Basic error logging - no complex context tracking\nexport function logError(message: string, error?: Error | unknown): void {\n if (typeof console !== 'undefined') {\n console.error(`nuclo: ${message}`, error);\n }\n}\n\n// Simplified safe execution - no complex context\nexport function safeExecute<T>(fn: () => T, fallback?: T): T | undefined {\n try {\n return fn();\n } catch (error) {\n logError(\"Operation failed\", error);\n return fallback;\n }\n}\n\n// Basic DOM error handler\nexport function handleDOMError(error: Error | unknown, operation: string): void {\n logError(`DOM ${operation} failed`, error);\n}","/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","import { isBrowser } from \"./environment\";\nimport { logError } from \"./errorHandler\";\n\nfunction safeAppendChild(parent: Element | Node, child: Node): boolean {\n if (!parent || !child) return false;\n try {\n parent.appendChild(child);\n return true;\n } catch (error) {\n logError('Failed to append child node', error);\n return false;\n }\n}\n\nexport function safeRemoveChild(child: Node): boolean {\n if (!child?.parentNode) return false;\n try {\n child.parentNode.removeChild(child);\n return true;\n } catch (error) {\n logError('Failed to remove child node', error);\n return false;\n }\n}\n\nfunction safeInsertBefore(parent: Node, newNode: Node, referenceNode: Node | null): boolean {\n if (!parent || !newNode) return false;\n try {\n parent.insertBefore(newNode, referenceNode);\n return true;\n } catch (error) {\n logError('Failed to insert node before reference', error);\n return false;\n }\n}\n\nfunction createTextNodeSafely(text: string | number | boolean): Text | null {\n if (!isBrowser) return null;\n try {\n return document.createTextNode(String(text));\n } catch (error) {\n logError('Failed to create text node', error);\n return null;\n }\n}\n\nfunction createCommentSafely(text: string): Comment | null {\n if (!isBrowser) return null;\n try {\n return document.createComment(text);\n } catch (error) {\n logError('Failed to create comment node', error);\n return null;\n }\n}\n\n/**\n * Creates a comment node safely with error handling.\n * Exported for use across the codebase.\n */\nexport function createComment(text: string): Comment | null {\n return createCommentSafely(text);\n}\n\n/**\n * Creates a conditional comment placeholder node.\n * In SSR environments, this will still work because we bypass the isBrowser check.\n */\nexport function createConditionalComment(tagName: string, suffix: string = \"hidden\"): Comment | null {\n // For SSR, we need to create comments even when isBrowser is false\n // This function intentionally skips the isBrowser check for SSR compatibility\n try {\n return document.createComment(`conditional-${tagName}-${suffix}`);\n } catch (error) {\n logError('Failed to create conditional comment', error);\n return null;\n }\n}\n\nexport function createMarkerComment(prefix: string): Comment {\n if (!isBrowser) {\n throw new Error(\"Cannot create comment in non-browser environment\");\n }\n const comment = createCommentSafely(`${prefix}-${Math.random().toString(36).slice(2)}`);\n if (!comment) {\n throw new Error(\"Failed to create comment\");\n }\n return comment;\n}\n\nexport function createMarkerPair(prefix: string): { start: Comment; end: Comment } {\n const endComment = createCommentSafely(`${prefix}-end`);\n if (!endComment) {\n throw new Error(\"Failed to create end comment\");\n }\n return {\n start: createMarkerComment(`${prefix}-start`),\n end: endComment\n };\n}\n\nexport function clearBetweenMarkers(startMarker: Comment, endMarker: Comment): void {\n let current = startMarker.nextSibling;\n while (current && current !== endMarker) {\n const next = current.nextSibling;\n safeRemoveChild(current);\n current = next;\n }\n}\n\nexport function insertNodesBefore(nodes: Node[], referenceNode: Node): void {\n const parent = referenceNode.parentNode;\n if (parent) {\n nodes.forEach(node => safeInsertBefore(parent, node, referenceNode));\n }\n}\n\nexport function appendChildren(\n parent: Element | Node,\n ...children: Array<Element | Node | string | null | undefined>\n): Element | Node {\n if (!parent) return parent;\n\n children.forEach((child) => {\n if (child != null) {\n let nodeToAppend: Node;\n\n if (typeof child === \"string\") {\n const textNode = createTextNodeSafely(child);\n if (textNode) {\n nodeToAppend = textNode;\n } else {\n return;\n }\n } else {\n nodeToAppend = child as Node;\n }\n\n safeAppendChild(parent, nodeToAppend);\n }\n });\n\n return parent;\n}\n\nexport function isNodeConnected(node: Node | null | undefined): boolean {\n if (!node) return false;\n\n // Prefer the built-in isConnected property\n if (typeof node.isConnected === \"boolean\") {\n return node.isConnected;\n }\n\n // Fallback for older browsers (only if in browser environment)\n if (isBrowser && typeof document !== 'undefined') {\n return document.contains(node);\n }\n\n // In SSR or when document is not available, assume disconnected\n return false;\n}\n\n/**\n * Safely replaces an old node with a new node in the DOM.\n * Returns true on success, false on failure (and logs the error).\n */\nexport function replaceNodeSafely(oldNode: Node, newNode: Node): boolean {\n if (!oldNode?.parentNode) return false;\n try {\n oldNode.parentNode.replaceChild(newNode, oldNode);\n return true;\n } catch (error) {\n logError(\"Error replacing conditional node\", error);\n return false;\n }\n}\n","import { logError, safeExecute } from \"../utility/errorHandler\";\nimport { isNodeConnected } from \"../utility/dom\";\n\ntype TextResolver = () => Primitive;\n\ninterface ReactiveTextNodeInfo {\n resolver: TextResolver;\n lastValue: string;\n}\n\nconst reactiveTextNodes = new Map<Text, ReactiveTextNodeInfo>();\n\n/**\n * Creates a reactive text node that automatically updates when its resolver function changes.\n *\n * The text node will be registered for reactive updates and its content will be synchronized\n * whenever notifyReactiveTextNodes() is called.\n *\n * @param resolver - Function that returns the text content (string, number, boolean, etc.)\n * @param preEvaluated - Optional pre-evaluated value to avoid calling resolver immediately\n * @returns A Text node that will reactively update its content\n *\n * @example\n * ```ts\n * const count = signal(0);\n * const textNode = createReactiveTextNode(() => `Count: ${count.value}`);\n * // Later, when count changes and notifyReactiveTextNodes() is called,\n * // the text content automatically updates\n * ```\n */\nexport function createReactiveTextNode(resolver: TextResolver, preEvaluated?: unknown): Text | DocumentFragment {\n if (typeof resolver !== \"function\") {\n logError(\"Invalid resolver provided to createReactiveTextNode\");\n return document.createTextNode(\"\");\n }\n\n const initial = arguments.length > 1 ? preEvaluated : safeExecute(resolver, \"\");\n const str = initial === undefined ? \"\" : String(initial);\n const txt = document.createTextNode(str);\n\n reactiveTextNodes.set(txt, { resolver, lastValue: str });\n return txt;\n}\n\n/**\n * Updates all registered reactive text nodes.\n *\n * Iterates through all reactive text nodes, re-evaluates their resolver functions,\n * and updates their content if it has changed. Automatically cleans up disconnected nodes.\n *\n * This function should be called after state changes to synchronize the DOM with application state.\n *\n * @example\n * ```ts\n * // After updating application state\n * count.value++;\n * notifyReactiveTextNodes(); // All reactive text nodes update\n * ```\n */\nexport function notifyReactiveTextNodes(): void {\n reactiveTextNodes.forEach((info, node) => {\n if (!isNodeConnected(node)) {\n reactiveTextNodes.delete(node);\n return;\n }\n try {\n const raw = safeExecute(info.resolver);\n const newVal = raw === undefined ? \"\" : String(raw);\n if (newVal !== info.lastValue) {\n node.textContent = newVal;\n info.lastValue = newVal;\n }\n } catch (e) {\n logError(\"Failed to update reactive text node\", e);\n }\n });\n}\n","import { logError, safeExecute } from \"../utility/errorHandler\";\nimport { isNodeConnected } from \"../utility/dom\";\n\ntype AttributeResolver = () => unknown;\n\ninterface AttributeResolverRecord {\n resolver: AttributeResolver;\n applyValue: (value: unknown) => void;\n}\n\ninterface ReactiveElementInfo {\n attributeResolvers: Map<string, AttributeResolverRecord>;\n updateListener?: EventListener;\n}\n\nconst reactiveElements = new Map<Element, ReactiveElementInfo>();\n\nfunction ensureElementInfo(el: Element): ReactiveElementInfo {\n let info = reactiveElements.get(el);\n if (!info) {\n info = { attributeResolvers: new Map() };\n reactiveElements.set(el, info);\n }\n return info;\n}\n\nfunction applyAttributeResolvers(el: Element, info: ReactiveElementInfo): void {\n info.attributeResolvers.forEach(({ resolver, applyValue }, key) => {\n try {\n applyValue(safeExecute(resolver));\n } catch (e) {\n logError(`Failed to update reactive attribute: ${key}`, e);\n }\n });\n}\n\n/**\n * Registers a reactive attribute resolver for an element.\n *\n * The resolver will be called whenever the element receives an 'update' event,\n * allowing attributes to reactively update based on application state.\n *\n * @param element - The DOM element to make reactive\n * @param key - The attribute name being made reactive (e.g., 'class', 'style', 'disabled')\n * @param resolver - Function that returns the new attribute value\n * @param applyValue - Callback that applies the resolved value to the element\n *\n * @example\n * ```ts\n * const isActive = signal(false);\n * const button = document.createElement('button');\n * registerAttributeResolver(\n * button,\n * 'class',\n * () => isActive.value ? 'active' : 'inactive',\n * (value) => button.className = String(value)\n * );\n * ```\n */\nexport function registerAttributeResolver<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n key: string,\n resolver: AttributeResolver,\n applyValue: (value: unknown) => void\n): void {\n if (!(element instanceof Element) || !key || typeof resolver !== \"function\") {\n logError(\"Invalid parameters for registerAttributeResolver\");\n return;\n }\n const info = ensureElementInfo(element as Element);\n info.attributeResolvers.set(key, { resolver, applyValue });\n\n try {\n applyValue(safeExecute(resolver));\n } catch (e) {\n logError(\"Failed to apply initial attribute value\", e);\n }\n\n if (!info.updateListener) {\n const listener: EventListener = () => applyAttributeResolvers(element as Element, info);\n (element as Element).addEventListener(\"update\", listener);\n info.updateListener = listener;\n }\n}\n\n/**\n * Updates all registered reactive elements by re-evaluating their attribute resolvers.\n *\n * Iterates through all reactive elements and triggers their registered attribute resolvers\n * to update. Automatically cleans up disconnected elements and their event listeners.\n *\n * This function should be called after state changes to synchronize element attributes\n * with application state.\n *\n * @example\n * ```ts\n * // After updating application state\n * isActive.value = true;\n * notifyReactiveElements(); // All reactive attributes update\n * ```\n */\nexport function notifyReactiveElements(): void {\n reactiveElements.forEach((info, el) => {\n if (!isNodeConnected(el)) {\n if (info.updateListener) el.removeEventListener(\"update\", info.updateListener);\n reactiveElements.delete(el);\n return;\n }\n applyAttributeResolvers(el, info);\n });\n}\n","/**\n * Type-safe DOM helper utilities to reduce type assertions across the codebase.\n * These helpers provide proper typing for DOM operations while maintaining runtime safety.\n */\n\n/**\n * Safely casts an Element-like object to Node & ParentNode interface.\n * This is a common pattern needed when working with DOM manipulation.\n *\n * @param element - The element to cast\n * @returns The element typed as Node & ParentNode\n */\nexport function asParentNode<T extends Element | object>(element: T): Node & ParentNode {\n return element as unknown as Node & ParentNode;\n}\n\n/**\n * Creates a scoped DOM insertion context that temporarily redirects appendChild\n * to insertBefore at a specific reference node. This is useful for inserting\n * content at specific positions in the DOM tree.\n *\n * @param host - The host element\n * @param referenceNode - The node before which new nodes should be inserted\n * @param callback - Function to execute with the scoped context\n * @returns The result of the callback\n */\nexport function withScopedInsertion<T, THost extends Element | object>(\n host: THost,\n referenceNode: Node,\n callback: () => T\n): T {\n const parent = asParentNode(host);\n const originalAppend = parent.appendChild.bind(parent);\n const originalInsert = parent.insertBefore.bind(parent);\n\n // Temporarily override appendChild to insert before the reference node\n // TypeScript doesn't like this override but it's safe at runtime\n (parent as unknown as Record<string, unknown>).appendChild = function(node: Node): Node {\n return originalInsert(node, referenceNode);\n };\n\n try {\n return callback();\n } finally {\n // Restore original method\n (parent as unknown as Record<string, unknown>).appendChild = originalAppend;\n }\n}\n\n/**\n * Type-safe wrapper for setting CSS style properties.\n * Provides better error handling than direct CSSStyleDeclaration access.\n * Supports both camelCase and kebab-case property names.\n *\n * @param element - The element to apply styles to\n * @param property - The CSS property name (camelCase or kebab-case)\n * @param value - The value to set (string, number, or null to remove)\n * @returns true if the style was applied successfully, false otherwise\n */\nexport function setStyleProperty(\n element: HTMLElement,\n property: string,\n value: string | number | null\n): boolean {\n try {\n if (value === null || value === undefined || value === '') {\n // Use bracket notation to remove property (works with camelCase)\n (element.style as unknown as Record<string, string>)[property] = '';\n return true;\n }\n\n // Convert value to string first (might throw if toString() throws)\n const stringValue = String(value);\n // Use bracket notation to set property (works with camelCase)\n (element.style as unknown as Record<string, string>)[property] = stringValue;\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Type-safe wrapper for reading CSS style properties.\n *\n * @param element - The element to read styles from\n * @param property - The CSS property name\n * @returns The computed style value or empty string if not found\n */\nexport function getStyleProperty(\n element: HTMLElement,\n property: string\n): string {\n try {\n return element.style.getPropertyValue(property);\n } catch {\n return '';\n }\n}\n","import { isFunction } from \"../utility/typeGuards\";\nimport { registerAttributeResolver } from \"./reactive\";\nimport { setStyleProperty } from \"../utility/domTypeHelpers\";\nimport { logError } from \"../utility/errorHandler\";\n\ntype StyleAssignment = Partial<CSSStyleDeclaration>;\ntype StyleResolver = () => StyleAssignment | null | undefined;\n\n/**\n * Simplified style management - basic functionality with minimal overhead\n */\nexport function assignInlineStyles<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n styles: StyleAssignment | null | undefined,\n): void {\n if (!element?.style || !styles) return;\n\n for (const [property, value] of Object.entries(styles)) {\n const success = setStyleProperty(\n element as HTMLElement,\n property,\n value as string | number | null\n );\n\n if (!success) {\n // Don't try to stringify value in error message as it might throw\n logError(`Failed to set style property '${property}'`);\n }\n }\n}\n\nexport function applyStyleAttribute<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n styleValue: StyleAssignment | StyleResolver | null | undefined\n): void {\n if (!element) return;\n\n if (isFunction(styleValue)) {\n registerAttributeResolver(element, 'style', () => {\n try {\n return styleValue();\n } catch (error) {\n logError('Error in style resolver function', error);\n return null;\n }\n }, (resolvedStyles) => {\n assignInlineStyles(element, resolvedStyles as StyleAssignment);\n });\n } else {\n assignInlineStyles(element, styleValue);\n }\n}","const REACTIVE_CLASSNAME_KEY = '__nuclo_reactive_className__';\nconst STATIC_CLASSNAME_KEY = '__nuclo_static_className__';\n\n// Mark element as having a reactive className and capture static classes\nexport function initReactiveClassName(el: HTMLElement): void {\n\tif (!(el as any)[STATIC_CLASSNAME_KEY]) {\n\t\t(el as any)[STATIC_CLASSNAME_KEY] = new Set(el.className.split(' ').filter(c => c));\n\t}\n\t(el as any)[REACTIVE_CLASSNAME_KEY] = true;\n}\n\n// Check if element has a reactive className\nexport function hasReactiveClassName(el: HTMLElement): boolean {\n\treturn !!(el as any)[REACTIVE_CLASSNAME_KEY];\n}\n\n// Get static classes set for the element\nfunction getStaticClasses(el: HTMLElement): Set<string> {\n\treturn (el as any)[STATIC_CLASSNAME_KEY] as Set<string>;\n}\n\n// Add static classes to the element\nexport function addStaticClasses(el: HTMLElement, className: string): void {\n\tif (!className) return;\n\n\tif (!(el as any)[STATIC_CLASSNAME_KEY]) {\n\t\t(el as any)[STATIC_CLASSNAME_KEY] = new Set();\n\t}\n\n\tclassName.split(' ').filter(c => c).forEach(c => {\n\t\t((el as any)[STATIC_CLASSNAME_KEY] as Set<string>).add(c);\n\t});\n}\n\n// Merge reactive className with static classes\nexport function mergeReactiveClassName(el: HTMLElement, reactiveClassName: string): void {\n\tconst staticClasses = getStaticClasses(el);\n\n\t// Combine static classes with reactive className\n\tif (staticClasses && staticClasses.size > 0 && reactiveClassName) {\n\t\tconst allClasses = new Set(staticClasses);\n\t\treactiveClassName.split(' ').filter(c => c).forEach(c => allClasses.add(c));\n\t\tel.className = Array.from(allClasses).join(' ');\n\t} else if (reactiveClassName) {\n\t\tel.className = reactiveClassName;\n\t} else if (staticClasses && staticClasses.size > 0) {\n\t\tel.className = Array.from(staticClasses).join(' ');\n\t} else {\n\t\tel.className = '';\n\t}\n}\n\n// Merge static className (for non-reactive className attributes)\nexport function mergeStaticClassName(el: HTMLElement, newClassName: string): void {\n\tif (!newClassName) return;\n\n\tconst currentClassName = el.className;\n\n\t// If there's already a className, merge them (avoid duplicates)\n\tif (currentClassName && currentClassName !== newClassName) {\n\t\tconst existing = new Set(currentClassName.split(' ').filter(c => c));\n\t\tconst newClasses = newClassName.split(' ').filter(c => c);\n\t\tnewClasses.forEach(c => existing.add(c));\n\t\tel.className = Array.from(existing).join(' ');\n\t} else {\n\t\tel.className = newClassName;\n\t}\n}\n","import { isFunction } from \"../utility/typeGuards\";\nimport { registerAttributeResolver, createReactiveTextNode } from \"./reactive\";\nimport { applyStyleAttribute } from \"./styleManager\";\nimport {\n\tinitReactiveClassName,\n\thasReactiveClassName,\n\taddStaticClasses,\n\tmergeReactiveClassName,\n\tmergeStaticClassName\n} from \"./classNameMerger\";\n\ntype AttributeKey<TTagName extends ElementTagName> = keyof ExpandedElementAttributes<TTagName>;\ntype AttributeCandidate<TTagName extends ElementTagName> =\n ExpandedElementAttributes<TTagName>[AttributeKey<TTagName>];\n\nfunction applySingleAttribute<TTagName extends ElementTagName>(\n el: ExpandedElement<TTagName>,\n key: AttributeKey<TTagName>,\n raw: AttributeCandidate<TTagName> | undefined,\n shouldMergeClassName = false,\n): void {\n if (raw == null) return;\n\n if (key === \"style\") {\n applyStyleAttribute(el, raw as ExpandedElementAttributes<TTagName>[\"style\"]);\n return;\n }\n\n const setValue = (v: unknown, merge = false): void => {\n if (v == null) return;\n\n // Special handling for className to merge instead of replace (only for non-reactive updates)\n if (key === 'className' && el instanceof HTMLElement && merge) {\n mergeStaticClassName(el, String(v));\n return;\n }\n\n // SVG elements should always use setAttribute for most attributes\n // because many SVG properties are read-only\n const isSVGElement = el instanceof Element && el.namespaceURI === 'http://www.w3.org/2000/svg';\n\n if (isSVGElement) {\n // Always use setAttribute for SVG elements\n el.setAttribute(String(key), String(v));\n } else if (key in el) {\n // For HTML elements, try to set as property first\n try {\n (el as Record<string, unknown>)[key as string] = v;\n } catch {\n // If property is read-only, fall back to setAttribute\n if (el instanceof Element) {\n el.setAttribute(String(key), String(v));\n }\n }\n } else if (el instanceof Element) {\n el.setAttribute(String(key), String(v));\n }\n };\n\n if (isFunction(raw) && raw.length === 0) {\n // Type narrowing: zero-arity function that returns an attribute value\n const resolver = raw as () => AttributeCandidate<TTagName>;\n\n // For reactive className, we need to track which classes are reactive\n // so we can preserve static classes when the reactive className changes\n if (key === 'className' && el instanceof HTMLElement) {\n initReactiveClassName(el);\n\n registerAttributeResolver(el, String(key), resolver, (v) => {\n mergeReactiveClassName(el, String(v || ''));\n });\n } else {\n registerAttributeResolver(el, String(key), resolver, (v) => {\n setValue(v, false);\n });\n }\n } else {\n // Static attributes should merge classNames\n // For className, if there's already a reactive className, add to static classes\n if (key === 'className' && el instanceof HTMLElement) {\n if (hasReactiveClassName(el)) {\n // There's already a reactive className, add this to static classes\n const newClassName = String(raw || '');\n if (newClassName) {\n addStaticClasses(el, newClassName);\n // Also update the current className immediately\n const currentClasses = new Set(el.className.split(' ').filter(c => c));\n newClassName.split(' ').filter(c => c).forEach(c => currentClasses.add(c));\n el.className = Array.from(currentClasses).join(' ');\n }\n return;\n }\n }\n setValue(raw, shouldMergeClassName);\n }\n}\n\nexport function applyAttributes<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n attributes: ExpandedElementAttributes<TTagName>,\n mergeClassName = true,\n): void {\n if (!attributes) return;\n for (const k of Object.keys(attributes) as Array<AttributeKey<TTagName>>) {\n const value = (attributes as Record<string, unknown>)[k as string] as\n AttributeCandidate<TTagName> | undefined;\n // Only merge className for non-className keys OR when explicitly enabled for className\n const shouldMerge = mergeClassName && k === 'className';\n applySingleAttribute(element, k, value, shouldMerge);\n }\n}\n\nexport { createReactiveTextNode } from \"./reactive\";\n","import { isFunction, isNode, isObject } from \"./typeGuards\";\n\ntype BooleanCondition = () => boolean;\ntype ZeroArityFunction = () => unknown;\n\nconst modifierProbeCache = new WeakMap<ZeroArityFunction, { value: unknown; error: boolean }>();\n\nfunction probeOnce(fn: ZeroArityFunction): { value: unknown; error: boolean } {\n const cached = modifierProbeCache.get(fn);\n if (cached) {\n return cached;\n }\n try {\n const value = fn();\n const record = { value, error: false };\n modifierProbeCache.set(fn, record);\n return record;\n } catch {\n const record = { value: undefined, error: true };\n modifierProbeCache.set(fn, record);\n return record;\n }\n}\n\nfunction isBooleanFunction(fn: ZeroArityFunction): fn is BooleanCondition {\n const { value, error } = probeOnce(fn);\n if (error) return false;\n return typeof value === \"boolean\";\n}\n\nexport function isConditionalModifier(\n modifier: unknown,\n allModifiers: unknown[],\n currentIndex: number\n): modifier is BooleanCondition {\n if (!isFunction(modifier) || modifier.length !== 0) {\n return false;\n }\n\n // After checking length === 0, we know it's a ZeroArityFunction\n const zeroArityFn = modifier as ZeroArityFunction;\n if (!isBooleanFunction(zeroArityFn)) {\n return false;\n }\n\n const otherModifiers = allModifiers.filter((_, index) => index !== currentIndex);\n if (otherModifiers.length === 0) return false;\n\n const hasAttributesOrElements = otherModifiers.some((mod) => {\n if (isObject(mod) || isNode(mod)) return true;\n if (isFunction(mod) && mod.length > 0) return true;\n return false;\n });\n\n return hasAttributesOrElements;\n}\n\nexport function findConditionalModifier(modifiers: unknown[]): number {\n for (let i = 0; i < modifiers.length; i += 1) {\n if (isConditionalModifier(modifiers[i], modifiers, i)) {\n return i;\n }\n }\n return -1;\n}\n\nexport { modifierProbeCache };\n","import { applyAttributes } from \"./attributeManager\";\nimport { createReactiveTextNode } from \"./reactive\";\nimport { logError } from \"../utility/errorHandler\";\nimport { isFunction, isNode, isObject, isPrimitive, isZeroArityFunction } from \"../utility/typeGuards\";\nimport { modifierProbeCache } from \"../utility/modifierPredicates\";\nimport { createComment } from \"../utility/dom\";\n\nexport { isConditionalModifier, findConditionalModifier } from \"../utility/modifierPredicates\";\n\nexport type NodeModifier<TTagName extends ElementTagName = ElementTagName> =\n | NodeMod<TTagName>\n | NodeModFn<TTagName>;\n\nexport function applyNodeModifier<TTagName extends ElementTagName>(\n parent: ExpandedElement<TTagName>,\n modifier: NodeModifier<TTagName>,\n index: number,\n): Node | null {\n if (modifier == null) return null;\n\n if (isFunction(modifier)) {\n // Handle zero-argument functions (reactive text or reactive className)\n if (isZeroArityFunction(modifier)) {\n try {\n let record = modifierProbeCache.get(modifier);\n if (!record) {\n const value = (modifier as () => unknown)();\n record = { value, error: false };\n modifierProbeCache.set(modifier, record);\n }\n if (record.error) {\n return createReactiveTextFragment(index, () => \"\");\n }\n const v = record.value;\n\n // Check if the returned value is a className object from cn()\n // Must be a plain object with className property, not a Node or other object\n if (isObject(v) && !isNode(v) && 'className' in v && typeof v.className === 'string' && Object.keys(v).length === 1) {\n // Create a wrapper function that extracts className from the modifier result\n const originalModifier = modifier as () => unknown;\n const classNameFn = () => {\n const result = originalModifier();\n return (result as unknown as { className: string }).className;\n };\n applyAttributes(parent, { className: classNameFn } as ExpandedElementAttributes<TTagName>);\n return null;\n }\n\n if (isPrimitive(v) && v != null) {\n return createReactiveTextFragment(index, modifier as () => Primitive, v);\n }\n return null;\n } catch (error) {\n modifierProbeCache.set(modifier, { value: undefined, error: true });\n logError(\"Error evaluating reactive text function:\", error);\n return createReactiveTextFragment(index, () => \"\");\n }\n }\n\n // Handle NodeModFn functions\n const produced = modifier(parent, index);\n if (produced == null) return null;\n if (isPrimitive(produced)) {\n return createStaticTextFragment(index, produced);\n }\n if (isNode(produced)) return produced;\n if (isObject(produced)) {\n applyAttributes(parent, produced as ExpandedElementAttributes<TTagName>);\n }\n return null;\n }\n\n // Handle non-function modifiers\n const candidate = modifier as NodeMod<TTagName>;\n if (candidate == null) return null;\n if (isPrimitive(candidate)) {\n return createStaticTextFragment(index, candidate);\n }\n if (isNode(candidate)) return candidate;\n if (isObject(candidate)) {\n applyAttributes(parent, candidate as ExpandedElementAttributes<TTagName>);\n }\n return null;\n}\n\nfunction createReactiveTextFragment(\n index: number,\n resolver: () => Primitive,\n preEvaluated?: unknown\n): DocumentFragment {\n const fragment = document.createDocumentFragment();\n const comment = createComment(` text-${index} `);\n if (comment) fragment.appendChild(comment);\n const textNode = createReactiveTextNode(resolver, preEvaluated);\n fragment.appendChild(textNode);\n return fragment;\n}\n\nfunction createStaticTextFragment(index: number, value: Primitive): DocumentFragment {\n const fragment = document.createDocumentFragment();\n const comment = createComment(` text-${index} `);\n if (comment) fragment.appendChild(comment);\n const textNode = document.createTextNode(String(value));\n fragment.appendChild(textNode);\n return fragment;\n}\n","export interface ConditionalInfo<TTagName extends ElementTagName = ElementTagName> {\n condition: () => boolean;\n tagName: TTagName;\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>;\n}\n\ninterface NodeWithConditionalInfo extends Node {\n _conditionalInfo?: ConditionalInfo<keyof HTMLElementTagNameMap>;\n}\n\n/**\n * Registry of all nodes that have conditional info attached.\n * This enables O(nConditionals) updates instead of a full DOM tree walk.\n */\nconst activeConditionalNodes = new Set<Node>();\n\n/**\n * Attach conditional info to a node and register it.\n */\nexport function storeConditionalInfo<TTagName extends ElementTagName>(\n node: Node,\n info: ConditionalInfo<TTagName>\n): void {\n (node as NodeWithConditionalInfo)._conditionalInfo = info as ConditionalInfo<keyof HTMLElementTagNameMap>;\n activeConditionalNodes.add(node);\n}\n\n/**\n * Explicit unregister helper (optional use on teardown if needed).\n */\nexport function unregisterConditionalNode(node: Node): void {\n activeConditionalNodes.delete(node);\n}\n\n/**\n * Returns a readonly view of currently tracked conditional nodes.\n */\nexport function getActiveConditionalNodes(): ReadonlySet<Node> {\n return activeConditionalNodes;\n}\n\nexport function hasConditionalInfo(node: Node): boolean {\n return Boolean((node as NodeWithConditionalInfo)._conditionalInfo);\n}\n\nexport function getConditionalInfo(node: Node): ConditionalInfo<keyof HTMLElementTagNameMap> | null {\n return (node as NodeWithConditionalInfo)._conditionalInfo ?? null;\n}\n","/**\n * Shared helper for applying an array of modifiers to an element.\n * Consolidates the previously duplicated logic in several modules:\n * - conditionalRenderer\n * - conditionalUpdater\n * - elementFactory\n *\n * Goal: single, optimized, well‑typed implementation.\n *\n * A \"modifier\" can:\n * - Return (or be) primitives → appended as text\n * - Return (or be) Node → appended (if not already a child)\n * - Return (or be) attribute objects → merged into element\n * - Be a NodeModFn invoked with (parent, index)\n * - Be a zero‑arg function producing reactive text (handled upstream in applyNodeModifier)\n *\n * Indexing:\n * - startIndex allows callers to continue an index sequence if needed.\n * - Every successfully rendered child Node increments the local index.\n */\nimport { applyNodeModifier } from \"../core/modifierProcessor\";\n\nexport type NodeModifier<TTagName extends ElementTagName = ElementTagName> =\n | NodeMod<TTagName>\n | NodeModFn<TTagName>;\n\nexport interface ApplyModifiersResult<TTagName extends ElementTagName> {\n /**\n * The element passed in (for fluent patterns if desired).\n */\n element: ExpandedElement<TTagName>;\n /**\n * The next index after processing (startIndex + rendered children count).\n */\n nextIndex: number;\n /**\n * Number of child nodes appended (not counting attributes-only modifiers).\n */\n appended: number;\n}\n\n/**\n * Applies modifiers to an element, appending newly produced Nodes while avoiding\n * duplicate DOM insertions (i.e. only appends if parentNode differs).\n *\n * Returns meta information that callers can use for continuation indexing.\n */\nexport function applyModifiers<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>,\n startIndex = 0\n): ApplyModifiersResult<TTagName> {\n if (!modifiers || modifiers.length === 0) {\n return { element, nextIndex: startIndex, appended: 0 };\n }\n\n let localIndex = startIndex;\n let appended = 0;\n const parentNode = element as unknown as Node & ParentNode;\n\n for (let i = 0; i < modifiers.length; i += 1) {\n const mod = modifiers[i];\n // Fast null/undefined skip\n if (mod == null) continue;\n\n const produced = applyNodeModifier(element, mod, localIndex);\n if (!produced) continue;\n\n // Only append if the node isn't already where we expect\n if (produced.parentNode !== parentNode) {\n parentNode.appendChild(produced);\n }\n localIndex += 1;\n appended += 1;\n }\n\n return {\n element,\n nextIndex: localIndex,\n appended\n };\n}\n\n/**\n * Convenience helper: apply modifiers and return the element (fluent style).\n * Discards meta information.\n */\nexport function applyModifiersAndReturn<TTagName extends ElementTagName>(\n element: ExpandedElement<TTagName>,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>,\n startIndex = 0\n): ExpandedElement<TTagName> {\n applyModifiers(element, modifiers, startIndex);\n return element;\n}\n\n/**\n * Creates an element with the specified tag name and applies modifiers to it.\n * Centralizes element creation logic used across conditionalRenderer and conditionalUpdater.\n */\nexport function createElementWithModifiers<TTagName extends ElementTagName>(\n tagName: TTagName,\n modifiers: ReadonlyArray<NodeModifier<TTagName>>\n): ExpandedElement<TTagName> {\n const el = document.createElement(tagName) as ExpandedElement<TTagName>;\n applyModifiers(el, modifiers, 0);\n return el;\n}","import { findConditionalModifier } from \"./modifierProcessor\";\nimport { isBrowser } from \"../utility/environment\";\nimport { storeConditionalInfo } from \"../utility/conditionalInfo\";\nimport type { ConditionalInfo } from \"../utility/conditionalInfo\";\nimport { createElementWithModifiers, type NodeModifier } from \"../internal/applyModifiers\";\nimport { createConditionalComment } from \"../utility/dom\";\n\nexport function createConditionalElement<TTagName extends ElementTagName>(\n tagName: TTagName,\n condition: () => boolean,\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): ExpandedElement<TTagName> | Comment {\n const passed = condition();\n\n if (!isBrowser) {\n return passed\n ? createElementWithModifiers(tagName, modifiers as ReadonlyArray<NodeModifier<TTagName>>)\n : (createConditionalComment(tagName, \"ssr\") as unknown as ExpandedElement<TTagName>);\n }\n\n const conditionalInfo: ConditionalInfo<TTagName> = { condition, tagName, modifiers };\n\n if (passed) {\n const el = createElementWithModifiers(tagName, modifiers as ReadonlyArray<NodeModifier<TTagName>>);\n storeConditionalInfo(el as Node, conditionalInfo);\n return el;\n }\n\n const comment = createConditionalComment(tagName);\n if (!comment) {\n throw new Error(`Failed to create conditional comment for ${tagName}`);\n }\n storeConditionalInfo(comment as Node, conditionalInfo);\n return comment as unknown as ExpandedElement<TTagName>;\n}\n\nexport function processConditionalModifiers<TTagName extends ElementTagName>(\n modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): {\n condition: (() => boolean) | null;\n otherModifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>;\n} {\n const conditionalIndex = findConditionalModifier(modifiers);\n\n if (conditionalIndex === -1) {\n return { condition: null, otherModifiers: modifiers };\n }\n\n return {\n condition: modifiers[conditionalIndex] as () => boolean,\n otherModifiers: modifiers.filter((_, index) => index !== conditionalIndex)\n };\n}\n","import { createConditionalElement, processConditionalModifiers } from \"./conditionalRenderer\";\nimport { applyModifiers, type NodeModifier } from \"../internal/applyModifiers\";\nimport { SVG_TAGS } from \"./tagRegistry\";\n\n/**\n * Checks if a tag name is an SVG tag.\n */\nfunction isSVGTag(tagName: string): tagName is keyof SVGElementTagNameMap {\n return (SVG_TAGS as readonly string[]).includes(tagName);\n}\n\n/**\n * Creates an element with proper namespace handling for SVG elements.\n */\nfunction createElementWithNamespace<TTagName extends ElementTagName>(\n tagName: TTagName\n): Element {\n if (isSVGTag(tagName)) {\n return document.createElementNS('http://www.w3.org/2000/svg', tagName);\n }\n return document.createElement(tagName);\n}\n\nexport function createElementFactory<TTagName extends ElementTagName>(\n tagName: TTagName,\n ...modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>\n): NodeModFn<TTagName> {\n return (parent: ExpandedElement<TTagName>, index: number): ExpandedElement<TTagName> => {\n const { condition, otherModifiers } = processConditionalModifiers(modifiers);\n\n if (condition) {\n return createConditionalElement(tagName, condition, otherModifiers) as ExpandedElement<TTagName>;\n }\n\n const el = createElementWithNamespace(tagName) as ExpandedElement<TTagName>;\n applyModifiers(el, otherModifiers as ReadonlyArray<NodeModifier<TTagName>>, index);\n return el;\n };\n}\n\nexport function createTagBuilder<TTagName extends ElementTagName>(\n tagName: TTagName,\n): (...modifiers: Array<NodeMod<TTagName> | NodeModFn<TTagName>>) => NodeModFn<TTagName> {\n return (...mods) => createElementFactory(tagName, ...mods);\n}","import { createTagBuilder } from \"./elementFactory\";\n\nexport const HTML_TAGS = [\n \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"base\",\n \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\",\n \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\", \"details\",\n \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\",\n \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\",\n \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\", \"img\", \"input\", \"ins\",\n \"kbd\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"menu\",\n \"meta\", \"meter\", \"nav\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\",\n \"output\", \"p\", \"picture\", \"pre\", \"progress\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\",\n \"samp\", \"script\", \"search\", \"section\", \"select\", \"slot\", \"small\", \"source\",\n \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\",\n \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\",\n \"track\", \"u\", \"ul\", \"var\", \"video\", \"wbr\",\n] as const satisfies ReadonlyArray<ElementTagName>;\n\nexport const SVG_TAGS = [\n \"a\", \"animate\", \"animateMotion\", \"animateTransform\", \"circle\", \"clipPath\",\n \"defs\", \"desc\", \"ellipse\", \"feBlend\", \"feColorMatrix\", \"feComponentTransfer\",\n \"feComposite\", \"feConvolveMatrix\", \"feDiffuseLighting\", \"feDisplacementMap\",\n \"feDistantLight\", \"feDropShadow\", \"feFlood\", \"feFuncA\", \"feFuncB\", \"feFuncG\",\n \"feFuncR\", \"feGaussianBlur\", \"feImage\", \"feMerge\", \"feMergeNode\", \"feMorphology\",\n \"feOffset\", \"fePointLight\", \"feSpecularLighting\", \"feSpotLight\", \"feTile\",\n \"feTurbulence\", \"filter\", \"foreignObject\", \"g\", \"image\", \"line\", \"linearGradient\",\n \"marker\", \"mask\", \"metadata\", \"mpath\", \"path\", \"pattern\", \"polygon\", \"polyline\",\n \"radialGradient\", \"rect\", \"script\", \"set\", \"stop\", \"style\", \"svg\", \"switch\",\n \"symbol\", \"text\", \"textPath\", \"title\", \"tspan\", \"use\", \"view\",\n] as const satisfies ReadonlyArray<keyof SVGElementTagNameMap>;\n\nexport const SELF_CLOSING_TAGS = [\n \"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\",\n \"source\", \"track\", \"wbr\",\n] as const satisfies ReadonlyArray<ElementTagName>;\n\nfunction registerHtmlTag(target: Record<string, unknown>, tagName: ElementTagName): void {\n // Don't overwrite non-function properties (safety check)\n if (tagName in target && typeof target[tagName] !== 'function') {\n return;\n }\n // Register HTML tags - they override SVG tags with same name\n target[tagName] = createTagBuilder(tagName);\n}\n\nfunction registerSvgTag(target: Record<string, unknown>, tagName: keyof SVGElementTagNameMap): void {\n // Some SVG tags conflict with HTML tags or DOM globals\n // Use suffix convention: a_svg, script_svg, style_svg, title_svg, text_svg, stop_\n const conflictingTags = ['a', 'script', 'style', 'title', 'text'];\n const globalConflicts = ['stop']; // 'stop' conflicts with DOM stop property\n\n let exportName: string = tagName;\n if (conflictingTags.includes(tagName)) {\n exportName = `${tagName}_svg`;\n } else if (globalConflicts.includes(tagName)) {\n exportName = `${tagName}_`;\n }\n\n if (!(exportName in target)) {\n target[exportName] = createTagBuilder(tagName as ElementTagName);\n }\n}\n\nexport function registerGlobalTagBuilders(target: Record<string, unknown> = globalThis): void {\n const marker = \"__nuclo_tags_registered\";\n if ((target as Record<string, boolean>)[marker]) return;\n\n // Register SVG tags first with special names for conflicts\n SVG_TAGS.forEach((tagName) => registerSvgTag(target, tagName));\n\n // Then register HTML tags - these will take precedence for conflicting names\n // So 'a' will be HTML by default, and 'a_svg' will be available for SVG anchors\n HTML_TAGS.forEach((tagName) => registerHtmlTag(target, tagName));\n\n (target as Record<string, boolean>)[marker] = true;\n}\n","import { createMarkerPair, safeRemoveChild } from \"../utility/dom\";\nimport { arraysEqual } from \"../utility/arrayUtils\";\nimport { resolveRenderable } from \"../utility/renderables\";\nimport type { ListRenderer, ListRuntime, ListItemRecord, ListItemsProvider } from \"./types\";\n\nconst activeListRuntimes = new Set<ListRuntime<unknown, keyof HTMLElementTagNameMap>>();\n\nfunction renderItem<TItem, TTagName extends ElementTagName>(\n runtime: ListRuntime<TItem, TTagName>,\n item: TItem,\n index: number,\n): ExpandedElement<TTagName> | null {\n const result = runtime.renderItem(item, index);\n return resolveRenderable<TTagName>(result, runtime.host, index);\n}\n\nfunction remove<TItem, TTagName extends ElementTagName>(record: ListItemRecord<TItem, TTagName>): void {\n safeRemoveChild(record.element as unknown as Node);\n}\n\nexport function sync<TItem, TTagName extends ElementTagName>(\n runtime: ListRuntime<TItem, TTagName>\n): void {\n const { host, startMarker, endMarker } = runtime;\n const parent = (startMarker.parentNode ?? (host as unknown as Node & ParentNode)) as\n Node & ParentNode;\n\n const currentItems = runtime.itemsProvider();\n\n if (arraysEqual(runtime.lastSyncedItems, currentItems)) return;\n\n const recordsByPosition = new Map<number, ListItemRecord<TItem, TTagName>>();\n const availableRecords = new Map<TItem, ListItemRecord<TItem, TTagName>[]>();\n\n runtime.records.forEach((record) => {\n const items = availableRecords.get(record.item);\n if (items) {\n items.push(record);\n } else {\n availableRecords.set(record.item, [record]);\n }\n });\n\n currentItems.forEach((item, newIndex) => {\n if (\n newIndex < runtime.lastSyncedItems.length &&\n runtime.lastSyncedItems[newIndex] === item\n ) {\n const existingRecord = runtime.records[newIndex];\n if (existingRecord && existingRecord.item === item) {\n recordsByPosition.set(newIndex, existingRecord);\n const items = availableRecords.get(item);\n if (items) {\n const recordIndex = items.indexOf(existingRecord);\n if (recordIndex >= 0) {\n items.splice(recordIndex, 1);\n if (items.length === 0) {\n availableRecords.delete(item);\n }\n }\n }\n }\n }\n });\n\n const newRecords: Array<ListItemRecord<TItem, TTagName>> = [];\n const elementsToRemove = new Set<ListItemRecord<TItem, TTagName>>(runtime.records);\n let nextSibling: Node = endMarker;\n\n for (let i = currentItems.length - 1; i >= 0; i--) {\n const item = currentItems[i];\n let record = recordsByPosition.get(i);\n\n if (!record) {\n const availableItems = availableRecords.get(item);\n if (availableItems && availableItems.length > 0) {\n record = availableItems.shift()!;\n if (availableItems.length === 0) {\n availableRecords.delete(item);\n }\n }\n }\n\n if (record) {\n elementsToRemove.delete(record);\n } else {\n const element = renderItem(runtime, item, i);\n if (!element) continue;\n record = { item, element };\n }\n\n newRecords.unshift(record);\n\n const recordNode = record.element as unknown as Node;\n if (recordNode.nextSibling !== nextSibling) {\n parent.insertBefore(recordNode, nextSibling);\n }\n nextSibling = recordNode;\n }\n\n elementsToRemove.forEach(remove);\n\n runtime.records = newRecords;\n runtime.lastSyncedItems = [...currentItems];\n}\n\nexport function createListRuntime<TItem, TTagName extends ElementTagName = ElementTagName>(\n itemsProvider: ListItemsProvider<TItem>,\n renderItem: ListRenderer<TItem, TTagName>,\n host: ExpandedElement<TTagName>,\n): ListRuntime<TItem, TTagName> {\n const { start: startMarker, end: endMarker } = createMarkerPair(\"list\");\n\n const runtime: ListRuntime<TItem, TTagName> = {\n itemsProvider,\n renderItem,\n startMarker,\n endMarker,\n records: [],\n host,\n lastSyncedItems: [],\n };\n\n const parentNode = host as unknown as Node & ParentNode;\n parentNode.appendChild(startMarker);\n parentNode.appendChild(endMarker);\n\n activeListRuntimes.add(runtime as ListRuntime<unknown, keyof HTMLElementTagNameMap>);\n sync(runtime);\n\n return runtime;\n}\n\nexport function updateListRuntimes(): void {\n activeListRuntimes.forEach((runtime) => {\n if (!runtime.startMarker.isConnected || !runtime.endMarker.isConnected) {\n activeListRuntimes.delete(runtime);\n return;\n }\n\n sync(runtime);\n });\n}\n","import { isFunction, isTagLike } from \"./typeGuards\";\n\ntype RenderableInput<TTagName extends ElementTagName = ElementTagName> =\n | NodeModFn<TTagName>\n | ExpandedElement<TTagName>\n | Node\n | null\n | undefined;\n\nexport function resolveRenderable<TTagName extends ElementTagName = ElementTagName>(\n result: RenderableInput<TTagName>,\n host: ExpandedElement<TTagName>,\n index: number\n): ExpandedElement<TTagName> | null {\n if (isFunction(result)) {\n const element = result(host, index);\n if (element && isTagLike(element)) {\n return element as ExpandedElement<TTagName>;\n }\n return null;\n }\n\n if (result && isTagLike(result)) {\n return result as ExpandedElement<TTagName>;\n }\n\n return null;\n}\n","export function arraysEqual<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if ((i in a ? a[i] : undefined) !== (i in b ? b[i] : undefined)) return false;\n }\n return true;\n}\n","import { createListRuntime } from \"./runtime\";\nimport type { ListRenderer, ListItemsProvider } from \"./types\";\n\n/**\n * Maps items to DOM elements, keeping them in sync with changes.\n */\nexport function list<TItem, TTagName extends ElementTagName = ElementTagName>(\n itemsProvider: ListItemsProvider<TItem>,\n render: ListRenderer<TItem, TTagName>,\n): NodeModFn<TTagName> {\n return (host: ExpandedElement<TTagName>, index: number): Comment => {\n const runtime = createListRuntime(itemsProvider, render, host);\n // Return the start marker comment node\n // NodeModFn can return NodeMod | void, and Comment is a valid Node type\n return runtime.startMarker;\n };\n}\n","export type ConditionInput = boolean | (() => boolean);\n\nexport function runCondition(\n condition: () => boolean,\n onError?: (error: unknown) => void\n): boolean {\n try {\n return condition();\n } catch (error) {\n if (onError) {\n onError(error);\n return false;\n }\n throw error;\n }\n}\n\nexport function resolveCondition(\n value: ConditionInput,\n onError?: (error: unknown) => void\n): boolean {\n return typeof value === \"function\" ? runCondition(value, onError) : Boolean(value);\n}\n","import { applyNodeModifier } from \"../core/modifierProcessor\";\nimport { modifierProbeCache } from \"../utility/modifierPredicates\";\nimport { isFunction, isZeroArityFunction } from \"../utility/typeGuards\";\nimport { withScopedInsertion } from \"../utility/domTypeHelpers\";\nimport type { WhenContent } from \"./runtime\";\n\n/**\n * Renders a single content item and returns the resulting node if any.\n */\nfunction renderContentItem<TTagName extends ElementTagName>(\n item: WhenContent<TTagName>,\n host: ExpandedElement<TTagName>,\n index: number,\n endMarker: Comment\n): Node | null {\n if (!isFunction(item)) {\n return applyNodeModifier(host, item, index);\n }\n\n // Zero-arity functions need cache cleared\n if (isZeroArityFunction(item)) {\n modifierProbeCache.delete(item);\n return applyNodeModifier(host, item, index);\n }\n\n // Non-zero-arity functions need scoped insertion to insert before endMarker\n return withScopedInsertion(host, endMarker, () => {\n const maybeNode = applyNodeModifier(host, item, index);\n // Only include nodes that weren't already inserted\n return maybeNode && !maybeNode.parentNode ? maybeNode : null;\n });\n}\n\n/**\n * Renders a list of content items and collects the resulting nodes.\n */\nexport function renderContentItems<TTagName extends ElementTagName>(\n items: ReadonlyArray<WhenContent<TTagName>>,\n host: ExpandedElement<TTagName>,\n index: number,\n endMarker: Comment\n): Node[] {\n const nodes: Node[] = [];\n for (const item of items) {\n const node = renderContentItem(item, host, index, endMarker);\n if (node) {\n nodes.push(node);\n }\n }\n return nodes;\n}\n","import { clearBetweenMarkers, insertNodesBefore } from \"../utility/dom\";\nimport { resolveCondition } from \"../utility/conditions\";\nimport { renderContentItems } from \"./renderer\";\n\nexport type WhenCondition = boolean | (() => boolean);\nexport type WhenContent<TTagName extends ElementTagName = ElementTagName> =\n NodeMod<TTagName> | NodeModFn<TTagName>;\n\nexport interface WhenGroup<TTagName extends ElementTagName = ElementTagName> {\n condition: WhenCondition;\n content: WhenContent<TTagName>[];\n}\n\nexport interface WhenRuntime<TTagName extends ElementTagName = ElementTagName> {\n startMarker: Comment;\n endMarker: Comment;\n host: ExpandedElement<TTagName>;\n index: number;\n groups: WhenGroup<TTagName>[];\n elseContent: WhenContent<TTagName>[];\n /**\n * Tracks which branch is currently rendered:\n * - null: nothing rendered yet\n * - -1: else branch\n * - >=0: index of groups[]\n */\n activeIndex: number | -1 | null;\n update(): void;\n}\n\nconst activeWhenRuntimes = new Set<WhenRuntime<any>>();\n\n/**\n * Evaluates which condition branch should be active.\n * Returns the index of the first truthy condition, -1 for else branch, or null for no match.\n */\nfunction evaluateActiveCondition<TTagName extends ElementTagName>(\n groups: ReadonlyArray<WhenGroup<TTagName>>,\n elseContent: ReadonlyArray<WhenContent<TTagName>>\n): number | -1 | null {\n for (let i = 0; i < groups.length; i++) {\n if (resolveCondition(groups[i].condition)) {\n return i;\n }\n }\n return elseContent.length > 0 ? -1 : null;\n}\n\n/**\n * Main render function for when/else conditionals.\n * Evaluates conditions, clears old content, and renders the active branch.\n */\nexport function renderWhenContent<TTagName extends ElementTagName>(\n runtime: WhenRuntime<TTagName>\n): void {\n const { groups, elseContent, host, index, endMarker } = runtime;\n\n const newActive = evaluateActiveCondition(groups, elseContent);\n\n // No change needed\n if (newActive === runtime.activeIndex) return;\n\n // Clear previous content and update active index\n clearBetweenMarkers(runtime.startMarker, runtime.endMarker);\n runtime.activeIndex = newActive;\n\n // Nothing to render\n if (newActive === null) return;\n\n // Render the active branch\n const contentToRender = newActive >= 0 ? groups[newActive].content : elseContent;\n const nodes = renderContentItems(contentToRender, host, index, endMarker);\n\n insertNodesBefore(nodes, endMarker);\n}\n\n/**\n * Registers a when runtime for tracking and updates\n */\nexport function registerWhenRuntime<TTagName extends ElementTagName>(\n runtime: WhenRuntime<TTagName>\n): void {\n activeWhenRuntimes.add(runtime);\n}\n\n/**\n * Updates all active when/else conditional runtimes.\n *\n * Re-evaluates all conditional branches and re-renders if the active branch has changed.\n * Automatically cleans up runtimes that throw errors during update.\n *\n * This function should be called after state changes that affect conditional expressions.\n *\n * @example\n * ```ts\n * isLoggedIn.value = true;\n * updateWhenRuntimes(); // All when() conditionals re-evaluate\n * ```\n */\nexport function updateWhenRuntimes(): void {\n activeWhenRuntimes.forEach((runtime) => {\n try {\n runtime.update();\n } catch (error) {\n activeWhenRuntimes.delete(runtime);\n }\n });\n}\n\n/**\n * Clears all active when/else conditional runtimes.\n *\n * This is typically used for cleanup or testing purposes.\n * After calling this, no when() conditionals will be tracked for updates.\n */\nexport function clearWhenRuntimes(): void {\n activeWhenRuntimes.clear();\n}\n","import { isBrowser } from \"../utility/environment\";\nimport { createMarkerPair, createComment } from \"../utility/dom\";\nimport { asParentNode } from \"../utility/domTypeHelpers\";\nimport type { WhenCondition, WhenContent, WhenGroup, WhenRuntime } from \"./runtime\";\nimport { renderWhenContent, registerWhenRuntime } from \"./runtime\";\n\nclass WhenBuilderImpl<TTagName extends ElementTagName = ElementTagName> {\n private groups: WhenGroup<TTagName>[] = [];\n private elseContent: WhenContent<TTagName>[] = [];\n\n constructor(initialCondition: WhenCondition, ...content: WhenContent<TTagName>[]) {\n this.groups.push({ condition: initialCondition, content });\n }\n\n when(condition: WhenCondition, ...content: WhenContent<TTagName>[]): WhenBuilderImpl<TTagName> {\n this.groups.push({ condition, content });\n return this;\n }\n\n else(...content: WhenContent<TTagName>[]): WhenBuilderImpl<TTagName> {\n this.elseContent = content;\n return this;\n }\n\n render(host: ExpandedElement<TTagName>, index: number): Node | null {\n if (!isBrowser) {\n const comment = createComment(\"when-ssr\");\n return comment || null;\n }\n\n const { start: startMarker, end: endMarker } = createMarkerPair(\"when\");\n\n const runtime: WhenRuntime<TTagName> = {\n startMarker,\n endMarker,\n host,\n index,\n groups: [...this.groups],\n elseContent: [...this.elseContent],\n activeIndex: null,\n update: () => renderWhenContent(runtime),\n };\n\n registerWhenRuntime(runtime);\n\n const parent = asParentNode(host);\n parent.appendChild(startMarker);\n parent.appendChild(endMarker);\n\n renderWhenContent(runtime);\n\n return startMarker;\n }\n}\n\nexport function createWhenBuilderFunction<TTagName extends ElementTagName>(\n builder: WhenBuilderImpl<TTagName>\n): WhenBuilder<TTagName> {\n const nodeModFn = (host: ExpandedElement<TTagName>, index: number): Node | null => {\n return builder.render(host, index);\n };\n\n return Object.assign(nodeModFn, {\n when: (condition: WhenCondition, ...content: WhenContent<TTagName>[]): WhenBuilder<TTagName> => {\n builder.when(condition, ...content);\n return createWhenBuilderFunction(builder);\n },\n else: (...content: WhenContent<TTagName>[]): WhenBuilder<TTagName> => {\n builder.else(...content);\n return createWhenBuilderFunction(builder);\n },\n }) as unknown as WhenBuilder<TTagName>;\n}\n\nexport { WhenBuilderImpl };\n","import { WhenBuilderImpl, createWhenBuilderFunction } from \"./builder\";\nimport type { WhenCondition, WhenContent } from \"./runtime\";\n\nexport { updateWhenRuntimes, clearWhenRuntimes } from \"./runtime\";\n\n/**\n * Creates a conditional rendering block (when/else logic).\n *\n * Renders different content based on boolean conditions, similar to if/else statements.\n * Conditions can be static booleans or reactive functions that are re-evaluated on updates.\n *\n * @param condition - Boolean value or function returning a boolean\n * @param content - Content to render when condition is true\n * @returns A builder that allows chaining additional .when() or .else() branches\n *\n * @example\n * ```ts\n * const isLoggedIn = signal(false);\n *\n * div(\n * when(() => isLoggedIn.value,\n * span('Welcome back!')\n * )\n * .else(\n * button('Login', on('click', () => login()))\n * )\n * )\n * ```\n *\n * @example\n * ```ts\n * // Multiple conditions\n * div(\n * when(() => status.value === 'loading',\n * spinner()\n * )\n * .when(() => status.value === 'error',\n * errorMessage()\n * )\n * .else(\n * contentView()\n * )\n * )\n * ```\n */\nexport function when<TTagName extends ElementTagName = ElementTagName>(\n condition: WhenCondition,\n ...content: WhenContent<TTagName>[]\n): WhenBuilder<TTagName> {\n const builder = new WhenBuilderImpl<TTagName>(condition, ...content);\n return createWhenBuilderFunction(builder);\n}\n","import { createElementWithModifiers } from \"../internal/applyModifiers\";\nimport { isBrowser } from \"../utility/environment\";\nimport {\n ConditionalInfo,\n getConditionalInfo,\n storeConditionalInfo,\n getActiveConditionalNodes,\n unregisterConditionalNode,\n} from \"../utility/conditionalInfo\";\nimport { runCondition } from \"../utility/conditions\";\nimport { replaceNodeSafely, createConditionalComment } from \"../utility/dom\";\nimport { logError } from \"../utility/errorHandler\";\n\nfunction createElementFromConditionalInfo<TTagName extends ElementTagName>(\n conditionalInfo: ConditionalInfo<TTagName>\n): ExpandedElement<TTagName> {\n try {\n return createElementWithModifiers(conditionalInfo.tagName, conditionalInfo.modifiers);\n } catch (error) {\n logError(`Error applying modifiers in conditional element \"${conditionalInfo.tagName}\"`, error);\n // Return a basic element without modifiers as fallback\n return document.createElement(conditionalInfo.tagName) as ExpandedElement<TTagName>;\n }\n}\n\nfunction updateConditionalNode(node: Element | Comment): void {\n const conditionalInfo = getConditionalInfo(node);\n if (!conditionalInfo) {\n return;\n }\n\n const shouldShow = runCondition(conditionalInfo.condition, (error) => {\n logError(\"Error evaluating conditional condition\", error);\n });\n const isElement = node.nodeType === Node.ELEMENT_NODE;\n\n if (shouldShow && !isElement) {\n const element = createElementFromConditionalInfo(conditionalInfo);\n storeConditionalInfo(element as Node, conditionalInfo);\n replaceNodeSafely(node, element as Node);\n } else if (!shouldShow && isElement) {\n const comment = createConditionalComment(conditionalInfo.tagName);\n if (comment) {\n storeConditionalInfo(comment, conditionalInfo);\n replaceNodeSafely(node, comment);\n }\n }\n}\n\nexport function updateConditionalElements(): void {\n if (!isBrowser) return;\n\n try {\n getActiveConditionalNodes().forEach((node) => {\n if (!node.isConnected) {\n unregisterConditionalNode(node);\n return;\n }\n updateConditionalNode(node as Element | Comment);\n });\n } catch (error) {\n logError(\"Error during conditional elements update\", error);\n }\n}\n","import { updateListRuntimes } from \"../list/runtime\";\nimport { notifyReactiveElements, notifyReactiveTextNodes } from \"./reactive\";\nimport { updateWhenRuntimes } from \"../when\";\nimport { updateConditionalElements } from \"./conditionalUpdater\";\nimport { dispatchGlobalUpdateEvent } from \"../utility/events\";\n\nconst updaters = [\n updateListRuntimes,\n updateWhenRuntimes,\n updateConditionalElements,\n notifyReactiveElements,\n notifyReactiveTextNodes,\n dispatchGlobalUpdateEvent,\n] as const;\n\nexport function update(): void {\n for (const fn of updaters) fn();\n}\n","import { logError } from \"./errorHandler\";\n\nexport function dispatchGlobalUpdateEvent(): void {\n if (typeof document === \"undefined\") return;\n\n const targets: EventTarget[] = document.body ? [document.body, document] : [document];\n\n for (const target of targets) {\n try {\n target.dispatchEvent(new Event(\"update\", { bubbles: true }));\n } catch (error) {\n logError(\"Error dispatching global update event\", error);\n }\n }\n}\n","/**\n * Typed event listener helper.\n *\n * Usage:\n * button(\n * \"Click\",\n * on(\"click\", (e) => {\n * // e is correctly typed (e.g. MouseEvent for \"click\")\n * })\n * )\n *\n * Design notes:\n * - Returns a NodeModFn so it can be used like any other modifier.\n * - Produces no child node (returns void in the modifier body).\n * - Provides strong typing of the event object based on the DOM event name.\n */\n\nimport { logError } from \"./errorHandler\";\n\n/**\n * Overload for standard HTMLElement events (strongly typed via lib.dom.d.ts)\n */\nexport function on<\n K extends keyof HTMLElementEventMap,\n TTagName extends ElementTagName = ElementTagName\n>(\n type: K,\n listener: (ev: HTMLElementEventMap[K]) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName>;\n\n/**\n * Fallback / custom event overload (arbitrary event names or custom event types).\n * Specify a custom event type with the E generic if needed:\n * on<\"my-event\", CustomEvent<MyDetail>>(\"my-event\", e => { ... })\n */\nexport function on<\n K extends string,\n E extends Event = Event,\n TTagName extends ElementTagName = ElementTagName\n>(\n type: K,\n listener: (ev: E) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName>;\n\nexport function on<TTagName extends ElementTagName = ElementTagName>(\n type: string,\n listener: (ev: Event) => unknown,\n options?: boolean | AddEventListenerOptions\n): NodeModFn<TTagName> {\n return (parent: ExpandedElement<TTagName>): void => {\n // Type guard: verify parent is an HTMLElement with addEventListener\n if (!parent || typeof (parent as HTMLElement).addEventListener !== \"function\") {\n return;\n }\n\n const el = parent as HTMLElement;\n const wrapped = (ev: Event): void => {\n try {\n listener.call(el, ev);\n } catch (error) {\n logError(`Error in '${type}' listener`, error);\n }\n };\n\n el.addEventListener(type, wrapped as EventListener, options);\n };\n}\n\n/**\n * (Optional) Helper to detect an on()-produced modifier (placeholder for future use).\n */\nexport function isOnModifier(fn: unknown): boolean {\n return typeof fn === \"function\" && Object.prototype.hasOwnProperty.call(fn, \"__nucloOn\");\n}","/**\n * Renders a NodeModFn to a parent element by calling it and appending the result.\n *\n * @param nodeModFn The NodeModFn to render (created by tag builders like div(), h1(), etc.)\n * @param parent The parent element to render into (defaults to document.body)\n * @param index The index to pass to the NodeModFn (defaults to 0)\n * @returns The rendered element\n */\nexport function render<TTagName extends ElementTagName = ElementTagName>(\n nodeModFn: NodeModFn<TTagName>,\n parent?: Element,\n index: number = 0\n): ExpandedElement<TTagName> {\n const targetParent = (parent || document.body) as ExpandedElement<TTagName>;\n const element = nodeModFn(targetParent, index) as ExpandedElement<TTagName>;\n (parent || document.body).appendChild(element as Node);\n return element;\n}\n","// Style properties registry - defines all CSS properties that can be used\n// This allows dynamic generation of methods and functions\n\nexport interface StylePropertyDefinition {\n\t/** The method/function name (e.g., \"bg\", \"fontSize\") */\n\tname: string;\n\t/** The CSS property name (e.g., \"background-color\", \"font-size\") */\n\tcssProperty: string;\n\t/** Optional: Default value to use if none provided */\n\tdefaultValue?: string;\n\t/** Optional: Whether this is a shorthand that takes no arguments */\n\tisShorthand?: boolean;\n}\n\nexport const STYLE_PROPERTIES: readonly StylePropertyDefinition[] = [\n\t// Display\n\t{ name: \"display\", cssProperty: \"display\" },\n\t{ name: \"grid\", cssProperty: \"display\", defaultValue: \"grid\", isShorthand: true },\n\n\t// Colors\n\t{ name: \"bg\", cssProperty: \"background-color\" },\n\t{ name: \"color\", cssProperty: \"color\" },\n\t{ name: \"accentColor\", cssProperty: \"accent-color\" },\n\n\t// Typography\n\t{ name: \"fontSize\", cssProperty: \"font-size\" },\n\t{ name: \"fontWeight\", cssProperty: \"font-weight\" },\n\t{ name: \"fontFamily\", cssProperty: \"font-family\" },\n\t{ name: \"lineHeight\", cssProperty: \"line-height\" },\n\t{ name: \"letterSpacing\", cssProperty: \"letter-spacing\" },\n\t{ name: \"textAlign\", cssProperty: \"text-align\" },\n\t{ name: \"textDecoration\", cssProperty: \"text-decoration\" },\n\t{ name: \"fontStyle\", cssProperty: \"font-style\" },\n\t{ name: \"fontVariant\", cssProperty: \"font-variant\" },\n\t{ name: \"fontStretch\", cssProperty: \"font-stretch\" },\n\t{ name: \"textTransform\", cssProperty: \"text-transform\" },\n\t{ name: \"textIndent\", cssProperty: \"text-indent\" },\n\t{ name: \"textOverflow\", cssProperty: \"text-overflow\" },\n\t{ name: \"textShadow\", cssProperty: \"text-shadow\" },\n\t{ name: \"whiteSpace\", cssProperty: \"white-space\" },\n\t{ name: \"wordSpacing\", cssProperty: \"word-spacing\" },\n\t{ name: \"wordWrap\", cssProperty: \"word-wrap\" },\n\t{ name: \"overflowWrap\", cssProperty: \"overflow-wrap\" },\n\t{ name: \"textAlignLast\", cssProperty: \"text-align-last\" },\n\t{ name: \"textJustify\", cssProperty: \"text-justify\" },\n\t{ name: \"textDecorationLine\", cssProperty: \"text-decoration-line\" },\n\t{ name: \"textDecorationColor\", cssProperty: \"text-decoration-color\" },\n\t{ name: \"textDecorationStyle\", cssProperty: \"text-decoration-style\" },\n\t{ name: \"textDecorationThickness\", cssProperty: \"text-decoration-thickness\" },\n\t{ name: \"textUnderlineOffset\", cssProperty: \"text-underline-offset\" },\n\t{ name: \"verticalAlign\", cssProperty: \"vertical-align\" },\n\n\t// Layout\n\t{ name: \"position\", cssProperty: \"position\" },\n\t{ name: \"padding\", cssProperty: \"padding\" },\n\t{ name: \"paddingTop\", cssProperty: \"padding-top\" },\n\t{ name: \"paddingRight\", cssProperty: \"padding-right\" },\n\t{ name: \"paddingBottom\", cssProperty: \"padding-bottom\" },\n\t{ name: \"paddingLeft\", cssProperty: \"padding-left\" },\n\t{ name: \"margin\", cssProperty: \"margin\" },\n\t{ name: \"marginTop\", cssProperty: \"margin-top\" },\n\t{ name: \"marginRight\", cssProperty: \"margin-right\" },\n\t{ name: \"marginBottom\", cssProperty: \"margin-bottom\" },\n\t{ name: \"marginLeft\", cssProperty: \"margin-left\" },\n\t{ name: \"width\", cssProperty: \"width\" },\n\t{ name: \"height\", cssProperty: \"height\" },\n\t{ name: \"minWidth\", cssProperty: \"min-width\" },\n\t{ name: \"maxWidth\", cssProperty: \"max-width\" },\n\t{ name: \"minHeight\", cssProperty: \"min-height\" },\n\t{ name: \"maxHeight\", cssProperty: \"max-height\" },\n\t{ name: \"boxSizing\", cssProperty: \"box-sizing\" },\n\n\t// Positioning\n\t{ name: \"top\", cssProperty: \"top\" },\n\t{ name: \"right\", cssProperty: \"right\" },\n\t{ name: \"bottom\", cssProperty: \"bottom\" },\n\t{ name: \"left\", cssProperty: \"left\" },\n\t{ name: \"zIndex\", cssProperty: \"z-index\" },\n\n\t// Flexbox\n\t{ name: \"flexDirection\", cssProperty: \"flex-direction\" },\n\t{ name: \"alignItems\", cssProperty: \"align-items\" },\n\t{ name: \"justifyContent\", cssProperty: \"justify-content\" },\n\t{ name: \"gap\", cssProperty: \"gap\" },\n\t{ name: \"flexWrap\", cssProperty: \"flex-wrap\" },\n\t{ name: \"flexGrow\", cssProperty: \"flex-grow\" },\n\t{ name: \"flexShrink\", cssProperty: \"flex-shrink\" },\n\t{ name: \"flexBasis\", cssProperty: \"flex-basis\" },\n\t{ name: \"alignSelf\", cssProperty: \"align-self\" },\n\t{ name: \"alignContent\", cssProperty: \"align-content\" },\n\t{ name: \"justifySelf\", cssProperty: \"justify-self\" },\n\t{ name: \"justifyItems\", cssProperty: \"justify-items\" },\n\n\t// Grid\n\t{ name: \"gridTemplateColumns\", cssProperty: \"grid-template-columns\" },\n\t{ name: \"gridTemplateRows\", cssProperty: \"grid-template-rows\" },\n\t{ name: \"gridTemplateAreas\", cssProperty: \"grid-template-areas\" },\n\t{ name: \"gridColumn\", cssProperty: \"grid-column\" },\n\t{ name: \"gridRow\", cssProperty: \"grid-row\" },\n\t{ name: \"gridColumnStart\", cssProperty: \"grid-column-start\" },\n\t{ name: \"gridColumnEnd\", cssProperty: \"grid-column-end\" },\n\t{ name: \"gridRowStart\", cssProperty: \"grid-row-start\" },\n\t{ name: \"gridRowEnd\", cssProperty: \"grid-row-end\" },\n\t{ name: \"gridArea\", cssProperty: \"grid-area\" },\n\t{ name: \"gridAutoColumns\", cssProperty: \"grid-auto-columns\" },\n\t{ name: \"gridAutoRows\", cssProperty: \"grid-auto-rows\" },\n\t{ name: \"gridAutoFlow\", cssProperty: \"grid-auto-flow\" },\n\n\t// Borders\n\t{ name: \"border\", cssProperty: \"border\" },\n\t{ name: \"borderTop\", cssProperty: \"border-top\" },\n\t{ name: \"borderRight\", cssProperty: \"border-right\" },\n\t{ name: \"borderBottom\", cssProperty: \"border-bottom\" },\n\t{ name: \"borderLeft\", cssProperty: \"border-left\" },\n\t{ name: \"borderWidth\", cssProperty: \"border-width\" },\n\t{ name: \"borderStyle\", cssProperty: \"border-style\" },\n\t{ name: \"borderColor\", cssProperty: \"border-color\" },\n\t{ name: \"borderTopWidth\", cssProperty: \"border-top-width\" },\n\t{ name: \"borderRightWidth\", cssProperty: \"border-right-width\" },\n\t{ name: \"borderBottomWidth\", cssProperty: \"border-bottom-width\" },\n\t{ name: \"borderLeftWidth\", cssProperty: \"border-left-width\" },\n\t{ name: \"borderTopStyle\", cssProperty: \"border-top-style\" },\n\t{ name: \"borderRightStyle\", cssProperty: \"border-right-style\" },\n\t{ name: \"borderBottomStyle\", cssProperty: \"border-bottom-style\" },\n\t{ name: \"borderLeftStyle\", cssProperty: \"border-left-style\" },\n\t{ name: \"borderTopColor\", cssProperty: \"border-top-color\" },\n\t{ name: \"borderRightColor\", cssProperty: \"border-right-color\" },\n\t{ name: \"borderBottomColor\", cssProperty: \"border-bottom-color\" },\n\t{ name: \"borderLeftColor\", cssProperty: \"border-left-color\" },\n\t{ name: \"borderRadius\", cssProperty: \"border-radius\" },\n\t{ name: \"borderTopLeftRadius\", cssProperty: \"border-top-left-radius\" },\n\t{ name: \"borderTopRightRadius\", cssProperty: \"border-top-right-radius\" },\n\t{ name: \"borderBottomLeftRadius\", cssProperty: \"border-bottom-left-radius\" },\n\t{ name: \"borderBottomRightRadius\", cssProperty: \"border-bottom-right-radius\" },\n\n\t// Outline\n\t{ name: \"outline\", cssProperty: \"outline\" },\n\t{ name: \"outlineWidth\", cssProperty: \"outline-width\" },\n\t{ name: \"outlineStyle\", cssProperty: \"outline-style\" },\n\t{ name: \"outlineColor\", cssProperty: \"outline-color\" },\n\t{ name: \"outlineOffset\", cssProperty: \"outline-offset\" },\n\n\t// Background\n\t{ name: \"backgroundColor\", cssProperty: \"background-color\" },\n\t{ name: \"backgroundImage\", cssProperty: \"background-image\" },\n\t{ name: \"backgroundRepeat\", cssProperty: \"background-repeat\" },\n\t{ name: \"backgroundPosition\", cssProperty: \"background-position\" },\n\t{ name: \"backgroundSize\", cssProperty: \"background-size\" },\n\t{ name: \"backgroundAttachment\", cssProperty: \"background-attachment\" },\n\t{ name: \"backgroundClip\", cssProperty: \"background-clip\" },\n\t{ name: \"backgroundOrigin\", cssProperty: \"background-origin\" },\n\n\t// Effects\n\t{ name: \"boxShadow\", cssProperty: \"box-shadow\" },\n\t{ name: \"opacity\", cssProperty: \"opacity\" },\n\t{ name: \"transition\", cssProperty: \"transition\" },\n\t{ name: \"transitionProperty\", cssProperty: \"transition-property\" },\n\t{ name: \"transitionDuration\", cssProperty: \"transition-duration\" },\n\t{ name: \"transitionTimingFunction\", cssProperty: \"transition-timing-function\" },\n\t{ name: \"transitionDelay\", cssProperty: \"transition-delay\" },\n\n\t// Transform\n\t{ name: \"transform\", cssProperty: \"transform\" },\n\t{ name: \"transformOrigin\", cssProperty: \"transform-origin\" },\n\t{ name: \"transformStyle\", cssProperty: \"transform-style\" },\n\t{ name: \"perspective\", cssProperty: \"perspective\" },\n\t{ name: \"perspectiveOrigin\", cssProperty: \"perspective-origin\" },\n\t{ name: \"backfaceVisibility\", cssProperty: \"backface-visibility\" },\n\n\t// Animation\n\t{ name: \"animation\", cssProperty: \"animation\" },\n\t{ name: \"animationName\", cssProperty: \"animation-name\" },\n\t{ name: \"animationDuration\", cssProperty: \"animation-duration\" },\n\t{ name: \"animationTimingFunction\", cssProperty: \"animation-timing-function\" },\n\t{ name: \"animationDelay\", cssProperty: \"animation-delay\" },\n\t{ name: \"animationIterationCount\", cssProperty: \"animation-iteration-count\" },\n\t{ name: \"animationDirection\", cssProperty: \"animation-direction\" },\n\t{ name: \"animationFillMode\", cssProperty: \"animation-fill-mode\" },\n\t{ name: \"animationPlayState\", cssProperty: \"animation-play-state\" },\n\n\t// Filter\n\t{ name: \"filter\", cssProperty: \"filter\" },\n\t{ name: \"backdropFilter\", cssProperty: \"backdrop-filter\" },\n\n\t// Overflow\n\t{ name: \"overflow\", cssProperty: \"overflow\" },\n\t{ name: \"overflowX\", cssProperty: \"overflow-x\" },\n\t{ name: \"overflowY\", cssProperty: \"overflow-y\" },\n\n\t// Visibility\n\t{ name: \"visibility\", cssProperty: \"visibility\" },\n\n\t// Object fit/position\n\t{ name: \"objectFit\", cssProperty: \"object-fit\" },\n\t{ name: \"objectPosition\", cssProperty: \"object-position\" },\n\n\t// List\n\t{ name: \"listStyle\", cssProperty: \"list-style\" },\n\t{ name: \"listStyleType\", cssProperty: \"list-style-type\" },\n\t{ name: \"listStylePosition\", cssProperty: \"list-style-position\" },\n\t{ name: \"listStyleImage\", cssProperty: \"list-style-image\" },\n\n\t// Table\n\t{ name: \"borderCollapse\", cssProperty: \"border-collapse\" },\n\t{ name: \"borderSpacing\", cssProperty: \"border-spacing\" },\n\t{ name: \"captionSide\", cssProperty: \"caption-side\" },\n\t{ name: \"emptyCells\", cssProperty: \"empty-cells\" },\n\t{ name: \"tableLayout\", cssProperty: \"table-layout\" },\n\n\t// Content\n\t{ name: \"content\", cssProperty: \"content\" },\n\t{ name: \"quotes\", cssProperty: \"quotes\" },\n\t{ name: \"counterReset\", cssProperty: \"counter-reset\" },\n\t{ name: \"counterIncrement\", cssProperty: \"counter-increment\" },\n\n\t// User interface\n\t{ name: \"appearance\", cssProperty: \"appearance\" },\n\t{ name: \"userSelect\", cssProperty: \"user-select\" },\n\t{ name: \"pointerEvents\", cssProperty: \"pointer-events\" },\n\t{ name: \"resize\", cssProperty: \"resize\" },\n\t{ name: \"scrollBehavior\", cssProperty: \"scroll-behavior\" },\n\n\t// Clip\n\t{ name: \"clip\", cssProperty: \"clip\" },\n\t{ name: \"clipPath\", cssProperty: \"clip-path\" },\n\n\t// Isolation\n\t{ name: \"isolation\", cssProperty: \"isolation\" },\n\n\t// Mix blend mode\n\t{ name: \"mixBlendMode\", cssProperty: \"mix-blend-mode\" },\n\n\t// Will change\n\t{ name: \"willChange\", cssProperty: \"will-change\" },\n\n\t// Contain\n\t{ name: \"contain\", cssProperty: \"contain\" },\n\n\t// Page break\n\t{ name: \"pageBreakBefore\", cssProperty: \"page-break-before\" },\n\t{ name: \"pageBreakAfter\", cssProperty: \"page-break-after\" },\n\t{ name: \"pageBreakInside\", cssProperty: \"page-break-inside\" },\n\n\t// Break\n\t{ name: \"breakBefore\", cssProperty: \"break-before\" },\n\t{ name: \"breakAfter\", cssProperty: \"break-after\" },\n\t{ name: \"breakInside\", cssProperty: \"break-inside\" },\n\n\t// Orphans and widows\n\t{ name: \"orphans\", cssProperty: \"orphans\" },\n\t{ name: \"widows\", cssProperty: \"widows\" },\n\n\t// Column\n\t{ name: \"columnCount\", cssProperty: \"column-count\" },\n\t{ name: \"columnFill\", cssProperty: \"column-fill\" },\n\t{ name: \"columnGap\", cssProperty: \"column-gap\" },\n\t{ name: \"columnRule\", cssProperty: \"column-rule\" },\n\t{ name: \"columnRuleColor\", cssProperty: \"column-rule-color\" },\n\t{ name: \"columnRuleStyle\", cssProperty: \"column-rule-style\" },\n\t{ name: \"columnRuleWidth\", cssProperty: \"column-rule-width\" },\n\t{ name: \"columnSpan\", cssProperty: \"column-span\" },\n\t{ name: \"columnWidth\", cssProperty: \"column-width\" },\n\t{ name: \"columns\", cssProperty: \"columns\" },\n\n\t// Interaction\n\t{ name: \"cursor\", cssProperty: \"cursor\" },\n] as const;\n\n// Special methods that have custom logic beyond simple property setting\nexport const SPECIAL_METHODS = [\n\t\"bold\", // Sets font-weight: bold\n\t\"center\", // Sets justify-content: center and align-items: center\n\t\"flex\", // Can set display: flex OR flex property depending on argument\n] as const;\n","// Cache for generated classes: maps CSS property sets to class names\nconst styleCache = new Map<string, string>();\n\n// Simple hash function to generate a short hash from a string (similar to MD5 but simpler)\nexport function simpleHash(str: string): string {\n\tlet hash = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst char = str.charCodeAt(i);\n\t\thash = ((hash << 5) - hash) + char;\n\t\thash = hash & hash; // Convert to 32-bit integer\n\t}\n\t// Convert to positive hex string and take first 8 characters\n\treturn Math.abs(hash).toString(16).padStart(8, '0').substring(0, 8);\n}\n\n// Generate a cache key from a set of CSS properties\nexport function generateStyleKey(styles: Record<string, string>): string {\n\tconst sortedEntries = Object.entries(styles)\n\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t.map(([property, value]) => `${property}:${value}`)\n\t\t.join('|');\n\treturn sortedEntries;\n}\n\n// Get cached class name or return undefined\nexport function getCachedClassName(cacheKey: string): string | undefined {\n\treturn styleCache.get(cacheKey);\n}\n\n// Set cached class name\nexport function setCachedClassName(cacheKey: string, className: string): void {\n\tstyleCache.set(cacheKey, className);\n}\n\n// Check if cache has a class name\nexport function hasCachedClassName(cacheKey: string): boolean {\n\treturn styleCache.has(cacheKey);\n}\n","// Supported at-rule types\ntype AtRuleType = 'media' | 'container' | 'supports' | 'style';\n\n// Check if a class exists in the DOM\nexport function classExistsInDOM(className: string, condition?: string, atRuleType: AtRuleType = 'media'): boolean {\n\tconst styleSheet = document.querySelector(\"#nuclo-styles\") as HTMLStyleElement;\n\tif (!styleSheet || !styleSheet.sheet) {\n\t\treturn false;\n\t}\n\n\tif (condition) {\n\t\tconst rules = Array.from(styleSheet.sheet.cssRules || []);\n\t\tconst conditionRule = rules.find(rule => {\n\t\t\tif (atRuleType === 'media' && rule instanceof CSSMediaRule) {\n\t\t\t\treturn rule.media.mediaText === condition;\n\t\t\t}\n\t\t\tif (atRuleType === 'container' && rule instanceof CSSContainerRule) {\n\t\t\t\treturn rule.conditionText === condition;\n\t\t\t}\n\t\t\tif (atRuleType === 'supports' && rule instanceof CSSSupportsRule) {\n\t\t\t\treturn rule.conditionText === condition;\n\t\t\t}\n\t\t\treturn false;\n\t\t}) as CSSGroupingRule | undefined;\n\n\t\tif (!conditionRule) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Array.from(conditionRule.cssRules).some(rule => {\n\t\t\tif (rule instanceof CSSStyleRule) {\n\t\t\t\treturn rule.selectorText === `.${className}`;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t} else {\n\t\tconst rules = Array.from(styleSheet.sheet.cssRules || []);\n\t\treturn rules.some(rule => {\n\t\t\tif (rule instanceof CSSStyleRule) {\n\t\t\t\treturn rule.selectorText === `.${className}`;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n}\n\n// Create a CSS class with multiple styles\nexport function createCSSClassWithStyles(\n\tclassName: string,\n\tstyles: Record<string, string>,\n\tcondition?: string,\n\tatRuleType: AtRuleType = 'media'\n): void {\n\tlet styleSheet = document.querySelector(\"#nuclo-styles\") as HTMLStyleElement;\n\n\tif (!styleSheet) {\n\t\tstyleSheet = document.createElement(\"style\");\n\t\tstyleSheet.id = \"nuclo-styles\";\n\t\tdocument.head.appendChild(styleSheet);\n\t}\n\n\tconst rules = Object.entries(styles)\n\t\t.map(([property, value]) => `${property}: ${value}`)\n\t\t.join(\"; \");\n\n\tif (condition) {\n\t\t// Create or get at-rule (media, container, supports, etc.)\n\t\tconst existingRules = Array.from(styleSheet.sheet?.cssRules || []);\n\t\tlet groupingRule: CSSGroupingRule | null = null;\n\n\t\t// Helper to check if a rule matches our at-rule type and condition\n\t\tconst isMatchingRule = (rule: CSSRule): boolean => {\n\t\t\tif (atRuleType === 'media' && rule instanceof CSSMediaRule) {\n\t\t\t\treturn rule.media.mediaText === condition;\n\t\t\t}\n\t\t\tif (atRuleType === 'container' && rule instanceof CSSContainerRule) {\n\t\t\t\treturn rule.conditionText === condition;\n\t\t\t}\n\t\t\tif (atRuleType === 'supports' && rule instanceof CSSSupportsRule) {\n\t\t\t\treturn rule.conditionText === condition;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\t// Helper to check if a rule is any at-rule\n\t\tconst isAtRule = (rule: CSSRule): boolean => {\n\t\t\treturn rule instanceof CSSMediaRule ||\n\t\t\t\trule instanceof CSSContainerRule ||\n\t\t\t\trule instanceof CSSSupportsRule;\n\t\t};\n\n\t\tfor (const rule of existingRules) {\n\t\t\tif (isMatchingRule(rule)) {\n\t\t\t\tgroupingRule = rule as CSSGroupingRule;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!groupingRule) {\n\t\t\t// Find the correct insertion index: after all style rules, append at-rules in order\n\t\t\t// Since we process queries in registration order, we can simply append\n\t\t\t// This ensures: style rules first, then at-rules in the order they're processed\n\t\t\tlet insertIndex = existingRules.length;\n\n\t\t\t// Find the last at-rule to insert after it (maintains order)\n\t\t\tfor (let i = existingRules.length - 1; i >= 0; i--) {\n\t\t\t\tif (isAtRule(existingRules[i])) {\n\t\t\t\t\tinsertIndex = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (existingRules[i] instanceof CSSStyleRule) {\n\t\t\t\t\t// If we hit a style rule, insert after it\n\t\t\t\t\tinsertIndex = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create the appropriate at-rule\n\t\t\tconst atRulePrefix = atRuleType === 'media' ? '@media' :\n\t\t\t\tatRuleType === 'container' ? '@container' :\n\t\t\t\tatRuleType === 'supports' ? '@supports' :\n\t\t\t\t'@media'; // fallback\n\n\t\t\tstyleSheet.sheet?.insertRule(`${atRulePrefix} ${condition} {}`, insertIndex);\n\t\t\tgroupingRule = styleSheet.sheet?.cssRules[insertIndex] as CSSGroupingRule;\n\t\t}\n\n\t\t// Check if class already exists in this at-rule\n\t\tlet existingRule: CSSStyleRule | null = null;\n\t\tfor (const rule of Array.from(groupingRule.cssRules)) {\n\t\t\tif (rule instanceof CSSStyleRule && rule.selectorText === `.${className}`) {\n\t\t\t\texistingRule = rule;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (existingRule) {\n\t\t\t// Update existing rule by replacing all styles\n\t\t\t// First, clear all existing properties\n\t\t\twhile (existingRule.style.length > 0) {\n\t\t\t\texistingRule.style.removeProperty(existingRule.style[0]);\n\t\t\t}\n\t\t\t// Then set all new properties\n\t\t\tObject.entries(styles).forEach(([property, value]) => {\n\t\t\t\texistingRule!.style.setProperty(property, value);\n\t\t\t});\n\t\t} else {\n\t\t\tgroupingRule.insertRule(`.${className} { ${rules} }`, groupingRule.cssRules.length);\n\t\t}\n\t} else {\n\t\t// Regular style rule (no at-rule)\n\t\t// Find existing rule or insert at the beginning (before at-rules)\n\t\tlet existingRule: CSSStyleRule | null = null;\n\t\tlet insertIndex = 0;\n\n\t\t// Helper to check if a rule is any at-rule\n\t\tconst isAtRule = (rule: CSSRule): boolean => {\n\t\t\treturn rule instanceof CSSMediaRule ||\n\t\t\t\trule instanceof CSSContainerRule ||\n\t\t\t\trule instanceof CSSSupportsRule;\n\t\t};\n\n\t\tconst allRules = Array.from(styleSheet.sheet?.cssRules || []);\n\t\tfor (let i = 0; i < allRules.length; i++) {\n\t\t\tconst rule = allRules[i];\n\t\t\tif (rule instanceof CSSStyleRule && rule.selectorText === `.${className}`) {\n\t\t\t\texistingRule = rule;\n\t\t\t\tinsertIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Track where at-rules start to insert default styles before them\n\t\t\tif (!isAtRule(rule)) {\n\t\t\t\tinsertIndex = i + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (existingRule) {\n\t\t\t// Update existing rule by replacing all styles\n\t\t\t// First, clear all existing properties\n\t\t\twhile (existingRule.style.length > 0) {\n\t\t\t\texistingRule.style.removeProperty(existingRule.style[0]);\n\t\t\t}\n\t\t\t// Then set all new properties\n\t\t\tObject.entries(styles).forEach(([property, value]) => {\n\t\t\t\texistingRule!.style.setProperty(property, value);\n\t\t\t});\n\t\t} else {\n\t\t\tstyleSheet.sheet?.insertRule(`.${className} { ${rules} }`, insertIndex);\n\t\t}\n\t}\n}\n\n// Legacy function for backward compatibility\nexport function createCSSClass(className: string, styles: Record<string, string>): void {\n\tcreateCSSClassWithStyles(className, styles);\n}\n","import { STYLE_PROPERTIES, SPECIAL_METHODS, type StylePropertyDefinition } from \"./styleProperties\";\nimport { generateStyleKey, simpleHash, getCachedClassName, setCachedClassName } from \"./styleCache\";\nimport { createCSSClassWithStyles, classExistsInDOM } from \"./cssGenerator\";\n\n// Get or create a class name for a set of CSS properties\nfunction getOrCreateClassName(styles: Record<string, string>, prefix = '', mediaQuery?: string): string {\n\tconst styleKey = generateStyleKey(styles);\n\tconst cacheKey = prefix ? `${prefix}:${styleKey}` : styleKey;\n\n\tconst cached = getCachedClassName(cacheKey);\n\tif (cached) {\n\t\tconst cachedClassName = cached;\n\t\t// Verify the class exists in the DOM, recreate if not (handles test isolation)\n\t\tif (!classExistsInDOM(cachedClassName, mediaQuery)) {\n\t\t\tcreateCSSClassWithStyles(cachedClassName, styles, mediaQuery);\n\t\t}\n\t\treturn cachedClassName;\n\t}\n\n\t// Generate a hash-based class name from the style key\n\tconst hash = simpleHash(styleKey);\n\tconst className = prefix ? `n${prefix}-${hash}` : `n${hash}`;\n\tsetCachedClassName(cacheKey, className);\n\n\t// Create the CSS class with media query if provided\n\tcreateCSSClassWithStyles(className, styles, mediaQuery);\n\n\treturn className;\n}\n\n// Utility class builder for chaining CSS properties\nexport class StyleBuilder {\n\tprivate styles: Record<string, string> = {};\n\n\t// Get the accumulated styles\n\tgetStyles(): Record<string, string> {\n\t\treturn { ...this.styles };\n\t}\n\n\t// Get class name for the current styles\n\tgetClassName(prefix = '', mediaQuery?: string): string {\n\t\treturn getOrCreateClassName(this.styles, prefix, mediaQuery);\n\t}\n\n\t// Get class names as space-separated string (for backward compatibility)\n\tgetClassNames(): string[] {\n\t\treturn [this.getClassName()];\n\t}\n\n\t// Get class definitions (for backward compatibility)\n\tgetClassDefinitions(): Array<{ className: string; property: string; value: string }> {\n\t\treturn Object.entries(this.styles).map(([property, value]) => ({\n\t\t\tclassName: this.getClassName(),\n\t\t\tproperty,\n\t\t\tvalue\n\t\t}));\n\t}\n\n\t// Get class names as space-separated string\n\ttoString(): string {\n\t\treturn this.getClassName();\n\t}\n\n\t// Add a custom style\n\tadd(property: string, value: string): this {\n\t\tthis.styles[property] = value;\n\t\treturn this;\n\t}\n\n\t// Special methods with custom logic\n\tbold(): this {\n\t\tthis.styles[\"font-weight\"] = \"bold\";\n\t\treturn this;\n\t}\n\n\tcenter(): this {\n\t\tthis.styles[\"justify-content\"] = \"center\";\n\t\tthis.styles[\"align-items\"] = \"center\";\n\t\treturn this;\n\t}\n\n\tflex(value?: string): this {\n\t\tif (value !== undefined) {\n\t\t\tthis.styles[\"flex\"] = value;\n\t\t} else {\n\t\t\tthis.styles[\"display\"] = \"flex\";\n\t\t}\n\t\treturn this;\n\t}\n}\n\n// TypeScript interface declaration merging - adds types for dynamically generated methods\nexport interface StyleBuilder {\n\tdisplay(value: string): this;\n\tgrid(): this;\n\tbg(color: string): this;\n\tcolor(colorValue: string): this;\n\taccentColor(value: string): this;\n\tfontSize(size: string): this;\n\tfontWeight(value: string): this;\n\tfontFamily(value: string): this;\n\tlineHeight(value: string): this;\n\tletterSpacing(value: string): this;\n\ttextAlign(value: string): this;\n\ttextDecoration(value: string): this;\n\tfontStyle(value: string): this;\n\tfontVariant(value: string): this;\n\tfontStretch(value: string): this;\n\ttextTransform(value: string): this;\n\ttextIndent(value: string): this;\n\ttextOverflow(value: string): this;\n\ttextShadow(value: string): this;\n\twhiteSpace(value: string): this;\n\twordSpacing(value: string): this;\n\twordWrap(value: string): this;\n\toverflowWrap(value: string): this;\n\ttextAlignLast(value: string): this;\n\ttextJustify(value: string): this;\n\ttextDecorationLine(value: string): this;\n\ttextDecorationColor(value: string): this;\n\ttextDecorationStyle(value: string): this;\n\ttextDecorationThickness(value: string): this;\n\ttextUnderlineOffset(value: string): this;\n\tverticalAlign(value: string): this;\n\tposition(value: string): this;\n\tpadding(value: string): this;\n\tpaddingTop(value: string): this;\n\tpaddingRight(value: string): this;\n\tpaddingBottom(value: string): this;\n\tpaddingLeft(value: string): this;\n\tmargin(value: string): this;\n\tmarginTop(value: string): this;\n\tmarginRight(value: string): this;\n\tmarginBottom(value: string): this;\n\tmarginLeft(value: string): this;\n\twidth(value: string): this;\n\theight(value: string): this;\n\tminWidth(value: string): this;\n\tmaxWidth(value: string): this;\n\tminHeight(value: string): this;\n\tmaxHeight(value: string): this;\n\tboxSizing(value: string): this;\n\ttop(value: string): this;\n\tright(value: string): this;\n\tbottom(value: string): this;\n\tleft(value: string): this;\n\tzIndex(value: string): this;\n\tflexDirection(value: string): this;\n\talignItems(value: string): this;\n\tjustifyContent(value: string): this;\n\tgap(value: string): this;\n\tflexWrap(value: string): this;\n\tflexGrow(value: string): this;\n\tflexShrink(value: string): this;\n\tflexBasis(value: string): this;\n\talignSelf(value: string): this;\n\talignContent(value: string): this;\n\tjustifySelf(value: string): this;\n\tjustifyItems(value: string): this;\n\tgridTemplateColumns(value: string): this;\n\tgridTemplateRows(value: string): this;\n\tgridTemplateAreas(value: string): this;\n\tgridColumn(value: string): this;\n\tgridRow(value: string): this;\n\tgridColumnStart(value: string): this;\n\tgridColumnEnd(value: string): this;\n\tgridRowStart(value: string): this;\n\tgridRowEnd(value: string): this;\n\tgridArea(value: string): this;\n\tgridAutoColumns(value: string): this;\n\tgridAutoRows(value: string): this;\n\tgridAutoFlow(value: string): this;\n\tborder(value: string): this;\n\tborderTop(value: string): this;\n\tborderRight(value: string): this;\n\tborderBottom(value: string): this;\n\tborderLeft(value: string): this;\n\tborderWidth(value: string): this;\n\tborderStyle(value: string): this;\n\tborderColor(value: string): this;\n\tborderTopWidth(value: string): this;\n\tborderRightWidth(value: string): this;\n\tborderBottomWidth(value: string): this;\n\tborderLeftWidth(value: string): this;\n\tborderTopStyle(value: string): this;\n\tborderRightStyle(value: string): this;\n\tborderBottomStyle(value: string): this;\n\tborderLeftStyle(value: string): this;\n\tborderTopColor(value: string): this;\n\tborderRightColor(value: string): this;\n\tborderBottomColor(value: string): this;\n\tborderLeftColor(value: string): this;\n\tborderRadius(value: string): this;\n\tborderTopLeftRadius(value: string): this;\n\tborderTopRightRadius(value: string): this;\n\tborderBottomLeftRadius(value: string): this;\n\tborderBottomRightRadius(value: string): this;\n\toutline(value: string): this;\n\toutlineWidth(value: string): this;\n\toutlineStyle(value: string): this;\n\toutlineColor(value: string): this;\n\toutlineOffset(value: string): this;\n\tbackgroundColor(value: string): this;\n\tbackgroundImage(value: string): this;\n\tbackgroundRepeat(value: string): this;\n\tbackgroundPosition(value: string): this;\n\tbackgroundSize(value: string): this;\n\tbackgroundAttachment(value: string): this;\n\tbackgroundClip(value: string): this;\n\tbackgroundOrigin(value: string): this;\n\tboxShadow(value: string): this;\n\topacity(value: string): this;\n\ttransition(value: string): this;\n\ttransitionProperty(value: string): this;\n\ttransitionDuration(value: string): this;\n\ttransitionTimingFunction(value: string): this;\n\ttransitionDelay(value: string): this;\n\ttransform(value: string): this;\n\ttransformOrigin(value: string): this;\n\ttransformStyle(value: string): this;\n\tperspective(value: string): this;\n\tperspectiveOrigin(value: string): this;\n\tbackfaceVisibility(value: string): this;\n\tanimation(value: string): this;\n\tanimationName(value: string): this;\n\tanimationDuration(value: string): this;\n\tanimationTimingFunction(value: string): this;\n\tanimationDelay(value: string): this;\n\tanimationIterationCount(value: string): this;\n\tanimationDirection(value: string): this;\n\tanimationFillMode(value: string): this;\n\tanimationPlayState(value: string): this;\n\tfilter(value: string): this;\n\tbackdropFilter(value: string): this;\n\toverflow(value: string): this;\n\toverflowX(value: string): this;\n\toverflowY(value: string): this;\n\tvisibility(value: string): this;\n\tobjectFit(value: string): this;\n\tobjectPosition(value: string): this;\n\tlistStyle(value: string): this;\n\tlistStyleType(value: string): this;\n\tlistStylePosition(value: string): this;\n\tlistStyleImage(value: string): this;\n\tborderCollapse(value: string): this;\n\tborderSpacing(value: string): this;\n\tcaptionSide(value: string): this;\n\temptyCells(value: string): this;\n\ttableLayout(value: string): this;\n\tcontent(value: string): this;\n\tquotes(value: string): this;\n\tcounterReset(value: string): this;\n\tcounterIncrement(value: string): this;\n\tappearance(value: string): this;\n\tuserSelect(value: string): this;\n\tpointerEvents(value: string): this;\n\tresize(value: string): this;\n\tscrollBehavior(value: string): this;\n\tclip(value: string): this;\n\tclipPath(value: string): this;\n\tisolation(value: string): this;\n\tmixBlendMode(value: string): this;\n\twillChange(value: string): this;\n\tcontain(value: string): this;\n\tpageBreakBefore(value: string): this;\n\tpageBreakAfter(value: string): this;\n\tpageBreakInside(value: string): this;\n\tbreakBefore(value: string): this;\n\tbreakAfter(value: string): this;\n\tbreakInside(value: string): this;\n\torphans(value: string): this;\n\twidows(value: string): this;\n\tcolumnCount(value: string): this;\n\tcolumnFill(value: string): this;\n\tcolumnGap(value: string): this;\n\tcolumnRule(value: string): this;\n\tcolumnRuleColor(value: string): this;\n\tcolumnRuleStyle(value: string): this;\n\tcolumnRuleWidth(value: string): this;\n\tcolumnSpan(value: string): this;\n\tcolumnWidth(value: string): this;\n\tcolumns(value: string): this;\n\tcursor(value: string): this;\n}\n\n// Dynamically add methods to StyleBuilder prototype\nfunction registerStyleMethods(): void {\n\tconst proto = StyleBuilder.prototype as unknown as Record<string, unknown>;\n\n\tfor (const prop of STYLE_PROPERTIES) {\n\t\t// Skip if method already exists (e.g., special methods)\n\t\tif (prop.name in proto) continue;\n\n\t\tif (prop.isShorthand) {\n\t\t\t// Shorthand methods that use default values\n\t\t\tproto[prop.name] = function(this: StyleBuilder) {\n\t\t\t\tthis.add(prop.cssProperty, prop.defaultValue || \"\");\n\t\t\t\treturn this;\n\t\t\t};\n\t\t} else {\n\t\t\t// Regular methods that take a value\n\t\t\tproto[prop.name] = function(this: StyleBuilder, value: string) {\n\t\t\t\tthis.add(prop.cssProperty, value);\n\t\t\t\treturn this;\n\t\t\t};\n\t\t}\n\t}\n}\n\n// Register all methods on StyleBuilder\nregisterStyleMethods();\n\n// Dynamically create and export utility functions\nfunction createStyleFunction(prop: StylePropertyDefinition): (value?: string) => StyleBuilder {\n\tif (prop.isShorthand) {\n\t\treturn () => new StyleBuilder().add(prop.cssProperty, prop.defaultValue || \"\");\n\t} else {\n\t\treturn (value?: string) => new StyleBuilder().add(prop.cssProperty, value || \"\");\n\t}\n}\n\n// Create export object dynamically\nconst styleExports: Record<string, ((value?: string) => StyleBuilder)> = {};\n\n// Add regular properties\nfor (const prop of STYLE_PROPERTIES) {\n\tstyleExports[prop.name] = createStyleFunction(prop);\n}\n\n// Add special methods\nfor (const method of SPECIAL_METHODS) {\n\tif (method === \"bold\" || method === \"center\") {\n\t\tstyleExports[method] = () => new StyleBuilder()[method]();\n\t} else if (method === \"flex\") {\n\t\tstyleExports[method] = (value?: string) => new StyleBuilder().flex(value);\n\t}\n}\n\n// Export all style functions\nexport const {\n\t// Display\n\tdisplay, flex, grid,\n\t// Colors\n\tbg, color, accentColor,\n\t// Typography\n\tfontSize, fontWeight, fontFamily, lineHeight, letterSpacing,\n\ttextAlign, textDecoration, bold, fontStyle, fontVariant,\n\tfontStretch, textTransform, textIndent, textOverflow, textShadow,\n\twhiteSpace, wordSpacing, wordWrap, overflowWrap, textAlignLast,\n\ttextJustify, textDecorationLine, textDecorationColor, textDecorationStyle,\n\ttextDecorationThickness, textUnderlineOffset, verticalAlign,\n\t// Layout\n\tposition, padding, paddingTop, paddingRight, paddingBottom, paddingLeft,\n\tmargin, marginTop, marginRight, marginBottom, marginLeft,\n\twidth, height, minWidth, maxWidth, minHeight, maxHeight, boxSizing,\n\t// Positioning\n\ttop, right, bottom, left, zIndex,\n\t// Flexbox\n\tflexDirection, alignItems, justifyContent, center, gap,\n\tflexWrap, flexGrow, flexShrink, flexBasis, alignSelf,\n\talignContent, justifySelf, justifyItems,\n\t// Grid\n\tgridTemplateColumns, gridTemplateRows, gridTemplateAreas,\n\tgridColumn, gridRow, gridColumnStart, gridColumnEnd,\n\tgridRowStart, gridRowEnd, gridArea, gridAutoColumns,\n\tgridAutoRows, gridAutoFlow,\n\t// Borders\n\tborder, borderTop, borderRight, borderBottom, borderLeft,\n\tborderWidth, borderStyle, borderColor, borderTopWidth,\n\tborderRightWidth, borderBottomWidth, borderLeftWidth,\n\tborderTopStyle, borderRightStyle, borderBottomStyle, borderLeftStyle,\n\tborderTopColor, borderRightColor, borderBottomColor, borderLeftColor,\n\tborderRadius, borderTopLeftRadius, borderTopRightRadius,\n\tborderBottomLeftRadius, borderBottomRightRadius,\n\t// Outline\n\toutline, outlineWidth, outlineStyle, outlineColor, outlineOffset,\n\t// Background\n\tbackgroundColor, backgroundImage, backgroundRepeat, backgroundPosition,\n\tbackgroundSize, backgroundAttachment, backgroundClip, backgroundOrigin,\n\t// Effects\n\tboxShadow, opacity, transition, transitionProperty,\n\ttransitionDuration, transitionTimingFunction, transitionDelay,\n\t// Transform\n\ttransform, transformOrigin, transformStyle, perspective,\n\tperspectiveOrigin, backfaceVisibility,\n\t// Animation\n\tanimation, animationName, animationDuration, animationTimingFunction,\n\tanimationDelay, animationIterationCount, animationDirection,\n\tanimationFillMode, animationPlayState,\n\t// Filter\n\tfilter, backdropFilter,\n\t// Overflow\n\toverflow, overflowX, overflowY,\n\t// Visibility\n\tvisibility,\n\t// Object fit/position\n\tobjectFit, objectPosition,\n\t// List\n\tlistStyle, listStyleType, listStylePosition, listStyleImage,\n\t// Table\n\tborderCollapse, borderSpacing, captionSide, emptyCells, tableLayout,\n\t// Content\n\tcontent, quotes, counterReset, counterIncrement,\n\t// User interface\n\tappearance, userSelect, pointerEvents, resize, scrollBehavior,\n\t// Clip\n\tclip, clipPath,\n\t// Isolation\n\tisolation,\n\t// Mix blend mode\n\tmixBlendMode,\n\t// Will change\n\twillChange,\n\t// Contain\n\tcontain,\n\t// Page break\n\tpageBreakBefore, pageBreakAfter, pageBreakInside,\n\t// Break\n\tbreakBefore, breakAfter, breakInside,\n\t// Orphans and widows\n\torphans, widows,\n\t// Column\n\tcolumnCount, columnFill, columnGap, columnRule,\n\tcolumnRuleColor, columnRuleStyle, columnRuleWidth,\n\tcolumnSpan, columnWidth, columns,\n\t// Interaction\n\tcursor,\n} = styleExports as Record<string, (value?: string) => StyleBuilder>;\n","import { StyleBuilder } from \"./styleBuilder\";\nimport { generateStyleKey, simpleHash } from \"./styleCache\";\nimport { createCSSClassWithStyles } from \"./cssGenerator\";\n\n// Style queries type\ntype QueryStyles<T extends string> = Partial<Record<T, StyleBuilder>>;\n\n// Supported CSS at-rules\ntype AtRuleType = 'media' | 'container' | 'supports' | 'style';\n\n// Parse the at-rule prefix from a query string\nfunction parseAtRule(query: string): { type: AtRuleType; condition: string } {\n\tconst trimmed = query.trim();\n\n\t// Check for @media prefix\n\tif (trimmed.startsWith('@media ')) {\n\t\treturn { type: 'media', condition: trimmed.slice(7).trim() };\n\t}\n\n\t// Check for @container prefix\n\tif (trimmed.startsWith('@container ')) {\n\t\treturn { type: 'container', condition: trimmed.slice(11).trim() };\n\t}\n\n\t// Check for @supports prefix\n\tif (trimmed.startsWith('@supports ')) {\n\t\treturn { type: 'supports', condition: trimmed.slice(10).trim() };\n\t}\n\n\t// Check for @style prefix (for future CSS style queries)\n\tif (trimmed.startsWith('@style ')) {\n\t\treturn { type: 'style', condition: trimmed.slice(7).trim() };\n\t}\n\n\t// Default: treat as media query for backward compatibility\n\treturn { type: 'media', condition: trimmed };\n}\n\n// Create style queries function\n// Accepts either Record (for backward compatibility) or Array of [name, query] tuples (for explicit order)\nexport function createStyleQueries<T extends string>(\n\tqueries: Record<T, string> | Array<[T, string]>\n) {\n\t// Convert to array format to preserve order\n\tconst queriesArray: Array<[T, string]> = Array.isArray(queries)\n\t\t? queries\n\t\t: (Object.entries(queries) as Array<[T, string]>);\n\n\treturn function cn(\n\t\tdefaultStylesOrQueries?: StyleBuilder | QueryStyles<T>,\n\t\tqueryStyles?: QueryStyles<T>\n\t): { className: string } | string {\n\t\tlet defaultStyles: StyleBuilder | undefined;\n\t\tlet styles: QueryStyles<T> | undefined;\n\n\t\t// Handle both signatures:\n\t\t// 1. cn({ medium: width(\"50%\") }) - single argument with queries\n\t\t// 2. cn(width(\"100%\"), { medium: width(\"50%\") }) - default styles + queries\n\t\tif (queryStyles !== undefined) {\n\t\t\t// Two-argument form\n\t\t\tdefaultStyles = defaultStylesOrQueries as StyleBuilder;\n\t\t\tstyles = queryStyles;\n\t\t} else if (defaultStylesOrQueries instanceof StyleBuilder) {\n\t\t\t// Single argument, but it's a StyleBuilder (default styles only)\n\t\t\tdefaultStyles = defaultStylesOrQueries;\n\t\t\tstyles = undefined;\n\t\t} else {\n\t\t\t// Single argument with queries\n\t\t\tdefaultStyles = undefined;\n\t\t\tstyles = defaultStylesOrQueries as QueryStyles<T>;\n\t\t}\n\n\t\t// If nothing provided, return empty\n\t\tif (!defaultStyles && (!styles || Object.keys(styles).length === 0)) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// If we have queries, create a single class name for all queries\n\t\tif (styles && Object.keys(styles).length > 0) {\n\t\t\t// Collect all query styles in registration order\n\t\t\tconst allQueryStyles: Array<{ queryName: T; atRule: { type: AtRuleType; condition: string }; styles: Record<string, string> }> = [];\n\n\t\t\t// Process queries in the order they were registered\n\t\t\tfor (const [queryName, queryValue] of queriesArray) {\n\t\t\t\tconst styleBuilder = styles[queryName];\n\t\t\t\tif (styleBuilder) {\n\t\t\t\t\tallQueryStyles.push({\n\t\t\t\t\t\tqueryName,\n\t\t\t\t\t\tatRule: parseAtRule(queryValue),\n\t\t\t\t\t\tstyles: (styleBuilder as StyleBuilder).getStyles()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Generate a combined hash from all query styles (and default styles if present)\n\t\t\tconst allStyleKeys: string[] = [];\n\n\t\t\tif (defaultStyles) {\n\t\t\t\tconst defaultStylesObj = defaultStyles.getStyles();\n\t\t\t\tallStyleKeys.push(`default:${generateStyleKey(defaultStylesObj)}`);\n\t\t\t}\n\n\t\t\tallStyleKeys.push(...allQueryStyles.map(({ queryName, styles: qStyles }) => {\n\t\t\t\tconst styleKey = generateStyleKey(qStyles);\n\t\t\t\treturn `${queryName}:${styleKey}`;\n\t\t\t}));\n\n\t\t\tconst combinedStyleKey = allStyleKeys.sort().join('||');\n\t\t\tconst combinedHash = simpleHash(combinedStyleKey);\n\t\t\tconst className = `n${combinedHash}`;\n\n\t\t\t// Apply default styles first (no at-rule) - these are base styles\n\t\t\tlet accumulatedStyles: Record<string, string> = {};\n\t\t\tif (defaultStyles) {\n\t\t\t\taccumulatedStyles = { ...defaultStyles.getStyles() };\n\t\t\t\tcreateCSSClassWithStyles(className, accumulatedStyles);\n\t\t\t}\n\n\t\t\t// Apply all query styles to the same class name in their respective at-rules\n\t\t\t// Apply in registration order to ensure proper CSS cascade\n\t\t\t// Each query inherits from all previous queries (cascading)\n\t\t\tfor (const { atRule, styles: qStyles } of allQueryStyles) {\n\t\t\t\t// Merge accumulated styles (defaults + previous queries) with current query\n\t\t\t\t// This ensures each query inherits from previous ones\n\t\t\t\taccumulatedStyles = { ...accumulatedStyles, ...qStyles };\n\t\t\t\tcreateCSSClassWithStyles(className, accumulatedStyles, atRule.condition, atRule.type);\n\t\t\t}\n\n\t\t\treturn { className };\n\t\t}\n\n\t\t// Only default styles (no queries)\n\t\tif (defaultStyles) {\n\t\t\tconst className = defaultStyles.getClassName();\n\t\t\treturn { className };\n\t\t}\n\n\t\treturn \"\";\n\t};\n}\n\n// Backward compatibility: alias for createStyleQueries\nexport const createBreakpoints = createStyleQueries;\n","import { registerGlobalTagBuilders } from \"./tagRegistry\";\nimport { list } from \"../list\";\nimport { update } from \"./updateController\";\nimport { when } from \"../when\";\nimport { on } from \"../utility/on\";\nimport { render } from \"../utility/render\";\nimport * as styleExports from \"../style\";\n\n/**\n * Initializes the nuclo runtime by exposing tag builders and utilities.\n */\nexport function initializeRuntime(): void {\n registerGlobalTagBuilders();\n\n if (typeof globalThis !== \"undefined\") {\n const registry = globalThis as Record<string, unknown>;\n registry.list = list;\n registry.update = update;\n registry.when = when;\n registry.on = on;\n registry.render = render;\n\n // Register all style utilities globally\n // Use individual assignments to avoid errors with readonly properties (like window.top)\n for (const [key, value] of Object.entries(styleExports)) {\n try {\n registry[key] = value;\n } catch (e) {\n // Skip properties that can't be set (e.g., readonly window properties)\n }\n }\n }\n}\n\nif (typeof globalThis !== \"undefined\") {\n initializeRuntime();\n}\n"],"names":["isPrimitive","value","isNode","Node","isObject","isTagLike","isFunction","isZeroArityFunction","length","logError","message","error","console","safeExecute","fn","fallback","isBrowser","window","document","safeRemoveChild","child","parentNode","removeChild","createCommentSafely","text","createComment","createConditionalComment","tagName","suffix","createMarkerComment","prefix","Error","comment","Math","random","toString","slice","createMarkerPair","endComment","start","end","insertNodesBefore","nodes","referenceNode","parent","forEach","node","newNode","insertBefore","safeInsertBefore","isNodeConnected","isConnected","contains","replaceNodeSafely","oldNode","replaceChild","reactiveTextNodes","Map","reactiveElements","applyAttributeResolvers","el","info","attributeResolvers","resolver","applyValue","key","e","registerAttributeResolver","element","Element","get","set","ensureElementInfo","updateListener","listener","addEventListener","setStyleProperty","property","style","stringValue","String","assignInlineStyles","styles","Object","entries","REACTIVE_CLASSNAME_KEY","STATIC_CLASSNAME_KEY","mergeReactiveClassName","reactiveClassName","staticClasses","getStaticClasses","size","allClasses","Set","split","filter","c","add","className","Array","from","join","applySingleAttribute","raw","shouldMergeClassName","styleValue","resolvedStyles","setValue","v","merge","HTMLElement","newClassName","currentClassName","existing","mergeStaticClassName","namespaceURI","setAttribute","initReactiveClassName","hasReactiveClassName","addStaticClasses","currentClasses","applyAttributes","attributes","mergeClassName","k","keys","modifierProbeCache","WeakMap","isBooleanFunction","cached","record","undefined","probeOnce","isConditionalModifier","modifier","allModifiers","currentIndex","otherModifiers","_","index","some","mod","applyNodeModifier","createReactiveTextFragment","originalModifier","produced","createStaticTextFragment","candidate","preEvaluated","fragment","createDocumentFragment","appendChild","textNode","createTextNode","initial","arguments","str","txt","lastValue","createReactiveTextNode","activeConditionalNodes","storeConditionalInfo","_conditionalInfo","applyModifiers","modifiers","startIndex","nextIndex","appended","localIndex","i","createElementWithModifiers","createElement","processConditionalModifiers","conditionalIndex","findConditionalModifier","condition","createElementWithNamespace","SVG_TAGS","includes","isSVGTag","createElementNS","createElementFactory","passed","conditionalInfo","createConditionalElement","createTagBuilder","mods","HTML_TAGS","registerGlobalTagBuilders","target","globalThis","marker","exportName","registerSvgTag","registerHtmlTag","activeListRuntimes","renderItem","runtime","item","result","host","resolveRenderable","remove","sync","startMarker","endMarker","currentItems","itemsProvider","a","b","arraysEqual","lastSyncedItems","recordsByPosition","availableRecords","records","items","push","newIndex","existingRecord","recordIndex","indexOf","splice","delete","newRecords","elementsToRemove","nextSibling","availableItems","shift","unshift","recordNode","list","render","createListRuntime","runCondition","onError","resolveCondition","Boolean","renderContentItem","callback","originalAppend","bind","originalInsert","withScopedInsertion","maybeNode","activeWhenRuntimes","renderWhenContent","groups","elseContent","newActive","evaluateActiveCondition","activeIndex","current","next","clearBetweenMarkers","renderContentItems","content","WhenBuilderImpl","constructor","initialCondition","this","when","update","registerWhenRuntime","createWhenBuilderFunction","builder","assign","else","updateConditionalNode","getConditionalInfo","shouldShow","isElement","nodeType","ELEMENT_NODE","createElementFromConditionalInfo","updaters","unregisterConditionalNode","removeEventListener","newVal","textContent","targets","body","dispatchEvent","Event","bubbles","on","type","options","ev","call","nodeModFn","STYLE_PROPERTIES","name","cssProperty","defaultValue","isShorthand","SPECIAL_METHODS","styleCache","simpleHash","hash","charCodeAt","abs","padStart","substring","generateStyleKey","sort","localeCompare","map","createCSSClassWithStyles","atRuleType","styleSheet","querySelector","id","head","rules","existingRules","sheet","cssRules","groupingRule","isMatchingRule","rule","CSSMediaRule","media","mediaText","CSSContainerRule","CSSSupportsRule","conditionText","isAtRule","insertIndex","CSSStyleRule","atRulePrefix","insertRule","existingRule","selectorText","removeProperty","setProperty","allRules","createCSSClass","getOrCreateClassName","mediaQuery","styleKey","cacheKey","getCachedClassName","cachedClassName","conditionRule","find","classExistsInDOM","setCachedClassName","StyleBuilder","getStyles","getClassName","getClassNames","getClassDefinitions","bold","center","flex","createStyleFunction","prop","proto","prototype","registerStyleMethods","styleExports","method","display","grid","bg","color","accentColor","fontSize","fontWeight","fontFamily","lineHeight","letterSpacing","textAlign","textDecoration","fontStyle","fontVariant","fontStretch","textTransform","textIndent","textOverflow","textShadow","whiteSpace","wordSpacing","wordWrap","overflowWrap","textAlignLast","textJustify","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","verticalAlign","position","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","width","height","minWidth","maxWidth","minHeight","maxHeight","boxSizing","top","right","bottom","left","zIndex","flexDirection","alignItems","justifyContent","gap","flexWrap","flexGrow","flexShrink","flexBasis","alignSelf","alignContent","justifySelf","justifyItems","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","gridAutoColumns","gridAutoRows","gridAutoFlow","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderStyle","borderColor","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","outline","outlineWidth","outlineStyle","outlineColor","outlineOffset","backgroundColor","backgroundImage","backgroundRepeat","backgroundPosition","backgroundSize","backgroundAttachment","backgroundClip","backgroundOrigin","boxShadow","opacity","transition","transitionProperty","transitionDuration","transitionTimingFunction","transitionDelay","transform","transformOrigin","transformStyle","perspective","perspectiveOrigin","backfaceVisibility","animation","animationName","animationDuration","animationTimingFunction","animationDelay","animationIterationCount","animationDirection","animationFillMode","animationPlayState","backdropFilter","overflow","overflowX","overflowY","visibility","objectFit","objectPosition","listStyle","listStyleType","listStylePosition","listStyleImage","borderCollapse","borderSpacing","captionSide","emptyCells","tableLayout","quotes","counterReset","counterIncrement","appearance","userSelect","pointerEvents","resize","scrollBehavior","clip","clipPath","isolation","mixBlendMode","willChange","contain","pageBreakBefore","pageBreakAfter","pageBreakInside","breakBefore","breakAfter","breakInside","orphans","widows","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","cursor","parseAtRule","query","trimmed","trim","startsWith","createStyleQueries","queries","queriesArray","isArray","defaultStylesOrQueries","queryStyles","defaultStyles","allQueryStyles","queryName","queryValue","styleBuilder","atRule","allStyleKeys","defaultStylesObj","qStyles","accumulatedStyles","createBreakpoints","initializeRuntime","registry","children","nodeToAppend","createTextNodeSafely","safeAppendChild"],"mappings":"aAAM,SAAUA,EAAYC,GAC1B,OAAiB,OAAVA,GAAoC,iBAAVA,GAAuC,mBAAVA,CAChE,CAEM,SAAUC,EAAUD,GACxB,OAAOA,aAAiBE,IAC1B,CAEM,SAAUC,EAASH,GACvB,MAAwB,iBAAVA,GAAgC,OAAVA,CACtC,CAEM,SAAUI,EAAaJ,GAC3B,OAAOG,EAASH,IAAU,YAAcA,CAC1C,CAMM,SAAUK,EAA+BL,GAC7C,MAAwB,mBAAVA,CAChB,CAEM,SAAUM,EAAoBN,GAClC,OAAOK,EAAWL,IAAyC,IAA9BA,EAAmBO,MAClD,CCrBM,SAAUC,EAASC,EAAiBC,GACjB,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