@barocss/browser 0.8.2 → 0.10.0
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/README.md +25 -0
- package/dist/cdn/barocss.js +1 -1
- package/dist/cdn/barocss.js.map +1 -1
- package/dist/cdn/barocss.umd.cjs +1 -1
- package/dist/cdn/barocss.umd.cjs.map +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.d.cts +56 -5
- package/dist/index.d.ts +56 -5
- package/dist/index.es.js +321 -62
- package/dist/index.umd.js +9 -3
- package/package.json +2 -2
package/dist/cdn/barocss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barocss.js","names":["targetFunction","finalSelector","themeFunction","filters","decl","prop","value","source","type","atRoot","nodes","atRule","name","params","rule","selector","property","initialValue","syntax","push","debugEnabled","isDebug","debugWarn","args","console","warn","resetContextCaches","AstCache","constructor","this","cache","Map","maxSize","set","key","ast","size","firstKey","keys","next","delete","get","has","clear","getStats","hitRate","astCache","ParseResultCache","result","parseResultCache","UtilityCache","utilityCache","clearAllCaches","log","debugLog","states","WeakMap","cacheGeneration","getContextState","ctx","state","clearContextCaches","failures","utilityRegistry","registerUtility","util","Error","utilities","getUtility","modifierRegistry","staticModifier","selectors","options","registerModifier","match","mod","modifySelector","_rest","map","sel","functionalModifier","wrap","modifier","modifiers","getModifier","ESCAPE_REGEX","escapeRest","className","replace","c","staticUtility","decls","opts","handler","flatMap","a","b","Array","isArray","description","category","priority","functionalUtility","startsWith","token","_options","finalValue","parsedUtility","extra","opacity","supportsOpacity","arbitrary","customProperty","includes","list","split","length","pop","join","supportsArbitrary","processedValue","normalizeMathSpacing","expandThemeFunctions","handle","supportsCustomProperty","handleCustomProperty","customValue","themeValue","themeKey","theme","themeScalar","themeKeys","realThemeValue","supportsFraction","test","spacingKey","spacingKeys","negative","ref","spacingKeyValue","String","supportsNegative","handleNegativeBareValue","bare","handleBareValue","MATH_FNS","Set","arbitraryPropertyRegistration","_ctx","stack","out","i","ch","exec","toLowerCase","inMath","prev","trimEnd","p","binary","exponent","v","Number","isFinite","isUtilityPrefix","str","isUtility","filter","prefix","some","isModifier","modName","toString","parseClassName","realClassName","classPrefix","configured","config","configuredClassPrefix","none","utility","slice","important","endsWith","tokens","utilityIndex","t","hasCommentToken","m","FUNCTIONAL_VALUE_VARIANT","isSafeVariantValue","isSafeVariantToken","quote","depth","isWellFormedVariantBrackets","isStructureSafeValue","parseUtility","firstToken","secondToken","parsed","parseModifier","parseTokens","current","start","inBracket","inParen","char","end","tokenize","hasCommentDelimiter","text","n","hasHtmlEndTagOpener","allowTopLevelComma","parenDepth","modStr","nameSort","utilityValue","hasUnquotedAt","closeIdx","lastIndexOf","sortedUtilities","sort","matchedUtility","find","parts","isSafePrelude","isBalancedPrelude","isSafeDecl","astToCss","baseSelector","_indent","minify","indent","nextIndent","importantString","dedupedAst","seenProps","node","unshift","escBase","lead","charCodeAt","escapeClassName","trim","Boolean","finalResult","rootToCss","body","child","escapeKey","colorsToCssVars","colors","walk","obj","varName","boxShadowToCssVars","boxShadow","fontSizeToCssVars","fontSize","fontWeightToCssVars","fontWeight","fontFamilyToCssVars","fontFamily","letterSpacingToCssVars","letterSpacing","spacingToCssVars","spacing","borderRadiusToCssVars","borderRadius","zIndexToCssVars","zIndex","opacityToCssVars","animationToCssVars","animations","COMMENT_OR_BLOCK","referencedKeyframes","css","all","names","matchAll","whole","word","Object","prototype","hasOwnProperty","call","add","frames","step","props","entries","keyframesBlock","transitionTimingFunctionToCssVars","transition","transitionDurationToCssVars","transitionDuration","transitionDelayToCssVars","transitionDelay","blurToCssVars","blur","containerToCssVars","container","SAFE_VAR_NAME","toCssVarsBlock","vars","k","isSafeThemeVar","isSelfReferencingVar","BARO_VAR","PREFIXED_KEYS","failureCache","collectDeclPaths","path","curr","concat","getPriority","sourcePriority","media","supports","responsive","group","peer","dark","universal","data","aria","attribute","pseudo","base","starting","getRulePriority","declPathToAst","declPath","variants","sortedVariants","last","mergedVariants","ruleSelectors","nonRuleVariants","sortedRuleSelectors","grouped","reduce","acc","mergedBySource","reduceRight","mergeSelectorsBySource","extractAtRootNodes","parent","atRootNodes","parseClassToAst","fullClassName","utilRegs","u","utilReg","wrappers","variant","plugin","astHandler","items","context","variantChain","index","wrappingType","flatten","r","item","normalizePrefix","val","applyVarPrefix","generateCssRules","classList","seen","cls","dedup","parsedResult","cleanAst","astList","declPaths","merge","groupMap","JSON","stringify","children","mergeAstTreeList","optimizeAst","allAtRootNodes","flat","allCleanAst","cssList","forEach","rootCssList","rootCss","IncrementalParser","processedClasses","batchSize","debounceMs","pendingClasses","batchTimer","processClass","rules","error","processClasses","classes","results","newClasses","batch","addToPending","scheduleBatchProcessing","clearTimeout","window","setTimeout","processPendingClasses","classesToProcess","from","applyClasses","markProcessed","cacheStats","clearProcessed","isProcessed","unmarkProcessed","processClassesSync","getProcessedClasses","spin","ping","pulse","bounce","defaultTheme","inherit","transparent","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","mauve","olive","mist","taupe","px","xs","sm","DEFAULT","md","lg","xl","full","breakpoints","sans","serif","mono","thin","extralight","light","normal","medium","semibold","bold","extrabold","tighter","tight","wide","wider","widest","lineHeight","snug","relaxed","loose","inner","auto","transitionProperty","shadow","transform","transitionTimingFunction","linear","in","keyframes","to","animationVars","textShadow","dropShadow","aspect","video","customUtilityName","customUtilityProp","validateCustomUtility","raw","preflightFullCSS","deepMerge","override","skey","baseVal","overrideVal","themeLookupsInProgress","themeGetter","themeObj","colorKey","inProgress","pathKey","themeToCssVars","animation","fromEntries","themeToCssVarsAll","createContext","configObj","enabled","debug","configWithDefaults","presets","preset","extend","overrideTheme","resolveTheme","hasPreset","configGetter","extendTheme","values","existingValues","getPreflightCSS","level","initializeContextState","builtins","before","safe","shadowed","reg","splice","registerCustomUtilities","parseFraction","input","num","denom","isNaN","parseNumber","parseLength","parseFractionOrNumber","repeat","numerator","denominator","percent","CSS_COLOR_NAMES","parseColor","COLOR_KEYWORDS","themeColorDecls","alpha","bracketed","amount","isVar","toFixed","normalizeAlpha","_token","cursor","_extra","stripColorHint","part","compose","withOpacity","color","defaultTiming","defaultDuration","borderSpacingProperties","BORDER_SPACING","borderSpacing","axes","parseAlpha","op","pct","cp","splitTop","sep","cur","LENGTH","shadowLayers","layer","l","findIndex","shadowValueDecls","render","alphaDecl","shadowColorDecls","filters$1","dropShadowProperties","wrapDropShadow","layers","namedDropShadow","dropShadowValue","named","keepNamed","composed","cut","indexOf","dropShadowColor","keyword","filters","SHADOW_COMPOSITE","ringShadowProperties","shadowColorProperties","NAMED_SHADOWS","NAMED_INSET_SHADOWS","INSET_EXTENSIONS","insetEach","own","table","boxShadowLayer","namedBoxShadow","KEYWORD_COLORS","layerColor","main","textShadowProperties","namedTextShadow","textShadowValue","ringShadowValue","width","createRingColorDecls","colorVar","colorMix","fallback","Math","round","padStart","NAMED_CONTAINER","CONTAINER_TYPE","_value","toRem","NaN","bps","frac","SPACE_SELECTOR","axis","rev","reverseProperty","spaceRule","w","h","containers","common","inlineVp","blockVp","families","statics","leadingProperty","FONT_SIZE_HINTS","FONT_SIZE_KEYWORDS","LENGTH_RE","textArbitraryKind","hint","kind","placeholderColor","gradientStopProperties","positionValue","position","legacyPositionValue","gradientImage","fn","_context","G","stopsDecls","stop","colorDecls","parsedColor","propList","logical","borderStyleProperty","withBorderStyle","styled","x","y","styles","divide","s","outlineStyleProperty","withOutlineStyle","style","divideColor","ROTATE_SKEW","rotateAxis","skewAxis","scaleProperties","scaleAxis","deg","abs","sign","translateProperties","translateAxis","staticTranslateAxis","order","withPseudoContent","createContainerParams","negate","query","getDefaultBreakpoint","breakpoint","decodeArbitrarySelector","attributeVariantSelector","bracket","functionalArgument","hasTopLevelComma","breakpointKeys","baseBreakpoint","mediaQuery","_mod","mode","custom","joined","getDarkSelectors","atRuleNode","ruleNode","SIZE_VARIANT","not","startsAtRule","innerCompound","attr","compound","resolveHasIn","hasInSelector","resolveGroupHas","arg","groupHasSelector","tail","m2","atRuleHas","splitGroupName","negated","g","pattern","LEADING_AT","LATE_MEDIA","MIN_W","MAX_W","toPx","unit","parseFloat","preludeKey","prelude","min","max","ruleSortKey","rest","compareKeys","StylePartitionManager","insertSorted","partition","lo","hi","mid","upperBound","sheet","styleElement","cssRules","insertRule","escapeCssRule","textContent","insertionPoint","maxRulesPerPartition","styleIdPrefix","getCategory","partitions","categoryPartitions","partitionCounter","classToPartitionMap","classToCategoryPartitionMap","initializeDefaultPartition","createNewPartition","createNewCategoryPartition","atDocumentStart","newPartition","id","document","createElement","setAttribute","head","ownerDocument","insertBefore","firstChild","appendChild","hasRule","hasCategoryRule","setRuleCache","partitionIndex","setCategoryRuleCache","currentPartition","getCategoryPartition","hasDetachedPartitions","isConnected","addRule","addCategoryRule","categoryPartition","addRootRules","success","failed","addRules","removeRule","inSync","deleteRule","ruleCount","findRulePartition","updateRuleContent","ruleContent","cleanup","parentNode","removeChild","normalizeClassName","normalizeClassNameList","ChangeDetector","incrementalParser","BrowserRuntime","observer","gc","setGc","setParser","parser","observe","root","MutationObserver","disconnect","setRoot","mutations","mutation","reconcile","target","removedNodes","reconcileTree","addedNodes","attributeName","contains","nodeType","Node","ELEMENT_NODE","element","processElement","querySelectorAll","el","classesArray","applyParseResults","afterBatch","attributes","subtree","attributeFilter","childList","scan","scanExistingClasses","existingClasses","elementsWithClass","layoutResults","nonLayoutResults","onReady","unescapeCssIdent","_m","hex","fromCodePoint","parseInt","LEADING_CLASS","splitTopLevel","collectKeyframeNames","collectLeadingClasses","selectorText","runtimeConfig","ClassGc","host","graceMs","maxRules","now","Date","counts","counted","candidates","timer","cancel","count","getAttribute","prevSet","nextSet","cachedCount","schedule","delay","sweep","overflow","doomed","evicted","since","expired","inDom","isPermanent","reclaim","doc","documentElement","getElementsByClassName","stats","trackedClasses","SSR_STYLE_SELECTOR","LAYER_ORDER","rootCache","isDestroyed","existing","existingKeyframes","existingSheetCount","pinned","reclaimedCount","ssrRules","ssrClasses","observedOnce","styleId","skipExisting","gcGraceMs","Infinity","changeDetector","stylePartitionManager","getInsertionPoint","init","message","toUpperCase","injectPreflightCSS","ensureCssVars","adoptSsrSheets","adopted","moved","cssText","insertSsrRules","preflight","preflightCSS","cssVars","addClass","normalizeClasses","processClassesIncremental","isBrowser","_opts","existingResults","reset","getExistingClasses","rootCssRules","pageKeyframes","kf","cssRuleCount","rootCssCount","victims","stillUsed","sheets","styleSheets","owner","ownerNode","hasAttribute","getCss","getAllCss","getClasses","getCacheStats","incremental","runtime","cachedClasses","rootCacheSize","reclaimedClasses","clearCaches","updateConfig","newConfig","removeClass","retainedResults","destroy","styleElementId","getRuntime","baroBoot","loadingClassName","addEventListener","once","startClassName","endClassName","remove","baroStart","collectJsonRenderClassNames","spec","elements","preloadJsonRenderClasses","shadcnTheme"],"sources":["../../../barocss/src/core/ast.ts","../../../barocss/src/utils/debug.ts","../../../barocss/src/utils/cache.ts","../../../barocss/src/core/contextState.ts","../../../barocss/src/core/registry.ts","../../../barocss/src/core/tokenizer.ts","../../../barocss/src/core/parser.ts","../../../barocss/src/core/astToCss.ts","../../../barocss/src/core/cssVars.ts","../../../barocss/src/core/engine.ts","../../../barocss/src/core/incremental-parser.ts","../../../barocss/src/theme/colors.ts","../../../barocss/src/theme/spacing.ts","../../../barocss/src/theme/border-radius.ts","../../../barocss/src/theme/font-size.ts","../../../barocss/src/theme/font-family.ts","../../../barocss/src/theme/font-weight.ts","../../../barocss/src/theme/line-height.ts","../../../barocss/src/theme/box-shadow.ts","../../../barocss/src/theme/z-index.ts","../../../barocss/src/theme/opacity.ts","../../../barocss/src/theme/transition-property.ts","../../../barocss/src/theme/transition-timing-function.ts","../../../barocss/src/theme/transition-duration.ts","../../../barocss/src/theme/transition-delay.ts","../../../barocss/src/theme/animations.ts","../../../barocss/src/theme/keyframes.ts","../../../barocss/src/theme/animation-vars.ts","../../../barocss/src/theme/breakpoints.ts","../../../barocss/src/theme/container.ts","../../../barocss/src/theme/letter-spacing.ts","../../../barocss/src/theme/blur.ts","../../../barocss/src/theme/text-shadow.ts","../../../barocss/src/theme/default-theme.ts","../../../barocss/src/core/customUtilities.ts","../../../barocss/src/css/preflight.ts","../../../barocss/src/core/context.ts","../../../barocss/src/core/utils.ts","../../../barocss/src/presets/interactivity.ts","../../../barocss/src/presets/transitions.ts","../../../barocss/src/presets/table.ts","../../../barocss/src/presets/shadow-color.ts","../../../barocss/src/presets/filter.ts","../../../barocss/src/presets/backdrop-filter.ts","../../../barocss/src/presets/effects.ts","../../../barocss/src/presets/layout.ts","../../../barocss/src/presets/flexbox-grid.ts","../../../barocss/src/presets/spacing.ts","../../../barocss/src/presets/sizing.ts","../../../barocss/src/presets/typography.ts","../../../barocss/src/presets/background.ts","../../../barocss/src/presets/border.ts","../../../barocss/src/presets/transform.ts","../../../barocss/src/presets/svg.ts","../../../barocss/src/presets/accessibility.ts","../../../barocss/src/presets/variants/pseudo-classes.ts","../../../barocss/src/presets/variants/form-states.ts","../../../barocss/src/presets/variants/structural-selectors.ts","../../../barocss/src/presets/variants/media-features.ts","../../../barocss/src/presets/variants/attribute-selectors.ts","../../../barocss/src/presets/variants/basic-variants.ts","../../../barocss/src/presets/variants/utils.ts","../../../barocss/src/presets/variants/responsive.ts","../../../barocss/src/presets/variants/dark-mode.ts","../../../barocss/src/presets/variants/container-queries.ts","../../../barocss/src/presets/variants/has-variants.ts","../../../barocss/src/presets/variants/negation-variants.ts","../../../barocss/src/presets/variants/universal-selectors.ts","../../../barocss/src/presets/variants/arbitrary-variants.ts","../../../barocss/src/presets/variants/attribute-variants.ts","../../../barocss/src/presets/variants/nth-selectors.ts","../../../barocss/src/presets/variants/functional-selectors.ts","../../../barocss/src/presets/variants/at-rules.ts","../../../barocss/src/presets/variants/group-peer-extensions.ts","../../../barocss/src/core/rule-order.ts","../../src/style-partition-manager.ts","../../src/utils.ts","../../src/change-detector.ts","../../src/existing-classes.ts","../../src/class-gc.ts","../../src/browser-runtime.ts","../../src/baro-boot.ts","../../src/json-render-preload.ts","../../src/presets/shadcn.ts"],"sourcesContent":["// AST node types for barocss\nexport type AstNode =\n | { type: \"wrap\"; items: AstNode[], source?: string }\n | { type: \"decl\"; prop: string; value: string | [string, string][], source?: string }\n | { type: \"at-rule\"; name: string; params: string; nodes: AstNode[], source?: string }\n | { type: \"style-rule\"; selector: string; nodes: AstNode[], source?: string }\n | { type: \"rule\"; selector: string; nodes: AstNode[], source?: string }\n | { type: \"at-root\"; nodes: AstNode[], source?: string }\n | { type: \"comment\"; text: string, source?: string }\n | { type: \"raw\"; value: string, source?: string };\n\nexport type HasNodes = { nodes?: AstNode[] };\nexport type HasSource = { source?: string };\nexport type HasSelector = { selector?: string };\nexport type HasName = { name?: string };\nexport type HasParams = { params?: string };\nexport type HasValue = { value?: string | [string, string][] };\nexport type HasProp = { prop?: string };\nexport type HasItems = { items?: AstNode[] };\nexport type HasText = { text?: string };\n\nexport function decl(\n prop: string,\n value: string | [string, string][],\n source?: string\n): AstNode {\n return { type: \"decl\", prop, value, source };\n}\nexport function atRoot(nodes: AstNode[], source?: string): AstNode {\n return {\n type: \"at-root\",\n nodes,\n source\n };\n}\n\nexport function atRule(\n name: string,\n params: string,\n nodes: AstNode[],\n source?: string\n): AstNode {\n return { type: \"at-rule\", name, params, nodes, source };\n}\nexport function styleRule(selector: string, nodes: AstNode[], source?: string): AstNode {\n return { type: \"style-rule\", selector, nodes, source };\n}\nexport function rule(selector: string, nodes: AstNode[], source?: string): AstNode {\n return { type: \"rule\", selector, nodes, source };\n}\nexport function comment(text: string, source?: string): AstNode {\n return { type: \"comment\", text, source };\n}\nexport function raw(value: string, source?: string): AstNode {\n return { type: \"raw\", value, source };\n}\n\nexport function property(name: string, initialValue?: string, syntax?: string, source?: string): AstNode {\n const nodes: AstNode[] = [\n decl(\"syntax\", `\"${syntax || \"*\"}\"`, source),\n decl(\"inherits\", \"false\", source),\n ];\n \n if (initialValue) {\n nodes.push(decl(\"initial-value\", initialValue, source));\n }\n \n return atRule(\"property\", name, nodes, source);\n}","/**\n * Kit diagnostics are silent by default so untrusted runtime class names\n * cannot spam the console. Enable with `setDebug(true)` or `debug: true`\n * in the config passed to `createContext`.\n */\nlet debugEnabled = false;\n\nexport function setDebug(enabled: boolean): void {\n debugEnabled = enabled;\n}\n\nexport function isDebug(): boolean {\n return debugEnabled;\n}\n\nexport function debugLog(...args: unknown[]): void {\n // eslint-disable-next-line no-console\n if (debugEnabled) console.log(...args);\n}\n\nexport function debugWarn(...args: unknown[]): void {\n // eslint-disable-next-line no-console\n if (debugEnabled) console.warn(...args);\n}\n","import { debugLog } from \"./debug\";\nimport type { AstNode } from '../core/ast';\nimport { ParsedModifier, ParsedUtility } from '../core/parser';\n\n/**\n * AST cache management\n */\nexport class AstCache {\n private cache = new Map<string, AstNode[]>();\n private maxSize = 1000; // Prevent memory leaks\n \n set(key: string, ast: AstNode[]): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, ast);\n }\n \n get(key: string): AstNode[] | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global AST cache instance\nexport const astCache = new AstCache();\n\n/**\n * Parse result cache management\n */\nexport class ParseResultCache {\n private cache = new Map<string, { modifiers: ParsedModifier[]; utility: ParsedUtility | null }>();\n private maxSize = 2000; // Prevent memory leaks\n \n set(key: string, result: { modifiers: ParsedModifier[]; utility: ParsedUtility | null }): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, result);\n }\n \n get(key: string): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global parse result cache instance\nexport const parseResultCache = new ParseResultCache();\n\n/**\n * Utility cache management\n */\nexport class UtilityCache {\n private cache = new Map<string, boolean>();\n private maxSize = 1000; // Prevent memory leaks\n \n set(key: string, value: boolean): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, value);\n }\n \n get(key: string): boolean | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global utility cache instance\nexport const utilityCache = new UtilityCache();\n\nlet resetContextCaches: (() => void) | undefined;\n\n/** Internal hook for caches owned by contexts. */\nexport function setContextCacheReset(reset: () => void): void {\n resetContextCaches = reset;\n}\n\n/**\n * Clear all caches (for context changes or testing)\n */\nexport function clearAllCaches(): void {\n astCache.clear();\n parseResultCache.clear();\n utilityCache.clear();\n resetContextCaches?.();\n debugLog('[clearAllCaches] All caches cleared');\n}\n\n/**\n * WeakMap-based cache for memory optimization\n */\nexport class WeakCache<T> {\n private cache = new WeakMap<object, T>();\n private keyMap = new Map<string, object>();\n private maxSize = 1000;\n\n set(key: string, value: T): void {\n if (this.keyMap.size >= this.maxSize) {\n // Remove oldest entry\n const firstKey = this.keyMap.keys().next().value;\n if (firstKey) {\n const obj = this.keyMap.get(firstKey);\n if (obj) {\n this.cache.delete(obj);\n }\n this.keyMap.delete(firstKey);\n }\n }\n\n const obj = { key };\n this.cache.set(obj, value);\n this.keyMap.set(key, obj);\n }\n\n get(key: string): T | undefined {\n const obj = this.keyMap.get(key);\n if (obj) {\n return this.cache.get(obj);\n }\n return undefined;\n }\n\n has(key: string): boolean {\n return this.keyMap.has(key);\n }\n\n clear(): void {\n this.keyMap.clear();\n }\n\n getStats() {\n return {\n size: this.keyMap.size,\n maxSize: this.maxSize,\n hitRate: this.keyMap.size / this.maxSize\n };\n }\n}\n","import type { Context } from './context';\nimport type { ModifierRegistration, UtilityRegistration } from './registry';\nimport { AstCache, ParseResultCache, UtilityCache, setContextCacheReset } from '../utils/cache';\n\ninterface ContextState {\n utilities: UtilityRegistration[];\n modifiers: ModifierRegistration[];\n astCache: AstCache;\n parseResultCache: ParseResultCache;\n utilityCache: UtilityCache;\n failures: Set<string>;\n cacheGeneration: number;\n}\n\nconst states = new WeakMap<Context, ContextState>();\nlet cacheGeneration = 0;\n\nsetContextCacheReset(() => { cacheGeneration += 1; });\n\nexport function initializeContextState(\n ctx: Context,\n utilities: UtilityRegistration[],\n modifiers: ModifierRegistration[],\n): void {\n states.set(ctx, {\n utilities: [...utilities],\n modifiers: [...modifiers],\n astCache: new AstCache(),\n parseResultCache: new ParseResultCache(),\n utilityCache: new UtilityCache(),\n failures: new Set<string>(),\n cacheGeneration,\n });\n}\n\nexport function getContextState(ctx: Context): ContextState | undefined {\n const state = states.get(ctx);\n if (state && state.cacheGeneration !== cacheGeneration) {\n clearContextCaches(ctx);\n state.cacheGeneration = cacheGeneration;\n }\n return state;\n}\n\nexport function clearContextCaches(ctx: Context): void {\n const state = states.get(ctx);\n if (!state) return;\n state.astCache.clear();\n state.parseResultCache.clear();\n state.utilityCache.clear();\n state.failures.clear();\n}\n","import type { AstNode } from './ast';\nimport { decl, rule } from './ast';\nimport type { Context } from './context';\nimport { clearContextCaches, getContextState } from './contextState';\nimport { ParsedModifier, ParsedUtility } from './parser';\nimport { parseResultCache, utilityCache } from '../utils/cache';\n\n// Utility registration\nexport interface UtilityRegistration {\n /**\n * The name of the utility\n */\n name: string;\n /**\n * The match function for the utility\n * @param className The class name of the utility\n * @returns {boolean} Whether the utility matches the class name\n */\n match: (className: string) => boolean;\n /**\n * Handler for utility value\n * @param value Utility value (e.g. 'red-500')\n * @param ctx Context\n * @param token Parsed token\n * @param options Registration options\n */\n handler: (value: string, ctx: Context, token: ParsedUtility, options: UtilityRegistration) => AstNode[] | null | undefined;\n /**\n * The description of the utility\n * @example\n * ```\n * description: 'Custom utility description',\n * ```\n */\n description?: string;\n /**\n * The category of the utility\n * @example\n * ```\n * category: 'background',\n * ```\n */\n category?: string;\n /**\n * The priority of the utility\n * @example\n * ```\n * priority: 10,\n * ```\n */\n priority?: number;\n [key: string]: unknown;\n}\n\nconst utilityRegistry: UtilityRegistration[] = [];\nexport function registerUtility(util: UtilityRegistration, ctx?: Context) {\n const state = ctx && getContextState(ctx);\n if (ctx && !state) throw new Error('Utility registration requires a context from createContext');\n (state?.utilities || utilityRegistry).push(util);\n if (ctx) {\n clearContextCaches(ctx);\n } else {\n parseResultCache.clear();\n utilityCache.clear();\n }\n}\n\nexport function getUtility(ctx?: Context): UtilityRegistration[] {\n return (ctx && getContextState(ctx)?.utilities) || utilityRegistry;\n}\n\n// --- Modifier Registration ---\nexport type ModifierSelector = {\n selector: string;\n flatten?: boolean;\n wrappingType?: 'rule' | 'style-rule' | 'at-rule';\n override?: boolean;\n source?: string;\n};\n\nexport type ModifierRegistration = {\n match: (mod: string, context: Context) => boolean;\n modifySelector?: (params: { selector: string; fullClassName: string; mod: ParsedModifier; context: Context; variantChain?: ParsedModifier[]; index?: number }) => string | ModifierSelector | ModifierSelector[];\n wrap?: (mod: ParsedModifier, context: Context) => AstNode[];\n astHandler?: (ast: AstNode[], mod: ParsedModifier, context: Context, variantChain?: ParsedModifier[], index?: number) => AstNode[];\n sort?: number;\n description?: string;\n source?: string;\n /** Static variant name; lets the parser tell `placeholder-shown:` (variant) from a `placeholder-*` utility (#307). */\n name?: string;\n};\n\nexport const modifierRegistry: ModifierRegistration[] = [];\n\n/**\n * staticModifier: A helper that registers a modifier name and an array of CSS selectors directly to the registry\n * \n * @example\n * ```\n * staticModifier('disabled', ['&:disabled'], { source: 'pseudo' });\n * ```\n * \n * @param name The name of the modifier\n * @param selectors The selectors of the modifier\n * @param options The options of the modifier\n * \n * @returns {void}\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function staticModifier(name: string, selectors: string[], options: any = {}, ctx?: Context): void {\n registerModifier({\n name,\n match: (mod: string) => mod === name,\n modifySelector: ({ ..._rest }) => {\n return selectors.map(sel => ({\n selector: sel,\n source: options.source\n }));\n },\n ...options\n }, ctx);\n}\n\nexport function functionalModifier(match: ModifierRegistration['match'], modifySelector: ModifierRegistration['modifySelector'], wrap?: ModifierRegistration['wrap'], options: Partial<ModifierRegistration> = {}, ctx?: Context) {\n registerModifier({ match, modifySelector, wrap, ...options }, ctx);\n}\n\nexport function registerModifier(modifier: ModifierRegistration, ctx?: Context): void {\n const state = ctx && getContextState(ctx);\n if (ctx && !state) throw new Error('Modifier registration requires a context from createContext');\n (state?.modifiers || modifierRegistry).push(modifier);\n if (ctx) clearContextCaches(ctx);\n}\n\nexport function getModifier(ctx?: Context): ModifierRegistration[] {\n return (ctx && getContextState(ctx)?.modifiers) || modifierRegistry;\n}\n\n// escapeClassName\nconst ESCAPE_REGEX = /[^A-Za-z0-9_-]/g;\nexport function escapeClassName(className: string) {\n // #334: CSS.escape first-char rules — an identifier can't start with a digit, or `-` + digit, or be a lone `-`.\n if (className === '-') return '\\\\-';\n const lead = /^-?[0-9]/.exec(className);\n if (lead) {\n const i = lead[0].length - 1;\n return className.slice(0, i) + '\\\\' + className.charCodeAt(i).toString(16) + ' ' + escapeRest(className.slice(i + 1));\n }\n return escapeRest(className);\n}\nfunction escapeRest(className: string) {\n return className.replace(ESCAPE_REGEX, (c) => {\n if (c === ' ') return '\\\\x20 ';\n if (c === '.') return '\\\\.';\n if (c === '/') return '\\\\/';\n if (c === ':') return '\\\\:';\n if (c === '[') return '\\\\[';\n if (c === ']') return '\\\\]';\n if (c === '(') return '\\\\(';\n if (c === ')') return '\\\\)';\n if (c === '%') return '\\\\%';\n if (c === '#') return '\\\\#';\n if (c === ',') return '\\\\,';\n if (c === '=') return '\\\\=';\n if (c === '&') return '\\\\&';\n if (c === '~') return '\\\\~';\n if (c === '*') return '\\\\*';\n if (c === '$') return '\\\\$';\n if (c === '^') return '\\\\^';\n if (c === '+') return '\\\\+';\n if (c === '?') return '\\\\?';\n if (c === '!') return '\\\\!';\n if (c === '@') return '\\\\@';\n if (c === \"'\") return \"\\\\'\";\n if (c === '\"') return '\\\\\"';\n if (c === '`') return '\\\\`';\n if (c === ';') return '\\\\;';\n if (c === '<') return '\\\\<';\n if (c === '>') return '\\\\>';\n if (c === '{') return '\\\\{';\n if (c === '}') return '\\\\}';\n if (c === '|') return '\\\\|';\n if (c === '\\\\') return '\\\\\\\\';\n return '\\\\' + c;\n });\n}\n\n// --- Utility Helper Factories ---\n\ntype StaticUtilityValue = \n | AstNode // ast\n | [string, string] // [prop, value]\n | [string, [string, string][]] // [selector, [prop, value][]]\n | ((value: string) => AstNode); // function\n\n\n/**\n * staticUtility: A helper that registers a utility name and an array of CSS declaration pairs directly to the registry\n *\n * @example\n * ```\n * staticUtility('block', [['display', 'block']]);\n * staticUtility('hidden', [['display', 'none']]);\n * staticUtility('space-x-px', [\n * [\n * '& > :not([hidden]) ~ :not([hidden])', // selector\n * [\n * ['margin-inline-start', '1px'], // [prop, value]\n * ['margin-inline-end', '1px'], // [prop, value]\n * ],\n * ],\n * ]);\n * ```\n * \n * @param name The name of the utility\n * @param decls The declarations of the utility\n * @param opts The options of the utility\n * \n * @returns {void}\n */\nexport function staticUtility(\n name: string,\n decls: StaticUtilityValue[],\n opts?: { description?: string; category?: string; priority?: number },\n ctx?: Context,\n): void {\n registerUtility({\n name,\n match: (className: string) => {\n return className === name;\n },\n handler: (value: string): AstNode[] | null | undefined => {\n return decls.flatMap((params) => {\n\n if ((params as AstNode).type) {\n return [params as AstNode];\n }\n\n if (typeof params === 'function') {\n const targetFunction = params as (value: string) => AstNode;\n return [targetFunction(value)];\n }\n const [a, b] = params as [string, string | [string, string][]];\n\n if (typeof b === 'string') {\n // [prop, value]\n return [decl(a, b)];\n } else if (Array.isArray(b)) {\n // selector, [prop, value][]\n return [rule(a, b.map(([prop, value]) => decl(prop, value)))];\n }\n return [];\n });\n },\n description: opts?.description,\n category: opts?.category,\n priority: opts?.priority,\n }, ctx);\n}\n\nexport type FunctionalUtilityExtra = {\n opacity?: string;\n realThemeValue?: string;\n}\n\nexport type FunctionalUtilityOptions = {\n /**\n * The name of the utility\n * \n * prefix is automatically added to the name\n */\n name: string;\n /**\n * The CSS property to set\n * \n * css property is automatically added to the prop\n */\n prop?: string;\n /**\n * The theme key to look up values\n * \n * theme key is automatically added to the themeKey\n * \n * @example\n * ```\n * themeKey: 'colors'\n * ```\n */\n themeKey?: string;\n /**\n * The theme keys to look up values\n * \n * theme keys are automatically added to the themeKeys\n * \n * @example\n * ```\n * themeKeys: ['colors', 'spacing']\n * ```\n */\n themeKeys?: string[];\n /**\n * Whether to support arbitrary values\n * \n * `bg-[#ff0000]`\n * \n * @example\n * ```\n * supportsArbitrary: true\n * ```\n */\n supportsArbitrary?: boolean;\n /**\n * Whether to support fraction values\n * \n * `m-4`\n * \n * @example\n * ```\n * supportsFraction: true\n * ```\n */\n supportsFraction?: boolean;\n /**\n * Whether to support custom properties\n * \n * `bg-(--my-bg)`\n * \n * @example\n * ```\n * supportsCustomProperty: true\n * ```\n */\n supportsCustomProperty?: boolean;\n /**\n * Whether to support negative values\n * \n * `-m-4`\n * \n * @example\n * ```\n * supportsNegative: true\n * ```\n */\n supportsNegative?: boolean;\n /**\n * Whether to support opacity values\n */\n supportsOpacity?: boolean;\n /**\n * The handler function that processes values\n * \n * @example\n * ```\n * handle: (value, ctx, token, extra) => {\n * return [decl('background-color', value)];\n * }\n * ```\n * \n * @param value The value to process\n * @param ctx The context\n * @param token The parsed utility\n * @param extra The extra metadata\n * \n * @returns {AstNode[] | null | undefined} The AST nodes or null | undefined\n */\n handle?: (value: string, ctx: Context, token: ParsedUtility, extra?: FunctionalUtilityExtra) => AstNode[] | null | undefined;\n /**\n * The handler function that processes bare values\n * \n * @example\n * ```\n * handleBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * ```\n * \n * @param args The arguments\n * @param args.value The value to process\n * @param args.ctx The context\n * @param args.token The parsed utility\n * @param args.extra The extra metadata\n * \n * @returns {string | null | undefined} The processed value or null | undefined\n */\n handleBareValue?: (args: { value: string; ctx: Context; token: ParsedUtility, extra?: FunctionalUtilityExtra }) => string | null | undefined;\n /**\n * The handler function that processes negative bare values\n * \n * @example\n * ```\n * handleNegativeBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * ```\n */\n /**\n * #261: the utility uses the spacing scale, so a named `theme.spacing` key (`p-gutter`) resolves to\n * `var(--spacing-<key>)` (negative: `calc(var(--spacing-<key>) * -1)`), as in Tailwind 4. Only tried\n * after the bare-value handler rejects the value, so built-in keywords keep precedence.\n */\n spacingKeys?: boolean;\n handleNegativeBareValue?: (args: { value: string; ctx: Context; token: ParsedUtility, extra?: FunctionalUtilityExtra }) => string | null | undefined;\n\n /**\n * The handler function that processes custom property values\n * \n * \n * @example\n * ```\n * handleCustomProperty: (value, ctx, token, extra) => [decl('background-color', value)],\n * ```\n * \n * @param args The arguments\n * @param args.value The value to process\n * @param args.ctx The context\n * @param args.token The parsed utility\n * @param args.extra The extra metadata\n * \n * @returns {AstNode[] | null | undefined} The AST nodes or null | undefined\n */\n handleCustomProperty?: (value: string, ctx: Context, token: ParsedUtility, extra?: FunctionalUtilityExtra) => AstNode[] | null | undefined;\n /**\n * The description of the utility\n * \n * @example\n * ```\n * description: 'Custom utility description',\n * ```\n */\n description?: string;\n /**\n * The category of the utility\n * \n * It is used to group utilities in the documentation and styles\n * \n * \n * @example\n * ```\n * category: 'background',\n * ```\n */\n category?: string;\n /**\n * The priority of the utility\n * \n * It is used to sort utilities in the styles\n * \n * @example\n * ```\n * priority: 10,\n * ```\n * \n * The higher the number, the higher the priority\n * \n * @default 0\n */\n priority?: number;\n}\n\n/**\n * functionalUtility: A helper that registers dynamic utilities (theme, arbitrary, custom, negative, fraction, etc.) directly\n *\n * Example:\n * functionalUtility({\n * name: 'z',\n * supportsNegative: true,\n * themeKeys: ['--z-index'],\n * handleBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * handle: (value) => [decl('z-index', value)],\n * description: 'z-index utility',\n * category: 'layout',\n * });\n */\n/** #261: `var(--spacing-<key>)` for a named (non-numeric) `theme.spacing` key, else null. */\nfunction spacingKeyValue(ctx: Context, key: string, negative: boolean): string | null {\n if (key === 'px' || !/^[a-zA-Z][\\w-]*$/.test(key) || ctx.theme('spacing', key) == null) return null;\n const ref = `var(--spacing-${key})`;\n return negative ? `calc(${ref} * -1)` : ref;\n}\n\nexport function functionalUtility(opts: FunctionalUtilityOptions, ctx?: Context) {\n registerUtility({\n name: opts.name,\n match: (className: string) => className.startsWith(opts.name + '-'),\n handler: (value, ctx, token, _options) => {\n let finalValue = value;\n const parsedUtility = token;\n const extra: FunctionalUtilityExtra = {\n opacity: token.opacity,\n };\n\n if (opts.supportsOpacity && !token.arbitrary && !token.customProperty && value.includes('/')) {\n const list = value.split('/');\n\n if (list.length >= 2) {\n extra.opacity = list.pop();\n finalValue = list.join('/');\n }\n }\n\n // 1. Arbitrary value - already parsed in parser.ts\n if (opts.supportsArbitrary && parsedUtility.arbitrary) {\n const processedValue = normalizeMathSpacing(expandThemeFunctions(finalValue.replace(/_/g, ' ')));\n // console.log('[functionalUtility] arbitrary', { processedValue });\n // 7. handle (custom AST generation)\n if (opts.handle) {\n const result = opts.handle(processedValue, ctx, token, extra);\n // console.log('[functionalUtility] arbitrary handle result', result);\n if (result) return result;\n }\n // 8. default decl\n if (opts.prop) {\n // console.log('[functionalUtility] arbitrary default decl', { prop: opts.prop, processedValue });\n return [decl(opts.prop, processedValue)];\n }\n return [];\n }\n // 2. Custom property - already parsed in parser.ts\n if (opts.supportsCustomProperty && parsedUtility.customProperty) {\n // console.log('[functionalUtility] customProperty', { finalValue });\n if (opts.handleCustomProperty) {\n const result = opts.handleCustomProperty(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] customProperty handleCustomProperty result', result);\n return result;\n }\n const customValue = `var(${finalValue})`;\n if (opts.handle) {\n const result = opts.handle(customValue, ctx, token, extra);\n // console.log('[functionalUtility] customProperty handle result', result);\n if (result) return result;\n }\n if (opts.prop) {\n // console.log('[functionalUtility] customProperty default decl', { prop: opts.prop, customValue });\n return [decl(opts.prop, customValue)];\n }\n return [];\n }\n // 3. Theme lookup (themeKey or themeKeys); only scalar results count as a value (#333)\n let themeValue: string | undefined;\n if (opts.themeKey && ctx.theme) {\n themeValue = themeScalar(ctx.theme(opts.themeKey, finalValue));\n // console.log('[functionalUtility] themeKey lookup', { themeKey: opts.themeKey, finalValue, themeValue });\n }\n if (!themeValue && opts.themeKeys && ctx.theme) {\n for (const key of opts.themeKeys) {\n themeValue = themeScalar(ctx.theme(key, finalValue));\n // console.log('[functionalUtility] themeKeys lookup', { key, finalValue, themeValue });\n if (themeValue !== undefined) break;\n }\n }\n if (themeValue !== undefined) {\n extra.realThemeValue = finalValue;\n finalValue = themeValue;\n if (opts.prop) {\n // console.log('[functionalUtility] themeValue default decl', { prop: opts.prop, finalValue });\n return [decl(opts.prop, finalValue)];\n }\n if (opts.handle) {\n const result = opts.handle(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] themeValue handle result', result);\n if (result) return result;\n }\n return [];\n }\n // 4. Fraction value (e.g., 1/2, -2/5)\n // console.log('[functionalUtility] fraction', { value });\n if (opts.supportsFraction && /^-?\\d+\\/\\d+$/.test(value)) {\n finalValue = value;\n // console.log('[functionalUtility] fraction', { finalValue });\n }\n const spacingKey = opts.spacingKeys ? spacingKeyValue(ctx, String(finalValue).replace(/^-/, ''), !!parsedUtility.negative) : null;\n // 5. handleNegativeBareValue (only check negative bare value)\n if (parsedUtility.negative && opts.supportsNegative && opts.handleNegativeBareValue) {\n const bare = opts.handleNegativeBareValue({ value: String(finalValue).replace(/^-/, ''), ctx, token, extra }) ?? spacingKey;\n // console.log('[functionalUtility] negative bare', { bare });\n if (bare == null) return [];\n finalValue = bare;\n }\n // 6. handleBareValue (only check bare value) - only when negative is not true\n else if (opts.handleBareValue) {\n const bare = opts.handleBareValue({ value: finalValue, ctx, token, extra }) ?? spacingKey;\n // console.log('[functionalUtility] bare', { bare });\n if (bare == null) return [];\n finalValue = bare;\n }\n else if (spacingKey) {\n finalValue = spacingKey;\n }\n // A non-numeric bare value that no theme key or bare-value validator accepted is unknown (#213):\n // Tailwind emits nothing for it (`text-balanc`, `bg-notacolor`, `border-foo`), so don't pass it\n // through to handle()/prop as a raw CSS value. Numeric values stay with handle() to validate.\n else if (!/^-?(\\d|\\.\\d)/.test(String(finalValue))) {\n return [];\n }\n // 7. handle (custom AST generation)\n if (opts.handle) {\n // console.log('[functionalUtility] handle', { finalValue });\n const result = opts.handle(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] handle result', result);\n if (result) return result;\n }\n // 8. default decl\n if (opts.prop) {\n // console.log('[functionalUtility] default decl', { prop: opts.prop, finalValue });\n return [decl(opts.prop, finalValue)];\n }\n // console.log('[functionalUtility] fallback empty', { finalValue });\n return [];\n },\n description: opts.description,\n category: opts.category,\n priority: opts.priority,\n }, ctx);\n}\n\nconst MATH_FNS = new Set(['calc', 'min', 'max', 'clamp']);\n\n/**\n * Add Tailwind-style spacing inside calc()/min()/max()/clamp():\n * `calc(100%-2rem)` -> `calc(100% - 2rem)`. Leaves nested non-math functions\n * (var(--x-y)), unary signs and exponents (1e-3) alone.\n */\nexport function expandThemeFunctions(value: string): string {\n // Tailwind 4: `--spacing(8)` → `calc(var(--spacing) * 8)`.\n return value.replace(/--spacing\\(\\s*([^()]+?)\\s*\\)/g, 'calc(var(--spacing) * $1)');\n}\n\n/** Arbitrary property class `[prop:value]` (parser sets token.property). */\nexport const arbitraryPropertyRegistration: UtilityRegistration = {\n name: '[arbitrary-property]',\n match: () => false,\n handler: (value, _ctx, token) => {\n const prop = (token as { property?: string }).property;\n if (!prop || !value) return [];\n return [decl(prop, normalizeMathSpacing(expandThemeFunctions(value.replace(/_/g, ' '))))];\n },\n};\n\nexport function normalizeMathSpacing(value: string): string {\n if (!/(calc|min|max|clamp)\\(/.test(value)) return value;\n const stack: boolean[] = [];\n let out = '';\n for (let i = 0; i < value.length; i++) {\n const ch = value[i];\n if (ch === '(') {\n const name = (/([a-z-]*)$/i.exec(out)?.[1] ?? '').toLowerCase();\n const inMath = stack.length > 0 && stack[stack.length - 1];\n stack.push(MATH_FNS.has(name) || (name === '' && inMath));\n out += ch;\n continue;\n }\n if (ch === ')') { stack.pop(); out += ch; continue; }\n const inMath = stack.length > 0 && stack[stack.length - 1];\n if (!inMath) { out += ch; continue; }\n if (ch === ',') { out = out.trimEnd() + ', '; while (value[i + 1] === ' ') i++; continue; }\n if ('+-*/'.includes(ch)) {\n const prev = out.trimEnd();\n const p = prev[prev.length - 1] ?? '';\n const binary = /[\\w%)]/.test(p);\n const exponent = (ch === '+' || ch === '-') && /\\de$/i.test(prev) && prev.length === out.length && /\\d/.test(value[i + 1] ?? '');\n if (binary && !exponent) {\n out = prev + ' ' + ch + ' ';\n while (value[i + 1] === ' ') i++;\n continue;\n }\n }\n out += ch;\n }\n return out;\n}\n\n/**\n * A theme lookup result usable as a CSS value (#333): strings as-is, finite numbers stringified; anything else\n * (a nested palette object when no shade is given, arrays, functions) counts as \"no value\".\n */\nfunction themeScalar(v: unknown): string | undefined {\n if (typeof v === 'string') return v;\n if (typeof v === 'number' && Number.isFinite(v)) return String(v);\n return undefined;\n}\n","export interface Token {\n value: string;\n start: number;\n end: number;\n}\n\n/**\n * Tokenizes a class name string into an array of tokens\n * Only handles separation by ':' while respecting brackets and parentheses\n * \n * Examples:\n * - 'hover:bg-red-500' → [{ value: 'hover' }, { value: 'bg-red-500' }]\n * - 'bg-[#ff0000]:hover' → [{ value: 'bg-[#ff0000]' }, { value: 'hover' }]\n * - 'text-[color:var(--foo)]' → [{ value: 'text-[color:var(--foo)]' }]\n * - '!bg-[red]' → [{ value: '!bg-[red]' }]\n */\nexport function tokenize(className: string): Token[] {\n const tokens: Token[] = [];\n let current = '';\n let start = 0;\n let inBracket = 0;\n let inParen = 0;\n \n for (let i = 0; i < className.length; i++) {\n const char = className[i];\n \n // Bracket tracking\n if (char === '[') inBracket++;\n if (char === ']') inBracket--;\n if (char === '(') inParen++;\n if (char === ')') inParen--;\n \n // Separator (only when not inside brackets or parentheses)\n if (char === ':' && inBracket === 0 && inParen === 0) {\n if (current) {\n tokens.push({\n value: current,\n start,\n end: i\n });\n }\n current = '';\n start = i + 1;\n } else {\n current += char;\n }\n }\n \n // Add remaining token\n if (current) {\n tokens.push({\n value: current,\n start,\n end: className.length\n });\n }\n \n return tokens;\n} ","// Types for parsed modifier and utility\nexport interface ParsedModifier {\n type: string;\n value?: string;\n negative?: boolean;\n arbitrary?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ParsedUtility {\n category?: string;\n prefix: string;\n value?: string;\n arbitrary?: boolean;\n customProperty?: boolean;\n negative?: boolean;\n opacity?: string;\n priority?: number;\n important?: boolean;\n /** Set for an arbitrary property class (`[prop:value]`); `value` holds the raw value. */\n property?: string;\n [key: string]: unknown;\n}\n\nimport { getUtility, getModifier, UtilityRegistration } from './registry';\nimport { tokenize, Token } from './tokenizer';\nimport { parseResultCache, utilityCache } from '../utils/cache';\nimport type { Context } from './context';\nimport { getContextState } from './contextState';\n\n// Cache systems\n\n/**\n * Checks if a string is a utility prefix by checking against registered utilities\n * Optimized with prefix filtering and caching\n * @param str The string to check\n * @returns true if it's a utility prefix\n */\nfunction isUtilityPrefix(str: string, ctx?: Context): boolean {\n const cache = (ctx && getContextState(ctx)?.utilityCache) || utilityCache;\n // Check cache\n if (cache.has(str)) {\n return cache.get(str)!;\n }\n \n const utilities = getUtility(ctx);\n const modifiers = getModifier(ctx);\n \n // 1. Fast prefix filtering (O(1) prefix check)\n const candidateUtilities = utilities.filter(util => {\n const prefix = util.name;\n return str.startsWith(prefix + '-') || str === prefix || str.startsWith(prefix);\n });\n \n // 2. Exact match check only on filtered candidates\n const isUtility = candidateUtilities.some(util => util.match(str));\n \n // 3. Filter modifiers similarly\n const candidateModifiers = modifiers.filter(mod => {\n // Use modifier name if available, otherwise extract from match function\n const modName = (mod as unknown as { name: string }).name || mod.match.toString().split('(')[0];\n return str.startsWith(modName + ':') || str === modName;\n });\n \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const isModifier = candidateModifiers.some(mod => mod.match(str, {} as any));\n \n // 4. Calculate result\n const result = isUtility && !isModifier;\n \n // 5. Cache result\n cache.set(str, result);\n \n return result;\n}\n\n/**\n * Parses a class name string into modifiers and utility using tokenization\n * Supports both directions:\n * - modifier:utility (traditional CSS)\n * - utility:modifier (Master CSS style)\n * \n * Examples:\n * - 'group-hover:sm:bg-[red]' → modifier:utility\n * - 'bg-red-500:hover' → utility:modifier\n * - 'text-[color:var(--foo)]' → utility only\n * \n * @param className e.g. 'group-hover:sm:bg-[red]', 'text-[color:var(--foo)]'\n * @returns { modifiers, utility }\n */\nexport function parseClassName(className: string, ctx?: Context): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } {\n const cache = (ctx && getContextState(ctx)?.parseResultCache) || parseResultCache;\n // Check parse result cache first\n if (cache.has(className)) {\n return cache.get(className)!;\n }\n\n // #286: config.prefix (Tailwind 4 `prefix(tw)`): the prefix is the first `:` segment (`tw:hover:flex`) and is\n // stripped before the `!` forms and the variant split, so every #220/#248/#273 guard still runs on the rest.\n // A class without the prefix (including `!tw:flex` and `hover:tw:flex`, as in Tailwind 4) generates nothing.\n let realClassName = className;\n const classPrefix = ctx ? configuredClassPrefix(ctx) : '';\n if (classPrefix) {\n if (!className.startsWith(classPrefix + ':')) {\n const none = { modifiers: [], utility: null };\n cache.set(className, none);\n return none;\n }\n realClassName = className.slice(classPrefix.length + 1);\n }\n\n // Examples: !bg-[red]\n let important = false;\n if (realClassName.startsWith('!')) {\n important = true;\n realClassName = realClassName.slice(1);\n } else if (realClassName.length > 1 && realClassName.endsWith('!')) {\n // Tailwind 4 trailing form: p-4!, hover:size-5!. A `!` inside an arbitrary\n // value (`[...!...]`) never ends the class, so it is unaffected.\n important = true;\n realClassName = realClassName.slice(0, -1);\n }\n \n // 1. Tokenize string into tokens\n const tokens = tokenize(realClassName);\n // 2. Convert tokens to parsed result\n const result = parseTokens(tokens, ctx);\n if (result.utility) {\n result.utility.important = important;\n }\n \n // Cache the result\n cache.set(className, result);\n \n return result;\n}\n\n/**\n * The class prefix from config.prefix. Tailwind 4 only accepts lowercase letters (`prefix(tw)`); any other\n * value is ignored (no prefix) rather than guessed at.\n */\nfunction configuredClassPrefix(ctx: Context): string {\n const configured = ctx.config('prefix');\n return typeof configured === 'string' && /^[a-z]+$/.test(configured) ? configured : '';\n}\n\n/**\n * Parses tokens into modifiers and utility\n */\nfunction parseTokens(tokens: Token[], ctx?: Context): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } {\n const modifiers: ParsedModifier[] = [];\n let utility: ParsedUtility | null = null;\n \n // Handle empty token array\n if (tokens.length === 0) {\n return { modifiers, utility: null };\n }\n \n // #220: every token but the utility is a variant; one that could end or widen the selector rejects the class.\n if (tokens.length > 1) {\n const utilityIndex = isUtilityPrefix(tokens[0].value, ctx) ? 0 : tokens.length - 1;\n if (tokens.some((t, i) => i !== utilityIndex && (!isSafeVariantToken(t.value) || !isWellFormedVariantBrackets(t.value)))) {\n return { modifiers, utility: null };\n }\n }\n\n // #224: the utility token carries the arbitrary / custom-property value that is pasted into a declaration;\n // one that could end or open a declaration, block or rule rejects the class (no rule).\n const utilityToken = tokens.length > 1 && !isUtilityPrefix(tokens[0].value, ctx) ? tokens[tokens.length - 1] : tokens[0];\n if (!isStructureSafeValue(utilityToken.value)) {\n return { modifiers, utility: null };\n }\n\n // Determine token types and parse in both directions\n if (tokens.length === 1) {\n // utility only\n utility = parseUtility(tokens[0].value, ctx);\n } else if (tokens.length === 2) {\n const firstToken = tokens[0];\n const secondToken = tokens[1];\n const isFirstUtility = isUtilityPrefix(firstToken.value, ctx);\n \n if (isFirstUtility) {\n // utility:modifier form\n utility = parseUtility(firstToken.value, ctx);\n const parsed = parseModifier(secondToken.value);\n if (parsed) modifiers.push(parsed);\n } else {\n // modifier:utility form\n const parsed = parseModifier(firstToken.value);\n if (parsed) modifiers.push(parsed);\n utility = parseUtility(secondToken.value, ctx);\n }\n } else {\n // Multiple tokens\n // Check if the first token is a utility\n const isFirstUtility = isUtilityPrefix(tokens[0].value, ctx);\n \n if (isFirstUtility) {\n // utility:modifier:modifier form\n utility = parseUtility(tokens[0].value, ctx);\n for (let i = 1; i < tokens.length; i++) {\n const parsed = parseModifier(tokens[i].value);\n if (parsed) modifiers.push(parsed);\n }\n } else {\n // modifier:modifier:utility form\n for (let i = 0; i < tokens.length - 1; i++) {\n const parsed = parseModifier(tokens[i].value);\n if (parsed) modifiers.push(parsed);\n }\n utility = parseUtility(tokens[tokens.length - 1].value, ctx);\n }\n }\n return { modifiers, utility };\n}\n\n/**\n * A variant token is pasted into a selector (or at-rule prelude), so it must not be able to end it or add a\n * member to the selector list. Rejects, outside quotes: unbalanced or mismatched ()/[], a quote left open,\n * `{`, `}`, `;`, and a `,` that is not inside parentheses (`:is(a,b)` stays valid, `[&,x]` does not).\n */\n// Variants that paste their whole `[...]` value inside a functional pseudo-class (`:has(…)`, `:not(…)`), so a comma\n// in the value can only ever separate that pseudo-class's arguments, never members of the generated selector list.\nconst FUNCTIONAL_VALUE_VARIANT = /^-?(?:(?:group|peer)-)?(?:has|not)-\\[(.*)\\](?:\\/[\\w-]+)?$/;\n\n/**\n * #221: isSafeVariantValue for a whole variant token, except that has-[…]/not-[…] (optionally group-/peer-) may\n * carry a comma at the top level of their bracket value: those variants wrap the value in `:has()`/`:not()`.\n * The value itself must still be balanced and free of `{`, `}` and `;`, so it cannot close the pseudo-class.\n */\nexport function isSafeVariantToken(value: string): boolean {\n if (hasCommentToken(value)) return false;\n const m = FUNCTIONAL_VALUE_VARIANT.exec(value);\n if (m) return isSafeVariantValue(m[1], true);\n return isSafeVariantValue(value);\n}\n\n/**\n * #224: true when a utility value (or a whole utility token) cannot change the structure of the declaration block it\n * is pasted into. Rejects, outside quotes: `{`, `}`, `;`, unbalanced or mismatched ()/[], and a quote left open.\n * Commas are allowed (values are not selector lists), so this is isSafeVariantValue with top-level commas allowed.\n */\n/**\n * #332: a variant token's bracket groups must be well formed. An empty group (`[]`, as in an empty\n * `has-[]`/`group-has-[]`/`[]` variant) has nothing to select and emits nothing. A token that opens with `[`\n * is one arbitrary variant: its first group must close at the token's last character, so two adjacent groups\n * are never read as a single variant whose inner text is unbalanced. CSS escapes and quoted strings are skipped.\n */\nexport function isWellFormedVariantBrackets(value: string): boolean {\n let quote = '';\n let depth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n if (c === '\"' || c === \"'\") { quote = c; continue; }\n if (c === '[') {\n if (value[i + 1] === ']') return false;\n depth++;\n } else if (c === ']') {\n depth--;\n if (depth === 0 && value.startsWith('[') && i !== value.length - 1) return false;\n }\n }\n return true;\n}\n\n/** #248: a comment opener or closer anywhere in a variant (quoted or not) could leave a comment unclosed in the output. */\nexport function hasCommentToken(value: string): boolean {\n return value.includes('/*') || value.includes('*/');\n}\n\n/**\n * #273: true when an emitted selector or at-rule prelude contains a comment opener or closer outside a CSS escape.\n * Backslash-escape pairs are skipped, so an escaped `\\/` or `\\*` from a class name never counts. Used by the\n * serializer on the final, composed string, where adjacent pieces that were each safe alone can join into one.\n */\nexport function hasCommentDelimiter(text: string): boolean {\n for (let i = 0; i < text.length - 1; i++) {\n const c = text[i];\n if (c === '\\\\') { i++; continue; }\n const n = text[i + 1];\n if ((c === '/' && n === '*') || (c === '*' && n === '/')) return true;\n }\n return false;\n}\n\n/**\n * #332: true when an emitted selector or at-rule prelude has balanced, correctly nested `()`, `[]` and `{}` and\n * no open quote. CSS escapes (backslash pairs) and quoted strings are skipped, so escaped brackets from a class\n * name never count. Top-level commas are allowed (selector lists, `:is(a, b)`). Checked on the final composed\n * string: an unbalanced prelude in concatenated CSS text would swallow the rules that follow it.\n */\nexport function isBalancedPrelude(text: string): boolean {\n const stack: string[] = [];\n let quote = '';\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n switch (c) {\n case '\"': case \"'\": quote = c; break;\n case '(': stack.push(')'); break;\n case '[': stack.push(']'); break;\n case '{': stack.push('}'); break;\n case ')': case ']': case '}':\n if (stack.pop() !== c) return false;\n break;\n }\n }\n return stack.length === 0 && !quote;\n}\n\n/**\n * #323: true when emitted text contains a markup end-tag opener (less-than then slash). Generated CSS can be\n * placed inside an HTML style element, where that sequence could end the element early. CSS escapes in the\n * output never form it, and a lone less-than (range media queries) stays allowed.\n */\nexport function hasHtmlEndTagOpener(text: string): boolean {\n return text.includes('</');\n}\n\nexport function isStructureSafeValue(value: string): boolean {\n // #247 review: a comment opener/closer in any arbitrary value could swallow the rest of the stylesheet.\n if (hasCommentToken(value)) return false;\n return isSafeVariantValue(value, true);\n}\n\n/** An unquoted `@` would start an at-rule token; no declaration value of an arbitrary property needs one. */\nfunction hasUnquotedAt(value: string): boolean {\n let quote = '';\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n if (c === '\"' || c === \"'\") quote = c;\n else if (c === '@') return true;\n }\n return false;\n}\n\nexport function isSafeVariantValue(value: string, allowTopLevelComma = false): boolean {\n const stack: string[] = [];\n let quote = '';\n let parenDepth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n switch (c) {\n case '\"': case \"'\": quote = c; break;\n case '(': stack.push(')'); parenDepth++; break;\n case '[': stack.push(']'); break;\n case ')': case ']':\n if (stack.pop() !== c) return false;\n if (c === ')') parenDepth--;\n break;\n case '{': case '}': case ';': return false;\n case ',': if (parenDepth === 0 && !allowTopLevelComma) return false; break;\n }\n }\n return stack.length === 0 && !quote;\n}\n\n/**\n * Parse modifier token\n */\nfunction parseModifier(value: string): ParsedModifier | null {\n let negative = false;\n let modStr = value;\n \n if (modStr.startsWith('-')) {\n negative = true;\n modStr = modStr.slice(1);\n }\n \n // Arbitrary variant support\n if (modStr.startsWith('[') && modStr.endsWith(']')) {\n return { type: modStr, negative, arbitrary: true };\n }\n \n return { type: modStr, negative };\n}\n\nfunction nameSort(a: UtilityRegistration, b: UtilityRegistration): number {\n return b.name.length - a.name.length;\n}\n\n/**\n * Parse utility token\n */\nfunction parseUtility(value: string, ctx?: Context): ParsedUtility {\n // Examples: bg-[red], text-[color:var(--foo)], bg-(--my-bg), -m-4, -bg-[red]\n let prefix = '';\n let utilityValue = '';\n let arbitrary = false;\n let customProperty = false;\n let negative = false;\n let opacity = '';\n let category = '';\n let priority = 0;\n \n // Tailwind arbitrary property: [--cell-size:8px], [mask-type:luminance]\n const prop = /^\\[(--[a-zA-Z_][a-zA-Z0-9_-]*|-?[a-z][a-z-]*):(.+)\\]$/.exec(value);\n if (prop) {\n // Same #224 guard as every other arbitrary value, plus no at-rule token.\n if (!isStructureSafeValue(prop[2]) || hasUnquotedAt(prop[2])) return { prefix: '', value: '' };\n return { prefix: '', value: prop[2], arbitrary: true, property: prop[1] };\n }\n\n if (value.startsWith('-')) {\n negative = true;\n }\n\n // Handle arbitrary values\n if (value.includes('-[')) {\n [prefix, utilityValue] = value.split('-[');\n // Closing bracket position\n const closeIdx = utilityValue.lastIndexOf(']');\n if (closeIdx !== -1 && closeIdx < utilityValue.length - 1 && utilityValue[closeIdx + 1] === '/') {\n // If '/' follows the closing bracket, split opacity\n opacity = utilityValue.slice(closeIdx + 2); // after '/'\n utilityValue = utilityValue.slice(0, closeIdx); // keep inside brackets only\n } else {\n // If ends with ']', no opacity\n utilityValue = utilityValue.replace(/]$/, '');\n }\n arbitrary = true;\n } \n // Handle custom properties\n else if (value.includes('-(')) {\n [prefix, utilityValue] = value.split('-(');\n utilityValue = utilityValue.replace(/\\)$/, '');\n customProperty = true;\n } \n // Handle regular utilities\n else {\n const sortedUtilities = [...getUtility(ctx)].sort(nameSort);\n \n let matchedUtility = sortedUtilities.find(p => value === p.name);\n if (matchedUtility) {\n prefix = matchedUtility.name;\n utilityValue = \"\";\n negative = value.startsWith('-');\n category = matchedUtility.category!;\n priority = matchedUtility.priority!;\n } else {\n if (value.startsWith('-')) {\n negative = true;\n value = value.slice(1);\n }\n \n matchedUtility = sortedUtilities.find(p => value.startsWith(p.name + '-'));\n if (matchedUtility) {\n prefix = matchedUtility.name;\n utilityValue = value.slice(matchedUtility.name.length + 1);\n category = matchedUtility.category!;\n priority = matchedUtility.priority!;\n } else {\n const parts = value.split('-');\n prefix = parts[0];\n utilityValue = parts.slice(1).join('-');\n }\n }\n }\n \n return {\n prefix,\n value: utilityValue,\n arbitrary: !!arbitrary,\n customProperty: !!customProperty,\n negative: !!negative,\n opacity,\n category,\n priority,\n };\n}\n","import { debugWarn } from \"../utils/debug\";\nimport { type AstNode } from \"./ast\";\nimport { escapeClassName } from \"./registry\";\nimport { isStructureSafeValue, hasCommentDelimiter, hasHtmlEndTagOpener, isBalancedPrelude } from \"./parser\";\n\n// #273: a selector or at-rule prelude that contains a comment delimiter is never emitted (with its whole subtree).\n// #323: nor one carrying a markup end-tag opener (hasHtmlEndTagOpener).\n// #332: nor one whose brackets, parens or braces do not balance and close (isBalancedPrelude).\nconst isSafePrelude = (text: unknown): boolean => {\n const t = String(text ?? \"\");\n return !hasCommentDelimiter(t) && !hasHtmlEndTagOpener(t) && isBalancedPrelude(t);\n};\n\n// #224 defensive layer: a declaration whose property or value could end or open a block is dropped.\nconst isSafeDecl = (prop: unknown, value: unknown): boolean =>\n isStructureSafeValue(String(prop)) && isStructureSafeValue(String(value ?? \"\")) &&\n !hasHtmlEndTagOpener(String(prop)) && !hasHtmlEndTagOpener(String(value ?? \"\"));\n\nconst importantPrefix = \"!important\";\n\n/**\n * Converts AST nodes to CSS string\n * @param ast { AstNode[] } - Array of AST nodes to convert\n * @param baseSelector { string } - Base selector for nested rules (e.g., \".parent\" for \".parent .child\")\n * @param opts { minify?: boolean } - Options for CSS generation\n * @param _indent { string } - Current indentation level for pretty formatting\n */\nfunction astToCss(\n ast: AstNode[],\n baseSelector?: string,\n opts?: { minify?: boolean, important?: boolean },\n _indent = \"\"\n): string {\n const minify = opts?.minify;\n const indent = _indent;\n const nextIndent = _indent + \" \"; // Next-level indentation: current + 2 spaces\n const important = opts?.important ?? false;\n const importantString = important ? ` ${importantPrefix}` : \"\";\n // Note: Caching is handled at a higher level (IncrementalParser); omit here\n\n // Debug logging for empty AST\n if (!ast || ast.length === 0) {\n debugWarn('[astToCss] Empty AST received:', { ast, baseSelector, minify });\n return '';\n }\n\n // Deduplication logic: remove duplicates only among CSS property declarations (decl)\n // \n // How it works:\n // 1. Iterate in reverse (the last defined property wins)\n // 2. Only check duplicates for decl nodes (skip rule/at-rule)\n // 3. Consider duplicates by property name (prop)\n // \n // Current limitations:\n // - Does not dedupe rule or at-rule nodes\n // - When background.ts returns @supports + decl together, dedupe may not apply\n // - This can yield duplicate CSS rules in output\n const dedupedAst = [];\n if (Array.isArray(ast)) {\n const seenProps = new Map(); // Tracks property names already seen\n \n // Reverse iteration: keep the last defined property\n // Example: [color: red, color: blue] → keep only [color: blue]\n for (let i = ast.length - 1; i >= 0; i--) {\n const node = ast[i];\n \n if (node.type === \"decl\") {\n // Handle CSS property declaration nodes\n // node.important is not present; handle safely\n const key = node.prop; // Property name (e.g., \"color\", \"background-color\")\n \n // Skip duplicate properties\n if (seenProps.has(key)) {\n continue;\n }\n \n // Record new property\n seenProps.set(key, true);\n }\n \n // Add node to result (use unshift to preserve original order)\n dedupedAst.unshift(node);\n }\n }\n\n // Generate CSS string from deduped AST\n const result = dedupedAst\n .map((node) => {\n switch (node.type) {\n case \"decl\": {\n // Handle CSS property declaration (e.g., color: red;)\n const value = node.value;\n if (!isSafeDecl(node.prop, value)) return \"\";\n // node.important is absent; ignore\n if (node.prop.startsWith(\"--\")) {\n // Handle CSS custom property (e.g., --primary-color: #007bff;)\n if (minify) {\n const css = `${node.prop}: ${value}${importantString};`;\n // console.log(\"[astToCss] decl custom property minify\", css);\n return css;\n } else {\n const css = `${indent}${node.prop}: ${value}${importantString};`;\n // console.log(\"[astToCss] decl custom property pretty\", css);\n return css;\n }\n } else {\n const localIndent = minify ? \"\" : indent;\n const css = `${localIndent}${node.prop}: ${value}${importantString};`;\n return css;\n }\n }\n case \"rule\": {\n // Handle nested rule (e.g., .parent .child { ... })\n // \n // baseSelector handling logic:\n // 1. If baseSelector exists: combine to form \".parent .child\"\n // 2. If no baseSelector: keep as standalone \".child\"\n // 3. Replace '&' with baseSelector\n // 4. Pseudo selectors (e.g., :hover) append after baseSelector\n let selector = node.selector;\n \n if (baseSelector) {\n // When baseSelector exists: create nested rule\n const escBase = \".\" + escapeClassName(baseSelector); // Convert baseSelector to class form\n \n if (selector && selector.includes(\"&\")) {\n // Replace '&' with baseSelector\n // Example: \"&:hover\" → \".parent:hover\"\n selector = selector.replace(/&/g, escBase);\n } else if (!selector.startsWith(escBase)) {\n // If it does not start with baseSelector: prepend it\n selector = selector\n .split(\",\") // Handle multiple selectors separated by comma\n .map((sel) => {\n sel = sel.trim();\n \n if (sel.startsWith(\":\") || sel.startsWith(\"::\")) {\n // Pseudo selector: append directly after baseSelector\n // Example: \":hover\" → \".parent:hover\"\n return escBase + sel;\n } else {\n // Normal selector: separate with space from baseSelector\n // Example: \".child\" → \".parent .child\"\n return escBase + (sel.startsWith(\".\") ? \"\" : \" \") + sel;\n }\n })\n .join(\", \");\n }\n }\n \n if (!isSafePrelude(selector)) return \"\";\n // Create CSS rule\n if (minify) {\n const css = `${indent}${selector}{${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] rule minify\", css);\n return css;\n } else {\n const css = `${indent}${selector} {\\n${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] rule pretty\", css);\n return css;\n }\n }\n case \"style-rule\": {\n // Handle style-rule: top-level rule with complete selector\n // \n // baseSelector handling:\n // - Currently: pass baseSelector as-is\n // - Caveat: nested rules may not handle baseSelector correctly\n // - Example: .bg-white/60 { .nested { ... } } → .bg-white/60 .nested { ... }\n if (!isSafePrelude(node.selector)) return \"\";\n if (minify) {\n const css = `${indent}${node.selector} {${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] style-rule minify\", css);\n return css;\n } else {\n const css = `${indent}${node.selector} {\\n${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] style-rule pretty\", css, JSON.stringify(node, null, 2));\n return css;\n }\n }\n case \"at-rule\": {\n // Handle at-rule: @media, @supports, etc.\n // \n // baseSelector handling:\n // - Pass baseSelector to inner nodes of the at-rule\n // - Ensure nested rules get correct selectors\n // - Example: @media (min-width: 768px) { .parent .child { ... } }\n if (!isSafePrelude(node.name) || !isSafePrelude(node.params)) return \"\";\n if (minify) {\n const css = `${indent}@${node.name} ${node.params}{${astToCss(\n node.nodes, // Recursively process inner nodes of the at-rule\n baseSelector, // Always propagate baseSelector so '&' resolves inside at-rules\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] at-rule minify\", css);\n return css;\n } else {\n const css = `${indent}@${node.name} ${node.params} {\\n${astToCss(\n node.nodes, // Recursively process inner nodes of the at-rule\n baseSelector, // Always propagate baseSelector so '&' resolves inside at-rules\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] at-rule pretty\", css);\n return css;\n }\n }\n case \"comment\":\n // Handle CSS comments (removed in minify mode)\n return minify ? \"\" : `${indent}/* ${node.text} */`;\n case \"raw\":\n // Handle raw CSS code (output as-is)\n return `${indent}${node.value}`;\n default:\n debugWarn('[astToCss] Unknown node type:', node);\n return \"\";\n }\n })\n .filter(Boolean) // Remove empty strings\n .join(minify ? \"\" : \"\\n\"); // Join nodes (minify: no whitespace, pretty: newlines)\n\n // Add trailing newline for consistency with expected format\n const finalResult = result + (minify ? \"\" : \"\\n\");\n \n // Debug logging for empty result\n if (!finalResult || finalResult.trim() === '') {\n debugWarn('[astToCss] Empty result generated:', { \n ast, \n baseSelector, \n minify, \n result, \n finalResult,\n dedupedAst \n });\n }\n \n return finalResult;\n}\n\nfunction rootToCss(nodes: AstNode[], opts?: { minify?: boolean }): string {\n const minify = opts?.minify === true;\n const result = nodes\n .map((node) => {\n const list: string[] = [];\n\n if (node.type === \"decl\") {\n if (isSafeDecl(node.prop, node.value)) {\n list.push(minify ? `${node.prop}:${node.value};` : `${node.prop}: ${node.value};`);\n }\n } else if (node.type === \"at-rule\" && isSafePrelude(node.name) && isSafePrelude(node.params)) {\n if (minify) {\n const body = node.nodes\n .filter((child) => child.type === \"decl\" && isSafeDecl(child.prop, child.value))\n .map((child) => child.type === \"decl\" ? `${child.prop}:${child.value};` : \"\")\n .join(\"\");\n list.push(`@${node.name} ${node.params}{${body}}`);\n } else {\n list.push(`@${node.name} ${node.params} {\n${node.nodes.map((node) => {\n if (node.type === \"decl\" && isSafeDecl(node.prop, node.value)) {\n return `\\t${node.prop}: ${node.value};`;\n }\n})\n.join(\"\\n\")}\n}`\n );\n }\n }\n\n return list.join(minify ? \"\" : \"\\n\");\n })\n .join(minify ? \"\" : \"\\n\");\n\n return result;\n}\n\nexport { astToCss, rootToCss };\n","// Collection of converters from theme categories to CSS variables (v4 style)\n// Each function takes a category theme object and returns Record<string, string>\n// Namespace/naming rules aligned with v4\n\nimport type { Context, Theme } from './context';\nimport { isStructureSafeValue, hasCommentDelimiter, hasHtmlEndTagOpener } from './parser';\n\n// Global CSS variable prefix helper\nlet CSS_VAR_PREFIX = '--bcss-';\n\nfunction normalizePrefix(prefix: string): string {\n let p = prefix.trim();\n if (!p.startsWith('--')) p = `--${p}`;\n if (!p.endsWith('-')) p = `${p}-`;\n return p;\n}\n\nexport function setVarPrefix(prefix: string | undefined): void {\n if (typeof prefix !== 'string' || prefix.trim() === '') {\n CSS_VAR_PREFIX = '--bcss-';\n return;\n }\n CSS_VAR_PREFIX = normalizePrefix(prefix);\n}\n\nexport function getVarName(key: string, ctx?: Context): string {\n const configured = ctx?.config('cssVarPrefix');\n const prefix = typeof configured === 'string' && configured.trim()\n ? normalizePrefix(configured)\n : ctx ? '--bcss-' : CSS_VAR_PREFIX;\n return `${prefix}${key}`;\n}\n\n// Aliases for brevity\nexport const varName = getVarName;\nexport function v(key: string, ctx?: Context): string { return getVarName(key, ctx); }\n\nfunction escapeKey(key: string): string {\n return key.replace('.', '\\\\.');\n}\n\n/**\n * colors: { blue: { 500: '#123456' }, red: { 500: '#ff0000' } }\n * → { '--color-blue-500': '#123456', '--color-red-500': '#ff0000' }\n */\nexport function colorsToCssVars(colors?: Record<string, unknown>): Record<string, string> {\n if (!colors) return {};\n const result: Record<string, string> = {};\n function walk(obj: Record<string, unknown>, prefix: string[] = []) {\n for (const key in obj) {\n const value = obj[key] as unknown;\n if (typeof value === 'object' && value !== null) {\n walk(value as Record<string, unknown>, [...prefix, key]);\n } else {\n const varName = '--color-' + [...prefix, key].join('-');\n result[varName] = value as string;\n }\n }\n }\n walk(colors);\n return result;\n}\n\n/**\n * boxShadow: { lg: '0 10px 15px ...', ... }\n * → { '--shadow-lg': '...' }\n */\nexport function boxShadowToCssVars(boxShadow?: Record<string, unknown>): Record<string, string> {\n if (!boxShadow) return {};\n const result: Record<string, string> = {};\n for (const key in boxShadow) {\n result[`--shadow-${key}`] = boxShadow[key] as string;\n }\n return result;\n}\n\n/**\n * fontSize: { xs: ['0.75rem', '1rem'], ... }\n * → { '--text-xs': '0.75rem', '--text-xs--line-height': '1rem' }\n */\nexport function fontSizeToCssVars(fontSize?: Record<string, unknown>): Record<string, string> {\n if (!fontSize) return {};\n const result: Record<string, string> = {};\n for (const key in fontSize) {\n const value = fontSize[key] as unknown;\n if (Array.isArray(value)) {\n result[`--text-${key}`] = value[0] as string;\n if (value[1]) result[`--text-${key}--line-height`] = value[1];\n } else {\n result[`--text-${key}`] = value as string;\n }\n }\n // console.log('[fontSizeToCssVars] result', result);\n return result;\n}\n\n/**\n * fontWeight: { normal: '400', ... }\n * → { '--font-weight-normal': '400' }\n */\nexport function fontWeightToCssVars(fontWeight?: Record<string, unknown>): Record<string, string> {\n if (!fontWeight) return {};\n const result: Record<string, string> = {};\n for (const key in fontWeight) {\n result[`--font-weight-${key}`] = fontWeight[key] as string;\n }\n return result;\n}\n\n/**\n * fontFamily: { sans: ['ui-sans-serif', ...], ... }\n * → { '--font-sans-0': 'ui-sans-serif', ... }\n */\nexport function fontFamilyToCssVars(fontFamily?: Record<string, unknown>): Record<string, string> {\n if (!fontFamily) return {};\n const result: Record<string, string> = {};\n for (const key in fontFamily) {\n const value = fontFamily[key] as unknown;\n if (Array.isArray(value)) {\n result[`--font-${key}`] = value.join(', ');\n } else {\n result[`--font-${key}`] = value as string;\n }\n }\n return result;\n}\n\n/**\n * letterSpacing: { tight: '0.05em', ... }\n * → { '--letter-spacing-tight': '0.05em' }\n */\nexport function letterSpacingToCssVars(letterSpacing?: Record<string, unknown>): Record<string, string> {\n if (!letterSpacing) return {};\n const result: Record<string, string> = {};\n for (const key in letterSpacing) {\n result[`--letter-spacing-${key}`] = letterSpacing[key] as string;\n }\n return result;\n}\n\n/**\n * spacing: { 0: '0px', 1: '0.25rem', ... }\n * → { '--spacing-0': '0px', '--spacing-1': '0.25rem', ... }\n */\nexport function spacingToCssVars(spacing?: Record<string, unknown>): Record<string, string> {\n if (!spacing) return {};\n const result: Record<string, string> = {};\n for (const key in spacing) {\n result[`--spacing-${escapeKey(key)}`] = spacing[key] as string;\n }\n return result;\n}\n\n/**\n * borderRadius: { xl: '0.75rem', ... }\n * → { '--radius-xl': '0.75rem' }\n */\nexport function borderRadiusToCssVars(borderRadius?: Record<string, unknown>): Record<string, string> {\n if (!borderRadius) return {};\n const result: Record<string, string> = {};\n for (const key in borderRadius) {\n result[`--radius-${escapeKey(key)}`] = borderRadius[key] as string;\n }\n return result;\n}\n\n/**\n * zIndex: { 10: '10', ... }\n * → { '--z-10': '10' }\n */\nexport function zIndexToCssVars(zIndex?: Record<string, unknown>): Record<string, string> {\n if (!zIndex) return {};\n const result: Record<string, string> = {};\n for (const key in zIndex) {\n result[`--z-${escapeKey(key)}`] = String(zIndex[key] as number);\n }\n return result;\n}\n\n/**\n * opacity: { 50: '0.5', ... }\n * → { '--opacity-50': '0.5' }\n */\nexport function opacityToCssVars(opacity?: Record<string, unknown>): Record<string, string> {\n if (!opacity) return {};\n const result: Record<string, string> = {};\n for (const key in opacity) {\n result[`--opacity-${escapeKey(key)}`] = String(opacity[key] as number);\n }\n return result;\n}\n\n/**\n * animations: { spin: 'spin 1s linear infinite', ... }\n * → { '--animate-spin': 'spin 1s linear infinite' }\n */\nexport function animationToCssVars(animations?: Record<string, unknown>): Record<string, string> {\n if (!animations) return {};\n const result: Record<string, string> = {};\n for (const key in animations) {\n result[`--animate-${escapeKey(key)}`] = animations[key] as string;\n }\n return result;\n}\n\n/**\n * keyframes: { spin: { 'to': { transform: 'rotate(360deg)' } }, ... }\n * → Requires separate @keyframes block generation (variable conversion omitted here)\n */\nexport function keyframesToCss(keyframes?: Record<string, unknown>): string {\n if (!keyframes) return '';\n let css = '';\n for (const name in keyframes) {\n const frames = keyframes[name] as unknown;\n css += `@keyframes ${name} {\\n`;\n for (const step in frames as Record<string, unknown>) {\n css += ` ${step} {`;\n const props = (frames as Record<string, unknown>)[step] as Record<string, unknown>;\n for (const prop in props) {\n css += ` ${prop}: ${props[prop] as string};`;\n }\n css += ' }\\n';\n }\n css += '}\\n';\n }\n return css;\n}\n\nconst COMMENT_OR_BLOCK = /\\/\\*|\\*\\/|[{};]|<\\//; // #323: also a markup end-tag opener\n\n/** #274: one `@keyframes` block in Tailwind's layout, or '' when a name/step/declaration could break out of it (#273). */\nexport function keyframesBlock(name: string, frames: unknown): string {\n if (!name || COMMENT_OR_BLOCK.test(name) || /\\s/.test(name) || !frames || typeof frames !== 'object') return '';\n let body = '';\n for (const [step, props] of Object.entries(frames as Record<string, unknown>)) {\n if (COMMENT_OR_BLOCK.test(step) || !props || typeof props !== 'object') return '';\n let decls = '';\n for (const [prop, value] of Object.entries(props as Record<string, unknown>)) {\n const v = String(value);\n if (COMMENT_OR_BLOCK.test(prop) || COMMENT_OR_BLOCK.test(v)) return '';\n decls += ` ${prop}: ${v};\\n`;\n }\n body += ` ${step} {\\n${decls} }\\n`;\n }\n return `@keyframes ${name} {\\n${body}}`;\n}\n\n/**\n * #274: the `@keyframes` blocks generated CSS needs: every theme keyframes name that an `animation` /\n * `animation-name` declaration mentions, directly or through a theme `var(--animate-*)`.\n */\nexport function referencedKeyframes(css: string, ctx: Context): string[] {\n if (!css.includes('animation')) return [];\n const all = ctx.theme('keyframes') as Record<string, unknown> | undefined;\n if (!all || typeof all !== 'object') return [];\n const names = new Set<string>();\n for (const m of css.matchAll(/(?:^|[\\s;{])animation(?:-name)?\\s*:\\s*([^;}]+)/g)) {\n const value = m[1].replace(/var\\(--animate-([\\w-]+)\\)/g, (whole, key: string) => {\n const v = ctx.theme('animations', key) ?? ctx.theme('animation', key);\n return typeof v === 'string' ? v : whole;\n });\n for (const word of value.split(/[\\s,()]+/)) {\n if (word && Object.prototype.hasOwnProperty.call(all, word)) names.add(word);\n }\n }\n return [...names].map((n) => keyframesBlock(n, all[n])).filter(Boolean);\n}\n\n/**\n * transition: { duration: '150ms', ... }\n * → { '--transition-duration': '150ms' }\n */\nexport function transitionTimingFunctionToCssVars(transition: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in transition) {\n\n if (key === 'DEFAULT') {\n result[`--default-transition-timing-function`] = transition[key];\n } else {\n result[`--transition-timing-function-${escapeKey(key)}`] = transition[key];\n // Tailwind v4 names: --ease-in / --ease-out / --ease-in-out (ease-linear uses a literal `linear`).\n if (key !== 'linear') result[`--ease-${escapeKey(key)}`] = transition[key];\n }\n }\n return result;\n}\n\n/**\n * transitionDuration: { DEFAULT: '150ms', ... }\n * → { '--default-transition-duration': '150ms' }\n */\nexport function transitionDurationToCssVars(transitionDuration: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in transitionDuration) {\n if (key === 'DEFAULT') {\n result[`--default-transition-duration`] = transitionDuration[key];\n } else {\n result[`--transition-duration-${escapeKey(key)}`] = transitionDuration[key];\n }\n }\n return result;\n}\n\n\n/**\n * transitionDelay: { DEFAULT: '0ms', ... }\n * → { '--default-transition-delay': '0ms' }\n */\nexport function transitionDelayToCssVars(transitionDelay: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const key in transitionDelay) {\n if (key === 'DEFAULT') {\n result[`--default-transition-delay`] = transitionDelay[key];\n } else {\n result[`--transition-delay-${escapeKey(key)}`] = transitionDelay[key];\n }\n } \n return result;\n}\n\n/**\n * blur: { DEFAULT: '0px', ... }\n * → { '--default-blur': '0px' }\n */\nexport function blurToCssVars(blur: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in blur) {\n if (key === 'DEFAULT') {\n result[`--default-blur`] = blur[key];\n } else {\n result[`--blur-${escapeKey(key)}`] = blur[key];\n }\n }\n return result;\n}\n\n/**\n * container: { 1: '1rem', ... }\n * → { '--container-1': '1rem' }\n */\nexport function containerToCssVars(container: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in container) {\n result[`--container-${escapeKey(key)}`] = container[key];\n }\n return result;\n}\n\n/**\n * themeToCssVarsAll: merge CSS variables from major theme categories\n */\nexport function themeToCssVarsAll(theme: Theme): Record<string, string> {\n return {\n ...colorsToCssVars(theme.colors! as Record<string, unknown>),\n ...boxShadowToCssVars(theme.boxShadow! as Record<string, unknown>),\n ...fontSizeToCssVars(theme.fontSize! as Record<string, unknown>),\n ...fontWeightToCssVars(theme.fontWeight! as Record<string, unknown>),\n ...fontFamilyToCssVars(theme.fontFamily! as Record<string, unknown>),\n ...letterSpacingToCssVars(theme.letterSpacing! as Record<string, unknown>),\n '--spacing': (theme.spacing! as Record<string, unknown>)['1'] as string,\n ...spacingToCssVars(theme.spacing! as Record<string, unknown>),\n ...containerToCssVars(theme.container! as Record<string, string>),\n ...borderRadiusToCssVars(theme.borderRadius! as Record<string, unknown>),\n ...zIndexToCssVars(theme.zIndex! as Record<string, unknown>),\n ...opacityToCssVars(theme.opacity! as Record<string, unknown>),\n ...animationToCssVars({ ...(theme.animations as Record<string, unknown>), ...(theme.animation as Record<string, unknown>) }),\n ...transitionTimingFunctionToCssVars(theme.transitionTimingFunction! as Record<string, string>),\n ...transitionDurationToCssVars(theme.transitionDuration! as Record<string, string>),\n ...transitionDelayToCssVars(theme.transitionDelay! as Record<string, string>),\n ...blurToCssVars(theme.blur! as Record<string, string>),\n ...Object.fromEntries(Object.entries((theme.textShadow ?? {}) as Record<string, string>).map(([k, v]) => [`--text-shadow-${escapeKey(k)}`, v])),\n ...Object.fromEntries(Object.entries((theme.dropShadow ?? {}) as Record<string, string>).map(([k, v]) => [`--drop-shadow-${escapeKey(k)}`, v])),\n ...Object.fromEntries(Object.entries((theme.aspect ?? {}) as Record<string, string>).map(([k, v]) => [`--aspect-${escapeKey(k)}`, v])),\n // keyframes handled separately\n };\n}\n\n/**\n * #260: a theme value that points at its own variable (`--color-brand-600: var(--color-brand-600)`,\n * optionally with a fallback) is cyclic. Emitting it on :root would override the site's own definition\n * with an invalid value, so the root var is skipped; utilities still reference the var.\n */\nexport function isSelfReferencingVar(name: string, value: unknown): boolean {\n if (typeof value !== 'string') return false;\n const m = /^var\\(\\s*(--[\\w-]+)\\s*(?:,[\\s\\S]*)?\\)$/.exec(value.trim());\n return !!m && m[1] === name.trim();\n}\n\n/**\n * toCssVarsBlock: convert Record<string, string> → :root { ... } CSS block string\n */\n// #323: a custom-property name is `--` plus word characters and hyphens; `\\.` is the only escape the\n// theme converters produce (fractional spacing keys).\nconst SAFE_VAR_NAME = /^--(?:[\\w-]|\\\\\\.)+$/;\n\n/**\n * #323: true when one theme variable can be printed as `name: value;` inside the :root block without\n * changing the block's structure. Theme config may come from an untrusted source, so a name must be a plain\n * custom-property ident and a value must be structure-safe and comment-free.\n */\nexport function isSafeThemeVar(name: unknown, value: unknown): boolean {\n if (typeof name !== 'string' || !SAFE_VAR_NAME.test(name) || hasHtmlEndTagOpener(name)) return false;\n if (typeof value !== 'string' && typeof value !== 'number') return false;\n const v = String(value);\n return v.trim() !== '' && isStructureSafeValue(v) && !hasCommentDelimiter(v) && !hasHtmlEndTagOpener(v);\n}\n\nexport function toCssVarsBlock(vars: Record<string, string>, extra: string = ''): string {\n return ':root,:host {\\n' + Object.entries(vars).filter(([k, v]) => isSafeThemeVar(k, v) && !isSelfReferencingVar(k, v)).map(([k, v]) => ` ${k}: ${v};`).join('\\n') + '\\n}\\n' + extra + '\\n';\n}\n\n// Presets write their internal composite variables as `--baro-*` (--baro-shadow, --baro-ring-shadow,\n// --baro-translate-x, --baro-border-style, ...). A configured `cssVarPrefix` renames them in the generated\n// AST, so a runtime next to a Tailwind build can set `cssVarPrefix: 'tw'` and compose with the build's\n// `--tw-*` composites (#222). Unset, empty or 'baro' leaves the output untouched.\nconst BARO_VAR = /--baro-/g;\nconst PREFIXED_KEYS = new Set(['prop', 'value', 'params', 'selector', 'nodes', 'items']);\n\nexport function applyVarPrefix<T>(ast: T, ctx?: Context): T {\n const configured = ctx?.config('cssVarPrefix');\n if (typeof configured !== 'string' || !configured.trim()) return ast;\n const prefix = normalizePrefix(configured);\n if (prefix === '--baro-') return ast;\n const walk = (node: unknown): unknown => {\n if (typeof node === 'string') return node.includes('--baro-') ? node.replace(BARO_VAR, prefix) : node;\n if (Array.isArray(node)) return node.map(walk);\n if (!node || typeof node !== 'object') return node;\n const out: Record<string, unknown> = {};\n for (const [k, val] of Object.entries(node)) out[k] = PREFIXED_KEYS.has(k) ? walk(val) : val;\n return out;\n };\n return walk(ast) as T;\n}\n","import { debugLog, debugWarn } from \"../utils/debug\";\nimport { HasItems, HasName, HasParams, HasSelector, type AstNode, type HasNodes } from \"./ast\";\nimport { parseClassName } from \"./parser\";\nimport { astCache, parseResultCache } from \"../utils/cache\";\nimport { getUtility, getModifier, arbitraryPropertyRegistration } from \"./registry\";\nimport { Context } from \"./context\";\nimport { astToCss, rootToCss } from \"./astToCss\";\nimport { clearAllCaches } from \"../utils/cache\";\nimport { clearContextCaches, getContextState } from './contextState';\nimport { applyVarPrefix, referencedKeyframes } from \"./cssVars\";\n\n// Failure cache for invalid class names\nconst failureCache = new Set<string>();\n\n/**\n * decl-to-root path collection function (reused in normalizeAstOrder, etc.)\n */\nexport type PathNode = Partial<AstNode>;\nexport type DeclPath = PathNode[];\n\n/**\n * collectDeclPaths\n * Collects all paths from AST tree to decl(leaf) (including variant chains).\n * - Input: AST node array\n * - Output: decl-to-root path(variant chain) array\n * - Usage: Used for path extraction for AST optimization/merging in optimizeAst, declPathToAst, etc.\n *\n * @param nodes AstNode[] - AST tree\n * @param path PathNode[] - Recursive use (initial value omitted)\n * @returns DeclPath[] - Array of paths to decl (variant chains)\n */\nexport function collectDeclPaths(\n nodes: AstNode[] = [],\n path: PathNode[] = []\n): DeclPath[] {\n let result: DeclPath[] = [];\n for (const node of nodes) {\n const curr = { ...node} as HasNodes;\n delete curr.nodes;\n\n const nodes = (node as HasNodes).nodes;\n if (node.type === \"decl\") {\n result.push([...path, curr]);\n } else if (nodes && nodes.length > 0) {\n result = result.concat(\n collectDeclPaths(nodes, [...path, curr])\n );\n }\n }\n return result;\n}\n\n// Sort criteria: at-rule > style-rule > rule > decl, depth first, sibling order preserved\nfunction getPriority(type: string): number {\n if (type === \"at-root\") return -1;\n if (type === \"at-rule\") return 0;\n if (type === \"style-rule\") return 10;\n if (type === \"rule\") return 20;\n return 30; // decl\n}\n\nconst sourcePriority: Record<string, number> = {\n media: 0, // @media\n supports: 1, // @supports\n container: 2, // @container\n responsive: 10, // sm:, md: etc.\n group: 20, // .group:hover &\n peer: 30, // .peer:focus ~ &\n dark: 40, // dark:\n universal: 50, // :is(), :where()\n data: 60, // [data-state=...]\n aria: 70, // [aria-pressed=...]\n attribute: 80, // [type=...]\n pseudo: 90, // :hover, :focus\n base: 100, // &\n starting: 110, // (root)\n};\n\nfunction getRulePriority(rule: Partial<AstNode>): number {\n return sourcePriority[rule.source || \"base\"] || 100;\n}\n\nconst mergeSelectorsBySource = (source: string, nodes: Partial<AstNode>[]) => {\n if (source === \"pseudo\") {\n // Inside → outside (reduce)\n return nodes.reduce((acc, sel) => {\n const selector = (sel as HasSelector).selector as string;\n if (acc === \"\") return selector;\n if (selector?.includes(\"&\")) return selector.replace(/&/, acc);\n return selector + \" \" + acc;\n }, \"\");\n } else {\n // Outside → inside (reduceRight)\n return nodes.reduceRight((acc, sel) => {\n const selector = (sel as HasSelector).selector as string;\n if (acc === \"\") return selector;\n if (selector?.includes(\"&\")) return selector.replace(/&/, acc);\n return selector + \" \" + acc;\n }, \"\");\n }\n};\n\n/**\n * declPathToAst\n * Converts decl-to-root path(variant chain) to actual nested AST.\n * - Input: DeclPath(variant chain)\n * - Output: Nested AstNode[]\n * - Consecutive same variants (same key) are merged, nested in outside→inside order\n *\n * @param declPath DeclPath\n * @returns AstNode[]\n */\nexport function declPathToAst(declPath: DeclPath): AstNode[] {\n if (!declPath || declPath.length === 0) return [];\n // Log type/selector/source for each node in declPath\n // 1. Separate decl (leaf) and variant chain\n const variants = declPath.slice(0, -1);\n const decl = declPath[declPath.length - 1];\n\n // 2. Keep existing sort/merge (hoist) logic\n const sortedVariants = [...variants].sort(\n (a, b) => getPriority(a.type!) - getPriority(b.type!)\n );\n\n // Add default rule handling for decl\n // 1. If first element is decl, add rule('&', [decl])\n // 2. If rule lacks '&' while child is decl, add current rule and rule('&', [decl])\n if (sortedVariants.length === 0) {\n if (decl.type === \"decl\") {\n // If first element is decl, add rule('&', [decl])\n sortedVariants.push({\n type: \"rule\",\n selector: \"&\",\n source: \"base\",\n });\n }\n } else {\n const last = sortedVariants[sortedVariants.length - 1];\n if (\n (last.type == \"at-rule\" && last.name !== \"property\") ||\n last.type == \"style-rule\" ||\n (last.type === \"rule\" && last.selector?.includes(\"&\") === false)\n ) {\n // console.log(\"[declPathToAst] add rule\", last);\n sortedVariants.push({\n type: \"rule\",\n selector: \"&\",\n source: \"base\",\n });\n }\n }\n\n const mergedVariants: typeof sortedVariants = [];\n for (const v of sortedVariants) {\n if (mergedVariants.length === 0) {\n mergedVariants.push(v);\n } else {\n const prev = mergedVariants[mergedVariants.length - 1];\n const isSame =\n v.type === prev.type &&\n ((v.type === \"at-rule\" &&\n prev.type === \"at-rule\" &&\n v.name === prev.name &&\n v.params === prev.params) ||\n ((v.type === \"rule\" || v.type === \"style-rule\") &&\n v.selector === (prev as HasSelector).selector));\n if (!isSame) {\n mergedVariants.push(v);\n }\n // else: skip(merge)\n }\n }\n // 3. Gather only rule nodes (consecutive rules only)\n const ruleSelectors: Partial<AstNode>[] = [];\n const nonRuleVariants: Partial<AstNode>[] = [];\n for (const v of mergedVariants) {\n if (v.type === \"rule\") ruleSelectors.push(v);\n else nonRuleVariants.push(v);\n }\n\n // 5. Compose selector and create a single rule\n let node: Partial<AstNode> = { ...decl };\n const sortedRuleSelectors = [...ruleSelectors].sort(\n (a, b) => getRulePriority(a) - getRulePriority(b)\n );\n if (sortedRuleSelectors.length > 0) {\n const grouped = sortedRuleSelectors.reduce((acc, rule) => {\n const key = rule.source || \"base\";\n if (!acc[key]) acc[key] = [];\n acc[key].push(rule);\n return acc;\n }, {} as Record<string, Partial<AstNode>[]>);\n // Detailed grouped log\n\n // 1. Sort by sourcePriority\n const mergedBySource = Object.entries(grouped)\n .sort(\n ([a], [b]) => (sourcePriority[a] ?? 999) - (sourcePriority[b] ?? 999)\n )\n .map(([source, nodes]) => {\n const merged = mergeSelectorsBySource(source, nodes);\n return merged;\n });\n\n // 2. Reduce from outside→inside (pseudo is always innermost)\n let acc = \"\";\n for (let i = 0; i < mergedBySource.length; i++) {\n const sel = mergedBySource[i];\n if (acc === \"\") acc = sel;\n else if (sel.includes(\"&\")) acc = sel.replace(/&/, acc);\n else acc = sel + \" \" + acc;\n }\n const finalSelector = acc;\n node = { type: \"rule\", selector: finalSelector, nodes: [node as AstNode] };\n }\n\n // 6. Nest remaining variants (e.g., at-rule) outside\n for (let i = nonRuleVariants.length - 1; i >= 0; i--) {\n node = { ...nonRuleVariants[i], nodes: [node as AstNode] };\n }\n\n return [node as AstNode];\n}\n\n/**\n * extractAtRootNodes\n * Extracts at-root nodes from AST tree and returns them as an array.\n * - Input: AstNode[]\n * - Output: AstNode[]\n * - Usage: Used in parseClassToAst for at-root node extraction\n *\n * @param nodes AstNode[]\n * @param parent AstNode\n * @param atRootNodes AstNode[]\n */\nfunction extractAtRootNodes(\n nodes: AstNode[],\n parent?: AstNode,\n atRootNodes: AstNode[] = []\n) {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === \"at-root\") {\n atRootNodes.push(node);\n delete nodes[i];\n } else if (node.type === \"rule\" || node.type === \"style-rule\" || node.type === \"at-rule\") {\n // at-rule too: a media/container variant (hover:, md:, dark: …) wraps the utility's nodes in an at-rule, and an\n // at-root @property left inside it would render as an empty @media block instead of being hoisted.\n extractAtRootNodes((node as HasNodes).nodes ?? [], node, atRootNodes);\n }\n }\n\n if (parent) {\n (parent as HasNodes).nodes = nodes.filter(Boolean) as AstNode[];\n }\n}\n\n/**\n * parseClassToAst\n * Parses className(including variant chain) to generate AST tree.\n * - Input: className(string), Context\n * - Output: AstNode[] (multiple roots possible for variant wrapping path)\n * - Perfectly supports variant wrapping structure (Cartesian product, nesting, siblings, etc.)\n * - Accumulates wrappers in wrappers and applies them from right to left.\n * - Can return multiple root asts.\n *\n * @param fullClassName string (e.g., 'sm:dark:hover:bg-red-500')\n * @param ctx Context\n * @returns AstNode[]\n *\n * @example\n * const ast = parseClassToAst('sm:dark:hover:bg-red-500', ctx);\n * // ast is an AST tree with sm, dark, hover variants nested\n */\nexport function parseClassToAst(\n fullClassName: string,\n ctx: Context\n): AstNode[] {\n const state = getContextState(ctx);\n const failures = state?.failures || failureCache;\n const cache = state?.astCache || astCache;\n // Check failure cache first\n if (failures.has(fullClassName)) {\n return [];\n }\n\n // Check AST cache first\n if (cache.has(fullClassName)) {\n return cache.get(fullClassName)!;\n }\n\n const { modifiers, utility } = parseClassName(fullClassName, ctx);\n\n // console.log('[parseClassToAst] modifiers', modifiers, utility);\n\n if (!utility) {\n debugWarn(`[BAROCSS] Invalid class name format: \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n const utilRegs = utility.property ? [arbitraryPropertyRegistration] : getUtility(ctx).filter((u) => {\n const fullClassName = utility.value\n ? `${utility.prefix}-${utility.value}`\n : utility.prefix;\n return u.match(fullClassName);\n });\n // console.log('[parseClassToAst] utilReg', utilReg);\n if (utilRegs.length === 0) {\n const utilityName = utility.value\n ? `${utility.prefix}-${utility.value}`\n : utility.prefix;\n debugWarn(`[BAROCSS] Unknown utility class: \"${utilityName}\" in \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n let value = utility.value;\n if (utility.negative && value) value = \"-\" + value;\n // console.log('[parseClassToAst] value', value, utility);\n // Several registrations can match one class (e.g. functional `text-*` and static `text-balance`, or\n // `transform` for custom properties and for arbitrary values). The first one that produces a rule wins;\n // a registration that rejects the value (empty result) falls through to the next (#213).\n let ast: AstNode[] = [];\n for (const utilReg of utilRegs) {\n ast = utilReg.handler(value!, ctx, utility, utilReg) || [];\n if (ast.length > 0) break;\n }\n\n // console.log('[parseClassToAst] ast', ast);\n\n const wrappers = [];\n const selector = \"&\";\n\n for (let i = 0; i < modifiers.length; i++) {\n const variant = modifiers[i];\n\n const plugin = getModifier(ctx).find((p) => p.match(variant.type, ctx));\n\n if (!plugin) {\n debugWarn(`[BAROCSS] Unknown variant: \"${variant.type}\" in \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n if (plugin.astHandler) {\n ast = plugin.astHandler(ast, variant, ctx, modifiers, i);\n }\n if (plugin.wrap) {\n const items = plugin.wrap(variant, ctx);\n wrappers.push({\n type: \"wrap\",\n items: items,\n });\n }\n if (plugin.modifySelector) {\n const result = plugin.modifySelector({\n selector,\n fullClassName,\n mod: variant,\n context: ctx,\n variantChain: modifiers,\n index: i,\n });\n // A wrapped identity selector adds no rule. Media-only modifiers use it.\n if (plugin.wrap && (\n result === '&' ||\n (typeof result === 'object' && !Array.isArray(result) && result.selector === '&') ||\n (Array.isArray(result) && result.length === 1 && result[0].selector === '&')\n )) continue;\n if (typeof result === \"string\" && result.includes(\"&\")) {\n wrappers.push({ type: \"rule\", selector: result });\n } else if (typeof result === \"object\" && !Array.isArray(result) && result.selector) {\n const wrappingType = result.wrappingType || \"rule\";\n wrappers.push({\n type: wrappingType,\n selector: result.selector,\n flatten: result.flatten,\n source: result.source,\n });\n } else if (Array.isArray(result)) {\n wrappers.push({\n type: \"wrap\",\n items: result.map((r) => ({\n type: r.wrappingType || \"rule\",\n selector: r.selector,\n source: r.source,\n flatten: r.flatten,\n })),\n });\n }\n }\n }\n\n // Nest wrappers in N→0 (right→left) order\n for (let i = wrappers.length - 1; i >= 0; i--) {\n const wrap = wrappers[i];\n\n if (wrap.type === \"wrap\") {\n ast = ((wrap as HasItems).items as AstNode[]).map((item) => (\n item.type === 'rule' || item.type === 'style-rule' || item.type === 'at-rule' || item.type === 'at-root'\n ? { ...item, nodes: [...(item.nodes || []), ...ast] }\n : item\n ));\n } else if (wrap.type === \"style-rule\") {\n ast = [\n {\n type: \"style-rule\",\n selector: wrap.selector!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n } else if (wrap.type === \"at-rule\") {\n ast = [\n {\n type: \"at-rule\",\n name: (wrap as HasName).name || \"media\",\n params: (wrap as HasParams).params!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n } else if (wrap.type === \"rule\") {\n ast = [\n {\n type: \"rule\",\n selector: wrap.selector!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n }\n }\n\n // console.log(\"[parseClassToAst] ast\", ast);\n\n // ast 에서 at-root 노드만 추출해서 ast 앞으로 추가\n // ast 내부에서는 at-root 노드를 제거\n // 재귀적으로 실행되어야 함\n const atRootNodes: AstNode[] = [];\n\n extractAtRootNodes(ast, undefined, atRootNodes);\n\n ast = applyVarPrefix([...atRootNodes, ...ast].filter(Boolean), ctx);\n\n // console.log(\"[parseClassToAst] ast\", ast);\n // Cache the result\n cache.set(fullClassName, ast);\n\n return ast;\n}\n\n/**\n * Clear all AST caches (mainly for testing)\n */\nexport function clearAstCache(ctx?: Context): void {\n if (ctx) {\n clearContextCaches(ctx);\n } else {\n clearAllCaches();\n failureCache.clear();\n }\n}\n\n/** Read AST cache statistics for one context, or the legacy global cache. */\nexport function getAstCacheStats(ctx?: Context) {\n return (ctx && getContextState(ctx)?.astCache || astCache).getStats();\n}\n\n/**\n * generateCss\n * Takes multiple classNames and generates CSS for each, joining them.\n * - Input: classList(string), Context, options\n * - Output: string (result of joining multiple CSS blocks)\n * - Processes internally parseClassToAst → optimizeAst → astToCss in sequence\n * - Supports options like dedup, minify\n *\n * @param classList string (e.g., 'bg-red-500 text-lg hover:bg-blue-500')\n * @param ctx Context\n * @param opts { minify?: boolean, dedup?: boolean }\n * @returns string\n *\n * @example\n * const css = generateCss('sm:dark:hover:bg-red-500 sm:focus:bg-blue-500', ctx);\n */\nexport function generateCss(\n classList: string,\n ctx: Context,\n opts?: { minify?: boolean; dedup?: boolean }\n): string {\n const seen = new Set<string>();\n const allAtRootNodes: AstNode[] = [];\n\n const results = classList\n .split(/\\s+/)\n .filter((cls) => {\n if (!cls) return false;\n if (opts?.dedup) {\n if (seen.has(cls)) return false;\n seen.add(cls);\n }\n return true;\n })\n .map((cls) => {\n // #333: a class whose generation throws contributes nothing; the other classes still generate.\n try {\n return generateOne(cls);\n } catch (err) {\n debugWarn(\"[generateCss] class generation failed:\", cls, err);\n return \"\";\n }\n })\n .join(opts?.minify ? \"\" : \"\\n\");\n\n function generateOne(cls: string): string {\n const ast = parseClassToAst(cls, ctx);\n const parsedResult = (getContextState(ctx)?.parseResultCache || parseResultCache).get(cls);\n const cleanAst = optimizeAst(ast);\n\n cleanAst.forEach((node) => {\n if (node.type === \"at-root\") {\n allAtRootNodes.push(...node.nodes);\n }\n });\n\n // If style-rule already has a complete selector, do not pass baseSelector\n const hasStyleRule = cleanAst.some((node) => node.type === \"style-rule\");\n const css = astToCss(cleanAst.filter((node) => node.type !== \"at-root\"), hasStyleRule ? undefined : cls, {\n minify: opts?.minify,\n important: parsedResult?.utility?.important ?? false,\n }); // Conditional baseSelector\n\n const result = css;\n\n // Debug logging for empty CSS\n if (!result || result.trim() === \"\") {\n debugWarn(\"[generateCss] Empty CSS generated for class:\", {\n class: cls,\n ast: cleanAst,\n hasStyleRule,\n css,\n result,\n });\n }\n\n return result;\n }\n\n const rootRules = [...new Set([\n ...allAtRootNodes\n .filter((node) => node.type === \"at-rule\")\n .map((node) => rootToCss([node], { minify: opts?.minify })),\n // #274: the @keyframes the class rules reference, once per sheet.\n ...referencedKeyframes(results, ctx),\n ])];\n const rootDeclarations = [...new Set(allAtRootNodes\n .filter((node) => node.type === \"decl\")\n .map((node) => rootToCss([node], { minify: opts?.minify }))\n .filter((decl) => decl !== \"\"))];\n const rootCss = [\n ...rootRules,\n ...(rootDeclarations.length\n ? [`:root,:host${opts?.minify ? \"\" : \" \"}{${rootDeclarations.join(opts?.minify ? \"\" : \"\\n\")}}`]\n : []),\n ].join(opts?.minify ? \"\" : \"\\n\");\n\n if (allAtRootNodes.length > 0) {\n debugLog(\"[generateCss] All collected atRoot nodes:\", allAtRootNodes);\n }\n\n // Debug logging for final result\n if (!results || results.trim() === \"\") {\n debugWarn(\"[generateCss] Empty final result:\", {\n classList,\n results,\n allAtRootNodes,\n });\n }\n\n return `${rootCss}${rootCss && results ? (opts?.minify ? \"\" : \"\\n\") : \"\"}${results}`;\n}\n\nexport type GenerateCssRulesResult = {\n cls: string;\n ast: AstNode[];\n css: string;\n cssList: string[];\n rootCss: string;\n rootCssList: string[];\n};\n\n/**\n * Returns an array of optimized results for multiple class names with dedup/filter.\n * - Each object: { cls, ast, css }\n * - Supports minify, dedup options\n * - Applies astToCss(cleanAst, cls, opts) per class\n * @param classList string (space-separated)\n * @param ctx Context\n * @param opts { minify?: boolean; dedup?: boolean }\n * @returns Array<{ cls: string; ast: AstNode[]; css: string }>\n */\nexport function generateCssRules(\n classList: string,\n ctx: Context,\n opts?: { minify?: boolean; dedup?: boolean }\n): Array<GenerateCssRulesResult> {\n const seen = new Set<string>();\n return classList\n .split(/\\s+/)\n .filter((cls) => {\n if (!cls) return false;\n if (opts?.dedup) {\n if (seen.has(cls)) return false;\n seen.add(cls);\n }\n return true;\n })\n .map((cls) => {\n // console.log(\"[generateCssRules] cls\", cls);\n const ast = parseClassToAst(cls, ctx);\n const parsedResult = (getContextState(ctx)?.parseResultCache || parseResultCache).get(cls);\n const options = {\n minify: opts?.minify,\n important: parsedResult?.utility?.important ?? false,\n };\n const cleanAst = optimizeAst(ast);\n\n // console.log(\"[generateCssRules] cleanAst\", cleanAst);\n\n const allAtRootNodes: AstNode[] = cleanAst\n .filter(\n (node) => node.type === \"at-root\" && !node.source\n )\n .map((node) => (node as HasNodes).nodes || [])\n .flat();\n const allCleanAst: AstNode[] = cleanAst.filter(\n (node) =>\n node.type !== \"at-root\" ||\n (node.type === \"at-root\" && node.source)\n );\n\n\n const cssList = [];\n for (const node of allCleanAst) {\n if (node.type === \"at-root\") {\n node.nodes.forEach((node) => {\n const css = astToCss([node], \"\", options);\n cssList.push(css);\n });\n } else {\n const css = astToCss([node], cls, options);\n cssList.push(css);\n }\n }\n // console.log('[generateCssRules] css', cls);\n const rootCssList = [];\n for (const node of allAtRootNodes) {\n const css = rootToCss([node]);\n rootCssList.push(css);\n }\n // #274: referenced @keyframes are root-level blocks too (deduped by content by every consumer).\n rootCssList.push(...referencedKeyframes(cssList.join(\"\\n\"), ctx));\n // console.log(\"[generateCssRules] rootCss\", rootCssList, allAtRootNodes);\n return {\n cls,\n ast: allCleanAst,\n css: cssList.join(options.minify ? \"\" : \"\\n\"),\n cssList,\n rootCss: rootCssList.join(options.minify ? \"\" : \"\\n\"),\n rootCssList,\n };\n });\n}\n\n/**\n * mergeAstTreeList\n * Takes a list of declPathToAst results (AstNode[][]), merges same at-rule(name, params) etc., and returns the final AST tree.\n * - Input: AstNode[][] (nested ASTs of multiple decl-to-root paths)\n * @returns AstNode[]\n * - Usage: Used in optimizeAst for final AST merging/optimization\n *\n * @param astList AstNode[][]\n * @returns AstNode[]\n */\nexport function mergeAstTreeList(astList: AstNode[][]): AstNode[] {\n // AstNode[][] → DeclPath[]\n const declPaths: DeclPath[] = astList.map((ast) => {\n // declPathToAst always returns [rootNode]\n const path: AstNode[] = [];\n let node = ast[0];\n while (node) {\n path.push({ ...node, nodes: undefined } as AstNode & HasNodes);\n if ((node as HasNodes).nodes && (node as HasNodes)?.nodes?.length === 1)\n node = (node as HasNodes).nodes?.[0] as AstNode;\n else break;\n }\n return path;\n });\n // Recursive merge\n function merge(declPaths: DeclPath[], depth = 0): AstNode[] {\n if (declPaths.length === 0) return [];\n if (declPaths[0].length === depth + 1) {\n // All decls remain\n return declPaths.map((path) => path[depth]) as AstNode[];\n }\n // Group by variant(type+key) at current depth\n const groupMap = new Map<string, DeclPath[]>();\n for (const path of declPaths) {\n const node = path[depth];\n let key = node.type;\n if (node.type === \"at-rule\") key += \":\" + node.name + \":\" + node.params;\n else if (node.type === \"rule\" || node.type === \"style-rule\")\n key += \":\" + node.selector;\n else key += \":\" + JSON.stringify(node);\n if (!groupMap.has(key!)) groupMap.set(key!, []);\n groupMap.get(key!)!.push(path);\n }\n // Recursive merge for each group\n const result: AstNode[] = [];\n for (const [, group] of groupMap.entries()) {\n const node = group[0][depth];\n const children = merge(group, depth + 1);\n result.push(\n children.length\n ? ({ ...node, nodes: children as AstNode[] } as AstNode & HasNodes)\n : ({ ...node } as AstNode & HasNodes)\n );\n }\n return result;\n }\n const merged = merge(declPaths);\n return merged;\n}\n/**\n * optimizeAst\n * Merges/organizes AST generated by parseClassToAst into an optimized AST tree based on decl-to-root path.\n * - Input: AstNode[] (result of parseClassToAst)\n * - Output: Optimized AST tree (AstNode[])\n * - Uses collectDeclPaths, declPathToAst, mergeAstTreeList internally\n * - Reflects all variant wrapping structures (nesting, siblings, merging, etc.)\n *\n * @param ast AstNode[]\n * @returns AstNode[]\n */\nexport function optimizeAst(ast: AstNode[]): AstNode[] {\n // console.log(\"[optimizeAst] ast\", ast);\n const declPaths = collectDeclPaths(ast);\n // console.log(\"[optimizeAst] declPaths\", declPaths);\n const astList = declPaths.map(declPathToAst);\n // console.log(\"[optimizeAst] astList\", astList);\n const merged = mergeAstTreeList(astList);\n // console.log(\"[optimizeAst] merged\", merged);\n\n return merged;\n}\n","import { debugWarn } from \"../utils/debug\";\nimport { parseClassName } from './parser';\nimport { parseClassToAst, generateCssRules, GenerateCssRulesResult } from './engine';\nimport type { Context } from './context';\nimport { astCache } from '../utils/cache';\nimport { getContextState } from './contextState';\n\n/**\n * Incremental parsing system for efficient class processing\n * \n * This class provides an optimized approach to CSS class processing by:\n * - Tracking processed classes to avoid redundant work\n * - Batching multiple class operations for better performance\n * - Supporting both synchronous and asynchronous processing modes\n * \n * ## Usage Patterns\n * \n * ### Universal Usage (Node.js & Browser)\n * ```typescript\n * const parser = new IncrementalParser(ctx);\n * \n * // Process classes synchronously\n * const results = parser.processClasses(['bg-blue-500', 'text-lg']);\n * \n * // Process single class\n * const result = parser.processClass('bg-red-500');\n * \n * // Get statistics\n * const stats = parser.getStats();\n * ```\n * \n * ### Browser Integration\n * ```typescript\n * const parser = new IncrementalParser(ctx);\n * const BrowserRuntime = new BrowserRuntime();\n * \n * // Process classes and manually inject CSS\n * const results = parser.processClasses(['bg-blue-500', 'text-lg']);\n * results.forEach(result => {\n * if (result.css) {\n * BrowserRuntime.insertRule(result.css);\n * }\n * });\n * \n * // Use with ChangeDetector for automatic DOM monitoring\n * const detector = new ChangeDetector(parser);\n * detector.observe(document.body, { scan: true });\n * ```\n * \n * ## Architecture\n * \n * - **IncrementalParser**: Pure CSS processing (works in Node.js and browser)\n * - **ChangeDetector**: Browser-only DOM monitoring (uses MutationObserver)\n * - **BrowserRuntime**: Browser-only CSS injection (uses DOM APIs)\n */\nexport class IncrementalParser {\n /** Set of class names that have already been processed to avoid duplicates */\n private processedClasses = new Set<string>();\n \n /** BAROCSS context for theme and utility resolution */\n private ctx: Context;\n \n /** Maximum number of classes to process in a single batch */\n private batchSize = 50;\n \n /** Debounce delay for batch processing in milliseconds */\n private debounceMs = 16;\n \n /** Set of classes waiting to be processed */\n private pendingClasses = new Set<string>();\n \n /** Timer for debounced batch processing */\n private batchTimer: number | null = null;\n\n /**\n * Create a new IncrementalParser instance\n * \n * @param ctx - BAROCSS context for theme and utility resolution\n */\n constructor(ctx: Context) {\n this.ctx = ctx;\n }\n\n /**\n * Processes a single CSS class and generates its AST and CSS representation\n * \n * This method performs the complete pipeline for a single class:\n * 1. Checks if the class has already been processed\n * 2. Parses the class name to extract utility information\n * 3. Generates the Abstract Syntax Tree (AST)\n * 4. Converts the AST to CSS rules\n * 5. Marks the class as processed to avoid future duplicates\n * \n * @param className - The CSS class name to process (e.g., 'bg-blue-500')\n * @returns Object containing AST and CSS, or null if processing failed or class was already processed\n */\n processClass(className: string): GenerateCssRulesResult | null {\n // Check if already processed\n if (this.processedClasses.has(className)) {\n // console.log('[IncrementalParser] Class already processed:', className);\n return null; // Already processed\n }\n\n try { \n // Parse class\n const parseResult = parseClassName(className, this.ctx);\n \n if (!parseResult.utility) {\n return null;\n }\n\n // Generate AST\n const ast = parseClassToAst(className, this.ctx);\n\n // console.log('[IncrementalParser] ast', className, ast);\n \n if (ast.length === 0) {\n debugWarn('[IncrementalParser] ast is empty', className);\n return null;\n }\n\n // Generate CSS using the same method as runtime\n const rules = generateCssRules(className, this.ctx, { dedup: false });\n \n if (rules.length === 0) {\n return null;\n }\n\n const rule = rules[0];\n if (!rule.css) {\n return null;\n }\n\n // Mark as processed\n this.processedClasses.add(className);\n\n return { \n cls: className, \n ast, \n css: rule.css, \n cssList: rule.cssList, \n rootCss: rule.rootCss,\n rootCssList: rule.rootCssList\n };\n } catch (error) {\n debugWarn('[IncrementalParser] Failed to process class:', className, error);\n return null;\n }\n }\n\n /**\n * Processes multiple CSS classes in batches for optimal performance\n * \n * This method handles multiple classes efficiently by:\n * - Filtering out already processed classes to avoid redundant work\n * - Processing classes in configurable batch sizes\n * - Returning comprehensive results for each processed class\n * \n * @param classes - Array of CSS class names to process\n * @returns Array of processing results, each containing className, AST, and CSS\n */\n processClasses(classes: string[]): Array<GenerateCssRulesResult> {\n const results: Array<GenerateCssRulesResult> = [];\n const newClasses = classes.filter(cls => !this.processedClasses.has(cls));\n\n if (newClasses.length === 0) {\n return results; // All classes already processed\n }\n\n // Process in batches for better performance\n for (let i = 0; i < newClasses.length; i += this.batchSize) {\n const batch = newClasses.slice(i, i + this.batchSize);\n \n for (const className of batch) {\n const result = this.processClass(className);\n if (result) {\n results.push(result);\n }\n };\n }\n\n return results;\n }\n\n /**\n * Adds classes to the pending queue for asynchronous batch processing\n * \n * This method is used by the ChangeDetector when new classes are discovered\n * in the DOM. Classes are queued and processed together to minimize\n * performance impact from frequent DOM mutations.\n * \n * @param classes - Array of CSS class names to queue for processing\n */\n addToPending(classes: string[]): void {\n classes.forEach(cls => this.pendingClasses.add(cls));\n this.scheduleBatchProcessing();\n }\n\n /**\n * Schedule batch processing with debouncing\n * \n * This method uses setTimeout to debounce rapid class additions\n * and process them in batches for better performance.\n */\n private scheduleBatchProcessing(): void {\n if (this.batchTimer) {\n clearTimeout(this.batchTimer);\n }\n\n if (typeof window !== 'undefined') {\n this.batchTimer = window.setTimeout(() => {\n this.processPendingClasses();\n }, this.debounceMs);\n } else {\n // In server environment, process immediately\n this.processPendingClasses();\n }\n }\n\n /**\n * Process pending classes from the queue\n * \n * This method is called by the debounced timer to process\n * all classes that have been added to the pending queue.\n */\n private processPendingClasses(): void {\n if (this.pendingClasses.size === 0) return;\n\n const classesToProcess = Array.from(this.pendingClasses);\n this.pendingClasses.clear();\n\n // Use common method for processing\n this.applyClasses(classesToProcess);\n }\n\n /**\n * Core method that processes classes and marks them as processed\n * \n * This is the common processing logic used by both pending and synchronous\n * processing methods. It:\n * 1. Processes the provided classes using the batch processor\n * 2. Marks classes as processed to prevent duplicates\n * \n * @param classes - Array of CSS class names to process\n */\n private applyClasses(classes: string[]): void {\n this.processClasses(classes);\n \n // Mark classes as processed\n classes.forEach(cls => {\n this.markProcessed(cls);\n });\n }\n\n /**\n * Returns comprehensive statistics about the incremental parser's state\n * \n * This method provides detailed metrics including:\n * - Number of processed classes\n * - Number of pending classes\n * - Cache statistics from AST and CSS caches\n * \n * @returns Object containing processing statistics and cache information\n */\n getStats() {\n return {\n processedClasses: this.processedClasses.size,\n pendingClasses: this.pendingClasses.size,\n cacheStats: {\n ast: (getContextState(this.ctx)?.astCache || astCache).getStats(),\n css: {} // No CSS cache, so return empty object\n }\n };\n }\n\n /**\n * Clears all processed classes and pending queue\n * \n * This method is useful when the theme or configuration changes,\n * requiring all classes to be reprocessed. It:\n * - Clears the processed classes set\n * - Clears the pending classes queue\n * - Cancels any pending batch processing timer\n */\n clearProcessed(): void {\n this.processedClasses.clear();\n this.pendingClasses.clear();\n if (this.batchTimer && typeof window !== 'undefined') {\n clearTimeout(this.batchTimer);\n this.batchTimer = null;\n }\n }\n\n /**\n * Checks if a specific class has been processed\n * \n * @param cls - The CSS class name to check\n * @returns True if the class has been processed, false otherwise\n */\n isProcessed(cls: string): boolean {\n return this.processedClasses.has(cls);\n }\n\n /**\n * Marks a class as processed to prevent future duplicate processing\n * \n * @param cls - The CSS class name to mark as processed\n */\n markProcessed(cls: string): void {\n this.processedClasses.add(cls);\n }\n\n /**\n * Forgets that a class was processed, so a later request generates it again\n * (used when the browser runtime reclaims an unused class's rules, #269).\n *\n * @param cls - The CSS class name to forget\n */\n unmarkProcessed(cls: string): void {\n this.processedClasses.delete(cls);\n }\n\n /**\n * Process classes synchronously and update BrowserRuntime cache\n * This method is used by ChangeDetector for scan operations\n */\n processClassesSync(classes: string[]): void {\n this.applyClasses(classes);\n }\n\n /**\n * Returns all currently processed class names\n * \n * This method is useful for debugging and monitoring purposes,\n * providing visibility into which classes have been processed.\n * \n * @returns Array of all processed class names\n */\n getProcessedClasses(): string[] {\n return Array.from(this.processedClasses);\n }\n}\n","// complete color palette (OKLCH/HEX, etc.)\n// Default theme reference\n\nexport const colors = {\n inherit: 'inherit',\n current: 'currentcolor',\n transparent: 'transparent',\n black: '#000',\n white: '#fff',\n slate: {\n '50': 'oklch(98.4% 0.003 247.858)',\n '100': 'oklch(96.8% 0.007 247.896)',\n '200': 'oklch(92.9% 0.013 255.508)',\n '300': 'oklch(86.9% 0.022 252.894)',\n '400': 'oklch(70.4% 0.04 256.788)',\n '500': 'oklch(55.4% 0.046 257.417)',\n '600': 'oklch(44.6% 0.043 257.281)',\n '700': 'oklch(37.2% 0.044 257.287)',\n '800': 'oklch(27.9% 0.041 260.031)',\n '900': 'oklch(20.8% 0.042 265.755)',\n '950': 'oklch(12.9% 0.042 264.695)',\n },\n gray: {\n '50': 'oklch(98.5% 0.002 247.839)',\n '100': 'oklch(96.7% 0.003 264.542)',\n '200': 'oklch(92.8% 0.006 264.531)',\n '300': 'oklch(87.2% 0.01 258.338)',\n '400': 'oklch(70.7% 0.022 261.325)',\n '500': 'oklch(55.1% 0.027 264.364)',\n '600': 'oklch(44.6% 0.03 256.802)',\n '700': 'oklch(37.3% 0.034 259.733)',\n '800': 'oklch(27.8% 0.033 256.848)',\n '900': 'oklch(21% 0.034 264.665)',\n '950': 'oklch(13% 0.028 261.692)',\n },\n zinc: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(96.7% 0.001 286.375)',\n '200': 'oklch(92% 0.004 286.32)',\n '300': 'oklch(87.1% 0.006 286.286)',\n '400': 'oklch(70.5% 0.015 286.067)',\n '500': 'oklch(55.2% 0.016 285.938)',\n '600': 'oklch(44.2% 0.017 285.786)',\n '700': 'oklch(37% 0.013 285.805)',\n '800': 'oklch(27.4% 0.006 286.033)',\n '900': 'oklch(21% 0.006 285.885)',\n '950': 'oklch(14.1% 0.005 285.823)',\n },\n neutral: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(97% 0 none)',\n '200': 'oklch(92.2% 0 none)',\n '300': 'oklch(87% 0 none)',\n '400': 'oklch(70.8% 0 none)',\n '500': 'oklch(55.6% 0 none)',\n '600': 'oklch(43.9% 0 none)',\n '700': 'oklch(37.1% 0 none)',\n '800': 'oklch(26.9% 0 none)',\n '900': 'oklch(20.5% 0 none)',\n '950': 'oklch(14.5% 0 none)',\n },\n stone: {\n '50': 'oklch(98.5% 0.001 106.423)',\n '100': 'oklch(97% 0.001 106.424)',\n '200': 'oklch(92.3% 0.003 48.717)',\n '300': 'oklch(86.9% 0.005 56.366)',\n '400': 'oklch(70.9% 0.01 56.259)',\n '500': 'oklch(55.3% 0.013 58.071)',\n '600': 'oklch(44.4% 0.011 73.639)',\n '700': 'oklch(37.4% 0.01 67.558)',\n '800': 'oklch(26.8% 0.007 34.298)',\n '900': 'oklch(21.6% 0.006 56.043)',\n '950': 'oklch(14.7% 0.004 49.25)',\n },\n red: {\n '50': 'oklch(97.1% 0.013 17.38)',\n '100': 'oklch(93.6% 0.032 17.717)',\n '200': 'oklch(88.5% 0.062 18.334)',\n '300': 'oklch(80.8% 0.114 19.571)',\n '400': 'oklch(70.4% 0.191 22.216)',\n '500': 'oklch(63.7% 0.237 25.331)',\n '600': 'oklch(57.7% 0.245 27.325)',\n '700': 'oklch(50.5% 0.213 27.518)',\n '800': 'oklch(44.4% 0.177 26.899)',\n '900': 'oklch(39.6% 0.141 25.723)',\n '950': 'oklch(25.8% 0.092 26.042)',\n },\n orange: {\n '50': 'oklch(98% 0.016 73.684)',\n '100': 'oklch(95.4% 0.038 75.164)',\n '200': 'oklch(90.1% 0.076 70.697)',\n '300': 'oklch(83.7% 0.128 66.29)',\n '400': 'oklch(75% 0.183 55.934)',\n '500': 'oklch(70.5% 0.213 47.604)',\n '600': 'oklch(64.6% 0.222 41.116)',\n '700': 'oklch(55.3% 0.195 38.402)',\n '800': 'oklch(47% 0.157 37.304)',\n '900': 'oklch(40.8% 0.123 38.172)',\n '950': 'oklch(26.6% 0.079 36.259)',\n },\n amber: {\n '50': 'oklch(98.7% 0.022 95.277)',\n '100': 'oklch(96.2% 0.059 95.617)',\n '200': 'oklch(92.4% 0.12 95.746)',\n '300': 'oklch(87.9% 0.169 91.605)',\n '400': 'oklch(82.8% 0.189 84.429)',\n '500': 'oklch(76.9% 0.188 70.08)',\n '600': 'oklch(66.6% 0.179 58.318)',\n '700': 'oklch(55.5% 0.163 48.998)',\n '800': 'oklch(47.3% 0.137 46.201)',\n '900': 'oklch(41.4% 0.112 45.904)',\n '950': 'oklch(27.9% 0.077 45.635)',\n },\n yellow: {\n '50': 'oklch(98.7% 0.026 102.212)',\n '100': 'oklch(97.3% 0.071 103.193)',\n '200': 'oklch(94.5% 0.129 101.54)',\n '300': 'oklch(90.5% 0.182 98.111)',\n '400': 'oklch(85.2% 0.199 91.936)',\n '500': 'oklch(79.5% 0.184 86.047)',\n '600': 'oklch(68.1% 0.162 75.834)',\n '700': 'oklch(55.4% 0.135 66.442)',\n '800': 'oklch(47.6% 0.114 61.907)',\n '900': 'oklch(42.1% 0.095 57.708)',\n '950': 'oklch(28.6% 0.066 53.813)',\n },\n lime: {\n '50': 'oklch(98.6% 0.031 120.757)',\n '100': 'oklch(96.7% 0.067 122.328)',\n '200': 'oklch(93.8% 0.127 124.321)',\n '300': 'oklch(89.7% 0.196 126.665)',\n '400': 'oklch(84.1% 0.238 128.85)',\n '500': 'oklch(76.8% 0.233 130.85)',\n '600': 'oklch(64.8% 0.2 131.684)',\n '700': 'oklch(53.2% 0.157 131.589)',\n '800': 'oklch(45.3% 0.124 130.933)',\n '900': 'oklch(40.5% 0.101 131.063)',\n '950': 'oklch(27.4% 0.072 132.109)',\n },\n green: {\n '50': 'oklch(98.2% 0.018 155.826)',\n '100': 'oklch(96.2% 0.044 156.743)',\n '200': 'oklch(92.5% 0.084 155.995)',\n '300': 'oklch(87.1% 0.15 154.449)',\n '400': 'oklch(79.2% 0.209 151.711)',\n '500': 'oklch(72.3% 0.219 149.579)',\n '600': 'oklch(62.7% 0.194 149.214)',\n '700': 'oklch(52.7% 0.154 150.069)',\n '800': 'oklch(44.8% 0.119 151.328)',\n '900': 'oklch(39.3% 0.095 152.535)',\n '950': 'oklch(26.6% 0.065 152.934)',\n },\n emerald: {\n '50': 'oklch(97.9% 0.021 166.113)',\n '100': 'oklch(95% 0.052 163.051)',\n '200': 'oklch(90.5% 0.093 164.15)',\n '300': 'oklch(84.5% 0.143 164.978)',\n '400': 'oklch(76.5% 0.177 163.223)',\n '500': 'oklch(69.6% 0.17 162.48)',\n '600': 'oklch(59.6% 0.145 163.225)',\n '700': 'oklch(50.8% 0.118 165.612)',\n '800': 'oklch(43.2% 0.095 166.913)',\n '900': 'oklch(37.8% 0.077 168.94)',\n '950': 'oklch(26.2% 0.051 172.552)',\n },\n teal: {\n '50': 'oklch(98.4% 0.014 180.72)',\n '100': 'oklch(95.3% 0.051 180.801)',\n '200': 'oklch(91% 0.096 180.426)',\n '300': 'oklch(85.5% 0.138 181.071)',\n '400': 'oklch(77.7% 0.152 181.912)',\n '500': 'oklch(70.4% 0.14 182.503)',\n '600': 'oklch(60% 0.118 184.704)',\n '700': 'oklch(51.1% 0.096 186.391)',\n '800': 'oklch(43.7% 0.078 188.216)',\n '900': 'oklch(38.6% 0.063 188.416)',\n '950': 'oklch(27.7% 0.046 192.524)',\n },\n cyan: {\n '50': 'oklch(98.4% 0.019 200.873)',\n '100': 'oklch(95.6% 0.045 203.388)',\n '200': 'oklch(91.7% 0.08 205.041)',\n '300': 'oklch(86.5% 0.127 207.078)',\n '400': 'oklch(78.9% 0.154 211.53)',\n '500': 'oklch(71.5% 0.143 215.221)',\n '600': 'oklch(60.9% 0.126 221.723)',\n '700': 'oklch(52% 0.105 223.128)',\n '800': 'oklch(45% 0.085 224.283)',\n '900': 'oklch(39.8% 0.07 227.392)',\n '950': 'oklch(30.2% 0.056 229.695)',\n },\n sky: {\n '50': 'oklch(97.7% 0.013 236.62)',\n '100': 'oklch(95.1% 0.026 236.824)',\n '200': 'oklch(90.1% 0.058 230.902)',\n '300': 'oklch(82.8% 0.111 230.318)',\n '400': 'oklch(74.6% 0.16 232.661)',\n '500': 'oklch(68.5% 0.169 237.323)',\n '600': 'oklch(58.8% 0.158 241.966)',\n '700': 'oklch(50% 0.134 242.749)',\n '800': 'oklch(44.3% 0.11 240.79)',\n '900': 'oklch(39.1% 0.09 240.876)',\n '950': 'oklch(29.3% 0.066 243.157)',\n },\n blue: {\n '50': 'oklch(97% 0.014 254.604)',\n '100': 'oklch(93.2% 0.032 255.585)',\n '200': 'oklch(88.2% 0.059 254.128)',\n '300': 'oklch(80.9% 0.105 251.813)',\n '400': 'oklch(70.7% 0.165 254.624)',\n '500': 'oklch(62.3% 0.214 259.815)',\n '600': 'oklch(54.6% 0.245 262.881)',\n '700': 'oklch(48.8% 0.243 264.376)',\n '800': 'oklch(42.4% 0.199 265.638)',\n '900': 'oklch(37.9% 0.146 265.522)',\n '950': 'oklch(28.2% 0.091 267.935)',\n },\n indigo: {\n '50': 'oklch(96.2% 0.018 272.314)',\n '100': 'oklch(93% 0.034 272.788)',\n '200': 'oklch(87% 0.065 274.039)',\n '300': 'oklch(78.5% 0.115 274.713)',\n '400': 'oklch(67.3% 0.182 276.935)',\n '500': 'oklch(58.5% 0.233 277.117)',\n '600': 'oklch(51.1% 0.262 276.966)',\n '700': 'oklch(45.7% 0.24 277.023)',\n '800': 'oklch(39.8% 0.195 277.366)',\n '900': 'oklch(35.9% 0.144 278.697)',\n '950': 'oklch(25.7% 0.09 281.288)',\n },\n violet: {\n '50': 'oklch(96.9% 0.016 293.756)',\n '100': 'oklch(94.3% 0.029 294.588)',\n '200': 'oklch(89.4% 0.057 293.283)',\n '300': 'oklch(81.1% 0.111 293.571)',\n '400': 'oklch(70.2% 0.183 293.541)',\n '500': 'oklch(60.6% 0.25 292.717)',\n '600': 'oklch(54.1% 0.281 293.009)',\n '700': 'oklch(49.1% 0.27 292.581)',\n '800': 'oklch(43.2% 0.232 292.759)',\n '900': 'oklch(38% 0.189 293.745)',\n '950': 'oklch(28.3% 0.141 291.089)',\n },\n purple: {\n '50': 'oklch(97.7% 0.014 308.299)',\n '100': 'oklch(94.6% 0.033 307.174)',\n '200': 'oklch(90.2% 0.063 306.703)',\n '300': 'oklch(82.7% 0.119 306.383)',\n '400': 'oklch(71.4% 0.203 305.504)',\n '500': 'oklch(62.7% 0.265 303.9)',\n '600': 'oklch(55.8% 0.288 302.321)',\n '700': 'oklch(49.6% 0.265 301.924)',\n '800': 'oklch(43.8% 0.218 303.724)',\n '900': 'oklch(38.1% 0.176 304.987)',\n '950': 'oklch(29.1% 0.149 302.717)',\n },\n fuchsia: {\n '50': 'oklch(97.7% 0.017 320.058)',\n '100': 'oklch(95.2% 0.037 318.852)',\n '200': 'oklch(90.3% 0.076 319.62)',\n '300': 'oklch(83.3% 0.145 321.434)',\n '400': 'oklch(74% 0.238 322.16)',\n '500': 'oklch(66.7% 0.295 322.15)',\n '600': 'oklch(59.1% 0.293 322.896)',\n '700': 'oklch(51.8% 0.253 323.949)',\n '800': 'oklch(45.2% 0.211 324.591)',\n '900': 'oklch(40.1% 0.17 325.612)',\n '950': 'oklch(29.3% 0.136 325.661)',\n },\n pink: {\n '50': 'oklch(97.1% 0.014 343.198)',\n '100': 'oklch(94.8% 0.028 342.258)',\n '200': 'oklch(89.9% 0.061 343.231)',\n '300': 'oklch(82.3% 0.12 346.018)',\n '400': 'oklch(71.8% 0.202 349.761)',\n '500': 'oklch(65.6% 0.241 354.308)',\n '600': 'oklch(59.2% 0.249 0.584)',\n '700': 'oklch(52.5% 0.223 3.958)',\n '800': 'oklch(45.9% 0.187 3.815)',\n '900': 'oklch(40.8% 0.153 2.432)',\n '950': 'oklch(28.4% 0.109 3.907)',\n },\n rose: {\n '50': 'oklch(96.9% 0.015 12.422)',\n '100': 'oklch(94.1% 0.03 12.58)',\n '200': 'oklch(89.2% 0.058 10.001)',\n '300': 'oklch(81% 0.117 11.638)',\n '400': 'oklch(71.2% 0.194 13.428)',\n '500': 'oklch(64.5% 0.246 16.439)',\n '600': 'oklch(58.6% 0.253 17.585)',\n '700': 'oklch(51.4% 0.222 16.935)',\n '800': 'oklch(45.5% 0.188 13.697)',\n '900': 'oklch(41% 0.159 10.272)',\n '950': 'oklch(27.1% 0.105 12.094)',\n },\n mauve: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(96% 0.003 325.6)',\n '200': 'oklch(92.2% 0.005 325.62)',\n '300': 'oklch(86.5% 0.012 325.68)',\n '400': 'oklch(71.1% 0.019 323.02)',\n '500': 'oklch(54.2% 0.034 322.5)',\n '600': 'oklch(43.5% 0.029 321.78)',\n '700': 'oklch(36.4% 0.029 323.89)',\n '800': 'oklch(26.3% 0.024 320.12)',\n '900': 'oklch(21.2% 0.019 322.12)',\n '950': 'oklch(14.5% 0.008 326)',\n },\n olive: {\n '50': 'oklch(98.8% 0.003 106.5)',\n '100': 'oklch(96.6% 0.005 106.5)',\n '200': 'oklch(93% 0.007 106.5)',\n '300': 'oklch(88% 0.011 106.6)',\n '400': 'oklch(73.7% 0.021 106.9)',\n '500': 'oklch(58% 0.031 107.3)',\n '600': 'oklch(46.6% 0.025 107.3)',\n '700': 'oklch(39.4% 0.023 107.4)',\n '800': 'oklch(28.6% 0.016 107.4)',\n '900': 'oklch(22.8% 0.013 107.4)',\n '950': 'oklch(15.3% 0.006 107.1)',\n },\n mist: {\n '50': 'oklch(98.7% 0.002 197.1)',\n '100': 'oklch(96.3% 0.002 197.1)',\n '200': 'oklch(92.5% 0.005 214.3)',\n '300': 'oklch(87.2% 0.007 219.6)',\n '400': 'oklch(72.3% 0.014 214.4)',\n '500': 'oklch(56% 0.021 213.5)',\n '600': 'oklch(45% 0.017 213.2)',\n '700': 'oklch(37.8% 0.015 216)',\n '800': 'oklch(27.5% 0.011 216.9)',\n '900': 'oklch(21.8% 0.008 223.9)',\n '950': 'oklch(14.8% 0.004 228.8)',\n },\n taupe: {\n '50': 'oklch(98.6% 0.002 67.8)',\n '100': 'oklch(96% 0.002 17.2)',\n '200': 'oklch(92.2% 0.005 34.3)',\n '300': 'oklch(86.8% 0.007 39.5)',\n '400': 'oklch(71.4% 0.014 41.2)',\n '500': 'oklch(54.7% 0.021 43.1)',\n '600': 'oklch(43.8% 0.017 39.3)',\n '700': 'oklch(36.7% 0.016 35.7)',\n '800': 'oklch(26.8% 0.011 36.5)',\n '900': 'oklch(21.4% 0.009 43.1)',\n '950': 'oklch(14.7% 0.004 49.3)',\n },\n}; ","// complete spacing scale\n// Default theme reference\n\nexport const spacing = {\n px: '1px',\n 0: '0px',\n 0.5: '0.125rem',\n 1: '0.25rem',\n 1.5: '0.375rem',\n 2: '0.5rem',\n 2.5: '0.625rem',\n 3: '0.75rem',\n 3.5: '0.875rem',\n 4: '1rem',\n 5: '1.25rem',\n 6: '1.5rem',\n 7: '1.75rem',\n 8: '2rem',\n 9: '2.25rem',\n 10: '2.5rem',\n 11: '2.75rem',\n 12: '3rem',\n 14: '3.5rem',\n 16: '4rem',\n 20: '5rem',\n 24: '6rem',\n 28: '7rem',\n 32: '8rem',\n 36: '9rem',\n 40: '10rem',\n 44: '11rem',\n 48: '12rem',\n 52: '13rem',\n 56: '14rem',\n 60: '15rem',\n 64: '16rem',\n 72: '18rem',\n 80: '20rem',\n 96: '24rem',\n 112: '28rem',\n 128: '32rem',\n}; ","// Tailwind 4.1.13 --radius-* scale (bare `rounded` is 0.25rem).\nexport const borderRadius = {\n none: '0px',\n xs: '0.125rem',\n sm: '0.25rem',\n DEFAULT: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n xl: '0.75rem',\n '2xl': '1rem',\n '3xl': '1.5rem',\n '4xl': '2rem',\n full: '9999px',\n};\n","// Complete fontSize scale\n// Default theme reference\n\nexport const fontSize = {\n xs: ['0.75rem', 'calc(1 / 0.75)'],\n sm: ['0.875rem', 'calc(1.25 / 0.875)'],\n base: ['1rem', 'calc(1.5 / 1)'],\n lg: ['1.125rem', 'calc(1.75 / 1.125)'],\n xl: ['1.25rem', 'calc(1.75 / 1.25)'],\n '2xl': ['1.5rem', 'calc(2 / 1.5)'],\n '3xl': ['1.875rem', 'calc(2.25 / 1.875)'],\n '4xl': ['2.25rem', 'calc(2.5 / 2.25)'],\n '5xl': ['3rem', '1'],\n '6xl': ['3.75rem', '1'],\n '7xl': ['4.5rem', '1'],\n '8xl': ['6rem', '1'],\n '9xl': ['8rem', '1'],\n}; ","// complete fontFamily list\n// Default theme reference\n\nexport const fontFamily = {\n sans: [\n '-apple-system',\n 'BlinkMacSystemFont',\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n 'Noto Sans',\n 'Arial',\n 'sans-serif',\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji',\n ],\n serif: [\n 'ui-serif',\n 'Georgia',\n 'Cambria',\n 'Times New Roman',\n 'Times',\n 'serif',\n ],\n mono: [\n 'ui-monospace',\n 'SFMono-Regular',\n 'Menlo',\n 'Monaco',\n 'Consolas',\n 'Liberation Mono',\n 'Courier New',\n 'monospace',\n ],\n}; ","// complete fontWeight scale\n// Default theme reference\n\nexport const fontWeight = {\n thin: '100',\n extralight: '200',\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n}; ","// complete lineHeight scale\n// Default theme reference\n\nexport const lineHeight = {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '2',\n 3: '.75rem',\n 4: '1rem',\n 5: '1.25rem',\n 6: '1.5rem',\n 7: '1.75rem',\n 8: '2rem',\n 9: '2.25rem',\n 10: '2.5rem',\n 11: '2.75rem',\n 12: '3rem',\n}; ","// Complete boxShadow map\n// Default theme reference\n\nexport const boxShadow = {\n '2xs': '0 1px rgb(0 0 0 / 0.05)',\n xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',\n sm: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',\n DEFAULT: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06)',\n md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',\n xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',\n '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',\n inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',\n none: 'none',\n}; ","// complete zIndex scale\n// Default theme reference\n\nexport const zIndex = {\n auto: 'auto',\n 0: '0',\n 10: '10',\n 20: '20',\n 30: '30',\n 40: '40',\n 50: '50',\n}; ","// complete opacity scale\n// Default theme reference\n\nexport const opacity = {\n 0: '0',\n 5: '0.05',\n 10: '0.1',\n 20: '0.2',\n 25: '0.25',\n 30: '0.3',\n 40: '0.4',\n 50: '0.5',\n 60: '0.6',\n 70: '0.7',\n 75: '0.75',\n 80: '0.8',\n 90: '0.9',\n 95: '0.95',\n 100: '1',\n}; ","// complete transitionProperty map\n// Default theme reference\n\nexport const transitionProperty = {\n none: 'none',\n all: 'all',\n DEFAULT: 'color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter',\n colors: 'color, background-color, border-color, text-decoration-color, fill, stroke',\n opacity: 'opacity',\n shadow: 'box-shadow',\n transform: 'transform',\n}; ","// complete transitionTimingFunction scale\n// Default theme reference\n\nexport const transitionTimingFunction = {\n DEFAULT: 'cubic-bezier(0.4, 0, 0.2, 1)',\n linear: 'linear',\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',\n}; ","// complete transitionDuration scale\n// Default theme reference\n\nexport const transitionDuration = {\n DEFAULT: '150ms',\n 75: '75ms',\n 100: '100ms',\n 150: '150ms',\n 200: '200ms',\n 300: '300ms',\n 500: '500ms',\n 700: '700ms',\n 1000: '1000ms',\n}; ","// complete transitionDelay scale\n// Default theme reference\n\nexport const transitionDelay = {\n 75: '75ms',\n 100: '100ms',\n 150: '150ms',\n 200: '200ms',\n 300: '300ms',\n 500: '500ms',\n 700: '700ms',\n 1000: '1000ms',\n}; ","// animation preset\n// default theme reference\n\nexport const animations = {\n spin: 'spin 1s linear infinite',\n ping: 'ping 1s cubic-bezier(0,0,0.2,1) infinite',\n pulse: 'pulse 2s cubic-bezier(0.4,0,0.6,1) infinite',\n bounce: 'bounce 1s infinite',\n}; ","// keyframes preset\n// default theme reference\n\nexport const keyframes = {\n spin: {\n to: {\n transform: 'rotate(360deg)',\n },\n },\n ping: {\n '75%, 100%': {\n transform: 'scale(2)',\n opacity: '0',\n },\n },\n pulse: {\n '50%': {\n opacity: '0.5',\n },\n },\n // #274: Tailwind 4.1.13's frames (0%/100% share the up position; 50% is the floor).\n bounce: {\n '0%, 100%': {\n transform: 'translateY(-25%)',\n 'animation-timing-function': 'cubic-bezier(0.8, 0, 1, 1)',\n },\n '50%': {\n transform: 'none',\n 'animation-timing-function': 'cubic-bezier(0, 0, 0.2, 1)',\n },\n },\n};\n","// animationVars preset\n// default theme reference\nimport { animations } from './animations';\n\nexport const animationVars = {\n '--animate-spin': animations.spin,\n '--animate-ping': animations.ping,\n '--animate-pulse': animations.pulse,\n '--animate-bounce': animations.bounce,\n}; ","// responsive design documentation\n\nexport const breakpoints = {\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n '2xl': '96rem',\n};","// responsive design documentation\n\nexport const container = {\n '3xs': '16rem',\n '2xs': '18rem',\n xs: '20rem',\n sm: '24rem',\n md: '28rem',\n lg: '32rem',\n xl: '36rem',\n '2xl': '42rem',\n '3xl': '48rem',\n '4xl': '56rem',\n '5xl': '64rem',\n '6xl': '72rem',\n '7xl': '80rem',\n};","// complete letterSpacing scale\n// Default theme reference\n\nexport const letterSpacing = {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.1em',\n}; ","// Tailwind 4.1.13 --blur-* scale (bare `blur` / `backdrop-blur` are 8px).\nexport const blur = {\n DEFAULT: '8px',\n xs: '4px',\n sm: '8px',\n md: '12px',\n lg: '16px',\n xl: '24px',\n '2xl': '40px',\n '3xl': '64px',\n};\n","// Tailwind 4.3.3 --text-shadow-* and --drop-shadow-* scales (theme.css).\nexport const textShadow = {\n '2xs': '0px 1px 0px rgb(0 0 0 / 0.15)',\n xs: '0px 1px 1px rgb(0 0 0 / 0.2)',\n sm: '0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)',\n md: '0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)',\n lg: '0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)',\n};\n\nexport const dropShadow = {\n xs: '0 1px 1px rgb(0 0 0 / 0.05)',\n sm: '0 1px 2px rgb(0 0 0 / 0.15)',\n md: '0 3px 3px rgb(0 0 0 / 0.12)',\n lg: '0 4px 4px rgb(0 0 0 / 0.15)',\n xl: '0 9px 7px rgb(0 0 0 / 0.1)',\n '2xl': '0 25px 25px rgb(0 0 0 / 0.15)',\n};\n","// default theme structure implemented to closely match reference\n// Default theme reference\n\nimport { colors } from './colors';\nimport { spacing } from './spacing';\nimport { borderRadius } from './border-radius';\nimport { fontSize } from './font-size';\nimport { fontFamily } from './font-family';\nimport { fontWeight } from './font-weight';\nimport { lineHeight } from './line-height';\nimport { boxShadow } from './box-shadow';\nimport { zIndex } from './z-index';\nimport { opacity } from './opacity';\nimport { transitionProperty } from './transition-property';\nimport { transitionTimingFunction } from './transition-timing-function';\nimport { transitionDuration } from './transition-duration';\nimport { transitionDelay } from './transition-delay';\nimport { animations } from './animations';\nimport { keyframes } from './keyframes';\nimport { animationVars } from './animation-vars';\nimport { breakpoints } from './breakpoints';\nimport { container } from './container';\nimport { letterSpacing } from './letter-spacing';\nimport { blur } from './blur';\nimport { textShadow, dropShadow } from './text-shadow';\n\nexport interface UserTheme {\n [key: string]: unknown;\n}\n\nexport const defaultTheme = {\n colors,\n spacing,\n borderRadius,\n breakpoints,\n container,\n fontSize,\n fontFamily,\n fontWeight,\n letterSpacing,\n lineHeight,\n boxShadow,\n zIndex,\n opacity,\n transitionProperty,\n transitionTimingFunction,\n transitionDuration,\n transitionDelay,\n animations,\n keyframes,\n animationVars,\n blur,\n textShadow,\n dropShadow,\n // Tailwind 4.1.13 --aspect-* (aspect-video → var(--aspect-video))\n aspect: { video: '16 / 9' },\n} as UserTheme; ","// #287: config.utilities (static custom utilities). Internal module: not re-exported from the package index.\nimport type { AstNode } from './ast';\nimport { decl } from './ast';\nimport type { Context } from './context';\nimport { getUtility, registerUtility } from './registry';\nimport { isStructureSafeValue, hasCommentDelimiter } from './parser';\nimport { debugWarn } from '../utils/debug';\n\nconst customUtilityName = /^[A-Za-z_][A-Za-z0-9_-]*$/;\nconst customUtilityProp = /^(--[A-Za-z0-9_-]+|-?[A-Za-z][A-Za-z0-9-]*)$/;\n\n/** The safe declarations of a custom utility, or null when its name or any declaration is invalid. */\nexport function validateCustomUtility(name: unknown, decls: unknown): [string, string][] | null {\n if (typeof name !== 'string' || !customUtilityName.test(name)) return null;\n if (!decls || typeof decls !== 'object' || Array.isArray(decls)) return null;\n const out: [string, string][] = [];\n for (const [prop, raw] of Object.entries(decls as Record<string, unknown>)) {\n if (typeof raw !== 'string' && typeof raw !== 'number') return null;\n const value = String(raw).trim();\n if (!customUtilityProp.test(prop) || !value || !isStructureSafeValue(value) || hasCommentDelimiter(value)) return null;\n out.push([prop, value]);\n }\n return out.length ? out : null;\n}\n\n/**\n * Registers config.utilities on this context, ahead of the built-ins (the first match wins). Like\n * Tailwind 4's `@utility`, a custom utility named like a built-in emits the built-in's declarations\n * first and then its own.\n */\nexport function registerCustomUtilities(ctx: Context, utilities: unknown): void {\n if (!utilities || typeof utilities !== 'object' || Array.isArray(utilities)) return;\n const list = getUtility(ctx);\n const builtins = [...list];\n const before = list.length;\n for (const [name, decls] of Object.entries(utilities as Record<string, unknown>)) {\n const safe = validateCustomUtility(name, decls);\n if (!safe) {\n debugWarn(`[BAROCSS] Ignoring invalid custom utility \"${name}\"`);\n continue;\n }\n const shadowed = builtins.filter((u) => u.match(name));\n registerUtility({\n name,\n category: 'custom',\n match: (className: string) => className === name,\n handler: (value, c, token) => {\n let base: AstNode[] = [];\n for (const reg of shadowed) {\n base = reg.handler(value, c, token, reg) || [];\n if (base.length > 0) break;\n }\n return [...base, ...safe.map(([prop, v]) => decl(prop, v))];\n },\n }, ctx);\n }\n if (list.length > before) list.unshift(...list.splice(before));\n}\n","// BaroCSS Preflight CSS as TypeScript variables\n// This eliminates the need for ?raw imports and improves compatibility\n\nexport const preflightMinimalCSS = `\n/* BaroCSS Preflight - Minimal Reset */\n/* ================================= */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Remove default margin and padding */\n* {\n margin: 0;\n padding: 0;\n}\n\n/* Set core body defaults */\nbody {\n min-height: 100vh;\n scroll-behavior: smooth;\n text-rendering: optimizeSpeed;\n line-height: 1.5;\n}\n\n/* Remove list styles on ul, ol elements */\nul,\nol {\n list-style: none;\n}\n\n/* Make images easier to work with */\nimg,\npicture {\n max-width: 100%;\n display: block;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n html {\n scroll-behavior: auto;\n }\n \n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n`;\n\nexport const preflightStandardCSS = `\n/* BaroCSS Preflight - Standard Reset */\n/* ================================== */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Remove default margin and padding */\n* {\n margin: 0;\n padding: 0;\n}\n\n/* Set core body defaults */\nbody {\n min-height: 100vh;\n scroll-behavior: smooth;\n text-rendering: optimizeSpeed;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n/* Remove list styles on ul, ol elements */\nul,\nol {\n list-style: none;\n}\n\n/* Make images easier to work with */\nimg,\npicture {\n max-width: 100%;\n display: block;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n html {\n scroll-behavior: auto;\n }\n \n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n/* Additional standard resets */\nhtml {\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n /* Tailwind 4.1.13 root font (app --default-font-family / --font-sans win) */\n font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n}\n\n/* Remove the gray background on active links in IE 10 */\na {\n background-color: transparent;\n}\n\n/* Add the correct font weight in Chrome, Edge, and Safari */\nb,\nstrong {\n font-weight: bolder;\n}\n\n/* Prevent sub and sup elements from affecting the line height */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Improve media defaults */\nsvg {\n vertical-align: middle;\n}\n\n/* Remove border on iframe */\niframe {\n border: 0;\n}\n\n/* Table defaults */\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\n/* Form element defaults */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Remove the inner border and padding in Firefox */\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/* Restore the focus styles unset by the previous rule */\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Correct the padding in Firefox */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/* Remove padding so developers aren't caught out when they zero out fieldset elements */\nlegend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n}\n\n/* Add the correct vertical alignment in Chrome, Firefox, and Opera */\nprogress {\n vertical-align: baseline;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Tailwind 4.1.13 monospace stack for code-like elements */\ncode,\nkbd,\nsamp,\npre {\n font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n}\n\n/* Tailwind 4.1.13 form-control reset: inherit typography and colour, drop native radius/background (#228) */\nbutton,\ninput,\nselect,\noptgroup,\ntextarea,\n::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\n:where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n}\n\n:where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n}\n\n::file-selector-button {\n margin-inline-end: 4px;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n}\n\ntextarea {\n resize: vertical;\n}\n`;\n\nexport const preflightFullCSS = `\n/* BaroCSS Preflight - Full Reset */\n/* =============================== */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Remove default margin and padding; reset border to Tailwind v4's universal\n \\`border: 0 solid\\` so a bare border/border-t (width set by the utility, style\n otherwise \\`none\\`) renders. Width 0 keeps borders invisible until a utility\n sets one. */\n* {\n margin: 0;\n padding: 0;\n border: 0 solid;\n}\n\n/* Set core body defaults */\nbody {\n min-height: 100vh;\n scroll-behavior: smooth;\n text-rendering: optimizeSpeed;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n/* Remove list styles on ul, ol elements */\nul,\nol {\n list-style: none;\n}\n\n/* Make images easier to work with */\nimg,\npicture {\n max-width: 100%;\n display: block;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n html {\n scroll-behavior: auto;\n }\n \n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n/* HTML5 display-role reset for older browsers */\narticle, aside, details, figcaption, figure, \nfooter, header, hgroup, menu, nav, section {\n display: block;\n}\n\n/* Additional full resets */\nhtml {\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n /* Tailwind 4.1.13 root font (app --default-font-family / --font-sans win) */\n font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n}\n\n/* Remove the gray background on active links in IE 10 */\na {\n background-color: transparent;\n text-decoration: none;\n color: inherit;\n}\n\n/* Add the correct font weight in Chrome, Edge, and Safari */\nb,\nstrong {\n font-weight: bolder;\n}\n\n/* Prevent sub and sup elements from affecting the line height */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Improve media defaults */\nsvg {\n vertical-align: middle;\n}\n\n/* Remove border on iframe */\niframe {\n border: 0;\n}\n\n/* Table defaults */\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\n/* Form element defaults */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Remove the inner border and padding in Firefox */\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/* Restore the focus styles unset by the previous rule */\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Correct the padding in Firefox */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/* Remove padding so developers aren't caught out when they zero out fieldset elements */\nlegend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n}\n\n/* Add the correct vertical alignment in Chrome, Firefox, and Opera */\nprogress {\n vertical-align: baseline;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Additional full reset styles */\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\n/* Add the correct font size in all browsers */\nsmall {\n font-size: 80%;\n}\n\n/* Prevent overflow of the container in all browsers */\ncode,\nkbd,\npre,\nsamp {\n font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n}\n\n/* Add the correct display in IE 9 */\naudio,\nvideo {\n display: inline-block;\n}\n\n/* Add the correct display in IE */\ntemplate {\n display: none;\n}\n\n/* Hidden attribute */\n[hidden] {\n display: none;\n}\n\n/* Focus styles */\n:focus {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n}\n\n/* Skip link for accessibility */\n.skip-link {\n position: absolute;\n top: -40px;\n left: 6px;\n background: #000;\n color: white;\n padding: 8px;\n text-decoration: none;\n z-index: 100;\n}\n\n.skip-link:focus {\n top: 6px;\n}\n\n/* Print styles */\n@media print {\n *,\n *::before,\n *::after {\n background: transparent !important;\n color: #000 !important;\n box-shadow: none !important;\n text-shadow: none !important;\n }\n \n a,\n a:visited {\n text-decoration: underline;\n }\n \n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n \n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n \n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n \n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n \n thead {\n display: table-header-group;\n }\n \n tr,\n img {\n page-break-inside: avoid;\n }\n \n img {\n max-width: 100% !important;\n }\n \n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n \n h2,\n h3 {\n page-break-after: avoid;\n }\n}\n\n/* Tailwind 4.1.13 form-control reset: inherit typography and colour, drop native radius/background (#228) */\nbutton,\ninput,\nselect,\noptgroup,\ntextarea,\n::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\n:where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n}\n\n:where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n}\n\n::file-selector-button {\n margin-inline-end: 4px;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n}\n\ntextarea {\n resize: vertical;\n}\n`;\n","import { setDebug } from \"../utils/debug\";\nimport { defaultTheme } from \"../theme\";\nimport { themeToCssVarsAll, toCssVarsBlock } from \"./cssVars\";\nimport { getModifier, getUtility } from './registry';\nimport { clearContextCaches, initializeContextState } from './contextState';\nimport { registerCustomUtilities } from './customUtilities';\nimport { preflightMinimalCSS, preflightStandardCSS, preflightFullCSS } from \"../css/preflight\";\n\ntype PreflightLevel = 'minimal' | 'standard' | 'full' | true | false;\n\ntype Function = (...args: unknown[]) => unknown;\ntype ContextRecord = Record<string, unknown>;\n\nexport function getPreflightCSS(level: PreflightLevel = true): string {\n if (level === 'minimal') {\n return preflightMinimalCSS;\n } else if (level === 'standard') {\n return preflightStandardCSS;\n } else if (level === 'full') {\n return preflightFullCSS;\n } else if (level === true) {\n return preflightFullCSS;\n } else if (level === false) {\n return '';\n }\n return '';\n}\n\n// Types for theme/config/context\nexport interface Theme {\n extend?: Theme;\n [namespace: string]: unknown;\n}\n\nexport interface Config {\n prefix?: string; // class prefix, Tailwind 4 `prefix(tw)` syntax: 'tw' -> `tw:flex`, `tw:hover:p-4`; lowercase letters; default none\n cssVarPrefix?: string; // prefix for generated CSS custom properties, default '--bcss-'\n /**\n * Modern dark mode strategy\n * - 'media': uses @media (prefers-color-scheme: dark)\n * - 'class': uses .dark selector\n * - string[]: custom selectors (e.g. ['class', '[data-theme=\"dark\"]'])\n */\n darkMode?: 'media' | 'class' | string[];\n theme?: Theme;\n presets?: { theme: Theme }[];\n\n /**\n * Whether to include preflight CSS\n * - 'minimal': Minimal preflight CSS\n * - 'standard': Standard preflight CSS\n * - 'full': Full preflight CSS\n * - true: Full preflight CSS (default)\n * - false: No preflight CSS\n * \n * default: true (full preflight)\n */\n preflight?: PreflightLevel;\n /**\n * Enable kit console diagnostics (off by default).\n * This sets a process-wide flag (see setDebug): it affects every context, and a\n * config without this key leaves the current flag unchanged.\n */\n debug?: boolean;\n /**\n * @deprecated Contexts now own their caches. Creating a context does not\n * clear caches that belong to another context.\n */\n clearCacheOnContextChange?: boolean;\n /**\n * #287: static custom utilities, the runtime mirror of a stylesheet's static `@utility name { ... }`.\n * Name → declarations (property → value; CSS custom properties allowed). Each one is registered on\n * this context only; variants and `!` apply as usual. A name equal to a built-in extends it like\n * `@utility` in Tailwind 4: the built-in declarations are emitted first, then the custom ones (a later\n * duplicate property wins). An entry with an invalid name, property or value is skipped whole.\n * @example utilities: { 'max-w-app': { 'max-width': '72rem', 'margin-inline': 'auto' } }\n */\n utilities?: CustomUtilities;\n [key: string]: unknown;\n}\n\n/** #287: declarations of one static custom utility (property → value). */\nexport type CustomUtilityDeclarations = Record<string, string | number>;\n/** #287: static custom utilities by class name. */\nexport type CustomUtilities = Record<string, CustomUtilityDeclarations>;\n\n\nexport const defaultConfig: Config = {\n darkMode: 'media', // same as default\n};\n\nexport interface Context {\n hasPreset: (category: string, preset: string) => boolean;\n theme: (...path: (string|number)[]) => unknown;\n config: (...path: (string|number)[]) => unknown;\n themeToCssVars: (prefix?: string) => string;\n // Safe API for extending theme from plugins\n extendTheme: (category: string, values: Record<string, unknown> | Function) => void;\n getPreflightCSS: (level?: PreflightLevel) => string;\n}\n\n// Deep merge utility\nexport function deepMerge<T extends Record<string, unknown>>(base: T, override: Partial<T>): T {\n const result: Record<string, unknown> = {};\n const keys = new Set([\n ...Object.keys(base || {}),\n ...Object.keys(override || {}),\n ]);\n for (const key of keys) {\n const skey = String(key);\n const baseVal = base && typeof base === 'object' ? (base as T)[skey] : undefined;\n const overrideVal = override && typeof override === 'object' ? (override as T)[skey] : undefined;\n if (\n overrideVal &&\n typeof overrideVal === 'object' &&\n !Array.isArray(overrideVal)\n ) {\n result[skey] = deepMerge(\n (typeof baseVal === 'object' && baseVal !== null) ? baseVal as T : {} as T,\n overrideVal\n );\n } else if (overrideVal !== undefined) {\n result[skey] = overrideVal;\n } else {\n result[skey] = baseVal;\n }\n }\n return result as T;\n}\n\nexport type ThemeGetter = (...path: (string|number)[]) => unknown;\n\nconst themeLookupsInProgress = new WeakMap<Theme, Set<string>>();\n\n/**\n * Modern theme getter for BAROCSS\n *\n * - Supports category-level (first path segment) function values only.\n * - If the category (e.g., 'spacing', 'colors') is a function, it will be executed with the theme getter as argument.\n * - This allows dynamic theme extension and plugin-style patterns, e.g.:\n * spacing: (theme) => ({ ...theme('spacing'), '72': '18rem' })\n * - Leaf (property) functions are NOT supported and will be ignored (returns undefined).\n * - Infinite recursion is prevented: If the exact same path is being resolved recursively (directly or indirectly), undefined is returned for that call.\n * - Category-level functions can safely call theme('category.otherKey') for dynamic references.\n * - Only true recursion on the same path is blocked.\n * - All theme lookups (theme('category.key')) will always re-execute the category function if present, ensuring dynamic resolution.\n *\n * @param themeObj - The theme object (possibly with category functions)\n * @param path - Path segments (string or number), or dot-path string (e.g. 'colors.red.500')\n * @returns The resolved theme value, or undefined if not found or if a leaf function is encountered\n *\n * @example\n * const theme = {\n * spacing: (theme) => ({ 1: '0.25rem', 2: theme('spacing.1') }),\n * };\n * themeGetter(theme, 'spacing.2'); // '0.25rem'\n *\n * @example\n * // Infinite recursion is prevented:\n * const theme = {\n * spacing: (theme) => theme('spacing.1'),\n * };\n * themeGetter(theme, 'spacing.1'); // undefined\n */\nexport function themeGetter(themeObj: Theme, ...path: (string | number)[]): unknown {\n // The theme getter function itself, passed to category functions for dynamic resolution\n const theme: ThemeGetter = (...args: (string | number)[]) => themeGetter(themeObj, ...args);\n\n // Parse the path: support both dot-path string and array of segments\n let keys: (string | number)[] = [];\n if (path.length === 1 && typeof path[0] === 'string' && path[0].includes('.')) {\n keys = path[0].split('.');\n } else {\n if (path[0] === 'colors' && typeof path[1] === 'string' && path[1].includes('-')) {\n // colors.red-500 → colors.red.500 (only for color names with numbers)\n // But custom-blue should remain as custom-blue\n const colorKey = path[1] as string;\n if (colorKey.match(/^[a-zA-Z]+-\\d+$/)) {\n // Only split if it's a pattern like \"red-500\", \"blue-600\", etc.\n keys = colorKey.split('-');\n keys = [path[0], ...keys];\n } else {\n // For custom keys like \"custom-blue\", keep as is\n keys = path;\n }\n } else {\n keys = path;\n }\n }\n if (keys.length === 0) return undefined;\n\n // Infinite recursion protection: track currently resolving full paths\n // If the exact same path is being resolved recursively, return undefined\n let inProgress = themeLookupsInProgress.get(themeObj);\n if (!inProgress) {\n inProgress = new Set();\n themeLookupsInProgress.set(themeObj, inProgress);\n }\n const pathKey = keys.join('.');\n if (inProgress.has(pathKey)) return undefined;\n inProgress.add(pathKey);\n\n try {\n // Get the category value (could be a function or object)\n let value = themeObj[keys[0]];\n // If the category is a function, execute it with the theme getter.\n if (typeof value === 'function') {\n value = value(theme);\n }\n\n for (let i = 1; i < keys.length; i++) {\n if (value == null) return undefined;\n value = (value as Record<string, unknown>)[keys[i]];\n }\n\n // Leaf functions are not supported.\n if (typeof value === 'function') return undefined;\n return value;\n } finally {\n inProgress.delete(pathKey);\n }\n}\n\n// config getter\nexport function configGetter(config: ContextRecord, ...path: (string|number)[]): unknown {\n let keys: (string|number)[] = [];\n if (path.length === 1 && typeof path[0] === 'string' && path[0].includes('.')) {\n keys = path[0].split('.');\n } else {\n keys = path;\n }\n return keys.reduce((acc: unknown, key) => (acc ? (acc as Record<string, unknown>)[key] : undefined), config) as unknown as ContextRecord;\n}\n\n// hasPreset\nexport function hasPreset(themeObj: Theme, category: string, preset: string): boolean {\n return (themeObj[category] as string[])?.includes?.(preset) as boolean;\n}\n\n// resolveTheme\nexport function resolveTheme(config: Config): Theme {\n let theme: Theme = {};\n if (config.presets) {\n for (const preset of config.presets) {\n if (preset.theme) {\n theme = deepMerge(theme, preset.theme);\n }\n }\n }\n if (config.theme) {\n const { extend, ...overrideTheme } = config.theme as Theme;\n theme = deepMerge(theme, overrideTheme); // switch from shallowMerge to deepMerge\n if (extend) {\n theme = deepMerge(theme, extend);\n }\n }\n return theme;\n}\n\n\nexport function themeToCssVars(theme: Theme): string {\n const vars = themeToCssVarsAll(theme);\n // console.log('[themeToCssVars] vars', vars);\n // #274: @keyframes are emitted on demand next to the classes that reference them (referencedKeyframes),\n // so a page's own @keyframes of the same name is never overridden by an unused theme copy.\n const result = toCssVarsBlock(vars);\n\n// console.log('[themeToCssVars] result', result);\n\n return result;\n}\n\n// createContext\nexport function createContext(configObj: Config): Context {\n if (configObj.debug !== undefined) setDebug(!!configObj.debug);\n // Automatically include defaultTheme as the base preset\n const configWithDefaults = {\n presets: [\n { theme: defaultTheme }, // always include defaultTheme as base preset\n ...(configObj.presets || [])\n ],\n ...configObj\n };\n const themeObj = resolveTheme(configWithDefaults);\n\n // 1. Declare ctx first as an object\n const ctx: Context = {\n hasPreset: (category: string, preset: string): boolean => {\n const result = hasPreset(themeObj, category, preset);\n // console.log(`[hasPreset] category: ${category}, preset: ${preset} =>`, result);\n return result as boolean;\n },\n theme: (...args) => {\n const result = themeGetter(themeObj, ...args);\n // console.log(`[theme] path:`, args, `=>`, result);\n return result;\n },\n config: (...args) => {\n const result = configGetter(configWithDefaults, ...args);\n // console.log(`[config] path:`, args, `=>`, result);\n return result;\n },\n themeToCssVars: () => themeToCssVars(themeObj),\n // Safe API for theme extension from plugins\n extendTheme: (category: string, values: Record<string, unknown> | Function) => {\n // console.log(`[extendTheme] category: ${category}, values:`, values);\n \n if (typeof values === 'function') {\n // If it's a function, execute with theme getter\n const themeFunction = values as (theme: ThemeGetter) => unknown;\n const result = themeFunction(ctx.theme);\n if (result && typeof result === 'object') {\n // Merge with existing values\n const existingValues = themeObj[category] || {} as Record<string, unknown>;\n themeObj[category] = {\n ...existingValues,\n ...result\n };\n // console.log(`[extendTheme] function result merged for ${category}:`, themeObj[category]);\n }\n } else if (typeof values === 'object' && values !== null && !Array.isArray(values)) {\n // Get existing category values\n const existingValues = themeObj[category] || {} as Record<string, unknown>;\n \n // Merge existing and new values\n themeObj[category] = {\n ...existingValues,\n ...values\n };\n // console.log(`[extendTheme] merged ${category}:`, themeObj[category]);\n } else {\n // console.warn(`[extendTheme] Invalid values for category ${category}:`, values);\n }\n clearContextCaches(ctx);\n },\n getPreflightCSS: (level: PreflightLevel = true) => {\n return getPreflightCSS(level);\n }\n };\n\n // 2. Property assignment (functions reference themeObj, configWithDefaults, etc.)\n // ctx.hasPreset = (category: string, preset: string) => {\n // const result = hasPreset(themeObj, category, preset);\n // console.log(`[hasPreset] category: ${category}, preset: ${preset} =>`, result);\n // return result;\n // };\n // ctx.theme = (...args) => {\n // const value = themeGetter(themeObj, ...args);\n // console.log(`[theme] path:`, args, '=>', value);\n // return value;\n // };\n // ctx.config = (...args) => {\n // const value = configGetter(configWithDefaults, ...args);\n // console.log(`[config] path:`, args, '=>', value);\n // return value;\n // };\n // ctx.plugins = configWithDefaults.plugins ?? [];\n // ctx.themeToCssVars = () => themeToCssVars(themeObj);\n\n initializeContextState(ctx, getUtility(), getModifier());\n registerCustomUtilities(ctx, configObj.utilities);\n return ctx;\n}\n","import { atRule, decl, type AstNode } from \"./ast\";\n// Value parsing helpers inspired by value-parser.ts\n\n/**\n * Extracts the value from [arbitrary] syntax, or returns null if not arbitrary.\n */\nexport function parseArbitraryValue(input: string): string | null {\n return input.startsWith('[') && input.endsWith(']') ? input.slice(1, -1) : null;\n}\n\n/**\n * Parses a fraction string (e.g., '1/2') and returns a percentage string (e.g., '50%'), or null if not a valid fraction.\n */\nexport function parseFraction(input: string): string | null {\n if (input.includes('/')) {\n const [num, denom] = input.split('/').map(Number);\n if (!isNaN(num) && !isNaN(denom) && denom !== 0) {\n return `${(num / denom) * 100}%`;\n }\n }\n return null;\n}\n\n/**\n * Returns the input if it is a valid non-negative integer string, else null.\n * \n * @example\n * parseNumber(\"10\") // \"10\"\n * parseNumber(\"-10\") // \"-10\"\n * parseNumber(\"10.5\") // \"10.5\"\n */\nexport function parseNumber(input: string): string | null {\n // Accept integers and decimals (e.g., 1, -2, 1.5, -0.25)\n return /^-?\\d+(?:\\.\\d+)?$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input if it is a valid non-negative integer string, else null.\n * \n * @example\n * parseInteger(\"10\") // \"10\"\n * parseInteger(\"-10\") // null\n * parseInteger(\"10.5\") // null\n */\nexport function parseInteger(input: string): string | null {\n return /^-?\\d+$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input if it is a valid length string, else null.\n */\nexport function parseLength(input: string): string | null {\n return /^\\d+(px|em|rem|vh|vw|vmin|vmax|%|in|cm|mm|pt|pc|ex|ch|fr)$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input without a leading '-' if negative, else null.\n */\nexport function parseNegative(input: string): string | null {\n return input.startsWith('-') ? input.slice(1) : null;\n}\n\n/**\n * Returns the input if it is a valid CSS var() expression, else null.\n */\nexport function parseVar(input: string): string | null {\n return input.startsWith('var(') && input.endsWith(')') ? input : null;\n}\n\n/**\n * Unified parser for fraction or number, with options for percent or repeat syntax.\n * - percent: if true, returns percentage for fraction (e.g., '1/2' -> '50%')\n * - repeat: if true, returns repeat() for number (e.g., '3' -> 'repeat(3, minmax(0, 1fr))')\n */\nexport function parseFractionOrNumber(value: string, opts: { percent?: boolean; repeat?: boolean } = {}): string | null {\n if (/^\\d+$/.test(value)) {\n if (opts.repeat) return `repeat(${value}, minmax(0, 1fr))`;\n return value;\n }\n if (value.includes('/')) {\n const [numerator, denominator] = value.split('/').map(Number);\n if (!isNaN(numerator) && !isNaN(denominator) && denominator !== 0) {\n const result = numerator / denominator;\n if (opts.percent) return `${result * 100}%`;\n return result.toString();\n }\n }\n return null;\n} \n\nconst CSS_COLOR_NAMES = new Set([\n \"aliceblue\",\n \"antiquewhite\",\n \"aqua\",\n \"aquamarine\",\n \"azure\",\n \"beige\",\n \"bisque\",\n \"black\",\n \"blanchedalmond\",\n \"blue\",\n \"blueviolet\",\n \"brown\",\n \"burlywood\",\n \"cadetblue\",\n \"chartreuse\",\n \"chocolate\",\n \"coral\",\n \"cornflowerblue\",\n \"cornsilk\",\n \"crimson\",\n \"cyan\",\n \"darkblue\",\n \"darkcyan\",\n \"darkgoldenrod\",\n \"darkgray\",\n \"darkgreen\",\n \"darkgrey\",\n \"darkkhaki\",\n \"darkmagenta\",\n \"darkolivegreen\",\n \"darkorange\",\n \"darkorchid\",\n \"darkred\",\n \"darksalmon\",\n \"darkseagreen\",\n \"darkslateblue\",\n \"darkslategray\",\n \"darkslategrey\",\n \"darkturquoise\",\n \"darkviolet\",\n \"deeppink\",\n \"deepskyblue\",\n \"dimgray\",\n \"dimgrey\",\n \"dodgerblue\",\n \"firebrick\",\n \"floralwhite\",\n \"forestgreen\",\n \"fuchsia\",\n \"gainsboro\",\n \"ghostwhite\",\n \"gold\",\n \"goldenrod\",\n \"gray\",\n \"grey\",\n \"green\",\n \"greenyellow\",\n \"honeydew\",\n \"hotpink\",\n \"indianred\",\n \"indigo\",\n \"ivory\",\n \"khaki\",\n \"lavender\",\n \"lavenderblush\",\n \"lawngreen\",\n \"lemonchiffon\",\n \"lightblue\",\n \"lightcoral\",\n \"lightcyan\",\n \"lightgoldenrodyellow\",\n \"lightgray\",\n \"lightgreen\",\n \"lightgrey\",\n \"lightpink\",\n \"lightsalmon\",\n \"lightseagreen\",\n \"lightskyblue\",\n \"lightslategray\",\n \"lightslategrey\",\n \"lightsteelblue\",\n \"lightyellow\",\n \"lime\",\n \"limegreen\",\n \"linen\",\n \"magenta\",\n \"maroon\",\n \"mediumaquamarine\",\n \"mediumblue\",\n \"mediumorchid\",\n \"mediumpurple\",\n \"mediumseagreen\",\n \"mediumslateblue\",\n \"mediumspringgreen\",\n \"mediumturquoise\",\n \"mediumvioletred\",\n \"midnightblue\",\n \"mintcream\",\n \"mistyrose\",\n \"moccasin\",\n \"navajowhite\",\n \"navy\",\n \"oldlace\",\n \"olive\",\n \"olivedrab\",\n \"orange\",\n \"orangered\",\n \"orchid\",\n \"palegoldenrod\",\n \"palegreen\",\n \"paleturquoise\",\n \"palevioletred\",\n \"papayawhip\",\n \"peachpuff\",\n \"peru\",\n \"pink\",\n \"plum\",\n \"powderblue\",\n \"purple\",\n \"red\",\n \"rosybrown\",\n \"royalblue\",\n \"saddlebrown\",\n \"salmon\",\n \"sandybrown\",\n \"seagreen\",\n \"seashell\",\n \"sienna\",\n \"silver\",\n \"skyblue\",\n \"slateblue\",\n \"slategray\",\n \"slategrey\",\n \"snow\",\n \"springgreen\",\n \"steelblue\",\n \"tan\",\n \"teal\",\n \"thistle\",\n \"tomato\",\n \"turquoise\",\n \"violet\",\n \"wheat\",\n \"white\",\n \"whitesmoke\",\n \"yellow\",\n \"yellowgreen\",\n]);\n\n/**\n * Returns the input if it is a valid color string, else null.\n *\n * #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(r, g, b), rgb(r, g, b, a), hsl(h, s, l), hsl(h, s, l, a), hwb(h, w, b), hwb(h, w, b, a), lab(l, a, b), lab(l, a, b, a), lch(l, c, h), lch(l, c, h, a), oklab(l, a, b), oklab(l, a, b, a), oklch(l, c, h), oklch(l, c, h, a), color-mix(in oklab, var(--color-blue-500) 60%, transparent)\n */\nexport function parseColor(input: string): string | null {\n\n // CSS named colors\n if (CSS_COLOR_NAMES.has(input.toLowerCase())) {\n return input;\n }\n\n if (input.startsWith('color:var(')) {\n return input.slice(6);\n }\n\n if (input.startsWith('color:')) {\n return parseColor(input.slice(6));\n }\n\n // hex\n if (input.startsWith('#') && input.length === 4) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 5) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 7) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 9) {\n return `#${input.slice(1)}`;\n }\n\n\n // rgb\n if (input.startsWith('rgb(')) {\n return input.slice(4, -1);\n }\n\n // rgba\n if (input.startsWith('rgba(')) {\n return input.slice(5, -1);\n }\n\n // hsl\n if (input.startsWith('hsl(')) {\n return input.slice(4, -1);\n }\n\n // hsla\n if (input.startsWith('hsla(')) {\n return input.slice(5, -1);\n }\n\n // hwb\n if (input.startsWith('hwb(')) {\n return input.slice(4, -1);\n }\n\n // lab\n if (input.startsWith('lab(')) {\n return input.slice(4, -1);\n }\n\n // lch\n if (input.startsWith('lch(')) {\n return input.slice(4, -1);\n }\n\n // oklab\n if (input.startsWith('oklab(')) {\n return input.slice(5, -1);\n }\n\n // oklch\n if (input.startsWith('oklch(')) {\n return input.slice(6, -1);\n }\n\n // color-mix\n if (input.startsWith('color-mix(')) {\n return input.slice(9, -1);\n }\n\n\n return null;\n}\nconst COLOR_KEYWORDS = new Set(['inherit', 'currentcolor', 'transparent']);\n/**\n * Declarations for a theme colour (#228), as Tailwind v4 emits them: `var(--color-<key>)` so runtime theme\n * overrides apply; with an opacity modifier, a literal srgb color-mix fallback plus an oklab color-mix of the var.\n */\nexport function themeColorDecls(prop: string, value: string, extra: { realThemeValue?: string; opacity?: string | number }): AstNode[] {\n const key = String(extra.realThemeValue);\n // A value that is already a var (shadcn-style `@theme inline` tokens) is kept as-is, as Tailwind inlines it.\n const ref = COLOR_KEYWORDS.has(value.toLowerCase()) || value.startsWith(\"var(\") || !/^[\\w-]+$/.test(key) ? value : `var(--color-${key})`;\n if (!extra.opacity) return [decl(prop, ref)];\n const alpha = normalizeAlpha(String(extra.opacity));\n const supports = (amount: string) =>\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [decl(prop, `color-mix(in oklab, ${ref} ${amount}, transparent)`)]);\n // A variable alpha has no static fallback amount: Tailwind keeps the plain colour and mixes only under @supports.\n if (alpha.isVar) return [decl(prop, value), supports(alpha.amount)];\n return [decl(prop, `color-mix(in srgb, ${value} ${alpha.amount}, transparent)`), supports(alpha.amount)];\n}\n\n/**\n * Opacity modifier → color-mix amount, as Tailwind v4 does: `50` → `50%`, `[37%]` → `37%`, `[0.5]` / `[.8]` → `50%` /\n * `80%` (a bracketed number ≤ 1 is a fraction), `[var(--a)]` / `(--a)` → `var(--a)`.\n */\nexport function normalizeAlpha(raw: string): { amount: string; isVar: boolean } {\n let v = raw.trim();\n const bracketed = v.startsWith(\"[\") && v.endsWith(\"]\");\n if (bracketed) v = v.slice(1, -1).trim();\n if (v.startsWith(\"(\") && v.endsWith(\")\")) v = `var(${v.slice(1, -1).trim()})`;\n if (v.startsWith(\"var(\")) return { amount: v, isVar: true };\n if (v.endsWith(\"%\")) return { amount: v, isVar: false };\n const n = Number(v);\n if (v !== \"\" && Number.isFinite(n)) {\n const pct = bracketed && n <= 1 ? n * 100 : n;\n return { amount: `${+pct.toFixed(4)}%`, isVar: false };\n }\n return { amount: v, isVar: false };\n}\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRule, atRoot, decl, property, type AstNode } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Accent Color Utilities ---\n// accent-color documentation\n\n// Theme color utilities (e.g. accent-inherit, accent-blue-500)\n// (Assume theme color registration is handled elsewhere, or extend as needed)\n\nstaticUtility(\"accent-inherit\", [[\"accent-color\", \"inherit\"]], { category: 'interactivity' });\nstaticUtility(\"accent-current\", [[\"accent-color\", \"currentColor\"]], { category: 'interactivity' });\nstaticUtility(\"accent-transparent\", [[\"accent-color\", \"transparent\"]], { category: 'interactivity' });\n\n// Functional: arbitrary value (accent-[value])\nfunctionalUtility({\n name: \"accent\",\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token, extra) => {\n if (extra?.realThemeValue) {\n if (extra.opacity) {\n return [\n atRule(\"supports\", `(color:color-mix(in lab, red, red))`, [\n decl(\n \"accent-color\",\n `color-mix(in lab, ${value} ${extra.opacity}%, transparent)`\n ),\n ]),\n decl(\"accent-color\", value),\n ];\n }\n\n return [decl(\"accent-color\", `var(--color-${extra.realThemeValue})`)];\n }\n\n return [decl(\"accent-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"accent-color\", `var(${value})`)],\n description: \"accent-color utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Appearance Utilities ---\n// appearance documentation\n\n// appearance-none: removes native form control styling\nstaticUtility(\"appearance-none\", [[\"appearance\", \"none\"]], { category: 'interactivity' });\n// appearance-auto: restores default browser styling\nstaticUtility(\"appearance-auto\", [[\"appearance\", \"auto\"]], { category: 'interactivity' });\n\n// --- Caret Color Utilities ---\n// caret-color documentation\n\n// Static caret colors\nstaticUtility(\"caret-inherit\", [[\"caret-color\", \"inherit\"]], { category: 'interactivity' });\nstaticUtility(\"caret-current\", [[\"caret-color\", \"currentColor\"]], { category: 'interactivity' });\nstaticUtility(\"caret-transparent\", [[\"caret-color\", \"transparent\"]], { category: 'interactivity' });\n\n// Theme color utilities (e.g. caret-blue-500)\n// (Assume theme color registration is handled elsewhere)\n\n// Functional: arbitrary value (caret-[value]) and custom property (caret-(--my-caret))\nfunctionalUtility({\n name: \"caret\",\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) {\n if (extra.opacity) {\n return [\n atRule(\"supports\", `(color:color-mix(in lab, red, red))`, [\n decl(\n \"caret-color\",\n `color-mix(in lab, ${value} ${extra.opacity}%, transparent)`\n ),\n ]),\n decl(\"caret-color\", value),\n ];\n }\n\n return [decl(\"caret-color\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"caret-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"caret-color\", `var(${value})`)],\n description:\n \"caret-color utility (static, theme, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Color Scheme Utilities ---\n// color-scheme documentation\n\n// scheme-normal: color-scheme: normal;\nstaticUtility(\"scheme-normal\", [[\"color-scheme\", \"normal\"]], { category: 'interactivity' });\n// scheme-dark: color-scheme: dark;\nstaticUtility(\"scheme-dark\", [[\"color-scheme\", \"dark\"]], { category: 'interactivity' });\n// scheme-light: color-scheme: light;\nstaticUtility(\"scheme-light\", [[\"color-scheme\", \"light\"]], { category: 'interactivity' });\n// scheme-light-dark: color-scheme: light dark;\nstaticUtility(\"scheme-light-dark\", [[\"color-scheme\", \"light dark\"]], { category: 'interactivity' });\n// scheme-only-dark: color-scheme: only dark;\nstaticUtility(\"scheme-only-dark\", [[\"color-scheme\", \"only dark\"]], { category: 'interactivity' });\n// scheme-only-light: color-scheme: only light;\nstaticUtility(\"scheme-only-light\", [[\"color-scheme\", \"only light\"]], { category: 'interactivity' });\n\n// --- Cursor Utilities ---\n// cursor documentation\n\n// Static cursor values\n[\n \"auto\",\n \"default\",\n \"pointer\",\n \"wait\",\n \"text\",\n \"move\",\n \"help\",\n \"not-allowed\",\n \"none\",\n \"context-menu\",\n \"progress\",\n \"cell\",\n \"crosshair\",\n \"vertical-text\",\n \"alias\",\n \"copy\",\n \"no-drop\",\n \"grab\",\n \"grabbing\",\n \"all-scroll\",\n \"col-resize\",\n \"row-resize\",\n \"n-resize\",\n \"e-resize\",\n \"s-resize\",\n \"w-resize\",\n \"ne-resize\",\n \"nw-resize\",\n \"se-resize\",\n \"sw-resize\",\n \"ew-resize\",\n \"ns-resize\",\n \"nesw-resize\",\n \"nwse-resize\",\n \"zoom-in\",\n \"zoom-out\",\n].forEach((cursor) => {\n staticUtility(`cursor-${cursor}`, [[\"cursor\", cursor]], { category: 'interactivity' });\n});\n\n// Functional: custom property (cursor-(--my-cursor)) and arbitrary value (cursor-[value])\nfunctionalUtility({\n name: \"cursor\",\n prop: \"cursor\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"cursor utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Field Sizing Utilities ---\n// field-sizing documentation\n\n// field-sizing-fixed: field-sizing: fixed;\nstaticUtility(\"field-sizing-fixed\", [[\"field-sizing\", \"fixed\"]], { category: 'interactivity' });\n// field-sizing-content: field-sizing: content;\nstaticUtility(\"field-sizing-content\", [[\"field-sizing\", \"content\"]], { category: 'interactivity' });\n\n// --- Pointer Events Utilities ---\n// pointer-events documentation\n\n// pointer-events-auto: pointer-events: auto;\nstaticUtility(\"pointer-events-auto\", [[\"pointer-events\", \"auto\"]], { category: 'interactivity' });\n// pointer-events-none: pointer-events: none;\nstaticUtility(\"pointer-events-none\", [[\"pointer-events\", \"none\"]], { category: 'interactivity' });\n\n// --- Resize Utilities ---\n// resize documentation\n\n// resize: resize: both;\nstaticUtility(\"resize\", [[\"resize\", \"both\"]], { category: 'interactivity' });\n// resize-x: resize: horizontal;\nstaticUtility(\"resize-x\", [[\"resize\", \"horizontal\"]], { category: 'interactivity' });\n// resize-y: resize: vertical;\nstaticUtility(\"resize-y\", [[\"resize\", \"vertical\"]], { category: 'interactivity' });\n// resize-none: resize: none;\nstaticUtility(\"resize-none\", [[\"resize\", \"none\"]], { category: 'interactivity' });\n\n// --- Scroll Behavior Utilities ---\n// scroll-behavior documentation\n\n// scroll-auto: scroll-behavior: auto;\nstaticUtility(\"scroll-auto\", [[\"scroll-behavior\", \"auto\"]], { category: 'interactivity' });\n// scroll-smooth: scroll-behavior: smooth;\nstaticUtility(\"scroll-smooth\", [[\"scroll-behavior\", \"smooth\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Align Utilities ---\n// scroll-snap-align documentation\nstaticUtility(\"snap-start\", [[\"scroll-snap-align\", \"start\"]], { category: 'interactivity' });\nstaticUtility(\"snap-end\", [[\"scroll-snap-align\", \"end\"]], { category: 'interactivity' });\nstaticUtility(\"snap-center\", [[\"scroll-snap-align\", \"center\"]], { category: 'interactivity' });\nstaticUtility(\"snap-align-none\", [[\"scroll-snap-align\", \"none\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Stop Utilities ---\n// scroll-snap-stop documentation\nstaticUtility(\"snap-normal\", [[\"scroll-snap-stop\", \"normal\"]], { category: 'interactivity' });\nstaticUtility(\"snap-always\", [[\"scroll-snap-stop\", \"always\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Type Utilities ---\n// scroll-snap-type documentation\nstaticUtility(\"snap-none\", [[\"scroll-snap-type\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"snap-x\", [[\"scroll-snap-type\", \"x var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-y\", [[\"scroll-snap-type\", \"y var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-both\", [[\"scroll-snap-type\", \"both var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-mandatory\", [[\"--baro-scroll-snap-strictness\", \"mandatory\"]], { category: 'interactivity' });\nstaticUtility(\"snap-proximity\", [[\"--baro-scroll-snap-strictness\", \"proximity\"]], { category: 'interactivity' });\n\n\n[\n [\"mbs\", \"scroll-margin-block-start\"], // #311 (Tailwind 4.3), before `mb`\n [\"mbe\", \"scroll-margin-block-end\"],\n [\"mt\", \"scroll-margin-top\"],\n [\"mr\", \"scroll-margin-right\"],\n [\"mb\", \"scroll-margin-bottom\"],\n [\"ml\", \"scroll-margin-left\"],\n [\"mx\", \"scroll-margin-inline\"],\n [\"my\", \"scroll-margin-block\"],\n [\"ms\", \"scroll-margin-inline-start\"],\n [\"me\", \"scroll-margin-inline-end\"],\n [\"m\", \"scroll-margin\"],\n].forEach(([name, prop]) => {\n // #314: 1px keyword, as Tailwind 4.3.3 (negative too, for margin only).\n staticUtility(`scroll-${name}-px`, [[prop, \"1px\"]], { category: 'interactivity' });\n staticUtility(`-scroll-${name}-px`, [[prop, \"-1px\"]], { category: 'interactivity' });\n functionalUtility({\n name: `scroll-${name}`,\n spacingKeys: true,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token, _extra) => {\n if (parseNumber(value) || token.negative) {\n return [decl(prop, `calc(var(--spacing) * ${value})`)];\n }\n return [decl(prop, value)];\n },\n handleCustomProperty: (value) => [decl(prop, `var(${value})`)],\n description: `${name} utility (static, arbitrary, custom property supported)`,\n category: \"interactivity\",\n });\n});\n\n\n\n\n\n[\n [\"pbs\", \"scroll-padding-block-start\"], // #311 (Tailwind 4.3), before `pb`\n [\"pbe\", \"scroll-padding-block-end\"],\n [\"pt\", \"scroll-padding-top\"],\n [\"pr\", \"scroll-padding-right\"],\n [\"pb\", \"scroll-padding-bottom\"],\n [\"pl\", \"scroll-padding-left\"],\n [\"px\", \"scroll-padding-inline\"],\n [\"py\", \"scroll-padding-block\"],\n [\"ps\", \"scroll-padding-inline-start\"],\n [\"pe\", \"scroll-padding-inline-end\"],\n [\"p\", \"scroll-padding\"],\n].forEach(([name, prop]) => {\n functionalUtility({\n name: `scroll-${name}`,\n spacingKeys: true,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : /^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, token, _extra) => {\n // #314: Tailwind 4.3.3 has no negative scroll-padding; `px` is 1px.\n if (token.negative) return [];\n if (parseNumber(value)) {\n return [decl(prop, `calc(var(--spacing) * ${value})`)];\n }\n return [decl(prop, value)];\n },\n handleCustomProperty: (value, _ctx, token) => (token.negative ? [] : [decl(prop, `var(${value})`)]),\n description: `scroll-${name} utility (static, arbitrary, custom property supported)`,\n category: \"interactivity\",\n });\n});\n\n// --- Touch Action Utilities ---\n// touch-action documentation\nstaticUtility(\"touch-auto\", [[\"touch-action\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"touch-none\", [[\"touch-action\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-x\", [[\"touch-action\", \"pan-x\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-left\", [[\"touch-action\", \"pan-left\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-right\", [[\"touch-action\", \"pan-right\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-y\", [[\"touch-action\", \"pan-y\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-up\", [[\"touch-action\", \"pan-up\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-down\", [[\"touch-action\", \"pan-down\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pinch-zoom\", [[\"touch-action\", \"pinch-zoom\"]], { category: 'interactivity' });\nstaticUtility(\"touch-manipulation\", [[\"touch-action\", \"manipulation\"]], { category: 'interactivity' });\n\n// --- User Select Utilities ---\n// user-select documentation\nstaticUtility(\"select-none\", [[\"-webkit-user-select\", \"none\"], [\"user-select\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"select-text\", [[\"-webkit-user-select\", \"text\"], [\"user-select\", \"text\"]], { category: 'interactivity' });\nstaticUtility(\"select-all\", [[\"-webkit-user-select\", \"all\"], [\"user-select\", \"all\"]], { category: 'interactivity' });\nstaticUtility(\"select-auto\", [[\"-webkit-user-select\", \"auto\"], [\"user-select\", \"auto\"]], { category: 'interactivity' });\n\n// --- Will Change Utilities ---\n// will-change documentation\nstaticUtility(\"will-change-auto\", [[\"will-change\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-scroll\", [[\"will-change\", \"scroll-position\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-contents\", [[\"will-change\", \"contents\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-transform\", [[\"will-change\", \"transform\"]], { category: 'interactivity' });\n\n// Functional: will-change-[value], will-change-(--custom-property)\nfunctionalUtility({\n name: \"will-change\",\n prop: \"will-change\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"will-change utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Scrollbar Utilities (#309, Tailwind 4.3) ---\nstaticUtility(\"scrollbar-auto\", [[\"scrollbar-width\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-thin\", [[\"scrollbar-width\", \"thin\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-none\", [[\"scrollbar-width\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-auto\", [[\"scrollbar-gutter\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-stable\", [[\"scrollbar-gutter\", \"stable\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-both\", [[\"scrollbar-gutter\", \"stable both-edges\"]], { category: 'interactivity' });\n\n// scrollbar-thumb-*/scrollbar-track-* set one half and re-emit the composite, with @property defaults (#0000)\n// so a lone thumb or track still yields a valid scrollbar-color.\nconst SCROLLBAR_COLOR = \"var(--baro-scrollbar-thumb) var(--baro-scrollbar-track)\";\nconst scrollbarProperties = () =>\n atRoot([\n property(\"--baro-scrollbar-thumb\", \"#0000\", \"<color>\"),\n property(\"--baro-scrollbar-track\", \"#0000\", \"<color>\"),\n ]);\nconst stripColorHint = (v: string) => v.replace(/^color:/, \"\");\n\nfor (const part of [\"thumb\", \"track\"] as const) {\n const key = `--baro-scrollbar-${part}`;\n const compose = (inner: AstNode[]) => [scrollbarProperties(), ...inner, decl(\"scrollbar-color\", SCROLLBAR_COLOR)];\n const withOpacity = (color: string, opacity?: string) =>\n opacity\n ? [decl(key, `color-mix(in oklab, ${color} ${opacity.replace(/^\\[(.*)\\]$/, \"$1\").replace(/%$/, \"\")}%, transparent)`)]\n : [decl(key, color)];\n functionalUtility({\n name: `scrollbar-${part}`,\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token, extra) => {\n if (extra?.realThemeValue) return compose(withOpacity(`var(--color-${extra.realThemeValue})`, extra.opacity));\n if (token.arbitrary) return compose(withOpacity(stripColorHint(value), extra?.opacity));\n if (value === \"inherit\" || value === \"transparent\") return compose([decl(key, value)]);\n if (value === \"current\") return compose(withOpacity(\"currentcolor\", extra?.opacity));\n return null;\n },\n handleCustomProperty: (value, _ctx, _token, extra) =>\n compose(withOpacity(`var(${stripColorHint(value)})`, extra?.opacity)),\n description: `scrollbar-color ${part} utility (theme, arbitrary, custom property, opacity)`,\n category: \"interactivity\",\n });\n}\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Transition Property Utilities ---\n// transition-property documentation\n\n// Default variable\nconst defaultTiming = \"var(--default-transition-timing-function)\"; // cubic-bezier(0.4, 0, 0.2, 1)\nconst defaultDuration = \"var(--default-transition-duration)\"; // 150ms\n\n// transition\nstaticUtility(\"transition\", [\n [\n \"transition-property\",\n \"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --baro-gradient-from, --baro-gradient-via, --baro-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events\",\n ],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-all\nstaticUtility(\"transition-all\", [\n [\"transition-property\", \"all\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-colors\nstaticUtility(\"transition-colors\", [\n [\n \"transition-property\",\n \"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --baro-gradient-from, --baro-gradient-via, --baro-gradient-to\",\n ],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-opacity\nstaticUtility(\"transition-opacity\", [\n [\"transition-property\", \"opacity\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-shadow\nstaticUtility(\"transition-shadow\", [\n [\"transition-property\", \"box-shadow\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-transform\nstaticUtility(\"transition-transform\", [\n [\"transition-property\", \"transform, translate, scale, rotate\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' } );\n\n\n// --- Transition Behavior ---\nstaticUtility(\"transition-normal\", [[\"transition-behavior\", \"normal\"]], { category: 'transitions' });\nstaticUtility(\"transition-discrete\", [[\"transition-behavior\", \"allow-discrete\"]], { category: 'transitions' }); \n\n// transition-none\nstaticUtility(\"transition-none\", [[\"transition-property\", \"none\"]], { category: 'transitions' });\n\n// transition-[value] (arbitrary value)\nfunctionalUtility({\n name: \"transition\",\n prop: \"transition-property\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n return [\n decl(\"transition-property\", value),\n decl(\"transition-timing-function\", defaultTiming),\n decl(\"transition-duration\", defaultDuration),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"transition-property\", `var(${value})`),\n decl(\"transition-timing-function\", defaultTiming),\n decl(\"transition-duration\", defaultDuration),\n ],\n description:\n \"transition-property utility (static, arbitrary value, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Duration ---\nstaticUtility(\"duration-initial\", [[\"transition-duration\", \"initial\"]], { category: 'transitions' });\n\nfunctionalUtility({\n name: \"duration\",\n prop: \"transition-duration\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"transition-duration\", `${value}ms`)];\n }\n return [decl(\"transition-duration\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-duration\", `var(${value})`)],\n description: \"transition-duration utility (static, number, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Timing Function ---\nstaticUtility(\"ease-linear\", [[\"transition-timing-function\", \"linear\"]], { category: 'transitions' });\nstaticUtility(\"ease-in\", [[\"transition-timing-function\", \"var(--ease-in)\"]], { category: 'transitions' });\nstaticUtility(\"ease-out\", [[\"transition-timing-function\", \"var(--ease-out)\"]], { category: 'transitions' });\nstaticUtility(\"ease-in-out\", [[\"transition-timing-function\", \"var(--ease-in-out)\"]], { category: 'transitions' });\nstaticUtility(\"ease-initial\", [[\"transition-timing-function\", \"initial\"]], { category: 'transitions' });\n\nfunctionalUtility({\n name: \"ease\",\n prop: \"transition-timing-function\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n return [decl(\"transition-timing-function\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-timing-function\", `var(${value})`)],\n description: \"transition-timing-function utility (static, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Delay ---\nfunctionalUtility({\n name: \"delay\",\n prop: \"transition-delay\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"transition-delay\", `${value}ms`)];\n }\n return [decl(\"transition-delay\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-delay\", `var(${value})`)],\n description: \"transition-delay utility (number, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Animation ---\nstaticUtility(\"animate-spin\", [\n [\"animation\", \"var(--animate-spin)\"],\n], { category: 'transitions' });\nstaticUtility(\"animate-ping\", [[\"animation\", \"var(--animate-ping)\"]], { category: 'transitions' });\nstaticUtility(\"animate-pulse\", [[\"animation\", \"var(--animate-pulse)\"]], { category: 'transitions' });\nstaticUtility(\"animate-bounce\", [[\"animation\", \"var(--animate-bounce)\"]], { category: 'transitions' });\nstaticUtility(\"animate-none\", [[\"animation\", \"none\"]], { category: 'transitions' } );\n\nfunctionalUtility({\n name: \"animate\",\n // #274: theme.animations (and Tailwind's theme.animation) names, e.g. theme.extend.animation.wiggle.\n themeKeys: [\"animations\", \"animation\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return [decl(\"animation\", `var(--animate-${extra.realThemeValue})`)];\n if (token.customProperty) {\n return [decl(\"animation\", `var(${value})`)];\n }\n return [decl(\"animation\", value)];\n },\n handleCustomProperty: (value) => [decl(\"animation\", `var(${value})`)],\n description: \"animation utility (static, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n","import { staticUtility } from \"../core/registry\";\nimport { functionalUtility } from \"../core/registry\";\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Table Layout Utilities (border-collapse, border-separate) ---\nstaticUtility(\"border-collapse\", [[\"border-collapse\", \"collapse\"]], { category: 'table' });\nstaticUtility(\"border-separate\", [[\"border-collapse\", \"separate\"]], { category: 'table' });\n\n// --- Table Layout ---\nstaticUtility(\"table-auto\", [[\"table-layout\", \"auto\"]], { category: 'table' });\nstaticUtility(\"table-fixed\", [[\"table-layout\", \"fixed\"]], { category: 'table' });\n\n// --- Border Spacing ---\n// #314: as Tailwind 4.3.3, each axis lives in --baro-border-spacing-x/y (with @property defaults) and\n// border-spacing composes both, so border-spacing-x-* and border-spacing-y-* combine on one element.\nconst borderSpacingProperties = () =>\n atRoot([\n property(\"--baro-border-spacing-x\", \"0\", \"<length>\"),\n property(\"--baro-border-spacing-y\", \"0\", \"<length>\"),\n ]);\nconst BORDER_SPACING = \"var(--baro-border-spacing-x) var(--baro-border-spacing-y)\";\nconst borderSpacing = (axes: string[], v: string) => [\n borderSpacingProperties(),\n ...axes.map((a) => decl(`--baro-border-spacing-${a}`, v)),\n decl(\"border-spacing\", BORDER_SPACING),\n];\n\n([\n [\"border-spacing-x\", [\"x\"]],\n [\"border-spacing-y\", [\"y\"]],\n [\"border-spacing\", [\"x\", \"y\"]],\n] as [string, string[]][]).forEach(([name, axes]) => {\n staticUtility(`${name}-px`, [\n borderSpacingProperties,\n ...axes.map((a) => [`--baro-border-spacing-${a}`, \"1px\"] as [string, string]),\n [\"border-spacing\", BORDER_SPACING],\n ], { category: \"table\" });\n functionalUtility({\n name,\n prop: \"border-spacing\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) =>\n borderSpacing(axes, parseNumber(value) ? `calc(var(--spacing) * ${value})` : value),\n handleCustomProperty: (value) => borderSpacing(axes, `var(${value})`),\n description: `${name} utility (number, px, arbitrary, custom property supported)`,\n category: \"table\",\n });\n});\n\n// --- Caption Side ---\nstaticUtility(\"caption-top\", [[\"caption-side\", \"top\"]], { category: 'table' });\nstaticUtility(\"caption-bottom\", [[\"caption-side\", \"bottom\"]], { category: 'table' });","import { atRule, decl, type AstNode } from \"../core/ast\";\n\n// #313: shared shadow colour/alpha handling for shadow-*, inset-shadow-*, text-shadow-* and drop-shadow-*,\n// matching Tailwind 4.3.3. Each shadow layer's colour is wrapped as var(--baro-<layer>-color, <colour>) so a\n// colour utility on the same element replaces it, and an opacity modifier (/50, /[20%], /(--o)) sets\n// --baro-<layer>-alpha and fades the default colour with oklab relative colour syntax.\nexport type ShadowLayer = \"shadow\" | \"inset-shadow\" | \"text-shadow\" | \"drop-shadow\";\n\n/** Opacity modifier to an alpha: `50` → 50%, `[20%]` → 20%, `(--o)` → var(--o); anything else is invalid. */\nexport function parseAlpha(op: string | undefined): { alpha: string; isVar: boolean } | null {\n if (!op) return null;\n if (/^\\d+(\\.\\d+)?$/.test(op)) return { alpha: `${op}%`, isVar: false };\n const pct = /^\\[(\\d+(?:\\.\\d+)?)%\\]$/.exec(op);\n if (pct) return { alpha: `${pct[1]}%`, isVar: false };\n const cp = /^\\((--[\\w-]+)\\)$/.exec(op);\n if (cp) return { alpha: `var(${cp[1]})`, isVar: true };\n return null;\n}\n\nfunction splitTop(value: string, sep: string): string[] {\n const out: string[] = [];\n let depth = 0;\n let cur = \"\";\n for (const ch of value) {\n if (ch === \"(\") depth++;\n else if (ch === \")\") depth--;\n if (depth === 0 && (sep === \" \" ? /\\s/.test(ch) : ch === sep)) {\n if (cur.trim()) out.push(cur.trim());\n cur = \"\";\n } else cur += ch;\n }\n if (cur.trim()) out.push(cur.trim());\n return out;\n}\n\nconst LENGTH = /^-?(\\d*\\.)?\\d+([a-z]+|%)?$/i;\n\n/** The shadow's layers with each colour wrapped in var(--baro-<layer>-color, …), faded by `alpha` if given. */\nexport function shadowLayers(value: string, layer: ShadowLayer, alpha?: string): string[] {\n return splitTop(value, \",\").map((l) => {\n const parts = splitTop(l, \" \");\n const i = parts.findIndex((p) => p !== \"inset\" && !LENGTH.test(p));\n // A layer without a colour gets Tailwind's currentcolor default.\n const c = i < 0 ? \"currentcolor\" : parts[i];\n parts[i < 0 ? parts.length : i] = `var(--baro-${layer}-color, ${alpha ? `oklab(from ${c} l a b / ${alpha})` : c})`;\n return parts.join(\" \");\n });\n}\n\n/**\n * Declarations for a shadow value on `prop`, honouring the opacity modifier the way Tailwind 4.3.3 does:\n * a numeric alpha fades the colour directly; a custom-property alpha keeps the plain value as a fallback\n * and fades it only where relative colour syntax is supported. Returns null for an invalid modifier.\n */\nexport function shadowValueDecls(\n layer: ShadowLayer,\n prop: string,\n value: string,\n opacity: string | undefined,\n render: (layers: string[]) => string = (l) => l.join(\", \"),\n): AstNode[] | null {\n const a = parseAlpha(opacity);\n if (opacity && !a) return null;\n if (!a) return [decl(prop, render(shadowLayers(value, layer)))];\n const alphaDecl = decl(`--baro-${layer}-alpha`, a.alpha);\n if (!a.isVar) return [alphaDecl, decl(prop, render(shadowLayers(value, layer, a.alpha)))];\n return [\n alphaDecl,\n decl(prop, render(shadowLayers(value, layer))),\n atRule(\"supports\", \"(color: lab(from red l a b))\", [decl(prop, render(shadowLayers(value, layer, a.alpha)))]),\n ];\n}\n\n/**\n * --baro-<layer>-color for a colour utility (shadow-red-500/50, text-shadow-(color:--c), …). `ref` is the\n * value used where color-mix is supported (the theme var), `color` the literal fallback. The colour is\n * always mixed with --baro-<layer>-alpha so a named size's opacity modifier also fades a custom colour.\n */\nexport function shadowColorDecls(layer: ShadowLayer, color: string, opacity: string | undefined, ref = color): AstNode[] | null {\n const key = `--baro-${layer}-color`;\n if (color === \"inherit\") return [decl(key, \"inherit\")];\n const a = parseAlpha(opacity);\n if (opacity && !a) return null;\n const inner = a ? `color-mix(in oklab, ${ref} ${a.alpha}, transparent)` : ref;\n const fallback = a ? `color-mix(in srgb, ${color} ${a.alpha}, transparent)` : color;\n return [\n decl(key, fallback),\n atRule(\"supports\", \"(color: color-mix(in lab, red, red))\", [\n decl(key, `color-mix(in oklab, ${inner} var(--baro-${layer}-alpha), transparent)`),\n ]),\n ];\n}\n","import { staticUtility, functionalUtility, registerUtility } from \"../core/registry\";\nimport { shadowColorDecls, shadowValueDecls } from \"./shadow-color\";\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\nimport { parseColor } from \"../core/utils\";\n\n// --- Filter ---\nstaticUtility(\"filter-none\", [[\"filter\", \"none\"]], { category: 'effects' });\n\nfunctionalUtility({\n name: \"filter\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\nconst filters = () => {\n return decl(\"filter\", \"var(--baro-blur, ) var(--baro-brightness, ) var(--baro-contrast, ) var(--baro-grayscale, ) var(--baro-hue-rotate, ) var(--baro-invert, ) var(--baro-saturate, ) var(--baro-sepia, ) var(--baro-drop-shadow, )\");\n}\n\n// --- Blur ---\n[\n [\"blur-xs\", \"var(--blur-xs)\"],\n [\"blur-sm\", \"var(--blur-sm)\"],\n [\"blur-md\", \"var(--blur-md)\"],\n [\"blur-lg\", \"var(--blur-lg)\"],\n [\"blur-xl\", \"var(--blur-xl)\"],\n [\"blur-2xl\", \"var(--blur-2xl)\"],\n [\"blur-3xl\", \"var(--blur-3xl)\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [\n decl(\"--baro-blur\", `blur(${value})`),\n filters()\n ], { category: 'effects' });\n});\nstaticUtility(\"blur\", [decl(\"--baro-blur\", \"blur(8px)\"), filters()], { category: 'effects' });\nstaticUtility(\"blur-none\", [decl(\"--baro-blur\", \"\"), filters()], { category: 'effects' });\n\nfunctionalUtility({\n name: \"blur\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.customProperty) return [decl(\"--baro-blur\", `blur(var(${value}))`), filters()];\n return [decl(\"--baro-blur\", `blur(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-blur\", `blur(var(${value}))`), filters()],\n description: \"blur filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Brightness ---\n\nfunctionalUtility({\n name: \"brightness\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (token.arbitrary) {\n return [decl(\"--baro-brightness\", `brightness(${value})`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-brightness\", `brightness(${value}%)`), filters()];\n }\n if (token.customProperty)\n return [decl(\"--baro-brightness\", `brightness(var(${value}))`), filters()];\n return [decl(\"--baro-brightness\", `brightness(${value})`), filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-brightness\", `brightness(var(${value}))`),\n filters()\n ],\n description:\n \"brightness filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Contrast ---\nfunctionalUtility({\n name: \"contrast\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [decl(\"--baro-contrast\", `contrast(${value})`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-contrast\", `contrast(${value}%)`), filters()];\n }\n if (token.customProperty)\n return [decl(\"--baro-contrast\", `contrast(var(${value}))`), filters()];\n return [decl(\"--baro-contrast\", `contrast(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-contrast\", `contrast(var(${value}))`), filters()],\n description:\n \"contrast filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Drop Shadow (#313: Tailwind 4.3.3 sizes, colours and opacity modifiers) ---\nconst dropShadowProperties = () =>\n atRoot([\n property(\"--baro-drop-shadow\"),\n property(\"--baro-drop-shadow-color\"),\n property(\"--baro-drop-shadow-alpha\", \"100%\", \"<percentage>\"),\n property(\"--baro-drop-shadow-size\"),\n ]);\nconst wrapDropShadow = (layers: string[]) => layers.map((l) => `drop-shadow(${l})`).join(\" \");\n// Bare `drop-shadow` is the deprecated two-layer theme reference.\nconst DROP_SHADOW_DEFAULT = \"0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)\";\nconst namedDropShadow = (ctx: { theme: (...k: string[]) => unknown }, name: string) => {\n const v = ctx.theme(\"dropShadow\", name);\n return typeof v === \"string\" && /^[\\w.-]+$/.test(name) ? v : null;\n};\n\n// A drop-shadow value: `named` keeps Tailwind's drop-shadow(var(--drop-shadow-<name>)) when unfaded.\nfunction dropShadowValue(value: string, opacity: string | undefined, named?: string, keepNamed = false) {\n const decls = shadowValueDecls(\"drop-shadow\", \"--baro-drop-shadow-size\", value, opacity, wrapDropShadow);\n if (!decls) return null;\n const composed = named !== undefined && (!opacity || keepNamed) ? named : \"var(--baro-drop-shadow-size)\";\n return [dropShadowProperties(), ...decls, decl(\"--baro-drop-shadow\", composed), filters()];\n}\n\nstaticUtility(\"drop-shadow-none\", [decl(\"--baro-drop-shadow\", \" \"), filters()]);\nregisterUtility({\n name: \"drop-shadow\",\n match: (className: string) => /^drop-shadow(\\/.+)?$/.test(className),\n handler: (value, _ctx, token) => {\n const full = value ? `${token.prefix}-${value}` : token.prefix;\n const cut = full.indexOf(\"/\");\n const opacity = cut < 0 ? undefined : full.slice(cut + 1);\n const literal = \"drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow( 0 1px 1px rgb(0 0 0 / 0.06))\";\n return dropShadowValue(DROP_SHADOW_DEFAULT, opacity, literal, true) ?? [];\n },\n category: \"effects\",\n});\n\nconst dropShadowColor = (color: string, opacity: string | undefined, ref?: string) => {\n const decls = shadowColorDecls(\"drop-shadow\", color, opacity, ref);\n return decls && [dropShadowProperties(), ...decls, decl(\"--baro-drop-shadow\", \"var(--baro-drop-shadow-size)\")];\n};\n\nfunctionalUtility({\n name: \"drop-shadow\",\n themeKeys: ['colors'],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handleBareValue: ({ value, ctx }) => (namedDropShadow(ctx, value) ? value : null),\n handle: (value, ctx, token, extra) => {\n const opacity = extra?.opacity;\n const keyword = token.arbitrary ? undefined : ({ inherit: \"inherit\", current: \"currentcolor\", transparent: \"transparent\" } as Record<string, string>)[extra?.realThemeValue ?? value];\n if (keyword) return dropShadowColor(keyword, opacity);\n if (extra?.realThemeValue) return dropShadowColor(value, opacity, `var(--color-${extra.realThemeValue})`);\n if (token.arbitrary) {\n if (parseColor(value)) return dropShadowColor(value, opacity);\n return dropShadowValue(value, opacity);\n }\n const named = namedDropShadow(ctx, value);\n if (named) return dropShadowValue(named, opacity, `drop-shadow(var(--drop-shadow-${value}))`);\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) return dropShadowColor(`var(${value.slice(6)})`, undefined) ?? [];\n return [\n dropShadowProperties(),\n decl(\"--baro-drop-shadow-size\", `drop-shadow(var(${value}))`),\n decl(\"--baro-drop-shadow\", `var(--baro-drop-shadow-size)`),\n filters(),\n ];\n },\n description:\n \"drop-shadow filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Grayscale ---\nstaticUtility(\"grayscale\", [decl(\"--baro-grayscale\", \"grayscale(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"grayscale\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-grayscale\", `grayscale(${value}%)`), filters()];\n }\n return [decl(\"--baro-grayscale\", `grayscale(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-grayscale\", `grayscale(var(${value}))`), filters()],\n description: \"grayscale filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Hue Rotate ---\n\nfunctionalUtility({\n name: \"hue-rotate\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, _ctx, token) => {\n if (token.negative && parseNumber(token.value!)) {\n return [decl(\"--baro-hue-rotate\", `hue-rotate(calc(${token.value}deg * -1))`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-hue-rotate\", `hue-rotate(${value}deg)`), filters()];\n }\n if (token.customProperty) return [decl(\"--baro-hue-rotate\", `hue-rotate(var(${value}))`), filters()];\n return [decl(\"--baro-hue-rotate\", `hue-rotate(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-hue-rotate\", `hue-rotate(var(${value}))`), filters()],\n description: \"hue-rotate filter utility (static, negative, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Invert ---\nstaticUtility(\"invert\", [decl(\"--baro-invert\", \"invert(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"invert\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-invert\", `invert(${value}%)`), filters()];\n }\n\n return [decl(\"--baro-invert\", `invert(${value})`), filters()];\n },\n description: \"invert filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Saturate ---\nfunctionalUtility({\n name: \"saturate\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-saturate\", `saturate(${value}%)`), filters()];\n }\n return [decl(\"--baro-saturate\", `saturate(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-saturate\", `saturate(var(${value}))`), filters()],\n description: \"saturate filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Sepia ---\nstaticUtility(\"sepia\", [decl(\"--baro-sepia\", \"sepia(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"sepia\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-sepia\", `sepia(${value}%)`), filters()];\n }\n return [decl(\"--baro-sepia\", `sepia(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-sepia\", `sepia(var(${value}))`), filters()],\n description: \"sepia filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\nconst filters = () => {\n return [\n decl(\n \"-webkit-backdrop-filter\",\n \"var(--baro-backdrop-blur, ) var(--baro-backdrop-brightness, ) var(--baro-backdrop-contrast, ) var(--baro-backdrop-grayscale, ) var(--baro-backdrop-hue-rotate, ) var(--baro-backdrop-invert, ) var(--baro-backdrop-saturate, ) var(--baro-backdrop-sepia, )\"\n ),\n decl(\n \"backdrop-filter\",\n \"var(--baro-backdrop-blur, ) var(--baro-backdrop-brightness, ) var(--baro-backdrop-contrast, ) var(--baro-backdrop-grayscale, ) var(--baro-backdrop-hue-rotate, ) var(--baro-backdrop-invert, ) var(--baro-backdrop-saturate, ) var(--baro-backdrop-sepia, )\"\n ),\n ];\n};\n\n// --- Backdrop Filter ---\nstaticUtility(\n \"backdrop-filter\",\n [[\"backdrop-filter\", \"var(--baro-backdrop-filter)\"]],\n { category: \"effects\" }\n);\nstaticUtility(\"backdrop-filter-none\", [[\"backdrop-filter\", \"none\"]], {\n category: \"effects\",\n});\n\nfunctionalUtility({\n name: \"backdrop-filter\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Blur ---\n[\n [\"backdrop-blur-xs\", \"var(--blur-xs)\"],\n [\"backdrop-blur-sm\", \"var(--blur-sm)\"],\n [\"backdrop-blur-md\", \"var(--blur-md)\"],\n [\"backdrop-blur-lg\", \"var(--blur-lg)\"],\n [\"backdrop-blur-xl\", \"var(--blur-xl)\"],\n [\"backdrop-blur-2xl\", \"var(--blur-2xl)\"],\n [\"backdrop-blur-3xl\", \"var(--blur-3xl)\"],\n].forEach(([name, value]) => {\n staticUtility(\n name as string,\n [decl(\"--baro-backdrop-blur\", `blur(${value})`), ...filters()],\n { category: \"effects\" }\n );\n});\nstaticUtility(\"backdrop-blur\", [decl(\"--baro-backdrop-blur\", \"blur(8px)\"), ...filters()], { category: \"effects\" });\nstaticUtility(\n \"backdrop-blur-none\",\n [decl(\"--baro-backdrop-blur\", \"\"), ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-blur\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-blur\", `blur(var(${value}))`),\n ...filters(),\n ];\n return [decl(\"--baro-backdrop-blur\", `blur(${value})`), ...filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-blur\", `blur(var(${value}))`),\n ...filters(),\n ],\n description:\n \"blur filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Brightness ---\n\nfunctionalUtility({\n name: \"backdrop-brightness\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value})`),\n ...filters(),\n ];\n }\n\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value}%)`),\n ...filters(),\n ];\n }\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(var(${value}))`),\n ...filters(),\n ];\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-brightness\", `brightness(var(${value}))`),\n ...filters(),\n ],\n description:\n \"brightness filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Contrast ---\nfunctionalUtility({\n name: \"backdrop-contrast\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value})`),\n ...filters(),\n ];\n }\n\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value}%)`),\n ...filters(),\n ];\n }\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(var(${value}))`),\n ...filters(),\n ];\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-contrast\", `contrast(var(${value}))`),\n ...filters(),\n ],\n description:\n \"contrast filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Grayscale ---\nstaticUtility(\n \"backdrop-grayscale\",\n [[\"--baro-backdrop-grayscale\", \"grayscale(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-grayscale\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-grayscale\", `grayscale(${value}%)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-grayscale\", `grayscale(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-grayscale\", `grayscale(var(${value}))`),\n ...filters(),\n ],\n description:\n \"grayscale filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Hue Rotate ---\n\nfunctionalUtility({\n name: \"backdrop-hue-rotate\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, _ctx, token) => {\n if (token.negative && parseNumber(token.value!)) {\n return [\n decl(\n \"--baro-backdrop-hue-rotate\",\n `hue-rotate(calc(${token.value}deg * -1))`\n ),\n ...filters(),\n ];\n }\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(${value}deg)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(var(${value}))`),\n ...filters(),\n ],\n description:\n \"hue-rotate filter utility (static, negative, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Invert ---\nstaticUtility(\n \"backdrop-invert\",\n [[\"--baro-backdrop-invert\", \"invert(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-invert\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-invert\", `invert(${value}%)`),\n ...filters(),\n ];\n }\n\n return [decl(\"--baro-backdrop-invert\", `invert(${value})`), ...filters()];\n },\n description:\n \"invert filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Saturate ---\nfunctionalUtility({\n name: \"backdrop-saturate\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-saturate\", `saturate(${value}%)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-saturate\", `saturate(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-saturate\", `saturate(var(${value}))`),\n ...filters(),\n ],\n description:\n \"saturate filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Sepia ---\nstaticUtility(\n \"backdrop-sepia\",\n [[\"--baro-backdrop-sepia\", \"sepia(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-sepia\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-backdrop-sepia\", `sepia(${value}%)`), ...filters()];\n }\n return [decl(\"--baro-backdrop-sepia\", `sepia(${value})`), ...filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-sepia\", `sepia(var(${value}))`),\n ...filters(),\n ],\n description:\n \"sepia filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n","import { staticUtility, functionalUtility, registerUtility } from \"../core/registry\";\nimport { shadowColorDecls, shadowValueDecls, type ShadowLayer } from \"./shadow-color\";\nimport { atRule, atRoot, decl, property } from \"../core/ast\";\nimport { parseColor, parseNumber } from \"../core/utils\";\n\n// --- Box Shadow ---\n// box-shadow documentation\n\n// Tailwind v4 composes every box-shadow layer into one declaration, so shadow-* and ring-* on the same element\n// both render: each utility sets only its own layer var and re-emits this composite.\nconst SHADOW_COMPOSITE =\n \"var(--baro-inset-shadow), var(--baro-inset-ring-shadow), var(--baro-ring-offset-shadow), var(--baro-ring-shadow), var(--baro-shadow)\";\n\n// Base values for the box-shadow composition layers, registered like Tailwind v4's @property layer so that a lone\n// shadow-*/ring-*/inset-ring-* composes a valid box-shadow when the other layers are unset.\n// Without these @property initial values the whole box-shadow declaration is invalid and nothing renders.\nconst ringShadowProperties = () =>\n atRoot([\n property(\"--baro-shadow\", \"0 0 #0000\"),\n property(\"--baro-inset-shadow\", \"0 0 #0000\"),\n property(\"--baro-inset-ring-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-offset-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-offset-width\", \"0px\", \"<length>\"),\n property(\"--baro-ring-offset-color\", \"#fff\"),\n ]);\n\n\n// #313: the colour/alpha registrations Tailwind 4.3.3 emits @property rules for, so a colour utility or an\n// opacity modifier composes with a size utility on the same element.\nconst shadowColorProperties = (layer: \"shadow\" | \"inset-shadow\") =>\n atRoot([\n property(`--baro-${layer}-color`),\n property(`--baro-${layer}-alpha`, \"100%\", \"<percentage>\"),\n ]);\n\n// Tailwind 4.3.3 named box shadows (\"\" is bare `shadow`, `inner` is the deprecated theme reference).\nconst NAMED_SHADOWS: Record<string, string> = {\n \"\": \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n \"2xs\": \"0 1px rgb(0 0 0 / 0.05)\",\n xs: \"0 1px 2px 0 rgb(0 0 0 / 0.05)\",\n sm: \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n md: \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n lg: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n xl: \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n \"2xl\": \"0 25px 50px -12px rgb(0 0 0 / 0.25)\",\n inner: \"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)\",\n};\n// Tailwind 4.3.3 named inset shadows; md..2xl are BaroCSS extensions (no opacity modifier).\nconst NAMED_INSET_SHADOWS: Record<string, string> = {\n \"2xs\": \"inset 0 1px rgb(0 0 0 / 0.05)\",\n xs: \"inset 0 1px 1px rgb(0 0 0 / 0.05)\",\n sm: \"inset 0 2px 4px rgb(0 0 0 / 0.05)\",\n};\nconst INSET_EXTENSIONS: Record<string, string> = {\n md: \"inset 0 4px 6px -1px rgb(0 0 0 / 0.05)\",\n lg: \"inset 0 10px 15px -3px rgb(0 0 0 / 0.05)\",\n xl: \"inset 0 20px 25px -5px rgb(0 0 0 / 0.05)\",\n \"2xl\": \"inset 0 25px 50px -12px rgb(0 0 0 / 0.05)\",\n};\nconst insetEach = (value: string) => value.split(/,(?![^(]*\\))/).map((l) => `inset ${l.trim()}`).join(\", \");\nconst own = (table: Record<string, string>, key: string) => Object.prototype.hasOwnProperty.call(table, key);\n\n// A box-shadow layer value (named or arbitrary) with its colour var and opacity modifier.\nfunction boxShadowLayer(layer: \"shadow\" | \"inset-shadow\", value: string, opacity: string | undefined) {\n const decls = shadowValueDecls(layer, `--baro-${layer}`, value, opacity);\n if (!decls) return null;\n return [ringShadowProperties(), shadowColorProperties(layer), ...decls, decl(\"box-shadow\", SHADOW_COMPOSITE)];\n}\n\nfunction namedBoxShadow(layer: \"shadow\" | \"inset-shadow\", name: string, opacity: string | undefined) {\n if (layer === \"shadow\") return own(NAMED_SHADOWS, name) ? boxShadowLayer(layer, NAMED_SHADOWS[name], opacity) : null;\n if (own(NAMED_INSET_SHADOWS, name)) return boxShadowLayer(layer, NAMED_INSET_SHADOWS[name], opacity);\n if (!opacity && own(INSET_EXTENSIONS, name)) return boxShadowLayer(layer, INSET_EXTENSIONS[name], undefined);\n return null;\n}\n\nstaticUtility(\"shadow-none\", [ringShadowProperties, [\"--baro-shadow\", \"0 0 #0000\"], [\"box-shadow\", SHADOW_COMPOSITE]], { category: 'effects' });\nstaticUtility(\"inset-shadow-none\", [ringShadowProperties, [\"--baro-inset-shadow\", \"inset 0 0 #0000\"], [\"box-shadow\", SHADOW_COMPOSITE]], { category: 'effects' });\n\n// Bare `shadow` and `shadow/<alpha>` (no dash, so the functional utility below never sees them).\nregisterUtility({\n name: \"shadow\",\n match: (className: string) => /^shadow(\\/.+)?$/.test(className),\n handler: (value, _ctx, token) => {\n const full = value ? `${token.prefix}-${value}` : token.prefix;\n const cut = full.indexOf(\"/\");\n return namedBoxShadow(\"shadow\", \"\", cut < 0 ? undefined : full.slice(cut + 1)) ?? [];\n },\n category: 'effects',\n});\n\nconst KEYWORD_COLORS: Record<string, string> = { inherit: \"inherit\", current: \"currentcolor\", transparent: \"transparent\" };\n\n// Colour for a shadow layer: theme colour, (color:--x), arbitrary colour, or a keyword.\nfunction layerColor(layer: ShadowLayer, main: string, opacity: string | undefined, token: { arbitrary?: boolean }, realThemeValue?: string) {\n const keyword = token.arbitrary ? undefined : KEYWORD_COLORS[realThemeValue ?? main];\n if (keyword) return shadowColorDecls(layer, keyword, opacity);\n if (realThemeValue) return shadowColorDecls(layer, main, opacity, `var(--color-${realThemeValue})`);\n if (main.startsWith(\"color:\")) return shadowColorDecls(layer, `var(${main.slice(6)})`, opacity);\n if (token.arbitrary && parseColor(main)) return shadowColorDecls(layer, main, opacity);\n return undefined;\n}\n\n// shadow-<size>[/alpha], shadow-<color>[/alpha], shadow-[<shadow>][/alpha], shadow-(--x)\nfor (const layer of [\"shadow\", \"inset-shadow\"] as const) {\n functionalUtility({\n name: layer,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\"],\n handleBareValue: ({ value, extra }) => (namedBoxShadow(layer, value, extra?.opacity) ? value : null),\n handle: (value, _ctx, token, extra) => {\n const opacity = extra?.opacity;\n const named = !extra?.realThemeValue && !token.arbitrary ? namedBoxShadow(layer, value, opacity) : null;\n if (named) return named;\n const color = layerColor(layer, value, opacity, token, extra?.realThemeValue);\n if (color !== undefined) return color;\n // Tailwind prefixes every layer of an arbitrary inset shadow with `inset`.\n if (token.arbitrary) return boxShadowLayer(layer, layer === \"inset-shadow\" ? insetEach(value) : value, opacity);\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"color:\") ? shadowColorDecls(layer, `var(${value.slice(6)})`, undefined) ?? [] : [ringShadowProperties(), decl(`--baro-${layer}`, layer === \"inset-shadow\" ? `inset var(${value})` : `var(${value})`), decl(\"box-shadow\", SHADOW_COMPOSITE)],\n });\n}\n\n// --- Text Shadow (#313, Tailwind 4.3.3) ---\nconst textShadowProperties = () =>\n atRoot([\n property(\"--baro-text-shadow-color\"),\n property(\"--baro-text-shadow-alpha\", \"100%\", \"<percentage>\"),\n ]);\nconst namedTextShadow = (ctx: { theme: (...k: string[]) => unknown }, name: string) => {\n const v = ctx.theme(\"textShadow\", name);\n return typeof v === \"string\" && /^[\\w.-]+$/.test(name) ? v : null;\n};\nconst textShadowValue = (value: string, opacity: string | undefined) => {\n const decls = shadowValueDecls(\"text-shadow\", \"text-shadow\", value, opacity);\n return decls ? [textShadowProperties(), ...decls] : null;\n};\nstaticUtility(\"text-shadow-none\", [textShadowProperties, [\"text-shadow\", \"none\"]], { category: 'effects' });\nfunctionalUtility({\n name: \"text-shadow\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\"],\n handleBareValue: ({ value, ctx }) => (namedTextShadow(ctx, value) ? value : null),\n handle: (value, ctx, token, extra) => {\n const opacity = extra?.opacity;\n if (!extra?.realThemeValue && !token.arbitrary) {\n const named = namedTextShadow(ctx, value);\n if (named) return textShadowValue(named, opacity);\n }\n const color = layerColor(\"text-shadow\", value, opacity, token, extra?.realThemeValue);\n if (color !== undefined) return color && [textShadowProperties(), ...color];\n if (token.arbitrary) return textShadowValue(value, opacity);\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"color:\")\n ? [textShadowProperties(), ...(shadowColorDecls(\"text-shadow\", `var(${value.slice(6)})`, undefined) ?? [])]\n : [textShadowProperties(), decl(\"text-shadow\", `var(${value})`)],\n category: \"effects\",\n});\n\n// --- Ring ( multi-variable) ---\n// ring-width documentation\n\n// Static ring width utilities\n[\n [\"ring\", \"1px\"],\n [\"ring-0\", \"0px\"],\n [\"ring-1\", \"1px\"],\n [\"ring-2\", \"2px\"],\n [\"ring-4\", \"4px\"],\n [\"ring-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n ringShadowProperties,\n // Like Tailwind, ring-N does not set the offset vars (they come from @property defaults and ring-offset-*),\n // so `ring-N ring-offset-M` composes the same in either rule order.\n // No hardcoded ring color: Tailwind v4's default ring color is currentColor (via the var() fallback below).\n [\n \"--baro-ring-shadow\",\n ringShadowValue(px as string),\n ],\n [\n \"box-shadow\",\n \"var(--baro-inset-shadow), var(--baro-inset-ring-shadow), var(--baro-ring-offset-shadow), var(--baro-ring-shadow), var(--baro-shadow)\",\n ],\n ]);\n});\n\nfunction ringShadowValue(width: string) {\n return `var(--baro-ring-inset,) 0 0 0 calc(${width} + var(--baro-ring-offset-width)) var(--baro-ring-color, currentcolor)`;\n}\n\n// Ring offset width utilities (ring-offset-<n>). Matches Tailwind's .ring-offset-N: sets the offset width and the\n// offset shadow; it renders a visible offset ring only when combined with a ring-* utility, exactly like Tailwind.\n[\n [\"ring-offset-0\", \"0px\"],\n [\"ring-offset-1\", \"1px\"],\n [\"ring-offset-2\", \"2px\"],\n [\"ring-offset-4\", \"4px\"],\n [\"ring-offset-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n [\"--baro-ring-offset-width\", px as string],\n [\"--baro-ring-offset-color\", \"#fff\"],\n [\n \"--baro-ring-offset-shadow\",\n `var(--baro-ring-inset,) 0 0 0 var(--baro-ring-offset-width) var(--baro-ring-offset-color)`,\n ],\n ], { category: 'effects' });\n});\n\n// Inset ring width utilities\n[\n [\"inset-ring\", \"1px\"],\n [\"inset-ring-0\", \"0px\"],\n [\"inset-ring-1\", \"1px\"],\n [\"inset-ring-2\", \"2px\"],\n [\"inset-ring-4\", \"4px\"],\n [\"inset-ring-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n // Tailwind 4.1.13: only the inset-ring layer; the colour defaults to currentcolor via the var() fallback.\n ringShadowProperties,\n [\"--baro-inset-ring-shadow\", `inset 0 0 0 ${px} var(--baro-inset-ring-color, currentcolor)`],\n [\"box-shadow\", SHADOW_COMPOSITE],\n ], { category: 'effects' });\n});\n\n// Ring inset\nstaticUtility(\"ring-inset\", [[\"--baro-ring-inset\", \"inset\"]], { category: 'effects' });\n\n// --- Ring color/opacity/arbitrary/custom property ( supports+fallback) ---\nfunction createRingColorDecls(\n key: string,\n main: string,\n opacity: string | undefined,\n realThemeValue: string\n) {\n const colorVar = `var(--color-${realThemeValue})`;\n let colorMix = colorVar;\n let fallback = colorVar;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${colorVar} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(key, colorMix),\n ]),\n decl(key, fallback),\n ];\n}\n\n// Ring color/opacity/arbitrary/custom property\nfunctionalUtility({\n name: \"ring\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\"],\n handle: (value, ctx, token, extra) => {\n const main = value;\n const opacity = extra?.opacity;\n const realThemeValue = extra?.realThemeValue;\n if (realThemeValue) {\n return createRingColorDecls(\n \"--baro-ring-color\",\n main,\n opacity,\n realThemeValue\n );\n }\n if (main.startsWith(\"color:\")) {\n const cp = main.replace(\"color:\", \"\");\n let colorMix = `var(${cp})`;\n let fallback = colorMix;\n if (opacity) {\n colorMix = `color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`;\n fallback = colorMix;\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-ring-color\", colorMix),\n ]),\n decl(\"--baro-ring-color\", fallback),\n ];\n }\n if (token.arbitrary) {\n let colorMix = main;\n let fallback = main;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-ring-color\", colorMix),\n ]),\n decl(\"--baro-ring-color\", fallback),\n ];\n }\n\n // ring-[3px]: an arbitrary length is a ring width (Tailwind's ring-[<length>]); anything else is a colour.\n if (!parseColor(main) && /^(-?(\\d+\\.?\\d*|\\.\\d+)(px|rem|em|%|vw|vh|vmin|vmax|ch|ex|pt|cm|mm|in|pc)|0|(length:.+)|calc\\(.+\\))$/i.test(main)) {\n const width = main.startsWith(\"length:\") ? main.slice(7) : main;\n return [\n ringShadowProperties(),\n decl(\"--baro-ring-shadow\", ringShadowValue(width)),\n decl(\"box-shadow\", SHADOW_COMPOSITE),\n ];\n }\n return [parseColor(main) ? decl(\"--baro-ring-color\", main) : decl(\"box-shadow\", main)];\n }\n if (main === \"inherit\" || main === \"current\" || main === \"transparent\") {\n return [\n decl(\"--baro-ring-color\", main === \"current\" ? \"currentColor\" : main),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) {\n const cp = value.replace(\"color:\", \"\");\n return [decl(\"--baro-ring-color\", `var(${cp})`)];\n }\n return [decl(\"--baro-ring-color\", `var(${value})`)];\n },\n});\n\n// Inset ring color/opacity/arbitrary/custom property ( supports+fallback)\nfunctionalUtility({\n name: \"inset-ring\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\", \"shadows\"],\n handle: (value, ctx, token, extra) => {\n const main = value;\n const opacity = extra?.opacity;\n const realThemeValue = extra?.realThemeValue;\n if (realThemeValue) {\n return createRingColorDecls(\n \"--baro-inset-ring-color\",\n main,\n opacity,\n realThemeValue\n );\n }\n if (main.startsWith(\"color:\")) {\n const cp = main.replace(\"color:\", \"\");\n let colorMix = `var(${cp})`;\n let fallback = colorMix;\n if (opacity) {\n colorMix = `color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`;\n fallback = colorMix;\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-inset-ring-color\", colorMix),\n ]),\n decl(\"--baro-inset-ring-color\", fallback),\n ];\n }\n if (token.arbitrary) {\n let colorMix = main;\n let fallback = main;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-inset-ring-color\", colorMix),\n ]),\n decl(\"--baro-inset-ring-color\", fallback),\n ];\n }\n\n return [decl(\"box-shadow\", `inset ${main}`)];\n }\n\n if (main === \"inherit\" || main === \"current\" || main === \"transparent\") {\n return [\n decl(\n \"--baro-inset-ring-color\",\n main === \"current\" ? \"currentColor\" : main\n ),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) {\n const cp = value.replace(\"color:\", \"\");\n return [decl(\"--baro-inset-ring-color\", `var(${cp})`)];\n }\n return [decl(\"--baro-inset-ring-color\", `var(${value})`)];\n },\n});\n\n// --- Opacity ---\n\nfunctionalUtility({\n name: \"opacity\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n // opacity-100, opacity-75, etc.\n if (parseNumber(value)) {\n let num = Number(value);\n if (num > 1) num = num / 100;\n return [decl(\"opacity\", String(num))];\n }\n // opacity-[.67] → .67\n if (token.arbitrary) {\n return [decl(\"opacity\", value)];\n }\n return null;\n },\n handleCustomProperty: (value) => [decl(\"opacity\", `var(${value})`)],\n description: \"opacity utility (number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mix Blend Mode ---\n[\n [\"mix-blend-normal\", \"normal\"],\n [\"mix-blend-multiply\", \"multiply\"],\n [\"mix-blend-screen\", \"screen\"],\n [\"mix-blend-overlay\", \"overlay\"],\n [\"mix-blend-darken\", \"darken\"],\n [\"mix-blend-lighten\", \"lighten\"],\n [\"mix-blend-color-dodge\", \"color-dodge\"],\n [\"mix-blend-color-burn\", \"color-burn\"],\n [\"mix-blend-hard-light\", \"hard-light\"],\n [\"mix-blend-soft-light\", \"soft-light\"],\n [\"mix-blend-difference\", \"difference\"],\n [\"mix-blend-exclusion\", \"exclusion\"],\n [\"mix-blend-hue\", \"hue\"],\n [\"mix-blend-saturation\", \"saturation\"],\n [\"mix-blend-color\", \"color\"],\n [\"mix-blend-luminosity\", \"luminosity\"],\n [\"mix-blend-plus-darker\", \"plus-darker\"],\n [\"mix-blend-plus-lighter\", \"plus-lighter\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mix-blend-mode\", value as string]]);\n});\n\n// --- Background Blend Mode ---\n[\n [\"bg-blend-normal\", \"normal\"],\n [\"bg-blend-multiply\", \"multiply\"],\n [\"bg-blend-screen\", \"screen\"],\n [\"bg-blend-overlay\", \"overlay\"],\n [\"bg-blend-darken\", \"darken\"],\n [\"bg-blend-lighten\", \"lighten\"],\n [\"bg-blend-color-dodge\", \"color-dodge\"],\n [\"bg-blend-color-burn\", \"color-burn\"],\n [\"bg-blend-hard-light\", \"hard-light\"],\n [\"bg-blend-soft-light\", \"soft-light\"],\n [\"bg-blend-difference\", \"difference\"],\n [\"bg-blend-exclusion\", \"exclusion\"],\n [\"bg-blend-hue\", \"hue\"],\n [\"bg-blend-saturation\", \"saturation\"],\n [\"bg-blend-color\", \"color\"],\n [\"bg-blend-luminosity\", \"luminosity\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"background-blend-mode\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Clip ---\n[\n [\"mask-clip-border\", \"border-box\"],\n [\"mask-clip-padding\", \"padding-box\"],\n [\"mask-clip-content\", \"content-box\"],\n [\"mask-clip-fill\", \"fill-box\"],\n [\"mask-clip-stroke\", \"stroke-box\"],\n [\"mask-clip-view\", \"view-box\"],\n [\"mask-no-clip\", \"no-clip\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-clip\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Composite ---\n[\n [\"mask-add\", \"add\"],\n [\"mask-subtract\", \"subtract\"],\n [\"mask-intersect\", \"intersect\"],\n [\"mask-exclude\", \"exclude\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-composite\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Mode ---\n[\n [\"mask-alpha\", \"alpha\"],\n [\"mask-luminance\", \"luminance\"],\n [\"mask-match\", \"match-source\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-mode\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Origin ---\n[\n [\"mask-origin-border\", \"border-box\"],\n [\"mask-origin-padding\", \"padding-box\"],\n [\"mask-origin-content\", \"content-box\"],\n [\"mask-origin-fill\", \"fill-box\"],\n [\"mask-origin-stroke\", \"stroke-box\"],\n [\"mask-origin-view\", \"view-box\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-origin\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Position ---\n[\n [\"mask-top-left\", \"top left\"],\n [\"mask-top\", \"top\"],\n [\"mask-top-right\", \"top right\"],\n [\"mask-left\", \"left\"],\n [\"mask-center\", \"center\"],\n [\"mask-right\", \"right\"],\n [\"mask-bottom-left\", \"bottom left\"],\n [\"mask-bottom\", \"bottom\"],\n [\"mask-bottom-right\", \"bottom right\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-position\", value as string]], { category: 'effects' });\n});\nfunctionalUtility({\n name: \"mask-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (token.arbitrary) return [decl(\"mask-position\", value)];\n if (token.customProperty) return [decl(\"mask-position\", `var(${value})`)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"mask-position\", `var(${value})`)],\n description:\n \"mask-position utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mask Repeat ---\n[\n [\"mask-repeat\", \"repeat\"],\n [\"mask-no-repeat\", \"no-repeat\"],\n [\"mask-repeat-x\", \"repeat-x\"],\n [\"mask-repeat-y\", \"repeat-y\"],\n [\"mask-repeat-space\", \"space\"],\n [\"mask-repeat-round\", \"round\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-repeat\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Size ---\n[\n [\"mask-auto\", \"auto\"],\n [\"mask-cover\", \"cover\"],\n [\"mask-contain\", \"contain\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-size\", value as string]], { category: 'effects' });\n});\n\n\n// --- Mask Type ---\n[\n [\"mask-type-alpha\", \"alpha\"],\n [\"mask-type-luminance\", \"luminance\"],\n ].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-type\", value as string]], { category: 'effects' });\n });\n\n// mask-size-[value] (arbitrary) & mask-size-(--custom-property)\nfunctionalUtility({\n name: \"mask-size\",\n prop: \"mask-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"mask-size utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mask Image ---\n// Tailwind v4.1.13 registers these mask gradient vars with @property initial values, so a lone\n// mask-linear-from-* composes a valid mask-image without inline var() fallbacks.\nconst maskProperties = () =>\n atRoot([\n property(\"--baro-mask-linear\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-radial\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-conic\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-linear-position\", \"0deg\"),\n property(\"--baro-mask-linear-from-position\", \"0%\"),\n property(\"--baro-mask-linear-to-position\", \"100%\"),\n property(\"--baro-mask-linear-from-color\", \"black\"),\n property(\"--baro-mask-linear-to-color\", \"transparent\"),\n ]);\n\nfunctionalUtility({\n name: \"mask-linear-from\",\n handleBareValue: ({ value }) => /^(?:100|[1-9]?\\d)%$/.test(value) ? value : null,\n handle: (value) => [\n decl(\"mask-image\", \"var(--baro-mask-linear), var(--baro-mask-radial), var(--baro-mask-conic)\"),\n decl(\"mask-composite\", \"intersect\"),\n decl(\"--baro-mask-linear-stops\", \"var(--baro-mask-linear-position), var(--baro-mask-linear-from-color) var(--baro-mask-linear-from-position), var(--baro-mask-linear-to-color) var(--baro-mask-linear-to-position)\"),\n decl(\"--baro-mask-linear\", \"linear-gradient(var(--baro-mask-linear-stops))\"),\n decl(\"--baro-mask-linear-from-position\", value),\n maskProperties(),\n ],\n category: \"effects\",\n});\n\nstaticUtility(\"mask-none\", [[\"mask-image\", \"none\"]], { category: \"effects\" });\nfunctionalUtility({\n name: \"mask\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (value === \"none\") return [decl(\"mask-image\", \"none\")];\n if (token.arbitrary) return [decl(\"mask-image\", value)];\n if (token.customProperty) return [decl(\"mask-image\", `var(${value})`)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"mask-image\", `var(${value})`)],\n description: \"mask-image utility (arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n","import { staticUtility, functionalUtility, registerUtility } from \"../core/registry\";\nimport { decl, atRule } from \"../core/ast\";\nimport {\n parseNumber,\n parseFraction,\n} from \"../core/utils\";\n\n// --- Layout: Isolation ---\nstaticUtility(\"isolate\", [[\"isolation\", \"isolate\"]], { category: 'layout' });\nstaticUtility(\"isolation-auto\", [[\"isolation\", \"auto\"]], { category: 'layout' });\n\n// --- Layout: Z-Index ---\nstaticUtility(\"z-auto\", [[\"z-index\", \"auto\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"z\",\n prop: \"z-index\",\n themeKey: \"zIndex\",\n supportsNegative: true,\n supportsFraction: true,\n supportsArbitrary: true, // z-[999], z-[calc(var(--index)+1)] 등 지원\n supportsCustomProperty: true, // z-(--my-z) supported\n // but actual theme lookup is handled in ctx.theme\n handleBareValue: ({ value }) => {\n return parseNumber(value); // only allow integers\n },\n description: \"z-index utility\",\n category: \"layout\",\n});\n\n// --- Layout: Aspect Ratio ---\nstaticUtility(\"aspect-square\", [[\"aspect-ratio\", \"1 / 1\"]], { category: 'layout' });\nstaticUtility(\"aspect-video\", [[\"aspect-ratio\", \"var(--aspect-video)\"]], { category: 'layout' });\nstaticUtility(\"aspect-auto\", [[\"aspect-ratio\", \"auto\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"aspect\",\n prop: \"aspect-ratio\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n description:\n \"aspect-ratio utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Columns ---\nstaticUtility(\"columns-auto\", [[\"columns\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"columns-3xs\", [[\"columns\", \"var(--container-3xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-2xs\", [[\"columns\", \"var(--container-2xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-xs\", [[\"columns\", \"var(--container-xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-sm\", [[\"columns\", \"var(--container-sm)\"]], { category: 'layout' });\nstaticUtility(\"columns-md\", [[\"columns\", \"var(--container-md)\"]], { category: 'layout' });\nstaticUtility(\"columns-lg\", [[\"columns\", \"var(--container-lg)\"]], { category: 'layout' });\nstaticUtility(\"columns-xl\", [[\"columns\", \"var(--container-xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-2xl\", [[\"columns\", \"var(--container-2xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-3xl\", [[\"columns\", \"var(--container-3xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-4xl\", [[\"columns\", \"var(--container-4xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-5xl\", [[\"columns\", \"var(--container-5xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-6xl\", [[\"columns\", \"var(--container-6xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-7xl\", [[\"columns\", \"var(--container-7xl)\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"columns\",\n prop: \"columns\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => parseNumber(value),\n description:\n \"columns utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Break After ---\nstaticUtility(\"break-after-auto\", [[\"break-after\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-after-avoid\", [[\"break-after\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-after-all\", [[\"break-after\", \"all\"]], { category: 'layout' });\nstaticUtility(\"break-after-avoid-page\", [[\"break-after\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-after-page\", [[\"break-after\", \"page\"]], { category: 'layout' });\nstaticUtility(\"break-after-left\", [[\"break-after\", \"left\"]], { category: 'layout' });\nstaticUtility(\"break-after-right\", [[\"break-after\", \"right\"]], { category: 'layout' });\nstaticUtility(\"break-after-column\", [[\"break-after\", \"column\"]], { category: 'layout' });\n\n// --- Layout: Break Before ---\nstaticUtility(\"break-before-auto\", [[\"break-before\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-before-avoid\", [[\"break-before\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-before-all\", [[\"break-before\", \"all\"]], { category: 'layout' });\nstaticUtility(\"break-before-avoid-page\", [[\"break-before\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-before-page\", [[\"break-before\", \"page\"]], { category: 'layout' });\nstaticUtility(\"break-before-left\", [[\"break-before\", \"left\"]], { category: 'layout' });\nstaticUtility(\"break-before-right\", [[\"break-before\", \"right\"]], { category: 'layout' });\nstaticUtility(\"break-before-column\", [[\"break-before\", \"column\"]], { category: 'layout' });\n\n// --- Layout: Break Inside ---\nstaticUtility(\"break-inside-auto\", [[\"break-inside\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid\", [[\"break-inside\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid-page\", [[\"break-inside\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid-column\", [[\"break-inside\", \"avoid-column\"]], { category: 'layout' });\n\n// --- Layout: Box Decoration Break ---\nstaticUtility(\"box-decoration-slice\", [[\"box-decoration-break\", \"slice\"]], { category: 'layout' });\nstaticUtility(\"box-decoration-clone\", [[\"box-decoration-break\", \"clone\"]], { category: 'layout' });\n\n// --- Layout: Box Sizing ---\n staticUtility(\"box-border\", [[\"box-sizing\", \"border-box\"]], { category: 'layout' });\nstaticUtility(\"box-content\", [[\"box-sizing\", \"content-box\"]], { category: 'layout' });\n\n// --- Layout: Display ---\nstaticUtility(\"block\", [[\"display\", \"block\"]], { category: 'layout' });\nstaticUtility(\"inline\", [[\"display\", \"inline\"]], { category: 'layout' });\nstaticUtility(\"inline-block\", [[\"display\", \"inline-block\"]], { category: 'layout' });\nstaticUtility(\"flow-root\", [[\"display\", \"flow-root\"]], { category: 'layout' });\nstaticUtility(\"flex\", [[\"display\", \"flex\"]], { category: 'layout' });\nstaticUtility(\"inline-flex\", [[\"display\", \"inline-flex\"]], { category: 'layout' });\nstaticUtility(\"grid\", [[\"display\", \"grid\"]], { category: 'layout' });\nstaticUtility(\"inline-grid\", [[\"display\", \"inline-grid\"]], { category: 'layout' });\nstaticUtility(\"contents\", [[\"display\", \"contents\"]], { category: 'layout' });\nstaticUtility(\"table\", [[\"display\", \"table\"]], { category: 'layout' });\nstaticUtility(\"inline-table\", [[\"display\", \"inline-table\"]], { category: 'layout' });\nstaticUtility(\"table-caption\", [[\"display\", \"table-caption\"]], { category: 'layout' });\nstaticUtility(\"table-cell\", [[\"display\", \"table-cell\"]], { category: 'layout' });\nstaticUtility(\"table-column\", [[\"display\", \"table-column\"]], { category: 'layout' });\nstaticUtility(\"table-column-group\", [[\"display\", \"table-column-group\"]], { category: 'layout' });\nstaticUtility(\"table-footer-group\", [[\"display\", \"table-footer-group\"]], { category: 'layout' });\nstaticUtility(\"table-header-group\", [[\"display\", \"table-header-group\"]], { category: 'layout' });\nstaticUtility(\"table-row-group\", [[\"display\", \"table-row-group\"]], { category: 'layout' });\nstaticUtility(\"table-row\", [[\"display\", \"table-row\"]], { category: 'layout' });\nstaticUtility(\"list-item\", [[\"display\", \"list-item\"]], { category: 'layout' });\nstaticUtility(\"hidden\", [[\"display\", \"none\"]], { category: 'layout' });\nstaticUtility(\"sr-only\", [\n [\"position\", \"absolute\"],\n [\"width\", \"1px\"],\n [\"height\", \"1px\"],\n [\"padding\", \"0\"],\n [\"margin\", \"-1px\"],\n [\"overflow\", \"hidden\"],\n [\"clip-path\", \"inset(50%)\"],\n [\"white-space\", \"nowrap\"],\n [\"border-width\", \"0\"],\n], { category: 'layout' });\n\nstaticUtility(\"not-sr-only\", [\n [\"position\", \"static\"],\n [\"width\", \"auto\"],\n [\"height\", \"auto\"],\n [\"padding\", \"0\"],\n [\"margin\", \"0\"],\n [\"overflow\", \"visible\"],\n [\"clip-path\", \"none\"],\n [\"white-space\", \"normal\"],\n], { category: 'layout' });\n\n// --- Layout: Container queries (@container, @container/<name>, @container-normal) ---\nstaticUtility(\"@container\", [[\"container-type\", \"inline-size\"]], { category: 'layout' });\nstaticUtility(\"@container-normal\", [[\"container-type\", \"normal\"]], { category: 'layout' });\nstaticUtility(\"@container-size\", [[\"container-type\", \"size\"]], { category: 'layout' }); // #311 (Tailwind 4.3)\n// Named forms: @container/<name>, @container-normal/<name>, @container-size/<name> (#311).\nconst NAMED_CONTAINER = /^@container(-normal|-size)?\\/([a-zA-Z0-9_-]+)$/;\nconst CONTAINER_TYPE: Record<string, string> = { '': 'inline-size', '-normal': 'normal', '-size': 'size' };\nregisterUtility({\n name: \"@container\",\n match: (className: string) => NAMED_CONTAINER.test(className),\n handler: (_value, _ctx, token) => {\n const m = NAMED_CONTAINER.exec(`${token.prefix}${token.value ? `-${token.value}` : \"\"}`);\n return m ? [decl(\"container-type\", CONTAINER_TYPE[m[1] ?? '']), decl(\"container-name\", m[2])] : null;\n },\n category: 'layout',\n});\n\n// --- Layout: Container (Tailwind 4: width 100% + max-width at each breakpoint, ascending) ---\nconst toRem = (v: string): number => {\n const m = /^(-?\\d*\\.?\\d+)(rem|px|em)$/.exec(v.trim());\n if (!m) return Number.NaN;\n return m[2] === 'px' ? Number(m[1]) / 16 : Number(m[1]);\n};\nregisterUtility({\n name: \"container\",\n match: (className: string) => className === \"container\",\n handler: (_value, ctx) => {\n const bps = (ctx.theme('breakpoints') || ctx.config('theme.breakpoints') || {}) as Record<string, unknown>;\n const values = Object.values(bps).filter((v): v is string => typeof v === 'string' && !Number.isNaN(toRem(v)));\n values.sort((a, b) => toRem(a) - toRem(b));\n return [decl(\"width\", \"100%\"), ...values.map((v) => atRule(\"media\", `(width >= ${v})`, [decl(\"max-width\", v)]))];\n },\n category: 'layout',\n});\n\n// --- Layout: Float ---\nstaticUtility(\"float-right\", [[\"float\", \"right\"]], { category: 'layout' });\nstaticUtility(\"float-left\", [[\"float\", \"left\"]], { category: 'layout' });\nstaticUtility(\"float-start\", [[\"float\", \"inline-start\"]], { category: 'layout' });\nstaticUtility(\"float-end\", [[\"float\", \"inline-end\"]], { category: 'layout' });\nstaticUtility(\"float-none\", [[\"float\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Clear ---\nstaticUtility(\"clear-left\", [[\"clear\", \"left\"]], { category: 'layout' });\nstaticUtility(\"clear-right\", [[\"clear\", \"right\"]], { category: 'layout' });\nstaticUtility(\"clear-both\", [[\"clear\", \"both\"]], { category: 'layout' });\nstaticUtility(\"clear-start\", [[\"clear\", \"inline-start\"]], { category: 'layout' });\nstaticUtility(\"clear-end\", [[\"clear\", \"inline-end\"]], { category: 'layout' });\nstaticUtility(\"clear-none\", [[\"clear\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Object Fit ---\nstaticUtility(\"object-contain\", [[\"object-fit\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"object-cover\", [[\"object-fit\", \"cover\"]], { category: 'layout' });\nstaticUtility(\"object-fill\", [[\"object-fit\", \"fill\"]], { category: 'layout' });\nstaticUtility(\"object-none\", [[\"object-fit\", \"none\"]], { category: 'layout' });\nstaticUtility(\"object-scale-down\", [[\"object-fit\", \"scale-down\"]], { category: 'layout' });\n\n// --- Layout: Object Position ---\nstaticUtility(\"object-top-left\", [[\"object-position\", \"top left\"]], { category: 'layout' });\nstaticUtility(\"object-top\", [[\"object-position\", \"top\"]], { category: 'layout' });\nstaticUtility(\"object-top-right\", [[\"object-position\", \"top right\"]], { category: 'layout' });\nstaticUtility(\"object-left\", [[\"object-position\", \"left\"]], { category: 'layout' });\nstaticUtility(\"object-center\", [[\"object-position\", \"center\"]], { category: 'layout' });\nstaticUtility(\"object-right\", [[\"object-position\", \"right\"]], { category: 'layout' });\nstaticUtility(\"object-bottom-left\", [[\"object-position\", \"bottom left\"]], { category: 'layout' });\nstaticUtility(\"object-bottom\", [[\"object-position\", \"bottom\"]], { category: 'layout' });\nstaticUtility(\"object-bottom-right\", [[\"object-position\", \"bottom right\"]], { category: 'layout' });\n\nfunctionalUtility({\n name: \"object\",\n prop: \"object-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description:\n \"object-position utility (arbitrary value, custom property supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Overflow ---\n staticUtility(\"overflow-auto\", [[\"overflow\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-hidden\", [[\"overflow\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-clip\", [[\"overflow\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-visible\", [[\"overflow\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-scroll\", [[\"overflow\", \"scroll\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-auto\", [[\"overflow-x\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-auto\", [[\"overflow-y\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-hidden\", [[\"overflow-x\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-hidden\", [[\"overflow-y\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-clip\", [[\"overflow-x\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-clip\", [[\"overflow-y\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-visible\", [[\"overflow-x\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-visible\", [[\"overflow-y\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-scroll\", [[\"overflow-x\", \"scroll\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-scroll\", [[\"overflow-y\", \"scroll\"]], { category: 'layout' });\n\n// --- Layout: Overscroll Behavior ---\nstaticUtility(\"overscroll-auto\", [[\"overscroll-behavior\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-contain\", [[\"overscroll-behavior\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-none\", [[\"overscroll-behavior\", \"none\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-auto\", [[\"overscroll-behavior-x\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-contain\", [[\"overscroll-behavior-x\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-none\", [[\"overscroll-behavior-x\", \"none\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-auto\", [[\"overscroll-behavior-y\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-contain\", [[\"overscroll-behavior-y\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-none\", [[\"overscroll-behavior-y\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Position ---\nstaticUtility(\"static\", [[\"position\", \"static\"]], { category: 'layout' });\nstaticUtility(\"fixed\", [[\"position\", \"fixed\"]], { category: 'layout' });\nstaticUtility(\"absolute\", [[\"position\", \"absolute\"]], { category: 'layout' });\nstaticUtility(\"relative\", [[\"position\", \"relative\"]], { category: 'layout' });\nstaticUtility(\"sticky\", [[\"position\", \"sticky\"]], { category: 'layout' });\n\n// --- Layout: Inset/Top/Right/Bottom/Left ---\n[\n [\"inset-x\", \"inset-inline\"],\n [\"inset-y\", \"inset-block\"],\n // Tailwind 4.3 logical sides; registered before `inset` so their handler runs first for `inset-s-*` etc.\n [\"inset-s\", \"inset-inline-start\"],\n [\"inset-e\", \"inset-inline-end\"],\n [\"inset-bs\", \"inset-block-start\"],\n [\"inset-be\", \"inset-block-end\"],\n [\"inset\", \"inset\"],\n [\"start\", \"inset-inline-start\"],\n [\"end\", \"inset-inline-end\"],\n [\"top\", \"top\"],\n [\"right\", \"right\"],\n [\"bottom\", \"bottom\"],\n [\"left\", \"left\"],\n].forEach(([name, prop]) => {\n // inset\n staticUtility(`${name}-auto`, [[prop, \"auto\"]], { category: 'layout' });\n staticUtility(`${name}-full`, [[prop, \"100%\"]], { category: 'layout' });\n staticUtility(`-${name}-full`, [[prop, \"-100%\"]], { category: 'layout' });\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'layout' });\n staticUtility(`-${name}-px`, [[prop, \"-1px\"]], { category: 'layout' });\n functionalUtility({\n name: name,\n spacingKeys: true,\n prop: prop,\n supportsNegative: true,\n supportsFraction: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n const frac = parseFraction(value);\n if (frac) return frac;\n return null;\n },\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * -${value})`;\n }\n const frac = parseFraction(value);\n if (frac) return `-${frac}`;\n return null;\n },\n description: `${name} utility (spacing, fraction, px, full, auto, custom property, arbitrary, negative supported)`,\n category: \"layout\",\n });\n});\n\n// --- Layout: Visibility ---\nstaticUtility(\"visible\", [[\"visibility\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"invisible\", [[\"visibility\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"collapse\", [[\"visibility\", \"collapse\"]], { category: 'layout' });\n\n// --- Layout: Gap ---\nfunctionalUtility({\n name: \"gap-x\",\n spacingKeys: true,\n prop: \"column-gap\",\n supportsArbitrary: true, // gap-x-[10vw]\n supportsCustomProperty: true, // gap-x-(--my-gap-x)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"column-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"column-gap\", `var(${value})`)],\n description: \"gap-x utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap-y\",\n spacingKeys: true,\n prop: \"row-gap\",\n supportsArbitrary: true, // gap-y-[10vw]\n supportsCustomProperty: true, // gap-y-(--my-gap-y)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"row-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"row-gap\", `var(${value})`)],\n description: \"gap-y utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap\",\n spacingKeys: true,\n prop: \"gap\",\n supportsArbitrary: true, // gap-[10vw]\n supportsCustomProperty: true, // gap-(--my-gap)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"gap\", `var(${value})`)],\n description: \"gap utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\n\n// #310: zoom-* (Tailwind 4.3): integer → percent (zoom-50 → 50%), zoom-[1.5], zoom-(--z).\nfunctionalUtility({\n name: \"zoom\",\n prop: \"zoom\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? `${value}%` : null),\n description: \"zoom utility (integer percent, arbitrary, custom property)\",\n category: \"layout\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport {\n parseFractionOrNumber,\n parseNumber,\n parseFraction,\n} from \"../core/utils\";\n\n\n// --- Flexbox & Grid: flex-basis ---\nstaticUtility(\"basis-full\", [[\"flex-basis\", \"100%\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-auto\", [[\"flex-basis\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-3xs\", [[\"flex-basis\", \"var(--container-3xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-2xs\", [[\"flex-basis\", \"var(--container-2xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-xs\", [[\"flex-basis\", \"var(--container-xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-sm\", [[\"flex-basis\", \"var(--container-sm)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-md\", [[\"flex-basis\", \"var(--container-md)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-lg\", [[\"flex-basis\", \"var(--container-lg)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-xl\", [[\"flex-basis\", \"var(--container-xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-2xl\", [[\"flex-basis\", \"var(--container-2xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-3xl\", [[\"flex-basis\", \"var(--container-3xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-4xl\", [[\"flex-basis\", \"var(--container-4xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-5xl\", [[\"flex-basis\", \"var(--container-5xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-6xl\", [[\"flex-basis\", \"var(--container-6xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-7xl\", [[\"flex-basis\", \"var(--container-7xl)\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"basis\",\n prop: \"flex-basis\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--container-${value}) * 1px)`;\n }\n const frac = parseFraction(value);\n if (frac) return frac;\n return null;\n },\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--container-${value}) * -1px)`;\n }\n const frac = parseFraction(value);\n if (frac) return `-${frac}`;\n return null;\n },\n description:\n \"flex-basis utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: flex-direction ---\nstaticUtility(\"flex-row\", [[\"flex-direction\", \"row\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-row-reverse\", [[\"flex-direction\", \"row-reverse\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-col\", [[\"flex-direction\", \"column\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-col-reverse\", [[\"flex-direction\", \"column-reverse\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: flex-wrap ---\nstaticUtility(\"flex-wrap\", [[\"flex-wrap\", \"wrap\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-wrap-reverse\", [[\"flex-wrap\", \"wrap-reverse\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-nowrap\", [[\"flex-wrap\", \"nowrap\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Flex ---\nstaticUtility(\"flex-auto\", [[\"flex\", \"1 1 auto\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-initial\", [[\"flex\", \"0 1 auto\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-none\", [[\"flex\", \"none\"]], { category: 'flex-grid' });\n\n// Registered before `flex` so the legacy aliases win over flex-<n> (first matching registration wins).\n// Legacy alias accepted by Tailwind 4: flex-grow, flex-grow-0, flex-grow-[2]\nstaticUtility(\"flex-grow\", [[\"flex-grow\", \"1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"flex-grow\",\n prop: \"flex-grow\",\n supportsArbitrary: true, // grow-[25vw], grow-[2], grow-[var(--factor)], etc.\n supportsCustomProperty: true, // grow-(--my-grow)\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [decl(\"flex-grow\", value)],\n description: \"flex-grow utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// Legacy alias accepted by Tailwind 4: flex-shrink, flex-shrink-0, flex-shrink-[2]\nstaticUtility(\"flex-shrink\", [[\"flex-shrink\", \"1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"flex-shrink\",\n prop: \"flex-shrink\",\n supportsArbitrary: true, // shrink-[2], shrink-[calc(100vw-var(--sidebar))], etc.\n supportsCustomProperty: true, // shrink-(--my-shrink)\n handleBareValue: ({ value }) => parseNumber(value),\n description: \"flex-shrink utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\nfunctionalUtility({\n name: \"flex\",\n supportsArbitrary: true, // flex-[3_1_auto], flex-[2], flex-[0_0_100%], etc.\n supportsCustomProperty: true, // flex-(--my-flex)\n supportsFraction: true, // flex-1/2 → flex: 50%;\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return value;\n const frac = parseFraction(value);\n if (frac) return `calc(${frac})`;\n return null;\n },\n handle: (value) => [decl(\"flex\", value)],\n description:\n \"flex shorthand utility (number, fraction, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Flex Grow ---\nstaticUtility(\"grow\", [[\"flex-grow\", \"1\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grow\",\n prop: \"flex-grow\",\n supportsArbitrary: true, // grow-[25vw], grow-[2], grow-[var(--factor)], etc.\n supportsCustomProperty: true, // grow-(--my-grow)\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [decl(\"flex-grow\", value)],\n description: \"flex-grow utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Flex Shrink ---\nstaticUtility(\"shrink\", [[\"flex-shrink\", \"1\"]], { category: 'flex-grid' });\nstaticUtility(\"shrink-0\", [[\"flex-shrink\", \"0\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"shrink\",\n prop: \"flex-shrink\",\n supportsArbitrary: true, // shrink-[2], shrink-[calc(100vw-var(--sidebar))], etc.\n supportsCustomProperty: true, // shrink-(--my-shrink)\n handleBareValue: ({ value }) => parseNumber(value),\n description: \"flex-shrink utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Order ---\nstaticUtility(\"order-first\", [[\"order\", \"calc(-infinity)\"]], { category: 'flex-grid' });\nstaticUtility(\"order-last\", [[\"order\", \"calc(infinity)\"]], { category: 'flex-grid' });\nstaticUtility(\"order-none\", [[\"order\", \"0\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"order\",\n prop: \"order\",\n supportsNegative: true, // -order-1 → order: calc(1 * -1)\n supportsArbitrary: true, // order-[min(var(--total-items),10)], etc.\n supportsCustomProperty: true, // order-(--my-order)\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"order utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Template Columns ---\nstaticUtility(\"grid-cols-none\", [[\"grid-template-columns\", \"none\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-cols-subgrid\", [[\"grid-template-columns\", \"subgrid\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grid-cols\",\n prop: \"grid-template-columns\",\n supportsArbitrary: true, // grid-cols-[200px_minmax(900px,_1fr)_100px], etc.\n supportsCustomProperty: true, // grid-cols-(--my-grid-cols)\n handleBareValue: ({ value }) =>\n parseFractionOrNumber(value, { repeat: true }),\n description:\n \"grid-template-columns utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Template Rows ---\nstaticUtility(\"grid-rows-none\", [[\"grid-template-rows\", \"none\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-rows-subgrid\", [[\"grid-template-rows\", \"subgrid\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grid-rows\",\n prop: \"grid-template-rows\",\n supportsArbitrary: true, // grid-rows-[200px_minmax(900px,_1fr)_100px], etc.\n supportsCustomProperty: true, // grid-rows-(--my-grid-rows)\n handleBareValue: ({ value }) =>\n parseFractionOrNumber(value, { repeat: true }),\n handle: (value) => {\n // grid-rows-[200px_minmax(900px,_1fr)_100px]\n // Just output as-is (spaces instead of underscores)\n if (typeof value === \"string\") {\n return [decl(\"grid-template-rows\", value.replace(/_/g, \" \"))];\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\"grid-template-rows\", `var(${value})`),\n ],\n description:\n \"grid-template-rows utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Row ---\n// row-span utilities\nstaticUtility(\"row-span-full\", [[\"grid-row\", \"1 / -1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-span\",\n prop: \"grid-row\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return `span ${value} / span ${value}`;\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\"grid-row\", `span var(${value}) / span var(${value})`),\n ],\n handle: (value) => {\n if (parseNumber(value))\n return [decl(\"grid-row\", `span ${value} / span ${value}`)];\n // arbitrary value: row-span-[5] → span 5 / span 5\n return null;\n },\n description:\n \"grid-row span utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-start utilities\nstaticUtility(\"row-start-auto\", [[\"grid-row-start\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-start\",\n prop: \"grid-row-start\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row-start\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row-start\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row-start\", value)];\n return null;\n },\n description:\n \"grid-row-start utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-end utilities\nstaticUtility(\"row-end-auto\", [[\"grid-row-end\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-end\",\n prop: \"grid-row-end\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row-end\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row-end\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row-end\", value)];\n return null;\n },\n description:\n \"grid-row-end utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-auto, row-<number>, -row-<number>, row-(<custom-property>), row-[value]\nstaticUtility(\"row-auto\", [[\"grid-row\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row\",\n prop: \"grid-row\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row\", value)];\n return null;\n },\n description:\n \"grid-row utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Auto Flow ---\n staticUtility(\"grid-flow-row\", [[\"grid-auto-flow\", \"row\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-col\", [[\"grid-auto-flow\", \"column\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-dense\", [[\"grid-auto-flow\", \"dense\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-row-dense\", [[\"grid-auto-flow\", \"row dense\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-col-dense\", [[\"grid-auto-flow\", \"column dense\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Grid Auto Columns ---\nstaticUtility(\"auto-cols-auto\", [[\"grid-auto-columns\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-min\", [[\"grid-auto-columns\", \"min-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-max\", [[\"grid-auto-columns\", \"max-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-fr\", [[\"grid-auto-columns\", \"minmax(0, 1fr)\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"auto-cols\",\n prop: \"grid-auto-columns\",\n supportsArbitrary: true, // auto-cols-[minmax(0,2fr)]\n supportsCustomProperty: true, // auto-cols-(--my-auto-cols)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null), // #310: auto-cols-4\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"grid-auto-columns\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-auto-columns\", `var(${value})`)],\n description:\n \"grid-auto-columns utility (static, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Auto Rows ---\nstaticUtility(\"auto-rows-auto\", [[\"grid-auto-rows\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-min\", [[\"grid-auto-rows\", \"min-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-max\", [[\"grid-auto-rows\", \"max-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-fr\", [[\"grid-auto-rows\", \"minmax(0, 1fr)\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"auto-rows\",\n prop: \"grid-auto-rows\",\n supportsArbitrary: true, // auto-rows-[minmax(0,2fr)]\n supportsCustomProperty: true, // auto-rows-(--my-auto-rows)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null), // #310: auto-rows-12\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"grid-auto-rows\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-auto-rows\", `var(${value})`)],\n description:\n \"grid-auto-rows utility (static, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Gap ---\nfunctionalUtility({\n name: \"gap-x\",\n prop: \"column-gap\",\n supportsArbitrary: true, // gap-x-[10vw]\n supportsCustomProperty: true, // gap-x-(--my-gap-x)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"column-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"column-gap\", `var(${value})`)],\n description: \"gap-x utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap-y\",\n prop: \"row-gap\",\n supportsArbitrary: true, // gap-y-[10vw]\n supportsCustomProperty: true, // gap-y-(--my-gap-y)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"row-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"row-gap\", `var(${value})`)],\n description: \"gap-y utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap\",\n prop: \"gap\",\n supportsArbitrary: true, // gap-[10vw]\n supportsCustomProperty: true, // gap-(--my-gap)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"gap\", `var(${value})`)],\n description: \"gap utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\n\n// --- Flexbox & Grid: Justify Content ---\nstaticUtility(\"justify-start\", [[\"justify-content\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-end\", [[\"justify-content\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-end-safe\", [[\"justify-content\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-center\", [[\"justify-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-center-safe\", [[\"justify-content\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-between\", [[\"justify-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-around\", [[\"justify-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-evenly\", [[\"justify-content\", \"space-evenly\"]], { category: 'flex-grid' });\n staticUtility(\"justify-stretch\", [[\"justify-content\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-baseline\", [[\"justify-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-normal\", [[\"justify-content\", \"normal\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Justify Items ---\nstaticUtility(\"justify-items-start\", [[\"justify-items\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-end\", [[\"justify-items\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-end-safe\", [[\"justify-items\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-center\", [[\"justify-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-center-safe\", [[\"justify-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-stretch\", [[\"justify-items\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-normal\", [[\"justify-items\", \"normal\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Justify Self ---\nstaticUtility(\"justify-self-auto\", [[\"justify-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-start\", [[\"justify-self\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-center\", [[\"justify-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-center-safe\", [[\"justify-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-end\", [[\"justify-self\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-end-safe\", [[\"justify-self\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-stretch\", [[\"justify-self\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Content ---\n staticUtility(\"content-normal\", [[\"align-content\", \"normal\"]], { category: 'flex-grid' });\nstaticUtility(\"content-center\", [[\"align-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"content-start\", [[\"align-content\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"content-end\", [[\"align-content\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"content-between\", [[\"align-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"content-around\", [[\"align-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"content-evenly\", [[\"align-content\", \"space-evenly\"]], { category: 'flex-grid' });\nstaticUtility(\"content-baseline\", [[\"align-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"content-stretch\", [[\"align-content\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Items ---\nstaticUtility(\"items-start\", [[\"align-items\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"items-end\", [[\"align-items\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"items-end-safe\", [[\"align-items\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"items-center\", [[\"align-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"items-center-safe\", [[\"align-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"items-baseline\", [[\"align-items\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"items-baseline-last\", [[\"align-items\", \"last baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"items-stretch\", [[\"align-items\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Self ---\nstaticUtility(\"self-auto\", [[\"align-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"self-start\", [[\"align-self\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"self-end\", [[\"align-self\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"self-end-safe\", [[\"align-self\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"self-center\", [[\"align-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"self-center-safe\", [[\"align-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"self-stretch\", [[\"align-self\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"self-baseline\", [[\"align-self\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"self-baseline-last\", [[\"align-self\", \"last baseline\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Place Content ---\nstaticUtility(\"place-content-center\", [[\"place-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-center-safe\", [[\"place-content\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-start\", [[\"place-content\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-end\", [[\"place-content\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-end-safe\", [[\"place-content\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-between\", [[\"place-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-around\", [[\"place-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-evenly\", [[\"place-content\", \"space-evenly\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-baseline\", [[\"place-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-stretch\", [[\"place-content\", \"stretch\"]], { category: 'flex-grid' } );\n\n// --- Flexbox & Grid: Place Items ---\nstaticUtility(\"place-items-start\", [[\"place-items\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-end\", [[\"place-items\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-end-safe\", [[\"place-items\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-center\", [[\"place-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-center-safe\", [[\"place-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-baseline\", [[\"place-items\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-stretch\", [[\"place-items\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Place Self ---\nstaticUtility(\"place-self-auto\", [[\"place-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-start\", [[\"place-self\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-end\", [[\"place-self\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-end-safe\", [[\"place-self\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-center\", [[\"place-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-center-safe\", [[\"place-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-stretch\", [[\"place-self\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Grid Column ---\n// col-span utilities\nstaticUtility(\"col-span-full\", [[\"grid-column\", \"1 / -1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-span\",\n prop: \"grid-column\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return `span ${value} / span ${value}`;\n return null;\n },\n handleCustomProperty: (value, _ctx, _token) => {\n return [decl(\"grid-column\", `span var(${value}) / span var(${value})`)];\n },\n handle: (value, _ctx, _token) => {\n if (parseNumber(value))\n return [decl(\"grid-column\", `span ${value} / span ${value}`)];\n return null;\n },\n description:\n \"grid-column span utility (number, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-start utilities\nstaticUtility(\"col-start-auto\", [[\"grid-column-start\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-start\",\n prop: \"grid-column-start\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column-start utility (number, negative, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-end utilities\nstaticUtility(\"col-end-auto\", [[\"grid-column-end\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-end\",\n prop: \"grid-column-end\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column-end utility (number, negative, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-auto, col-<number>, -col-<number>, col-(<custom-property>), col-[value]\nstaticUtility(\"col-auto\", [[\"grid-column\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col\",\n prop: \"grid-column\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});","import { parseNumber } from \"../core/utils\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRoot, decl, property, rule } from \"../core/ast\";\n\n// Padding utilities (p-*, px-*, py-*, ps-*, pe-*, pt-*, pr-*, pb-*, pl-*)\n[\n [\"px\", \"padding-inline\"],\n [\"py\", \"padding-block\"],\n [\"ps\", \"padding-inline-start\"],\n [\"pe\", \"padding-inline-end\"],\n [\"pbs\", \"padding-block-start\"],\n [\"pbe\", \"padding-block-end\"],\n [\"pt\", \"padding-top\"],\n [\"pr\", \"padding-right\"],\n [\"pb\", \"padding-bottom\"],\n [\"pl\", \"padding-left\"],\n [\"p\", \"padding\"],\n].forEach(([name, prop]) => {\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'spacing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n description: `${name} utility (number, arbitrary, custom property supported)`,\n category: \"spacing\",\n });\n});\n\n// Margin utilities (m-*, mx-*, my-*, ms-*, me-*, mt-*, mr-*, mb-*, ml-*)\n[\n [\"mx\", \"margin-inline\"],\n [\"my\", \"margin-block\"],\n [\"ms\", \"margin-inline-start\"],\n [\"me\", \"margin-inline-end\"],\n [\"mbs\", \"margin-block-start\"],\n [\"mbe\", \"margin-block-end\"],\n [\"mt\", \"margin-top\"],\n [\"mr\", \"margin-right\"],\n [\"mb\", \"margin-bottom\"],\n [\"ml\", \"margin-left\"],\n [\"m\", \"margin\"],\n].forEach(([name, prop]) => {\n staticUtility(`${name}-auto`, [[prop, \"auto\"]], { category: 'spacing' });\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'spacing' });\n staticUtility(`-${name}-px`, [[prop, \"-1px\"]], { category: 'spacing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n description: `${name} margin utility (number, negative, arbitrary, custom property, auto, px supported)`,\n category: \"spacing\",\n });\n});\n\n// --- Spacing: space-x, space-y, space-x-reverse, space-y-reverse ---\n// Tailwind 4 form: margin on the end of every non-last child\n// (`:where(& > :not(:last-child))`), not the v3 `> :not([hidden]) ~ :not([hidden])`.\nconst SPACE_SELECTOR = \":where(& > :not(:last-child))\";\n\n([\"x\", \"y\"] as const).forEach((axis) => {\n const name = `space-${axis}`;\n const rev = `--baro-space-${axis}-reverse`;\n const [start, end] =\n axis === \"x\"\n ? [\"margin-inline-start\", \"margin-inline-end\"]\n : [\"margin-block-start\", \"margin-block-end\"];\n const reverseProperty = () => atRoot([property(rev, \"0\")]);\n const spaceRule = (v: string) =>\n rule(SPACE_SELECTOR, [\n decl(rev, \"0\"),\n decl(start, `calc(${v} * var(${rev}))`),\n decl(end, `calc(${v} * calc(1 - var(${rev})))`),\n ]);\n const body = (v: string) => [reverseProperty(), spaceRule(v)];\n\n staticUtility(`${name}-px`, [reverseProperty, () => spaceRule(\"1px\")], { category: \"spacing\" });\n staticUtility(`-${name}-px`, [reverseProperty, () => spaceRule(\"-1px\")], { category: \"spacing\" });\n staticUtility(`${name}-reverse`, [\n reverseProperty,\n () => rule(SPACE_SELECTOR, [decl(rev, \"1\")]),\n ], { category: \"spacing\" });\n\n functionalUtility({\n spacingKeys: true,\n name,\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n handle: (value, _ctx, token) => {\n let v = String(value);\n if (/^-?\\d+(\\.\\d+)?$/.test(v)) {\n v = `calc(var(--spacing) * ${token.negative ? \"-\" : \"\"}${v})`;\n }\n return body(v);\n },\n handleCustomProperty: (value) => body(`var(${value})`),\n description: `${name} utility (number, negative, px, arbitrary, custom property, reverse supported)`,\n category: \"spacing\",\n });\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport {\n parseFractionOrNumber,\n parseNumber,\n} from \"../core/utils\";\n\n// Import layout utilities\nimport \"./layout\";\nimport \"./flexbox-grid\";\nimport \"./spacing\";\n\n\n// --- Sizing: width (w-*) and size (size-*) ---\n// width documentation\n\n// w-* static values\n[\n ['w-auto', 'auto'],\n ['w-px', '1px'],\n ['w-full', '100%'],\n ['w-screen', '100vw'],\n ['w-dvw', '100dvw'],\n ['w-dvh', '100dvh'],\n ['w-lvw', '100lvw'],\n ['w-lvh', '100lvh'],\n ['w-svw', '100svw'],\n ['w-svh', '100svh'],\n ['w-min', 'min-content'],\n ['w-max', 'max-content'],\n ['w-fit', 'fit-content'],\n ['w-3xs', 'var(--container-3xs)'],\n ['w-2xs', 'var(--container-2xs)'],\n ['w-xs', 'var(--container-xs)'],\n ['w-sm', 'var(--container-sm)'],\n ['w-md', 'var(--container-md)'],\n ['w-lg', 'var(--container-lg)'],\n ['w-xl', 'var(--container-xl)'],\n ['w-2xl', 'var(--container-2xl)'],\n ['w-3xl', 'var(--container-3xl)'],\n ['w-4xl', 'var(--container-4xl)'],\n ['w-5xl', 'var(--container-5xl)'],\n ['w-6xl', 'var(--container-6xl)'],\n ['w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['width', value]]);\n});\n\n// w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'w',\n prop: 'width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n \n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'width utility (spacing, fraction, arbitrary, custom property, container scale, static supported)',\n category: 'sizing',\n});\n\n// size-* static values\n[\n ['size-auto', ['auto', 'auto']],\n ['size-px', ['1px', '1px']],\n ['size-full', ['100%', '100%']],\n ['size-dvw', ['100dvw', '100dvw']],\n ['size-dvh', ['100dvh', '100dvh']],\n ['size-lvw', ['100lvw', '100lvw']],\n ['size-lvh', ['100lvh', '100lvh']],\n ['size-svw', ['100svw', '100svw']],\n ['size-svh', ['100svh', '100svh']],\n ['size-min', ['min-content', 'min-content']],\n ['size-max', ['max-content', 'max-content']],\n ['size-fit', ['fit-content', 'fit-content']],\n].forEach(([name, [w, h]]) => {\n staticUtility(name as string, [['width', w], ['height', h]]);\n});\n\n// size-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'size',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n handle: (value) => {\n // arbitrary, custom property, etc.\n return [\n decl('width', value),\n decl('height', value),\n ];\n },\n handleCustomProperty: (value) => [\n decl('width', `var(${value})`),\n decl('height', `var(${value})`),\n ],\n description: 'size utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: height (h-*) ---\n// height documentation\n\n// h-* static values\n[\n ['h-auto', 'auto'],\n ['h-px', '1px'],\n ['h-full', '100%'],\n ['h-screen', '100vh'],\n ['h-dvh', '100dvh'],\n ['h-lvh', '100lvh'],\n ['h-svh', '100svh'],\n ['h-min', 'min-content'],\n ['h-max', 'max-content'],\n ['h-fit', 'fit-content'],\n].forEach(([name, value]) => {\n staticUtility(name, [['height', value]]);\n});\n\n// h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'h',\n prop: 'height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: min-height (min-h-*) ---\n// min-height documentation\n\n// min-h-* static values\n[\n ['min-h-0', '0px'],\n ['min-h-px', '1px'],\n ['min-h-full', '100%'],\n ['min-h-screen', '100vh'],\n ['min-h-dvh', '100dvh'],\n ['min-h-lvh', '100lvh'],\n ['min-h-svh', '100svh'],\n ['min-h-min', 'min-content'],\n ['min-h-max', 'max-content'],\n ['min-h-fit', 'fit-content'],\n].forEach(([name, value]) => {\n staticUtility(name, [['min-height', value]], { category: 'sizing' });\n});\n\n// min-h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'min-h',\n prop: 'min-height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'min-height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: max-height (max-h-*) ---\n// max-height documentation\n\n// max-h-* static values\n[\n ['max-h-px', '1px'],\n ['max-h-full', '100%'],\n ['max-h-screen', '100vh'],\n ['max-h-dvh', '100dvh'],\n ['max-h-lvh', '100lvh'],\n ['max-h-svh', '100svh'],\n ['max-h-min', 'min-content'],\n ['max-h-max', 'max-content'],\n ['max-h-fit', 'fit-content'],\n ['max-h-none', 'none'],\n].forEach(([name, value]) => {\n staticUtility(name, [['max-height', value]], { category: 'sizing' });\n});\n\n// max-h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'max-h',\n prop: 'max-height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'max-height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: min-width (min-w-*) ---\n// min-width documentation\n\n// min-w-* static values\n[\n ['min-w-auto', 'auto'],\n ['min-w-px', '1px'],\n ['min-w-full', '100%'],\n ['min-w-screen', '100vw'],\n ['min-w-dvw', '100dvw'],\n ['min-w-dvh', '100dvh'],\n ['min-w-lvw', '100lvw'],\n ['min-w-lvh', '100lvh'],\n ['min-w-svw', '100svw'],\n ['min-w-svh', '100svh'],\n ['min-w-min', 'min-content'],\n ['min-w-max', 'max-content'],\n ['min-w-fit', 'fit-content'],\n ['min-w-3xs', 'var(--container-3xs)'],\n ['min-w-2xs', 'var(--container-2xs)'],\n ['min-w-xs', 'var(--container-xs)'],\n ['min-w-sm', 'var(--container-sm)'],\n ['min-w-md', 'var(--container-md)'],\n ['min-w-lg', 'var(--container-lg)'],\n ['min-w-xl', 'var(--container-xl)'],\n ['min-w-2xl', 'var(--container-2xl)'],\n ['min-w-3xl', 'var(--container-3xl)'],\n ['min-w-4xl', 'var(--container-4xl)'],\n ['min-w-5xl', 'var(--container-5xl)'],\n ['min-w-6xl', 'var(--container-6xl)'],\n ['min-w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['min-width', value]], { category: 'sizing' });\n});\n\n// min-w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'min-w',\n prop: 'min-width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'min-width utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n\n// --- Sizing: max-width (max-w-*) ---\n// max-width documentation\n\n// max-w-* static values\n[\n ['max-w-none', 'none'],\n ['max-w-min', 'min-content'],\n ['max-w-max', 'max-content'],\n ['max-w-fit', 'fit-content'],\n ['max-w-xs', 'var(--container-xs)'],\n ['max-w-sm', 'var(--container-sm)'],\n ['max-w-md', 'var(--container-md)'],\n ['max-w-lg', 'var(--container-lg)'],\n ['max-w-xl', 'var(--container-xl)'],\n ['max-w-2xl', 'var(--container-2xl)'],\n ['max-w-3xl', 'var(--container-3xl)'],\n ['max-w-4xl', 'var(--container-4xl)'],\n ['max-w-5xl', 'var(--container-5xl)'],\n ['max-w-6xl', 'var(--container-6xl)'],\n ['max-w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['max-width', value]], { category: 'sizing' });\n});\n\n// max-w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'max-w',\n prop: 'max-width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'max-width utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: logical inline-size / block-size (Tailwind 4.3) ---\n// inline-* / block-* and their min-/max- forms mirror the width / height scales. Bare `inline` / `block` (and\n// inline-block/flex/grid/table) stay display utilities: static names win over the functional sizing lookup,\n// matching Tailwind 4.3.3.\n{\n const containers = ['3xs', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl'].map(\n (k) => [k, `var(--container-${k})`],\n );\n const common = [['0', '0px'], ['px', '1px'], ['full', '100%'], ['min', 'min-content'], ['max', 'max-content'], ['fit', 'fit-content']];\n const inlineVp = [['screen', '100vw'], ['dvw', '100dvw'], ['lvw', '100lvw'], ['svw', '100svw']];\n const blockVp = [['screen', '100vh'], ['dvh', '100dvh'], ['lvh', '100lvh'], ['svh', '100svh'], ['lh', '1lh']];\n const families: [string, string, string[][]][] = [\n ['inline', 'inline-size', [...common, ['auto', 'auto'], ...inlineVp, ...containers]],\n ['min-inline', 'min-inline-size', [...common, ['auto', 'auto'], ...inlineVp, ...containers]],\n ['max-inline', 'max-inline-size', [...common, ['none', 'none'], ...inlineVp, ...containers]],\n ['block', 'block-size', [...common, ['auto', 'auto'], ...blockVp]],\n ['min-block', 'min-block-size', [...common, ['auto', 'auto'], ...blockVp]],\n ['max-block', 'max-block-size', [...common, ['none', 'none'], ...blockVp]],\n ];\n for (const [name, prop, statics] of families) {\n for (const [key, value] of statics) staticUtility(`${name}-${key}`, [[prop, value]], { category: 'sizing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value, token }) => {\n if (token.negative) return null; // Tailwind 4.3.3 has no negative inline/block sizes\n if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: `${prop} utility (spacing, fraction, arbitrary, custom property, keywords)`,\n category: 'sizing',\n });\n }\n}","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRoot, decl, property, rule } from \"../core/ast\";\n\n// Tailwind v4: leading-* sets --tw-leading (registered, non-inheriting) and text-<size> reads\n// var(--tw-leading, <size line-height>), so leading-* beats any text-* regardless of rule order (#254).\nconst leadingProperty = () => atRoot([property(\"--baro-leading\")]);\nimport { themeColorDecls,\n parseColor,\n parseNumber,\n} from \"../core/utils\";\n\n// --- Typography: Font Family ---\nstaticUtility(\"font-sans\", [[\"font-family\", \"var(--font-sans)\"]], { category: 'typography' });\nstaticUtility(\"font-serif\", [[\"font-family\", \"var(--font-serif)\"]], { category: 'typography' });\nstaticUtility(\"font-mono\", [[\"font-family\", \"var(--font-mono)\"]], { category: 'typography' });\n\n// --- Typography: Font Size ---\nstaticUtility(\"text-xs\", [[\"font-size\", \"var(--text-xs)\"], [\"line-height\", \"var(--baro-leading, var(--text-xs--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-sm\", [[\"font-size\", \"var(--text-sm)\"], [\"line-height\", \"var(--baro-leading, var(--text-sm--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-base\", [[\"font-size\", \"var(--text-base)\"], [\"line-height\", \"var(--baro-leading, var(--text-base--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-lg\", [[\"font-size\", \"var(--text-lg)\"], [\"line-height\", \"var(--baro-leading, var(--text-lg--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-xl\", [[\"font-size\", \"var(--text-xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-2xl\", [[\"font-size\", \"var(--text-2xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-2xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-3xl\", [[\"font-size\", \"var(--text-3xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-3xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-4xl\", [[\"font-size\", \"var(--text-4xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-4xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-5xl\", [[\"font-size\", \"var(--text-5xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-5xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-6xl\", [[\"font-size\", \"var(--text-6xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-6xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-7xl\", [[\"font-size\", \"var(--text-7xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-7xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-8xl\", [[\"font-size\", \"var(--text-8xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-8xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-9xl\", [[\"font-size\", \"var(--text-9xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-9xl--line-height))\"]], { category: 'typography' });\n\n\n// --- Typography: Font Weight ---\nstaticUtility(\"font-thin\", [[\"font-weight\", \"var(--font-weight-thin)\"]], { category: 'typography' });\nstaticUtility(\"font-extralight\", [[\"font-weight\", \"var(--font-weight-extralight)\"]], { category: 'typography' });\nstaticUtility(\"font-light\", [[\"font-weight\", \"var(--font-weight-light)\"]], { category: 'typography' });\nstaticUtility(\"font-normal\", [[\"font-weight\", \"var(--font-weight-normal)\"]], { category: 'typography' });\nstaticUtility(\"font-medium\", [[\"font-weight\", \"var(--font-weight-medium)\"]], { category: 'typography' });\nstaticUtility(\"font-semibold\", [[\"font-weight\", \"var(--font-weight-semibold)\"]], { category: 'typography' });\nstaticUtility(\"font-bold\", [[\"font-weight\", \"var(--font-weight-bold)\"]], { category: 'typography' });\nstaticUtility(\"font-extrabold\", [[\"font-weight\", \"var(--font-weight-extrabold)\"]], { category: 'typography' });\nstaticUtility(\"font-black\", [[\"font-weight\", \"var(--font-weight-black)\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"font\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n // font-features-*/font-stretch-* belong to their own registrations (#309).\n if (token.prefix !== \"font\") return null;\n if (parseNumber(value)) {\n return [decl(\"font-weight\", value)];\n }\n return [decl(\"font-family\", value)];\n },\n handleCustomProperty: (value, _ctx, token) => {\n if (token.prefix !== \"font\") return null;\n if (value.startsWith(\"font-name:\")) {\n return [decl(\"font-family\", `var(${value.replace(\"font-name:\", \"\")})`)];\n }\n return [decl(\"font-weight\", `var(${value})`)];\n },\n description: \"font-weight utility (theme, number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Font Style ---\nstaticUtility(\"italic\", [[\"font-style\", \"italic\"]], { category: 'typography' });\nstaticUtility(\"not-italic\", [[\"font-style\", \"normal\"]], { category: 'typography' });\n\n// --- Typography: Letter Spacing ---\nstaticUtility(\"tracking-tighter\", [[\"letter-spacing\", \"var(--letter-spacing-tighter)\"]], { category: 'typography' });\nstaticUtility(\"tracking-tight\", [[\"letter-spacing\", \"var(--letter-spacing-tight)\"]], { category: 'typography' });\nstaticUtility(\"tracking-normal\", [[\"letter-spacing\", \"var(--letter-spacing-normal)\"]], { category: 'typography' });\nstaticUtility(\"tracking-wide\", [[\"letter-spacing\", \"var(--letter-spacing-wide)\"]], { category: 'typography' });\nstaticUtility(\"tracking-wider\", [[\"letter-spacing\", \"var(--letter-spacing-wider)\"]], { category: 'typography' });\nstaticUtility(\"tracking-widest\", [[\"letter-spacing\", \"var(--letter-spacing-widest)\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"tracking\",\n prop: \"letter-spacing\",\n themeKey: \"letterSpacing\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"letter-spacing utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Line Height ---\nstaticUtility(\"leading-none\", [[\"--baro-leading\", \"var(--leading-none, 1)\"], [\"line-height\", \"var(--leading-none, 1)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-tight\", [[\"--baro-leading\", \"var(--leading-tight, 1.25)\"], [\"line-height\", \"var(--leading-tight, 1.25)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-snug\", [[\"--baro-leading\", \"var(--leading-snug, 1.375)\"], [\"line-height\", \"var(--leading-snug, 1.375)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-normal\", [[\"--baro-leading\", \"var(--leading-normal, 1.5)\"], [\"line-height\", \"var(--leading-normal, 1.5)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-relaxed\", [[\"--baro-leading\", \"var(--leading-relaxed, 1.625)\"], [\"line-height\", \"var(--leading-relaxed, 1.625)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-loose\", [[\"--baro-leading\", \"var(--leading-loose, 2)\"], [\"line-height\", \"var(--leading-loose, 2)\"], leadingProperty()], { category: 'typography' });\n\nfunctionalUtility({\n name: \"leading\",\n prop: \"line-height\",\n themeKey: \"lineHeight\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [decl(\"--baro-leading\", value), decl(\"line-height\", value), leadingProperty()],\n handleCustomProperty: (value) => [decl(\"--baro-leading\", `var(${value})`), decl(\"line-height\", `var(${value})`), leadingProperty()],\n description: \"line-height utility (theme, number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Align ---\nstaticUtility(\"text-left\", [[\"text-align\", \"left\"]], { category: 'typography' });\nstaticUtility(\"text-center\", [[\"text-align\", \"center\"]], { category: 'typography' });\nstaticUtility(\"text-right\", [[\"text-align\", \"right\"]], { category: 'typography' });\nstaticUtility(\"text-justify\", [[\"text-align\", \"justify\"]], { category: 'typography' });\nstaticUtility(\"text-start\", [[\"text-align\", \"start\"]], { category: 'typography' });\nstaticUtility(\"text-end\", [[\"text-align\", \"end\"]], { category: 'typography' });\n\nconst FONT_SIZE_HINTS = new Set([\"length\", \"size\", \"percentage\", \"absolute-size\", \"relative-size\"]);\nconst FONT_SIZE_KEYWORDS = /^(xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large|larger|smaller)$/;\nconst LENGTH_RE = /^-?(\\d+\\.?\\d*|\\.\\d+)(px|r?em|r?lh|r?cap|r?ch|r?ex|r?ic|%|vh|vw|vmin|vmax|[sdl]v[hwib]|v[ib]|cq[whib]|cqmin|cqmax|pt|pc|in|cm|mm|q)$/i;\n/** Tailwind's `text-[…]` inference: an explicit type hint wins; else lengths / size keywords / math → font-size, else colour. */\nfunction textArbitraryKind(raw: string): { fontSize: boolean; value: string } {\n const hint = /^([a-z-]+):(.+)$/.exec(raw);\n if (hint && (hint[1] === \"color\" || FONT_SIZE_HINTS.has(hint[1]))) {\n return { fontSize: hint[1] !== \"color\", value: hint[2] };\n }\n const fontSize = raw === \"0\" || LENGTH_RE.test(raw) || FONT_SIZE_KEYWORDS.test(raw) || /^(calc|min|max|clamp)\\(/.test(raw);\n return { fontSize, value: raw };\n}\n\n// --- Typography: Text Color ---\nstaticUtility(\"text-inherit\", [[\"color\", \"inherit\"]], { category: 'typography' });\nstaticUtility(\"text-current\", [[\"color\", \"currentColor\"]], { category: 'typography' });\nstaticUtility(\"text-transparent\", [[\"color\", \"transparent\"]], { category: 'typography' });\n\n// --- Typography: Text Overflow ---\nstaticUtility(\"truncate\", [[\"overflow\", \"hidden\"], [\"text-overflow\", \"ellipsis\"], [\"white-space\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"text-ellipsis\", [[\"text-overflow\", \"ellipsis\"]], { category: 'typography' });\nstaticUtility(\"text-clip\", [[\"text-overflow\", \"clip\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"text\", \n themeKey: \"colors\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return themeColorDecls(\"color\", value, extra);\n\n const kind = textArbitraryKind(value);\n return [decl(kind.fontSize ? \"font-size\" : \"color\", kind.value)];\n },\n // Tailwind 4: text-(--x) is a colour; text-(length:--x) is a font-size.\n handleCustomProperty: (value) => {\n const kind = textArbitraryKind(value);\n return [decl(kind.fontSize ? \"font-size\" : \"color\", `var(${kind.value})`)];\n },\n description: \"text color utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n\nfunctionalUtility({\n name: \"text\",\n themeKey: \"fontSize\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n // Check if it's a theme value first\n const themeValue = ctx.theme(\"fontSize\", value) as string | [string, string];\n if (themeValue) {\n if (Array.isArray(themeValue)) {\n // [fontSize, lineHeight] format\n return [\n decl(\"font-size\", themeValue[0]),\n decl(\"line-height\", `var(--baro-leading, ${themeValue[1]})`)\n ];\n } else {\n return [decl(\"font-size\", themeValue as string)];\n }\n }\n\n // Handle arbitrary values\n if (token.arbitrary) {\n return [decl(\"font-size\", value)];\n }\n\n return null;\n },\n handleCustomProperty: (value) => [decl(\"font-size\", `var(${value})`)],\n description: \"font-size utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Transform ---\nstaticUtility(\"uppercase\", [[\"text-transform\", \"uppercase\"]], { category: 'typography' });\nstaticUtility(\"lowercase\", [[\"text-transform\", \"lowercase\"]], { category: 'typography' });\nstaticUtility(\"capitalize\", [[\"text-transform\", \"capitalize\"]], { category: 'typography' });\nstaticUtility(\"normal-case\", [[\"text-transform\", \"none\"]], { category: 'typography' });\n\n// --- Typography: Text Decoration ---\nstaticUtility(\"underline\", [[\"text-decoration-line\", \"underline\"]], { category: 'typography' });\nstaticUtility(\"overline\", [[\"text-decoration-line\", \"overline\"]], { category: 'typography' });\nstaticUtility(\"line-through\", [[\"text-decoration-line\", \"line-through\"]], { category: 'typography' });\nstaticUtility(\"no-underline\", [[\"text-decoration-line\", \"none\"]], { category: 'typography' });\n\n\n\n// --- Typography: Whitespace ---\nstaticUtility(\"whitespace-normal\", [[\"white-space\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"whitespace-nowrap\", [[\"white-space\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre\", [[\"white-space\", \"pre\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre-line\", [[\"white-space\", \"pre-line\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre-wrap\", [[\"white-space\", \"pre-wrap\"]], { category: 'typography' });\nstaticUtility(\"whitespace-break-spaces\", [[\"white-space\", \"break-spaces\"]], { category: 'typography' });\n\n// --- Typography: Word Break ---\nstaticUtility(\"break-normal\", [[\"overflow-wrap\", \"normal\"], [\"word-break\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"break-words\", [[\"overflow-wrap\", \"break-word\"]], { category: 'typography' });\nstaticUtility(\"break-all\", [[\"word-break\", \"break-all\"]], { category: 'typography' });\nstaticUtility(\"break-keep\", [[\"word-break\", \"keep-all\"]], { category: 'typography' });\n\n// --- Typography: Font Smoothing ---\nstaticUtility(\"antialiased\", [[\"-webkit-font-smoothing\", \"antialiased\"], [\"-moz-osx-font-smoothing\", \"grayscale\"]], { category: 'typography' });\nstaticUtility(\"subpixel-antialiased\", [[\"-webkit-font-smoothing\", \"auto\"], [\"-moz-osx-font-smoothing\", \"auto\"]], { category: 'typography' });\n\n// --- Typography: Font Stretch ---\nstaticUtility(\"font-stretch-normal\", [[\"font-stretch\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-ultra-condensed\", [[\"font-stretch\", \"ultra-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-extra-condensed\", [[\"font-stretch\", \"extra-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-condensed\", [[\"font-stretch\", \"condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-semi-condensed\", [[\"font-stretch\", \"semi-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-semi-expanded\", [[\"font-stretch\", \"semi-expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-expanded\", [[\"font-stretch\", \"expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-extra-expanded\", [[\"font-stretch\", \"extra-expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-ultra-expanded\", [[\"font-stretch\", \"ultra-expanded\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"font-stretch\",\n prop: \"font-stretch\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"font-stretch utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Font Variant Numeric ---\nstaticUtility(\"normal-nums\", [[\"font-variant-numeric\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"ordinal\", [[\"font-variant-numeric\", \"ordinal\"]], { category: 'typography' });\nstaticUtility(\"slashed-zero\", [[\"font-variant-numeric\", \"slashed-zero\"]], { category: 'typography' });\nstaticUtility(\"lining-nums\", [[\"font-variant-numeric\", \"lining-nums\"]], { category: 'typography' });\nstaticUtility(\"oldstyle-nums\", [[\"font-variant-numeric\", \"oldstyle-nums\"]], { category: 'typography' });\nstaticUtility(\"proportional-nums\", [[\"font-variant-numeric\", \"proportional-nums\"]], { category: 'typography' });\nstaticUtility(\"tabular-nums\", [[\"font-variant-numeric\", \"tabular-nums\"]], { category: 'typography' });\nstaticUtility(\"diagonal-fractions\", [[\"font-variant-numeric\", \"diagonal-fractions\"]], { category: 'typography' });\nstaticUtility(\"stacked-fractions\", [[\"font-variant-numeric\", \"stacked-fractions\"]], { category: 'typography' });\n\n// --- Typography: Line Clamp ---\nstaticUtility(\"line-clamp-none\", [[\"-webkit-line-clamp\", \"none\"]], { category: 'typography' });\nfunctionalUtility({\n name: \"line-clamp\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [\n decl(\"overflow\", \"hidden\"),\n decl(\"display\", \"-webkit-box\"),\n decl(\"-webkit-box-orient\", \"vertical\"),\n decl(\"-webkit-line-clamp\", value)\n ],\n handleCustomProperty: (value) => [\n decl(\"overflow\", \"hidden\"),\n decl(\"display\", \"-webkit-box\"),\n decl(\"-webkit-box-orient\", \"vertical\"),\n decl(\"-webkit-line-clamp\", `var(${value})`)\n ],\n description: \"line-clamp utility (number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: List Style Type ---\nstaticUtility(\"list-none\", [[\"list-style-type\", \"none\"]], { category: 'typography' });\nstaticUtility(\"list-disc\", [[\"list-style-type\", \"disc\"]], { category: 'typography' });\nstaticUtility(\"list-decimal\", [[\"list-style-type\", \"decimal\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"list\",\n prop: \"list-style-type\",\n themeKey: \"listStyleType\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"list-style-type utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: List Style Position ---\nstaticUtility(\"list-inside\", [[\"list-style-position\", \"inside\"]], { category: 'typography' });\nstaticUtility(\"list-outside\", [[\"list-style-position\", \"outside\"]], { category: 'typography' });\n\n// --- Typography: List Style Image ---\nstaticUtility(\"list-image-none\", [[\"list-style-image\", \"none\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"list-image\",\n prop: \"list-style-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"list-style-image\", `url(${value})`)],\n handleCustomProperty: (value) => [decl(\"list-style-image\", `var(${value})`)],\n description: \"list-style-image utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Decoration Color ---\nfunctionalUtility({\n name: \"decoration\",\n themeKey: \"colors\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return themeColorDecls(\"text-decoration-color\", value, extra);\n return [decl(\"text-decoration-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"text-decoration-color\", `var(${value})`)],\n description: \"text-decoration-color utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Decoration Style ---\n staticUtility(\"decoration-solid\", [[\"text-decoration-style\", \"solid\"]], { category: 'typography' });\nstaticUtility(\"decoration-double\", [[\"text-decoration-style\", \"double\"]], { category: 'typography' });\nstaticUtility(\"decoration-dotted\", [[\"text-decoration-style\", \"dotted\"]], { category: 'typography' });\nstaticUtility(\"decoration-dashed\", [[\"text-decoration-style\", \"dashed\"]], { category: 'typography' });\nstaticUtility(\"decoration-wavy\", [[\"text-decoration-style\", \"wavy\"]], { category: 'typography' });\n\n// --- Typography: Text Decoration Thickness ---\nstaticUtility(\"decoration-auto\", [[\"text-decoration-thickness\", \"auto\"]], { category: 'typography' });\nstaticUtility(\"decoration-from-font\", [[\"text-decoration-thickness\", \"from-font\"]], { category: 'typography' });\nstaticUtility(\"decoration-0\", [[\"text-decoration-thickness\", \"0px\"]], { category: 'typography' });\nstaticUtility(\"decoration-1\", [[\"text-decoration-thickness\", \"1px\"]], { category: 'typography' });\nstaticUtility(\"decoration-2\", [[\"text-decoration-thickness\", \"2px\"]], { category: 'typography' });\nstaticUtility(\"decoration-4\", [[\"text-decoration-thickness\", \"4px\"]], { category: 'typography' });\nstaticUtility(\"decoration-8\", [[\"text-decoration-thickness\", \"8px\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"decoration\",\n prop: \"text-decoration-thickness\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `${value}px` : null),\n description: \"text-decoration-thickness utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Underline Offset ---\nstaticUtility(\"underline-offset-auto\", [[\"text-underline-offset\", \"auto\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-0\", [[\"text-underline-offset\", \"0px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-1\", [[\"text-underline-offset\", \"1px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-2\", [[\"text-underline-offset\", \"2px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-4\", [[\"text-underline-offset\", \"4px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-8\", [[\"text-underline-offset\", \"8px\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"underline-offset\",\n prop: \"text-underline-offset\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `${value}px` : null),\n description: \"text-underline-offset utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Wrap ---\nstaticUtility(\"text-wrap\", [[\"text-wrap\", \"wrap\"]], { category: 'typography' });\nstaticUtility(\"text-nowrap\", [[\"text-wrap\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"text-balance\", [[\"text-wrap\", \"balance\"]], { category: 'typography' });\nstaticUtility(\"text-pretty\", [[\"text-wrap\", \"pretty\"]], { category: 'typography' });\n\n// --- Typography: Text Indent ---\nfunctionalUtility({\n name: \"indent\",\n prop: \"text-indent\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n description: \"text-indent utility (spacing, negative, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Vertical Align ---\nstaticUtility(\"align-baseline\", [[\"vertical-align\", \"baseline\"]], { category: 'typography' });\nstaticUtility(\"align-top\", [[\"vertical-align\", \"top\"]], { category: 'typography' });\nstaticUtility(\"align-middle\", [[\"vertical-align\", \"middle\"]], { category: 'typography' });\nstaticUtility(\"align-bottom\", [[\"vertical-align\", \"bottom\"]], { category: 'typography' });\nstaticUtility(\"align-text-top\", [[\"vertical-align\", \"text-top\"]], { category: 'typography' });\nstaticUtility(\"align-text-bottom\", [[\"vertical-align\", \"text-bottom\"]], { category: 'typography' });\nstaticUtility(\"align-sub\", [[\"vertical-align\", \"sub\"]], { category: 'typography' });\nstaticUtility(\"align-super\", [[\"vertical-align\", \"super\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"align\",\n prop: \"vertical-align\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"vertical-align utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Hyphens ---\nstaticUtility(\"hyphens-none\", [[\"hyphens\", \"none\"]], { category: 'typography' });\nstaticUtility(\"hyphens-manual\", [[\"hyphens\", \"manual\"]], { category: 'typography' });\nstaticUtility(\"hyphens-auto\", [[\"hyphens\", \"auto\"]], { category: 'typography' });\n\n// --- Typography: Content ---\nstaticUtility(\"content-none\", [[\"--baro-content\", \"none\"], [\"content\", \"none\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"content\",\n prop: \"content\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"--baro-content\", `\"${value}\"`), decl(\"content\", \"var(--baro-content)\")],\n handleCustomProperty: (value) => [decl(\"--baro-content\", `var(${value})`), decl(\"content\", \"var(--baro-content)\")],\n description: \"content utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Placeholder Color --- (Tailwind 4: `.placeholder-red-500::placeholder { color: … }`)\nconst placeholderColor = (value: string) => [rule(\"&::placeholder\", [decl(\"color\", value)])];\nstaticUtility(\"placeholder-inherit\", placeholderColor(\"inherit\"), { category: 'typography' });\nstaticUtility(\"placeholder-current\", placeholderColor(\"currentcolor\"), { category: 'typography' });\nstaticUtility(\"placeholder-transparent\", placeholderColor(\"transparent\"), { category: 'typography' });\nfunctionalUtility({\n name: \"placeholder\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _ctx, _token, extra) => {\n if (extra?.realThemeValue) return [rule(\"&::placeholder\", themeColorDecls(\"color\", value, extra))];\n if (parseColor(value)) return placeholderColor(value);\n return null;\n },\n handleCustomProperty: (value) => placeholderColor(`var(${value})`),\n description: \"placeholder color utility (theme, alpha, arbitrary, custom property)\",\n});\n\n// --- Typography: Font Feature Settings (#309, Tailwind 4.3) ---\n// Tailwind 4.3 has no named values: font-features-[...] and font-features-(--x) only.\nfunctionalUtility({\n name: \"font-features\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => (token.arbitrary ? [decl(\"font-feature-settings\", value)] : null),\n handleCustomProperty: (value) => [decl(\"font-feature-settings\", `var(${value.replace(/^[a-z-]+:(?=--)/, \"\")})`)],\n description: \"font-feature-settings utility (arbitrary, custom property)\",\n category: \"typography\",\n});\n\n// #310: tab-* (Tailwind 4.3 tab-size): tab-4, tab-[8], tab-(--t).\nfunctionalUtility({\n name: \"tab\",\n prop: \"tab-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? value : null),\n description: \"tab-size utility (integer, arbitrary, custom property)\",\n category: \"typography\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { AstNode, atRoot, atRule, decl, property } from \"../core/ast\";\nimport { parseColor, parseLength, parseNumber, themeColorDecls } from \"../core/utils\";\n\nconst gradientStopProperties = () => {\n return atRoot([\n property('--baro-gradient-position'),\n property('--baro-gradient-from', '#0000', '<color>'),\n property('--baro-gradient-via', '#0000', '<color>'),\n property('--baro-gradient-to', '#0000', '<color>'),\n property('--baro-gradient-stops'),\n property('--baro-gradient-via-stops'),\n property('--baro-gradient-from-position', '0%', '<length-percentage>'),\n property('--baro-gradient-via-position', '50%', '<length-percentage>'),\n property('--baro-gradient-to-position', '100%', '<length-percentage>'),\n ], \"background\")\n}\n\n\n// --- Background Attachment ---\nstaticUtility(\"bg-fixed\", [[\"background-attachment\", \"fixed\"]], { category: 'background' });\nstaticUtility(\"bg-local\", [[\"background-attachment\", \"local\"]], { category: 'background' });\nstaticUtility(\"bg-scroll\", [[\"background-attachment\", \"scroll\"]], { category: 'background' });\n\n// --- Background Clip ---\nstaticUtility(\"bg-clip-border\", [[\"background-clip\", \"border-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-padding\", [[\"background-clip\", \"padding-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-content\", [[\"background-clip\", \"content-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-text\", [[\"background-clip\", \"text\"]], { category: 'background' });\n\n// --- Background Color ---\nstaticUtility(\"bg-inherit\", [[\"background-color\", \"inherit\"]], { category: 'background' });\nstaticUtility(\"bg-current\", [[\"background-color\", \"currentColor\"]], { category: 'background' });\nstaticUtility(\"bg-transparent\", [[\"background-color\", \"transparent\"]], { category: 'background' });\n\n// --- Background Image ---\nstaticUtility(\"bg-none\", [[\"background-image\", \"none\"]], { category: 'background' });\n\n// --- Background Origin ---\nstaticUtility(\"bg-origin-border\", [[\"background-origin\", \"border-box\"]], { category: 'background' });\nstaticUtility(\"bg-origin-padding\", [[\"background-origin\", \"padding-box\"]], { category: 'background' });\nstaticUtility(\"bg-origin-content\", [[\"background-origin\", \"content-box\"]], { category: 'background' });\n\n// --- Background Position ---\n[\n [\"bg-bottom\", \"bottom\"],\n [\"bg-center\", \"center\"],\n [\"bg-left\", \"left\"],\n [\"bg-left-bottom\", \"left bottom\"],\n [\"bg-left-top\", \"left top\"],\n [\"bg-right\", \"right\"],\n [\"bg-right-bottom\", \"right bottom\"],\n [\"bg-right-top\", \"right top\"],\n [\"bg-top\", \"top\"],\n].forEach(([name, value]) => {\n staticUtility(name, [[\"background-position\", value]], { category: 'background' });\n});\n\n/**\n * background-position utility (arbitrary, custom property supported)\n *\n * bg-position-[length] → background-position: [length]\n * bg-position-[length] → background-position: [length]\n */\nfunctionalUtility({\n name: \"bg-position\",\n prop: \"background-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"background-position utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Repeat ---\nstaticUtility(\"bg-repeat\", [[\"background-repeat\", \"repeat\"]], { category: 'background' });\nstaticUtility(\"bg-no-repeat\", [[\"background-repeat\", \"no-repeat\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-x\", [[\"background-repeat\", \"repeat-x\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-y\", [[\"background-repeat\", \"repeat-y\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-round\", [[\"background-repeat\", \"round\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-space\", [[\"background-repeat\", \"space\"]], { category: 'background' });\n\n// --- Background Size ---\nstaticUtility(\"bg-auto\", [[\"background-size\", \"auto\"]], { category: 'background' });\nstaticUtility(\"bg-cover\", [[\"background-size\", \"cover\"]], { category: 'background' });\nstaticUtility(\"bg-contain\", [[\"background-size\", \"contain\"]], { category: 'background' });\n\nfunctionalUtility({\n name: \"bg-size\",\n prop: \"background-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"background-size utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Gradients: Linear ---\nconst positionValue = (position: string) => [\n decl(\"--baro-gradient-position\", position),\n atRule(\"supports\", \"(background-image: linear-gradient(in lab, red, red))\", [\n decl(\"--baro-gradient-position\", `${position} in oklab`),\n ]),\n decl(\"background-image\", \"linear-gradient(var(--baro-gradient-stops))\"),\n];\n// Tailwind 4 emits the legacy bg-gradient-to-* with the interpolation space baked in, no @supports.\nconst legacyPositionValue = (position: string) => [\n decl(\"--baro-gradient-position\", `${position} in oklab`),\n decl(\"background-image\", \"linear-gradient(var(--baro-gradient-stops))\"),\n];\n\n[\n [\"bg-linear-to-t\", positionValue(\"to top\")],\n [\"bg-linear-to-tr\", positionValue(\"to top right\")],\n [\"bg-linear-to-r\", positionValue(\"to right\")],\n [\"bg-linear-to-br\", positionValue(\"to bottom right\")],\n [\"bg-linear-to-b\", positionValue(\"to bottom\")],\n [\"bg-linear-to-bl\", positionValue(\"to bottom left\")],\n [\"bg-linear-to-l\", positionValue(\"to left\")],\n [\"bg-linear-to-tl\", positionValue(\"to top left\")],\n\n // fallback , legacy CSS compatibility\n [\"bg-gradient-to-t\", legacyPositionValue(\"to top\")],\n [\"bg-gradient-to-tr\", legacyPositionValue(\"to top right\")],\n [\"bg-gradient-to-r\", legacyPositionValue(\"to right\")],\n [\"bg-gradient-to-br\", legacyPositionValue(\"to bottom right\")],\n [\"bg-gradient-to-b\", legacyPositionValue(\"to bottom\")],\n [\"bg-gradient-to-bl\", legacyPositionValue(\"to bottom left\")],\n [\"bg-gradient-to-l\", legacyPositionValue(\"to left\")],\n [\"bg-gradient-to-tl\", legacyPositionValue(\"to top left\")],\n].forEach(([name, value]) => {\n staticUtility(name as string, value as AstNode[], { category: 'background', priority: 1000 });\n});\n// bg-linear-<angle> (e.g., bg-linear-45)\nfunctionalUtility({\n name: \"bg-linear\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, context, token) => {\n if (parseNumber(value)) {\n // bg-linear-45 → --baro-gradient-position: 45deg (in oklab when supported)\n return positionValue(`${value}deg`);\n }\n if (token.arbitrary) {\n // bg-linear-[25deg,red_5%,yellow_60%,lime_90%,teal]\n return [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, ${value}))`\n ),\n ];\n }\n if (token.customProperty) {\n // bg-linear-(--my-gradient)\n return [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, var(${value})))`\n ),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, var(${value})))`\n ),\n ],\n description:\n \"linear-gradient background-image utility (angle, arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Gradients: Radial / Conic ---\n// Tailwind 4 shape: the utility sets --baro-gradient-position (the stops composite starts with it,\n// and it is registered without an initial value) and the image is just <fn>(var(--baro-gradient-stops)).\nconst gradientImage = (fn: string, position: string, fallback?: string): AstNode[] => [\n decl(\"--baro-gradient-position\", position),\n decl(\"background-image\", `${fn}(var(--baro-gradient-stops${fallback ? `,${fallback}` : \"\"}))`),\n];\nstaticUtility(\"bg-radial\", gradientImage(\"radial-gradient\", \"in oklab\"), { category: 'background' });\nfunctionalUtility({\n name: \"bg-radial\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _context, token) => {\n // bg-radial-[at_50%_75%]\n if (token.arbitrary) return gradientImage(\"radial-gradient\", value, value);\n if (token.customProperty) return gradientImage(\"radial-gradient\", `var(${value})`, `var(${value})`);\n return null;\n },\n handleCustomProperty: (value) => gradientImage(\"radial-gradient\", `var(${value})`, `var(${value})`),\n description:\n \"radial-gradient background-image utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\nstaticUtility(\"bg-conic\", gradientImage(\"conic-gradient\", \"in oklab\"), { category: 'background' });\nfunctionalUtility({\n name: \"bg-conic\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _context, token) => {\n // bg-conic-180 → --baro-gradient-position: from 180deg in oklab\n if (!token.arbitrary && !token.customProperty && parseNumber(value)) {\n return gradientImage(\"conic-gradient\", `from ${value}deg in oklab`);\n }\n // bg-conic-[from_45deg]\n if (token.arbitrary) return gradientImage(\"conic-gradient\", value, value);\n if (token.customProperty) return gradientImage(\"conic-gradient\", `var(${value})`, `var(${value})`);\n return null;\n },\n handleCustomProperty: (value) => gradientImage(\"conic-gradient\", `var(${value})`, `var(${value})`),\n description:\n \"conic-gradient background-image utility (angle, arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Gradient Stops ---\n\n\n\n// from-*, via-*, to-* (color, percentage, custom property, arbitrary), Tailwind 4 stop composition\nconst G = \"--baro-gradient\";\nconst stopsDecls = (stop: string, color: string | AstNode[]): AstNode[] => {\n const colorDecls = typeof color === \"string\" ? [decl(`${G}-${stop}`, color)] : color;\n if (stop === \"via\") {\n return [\n gradientStopProperties(),\n ...colorDecls,\n decl(`${G}-via-stops`, `var(${G}-position), var(${G}-from) var(${G}-from-position), var(${G}-via) var(${G}-via-position), var(${G}-to) var(${G}-to-position)`),\n decl(`${G}-stops`, `var(${G}-via-stops)`),\n ];\n }\n return [\n gradientStopProperties(),\n ...colorDecls,\n decl(`${G}-stops`, `var(${G}-via-stops, var(${G}-position), var(${G}-from) var(${G}-from-position), var(${G}-to) var(${G}-to-position))`),\n ];\n};\n[\"from\", \"via\", \"to\"].forEach((stop) => {\n functionalUtility({\n name: stop,\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _context, _token, extra) => {\n if (extra?.realThemeValue) {\n return stopsDecls(stop, themeColorDecls(`${G}-${stop}`, value, extra));\n }\n // from-10% → --baro-gradient-from-position: 10%\n if (parseLength(value)) {\n return [gradientStopProperties(), decl(`${G}-${stop}-position`, value)];\n }\n if (parseNumber(value)) {\n return [gradientStopProperties(), decl(`${G}-${stop}-position`, `${value}%`)];\n }\n if (parseColor(value)) {\n return stopsDecls(stop, value);\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(`--baro-gradient-${stop}`, `var(${value})`),\n ],\n description: `${stop} gradient stop utility (color, percent, custom property, arbitrary supported)`,\n category: \"background\",\n });\n // position variant: from-10%, via-30%, to-90%\n functionalUtility({\n name: `${stop}-position`,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(`--baro-gradient-${stop}-position`, value)],\n handleCustomProperty: (value) => [\n decl(`--baro-gradient-${stop}-position`, `var(${value})`),\n ],\n description: `${stop}-position gradient stop position utility (percent, custom property, arbitrary supported)`,\n category: \"background\",\n });\n});\n\n/**\n * background-size utility (arbitrary, custom property supported)\n * bg-[length] → background-size: [length]\n * bg-[length] → background-size: [length]\n * bg-[color] → background-color: [color]\n * bg-[url] → background-image: [url]\n * bg-[radial-gradient()] → background-image: radial-gradient(var(--baro-gradient-stops))\n * bg-red-500 → background-color: var(--color-red-500)\n */\nfunctionalUtility({\n name: \"bg\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, context, token, extra) => {\n if (value.startsWith(\"url(\")) {\n return [decl(\"background-image\", value)];\n }\n\n // if (value.startsWith(\"radial-gradient(\")) {\n // return [decl(\"background-image\", value)];\n // }\n\n if (value.startsWith(\"length:\")) {\n return [decl(\"background-size\", value.replace(\"length:\", \"\"))];\n }\n\n if (extra?.realThemeValue) return themeColorDecls(\"background-color\", value, extra);\n\n if (parseColor(value)) {\n const parsedColor = parseColor(value);\n\n if (value.startsWith(\"color:\")) {\n return [decl(\"background-color\", parsedColor || value)];\n }\n\n return [decl(\"background-color\", value)];\n }\n\n if (parseLength(value)) {\n return [decl(\"background-size\", value)];\n }\n\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"length:\")\n ? [decl(\"background-size\", `var(${value.slice(7)})`)]\n : [decl(\"background-color\", `var(${value})`)],\n description: \"background-size utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRoot, atRule, decl, property, rule } from \"../core/ast\";\nimport { parseNumber, parseLength, parseColor, themeColorDecls } from \"../core/utils\";\n\n// --- Border Radius ---\n// border-radius documentation\n\n// Static border radius utilities\nstaticUtility(\"rounded-none\", [[\"border-radius\", \"0px\"]], { category: 'borders' });\nstaticUtility(\"rounded-sm\", [[\"border-radius\", \"var(--radius-sm)\"]], { category: 'borders' });\nstaticUtility(\"rounded\", [[\"border-radius\", \"0.25rem\"]], { category: 'borders' });\nstaticUtility(\"rounded-md\", [[\"border-radius\", \"var(--radius-md)\"]], { category: 'borders' });\nstaticUtility(\"rounded-lg\", [[\"border-radius\", \"var(--radius-lg)\"]], { category: 'borders' });\nstaticUtility(\"rounded-xl\", [[\"border-radius\", \"var(--radius-xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-2xl\", [[\"border-radius\", \"var(--radius-2xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-3xl\", [[\"border-radius\", \"var(--radius-3xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-4xl\", [[\"border-radius\", \"var(--radius-4xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-xs\", [[\"border-radius\", \"var(--radius-xs)\"]], { category: 'borders' });\nstaticUtility(\"rounded-full\", [[\"border-radius\", \"9999px\"]], { category: 'borders' });\n\n\n// Individual corner radius utilities\n[\n [\"rounded-t\", [\"border-top-left-radius\", \"border-top-right-radius\"]],\n [\"rounded-r\", [\"border-top-right-radius\", \"border-bottom-right-radius\"]],\n [\"rounded-b\", [\"border-bottom-right-radius\", \"border-bottom-left-radius\"]],\n [\"rounded-l\", [\"border-top-left-radius\", \"border-bottom-left-radius\"]],\n [\"rounded-tl\", [\"border-top-left-radius\"]],\n [\"rounded-tr\", [\"border-top-right-radius\"]],\n [\"rounded-br\", [\"border-bottom-right-radius\"]],\n [\"rounded-bl\", [\"border-bottom-left-radius\"]],\n // #321 logical corners (Tailwind 4.3): none -> 0, full -> calc(infinity * 1px) like Tailwind.\n [\"rounded-s\", [\"border-start-start-radius\", \"border-end-start-radius\"]],\n [\"rounded-e\", [\"border-start-end-radius\", \"border-end-end-radius\"]],\n [\"rounded-ss\", [\"border-start-start-radius\"]],\n [\"rounded-se\", [\"border-start-end-radius\"]],\n [\"rounded-es\", [\"border-end-start-radius\"]],\n [\"rounded-ee\", [\"border-end-end-radius\"]],\n].forEach(([name, props]) => {\n const propList = props as string[];\n const logical = propList[0].startsWith(\"border-start\") || propList[0].startsWith(\"border-end\");\n // Static utilities\n staticUtility(`${name}-none`, propList.map(prop => [prop, logical ? \"0\" : \"0px\"]), { category: 'borders' });\n staticUtility(`${name}-sm`, propList.map(prop => [prop, \"var(--radius-sm)\"]), { category: 'borders' });\n staticUtility(`${name}`, propList.map(prop => [prop, \"0.25rem\"]), { category: 'borders' });\n staticUtility(`${name}-md`, propList.map(prop => [prop, \"var(--radius-md)\"]), { category: 'borders' });\n staticUtility(`${name}-lg`, propList.map(prop => [prop, \"var(--radius-lg)\"]), { category: 'borders' });\n staticUtility(`${name}-xl`, propList.map(prop => [prop, \"var(--radius-xl)\"]), { category: 'borders' });\n staticUtility(`${name}-2xl`, propList.map(prop => [prop, \"var(--radius-2xl)\"]), { category: 'borders' });\n staticUtility(`${name}-3xl`, propList.map(prop => [prop, \"var(--radius-3xl)\"]), { category: 'borders' });\n staticUtility(`${name}-4xl`, propList.map(prop => [prop, \"var(--radius-4xl)\"]), { category: 'borders' });\n staticUtility(`${name}-xs`, propList.map(prop => [prop, \"var(--radius-xs)\"]), { category: 'borders' });\n staticUtility(`${name}-full`, propList.map(prop => [prop, logical ? \"calc(infinity * 1px)\" : \"9999px\"]), { category: 'borders' });\n\n // Functional utility\n functionalUtility({\n name: name as string,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n // Tailwind 4.3 has no bare-number logical radius (rounded-s-2 emits nothing).\n if (!logical && parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n return null;\n },\n handle: (value) => propList.map(prop => decl(prop, value)),\n description: `${name} utility (spacing, arbitrary, custom property support)`,\n category: \"borders\",\n });\n});\n\n\n// Functional border radius utility\nfunctionalUtility({\n name: \"rounded\",\n // Only the `rounded` prefix itself: a class the logical rounded-s/e/... utility rejects (rounded-s-2) must not fall\n // through to border-radius (#321).\n handle: (value, _ctx, token) => (token.prefix === \"rounded\" ? [decl(\"border-radius\", value)] : null),\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n return null;\n },\n description: \"border-radius utility (spacing, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Border Width ---\n// border-width documentation\n\n// Like Tailwind v4, every border-width utility also sets border-style through a registered var whose initial value is\n// solid, so a bare border/border-t renders without relying on a preflight reset, and border-dashed/dotted/none (which\n// set the var) still win whatever the rule order.\nconst borderStyleProperty = () => atRoot([property(\"--baro-border-style\", \"solid\")]);\nconst withBorderStyle = (props: string[], width: string) => [\n borderStyleProperty(),\n ...props.map((prop) => decl(prop.replace(\"width\", \"style\"), \"var(--baro-border-style)\")),\n ...props.map((prop) => decl(prop, width)),\n];\n\n// Static border width utilities\n[[\"border-0\", \"0px\"], [\"border-2\", \"2px\"], [\"border-4\", \"4px\"], [\"border-8\", \"8px\"], [\"border\", \"1px\"]].forEach(([name, width]) => {\n staticUtility(name, [borderStyleProperty, [\"border-style\", \"var(--baro-border-style)\"], [\"border-width\", width]], { category: 'borders' });\n});\n\n\n\n// Individual side border width utilities\n[\n [\"border-x\", [\"border-left-width\", \"border-right-width\"]],\n [\"border-y\", [\"border-top-width\", \"border-bottom-width\"]],\n [\"border-bs\", [\"border-block-start-width\"]],\n [\"border-be\", [\"border-block-end-width\"]],\n [\"border-s\", [\"border-inline-start-width\"]], // #311 (Tailwind 4.3)\n [\"border-e\", [\"border-inline-end-width\"]],\n [\"border-t\", [\"border-top-width\"]],\n [\"border-r\", [\"border-right-width\"]],\n [\"border-b\", [\"border-bottom-width\"]],\n [\"border-l\", [\"border-left-width\"]],\n].forEach(([name, props]) => {\n const propList = props as string[];\n // Static utilities\n const styled = (width: string) => [\n borderStyleProperty,\n ...propList.map((prop) => [prop.replace(\"width\", \"style\"), \"var(--baro-border-style)\"] as [string, string]),\n ...propList.map((prop) => [prop, width] as [string, string]),\n ];\n staticUtility(`${name}-0`, styled(\"0px\"));\n staticUtility(`${name}-2`, styled(\"2px\"));\n staticUtility(`${name}-4`, styled(\"4px\"));\n staticUtility(`${name}-8`, styled(\"8px\"));\n staticUtility(`${name}`, styled(\"1px\"));\n\n // Functional utility\n functionalUtility({\n name: name as string,\n themeKeys: [\"borderWidth\", \"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return propList.flatMap(prop => themeColorDecls(prop.replace(\"width\", \"color\"), value, extra));\n if (parseColor(value)) {\n return propList.map(prop => decl(prop.replace(\"width\", \"color\"), value));\n }\n if (token.arbitrary) {\n return withBorderStyle(propList, value);\n }\n return null;\n },\n handleCustomProperty: (value) => {\n\n if (value.startsWith(\"length:\")) {\n return withBorderStyle(propList, `var(${value.replace(\"length:\", \"\")})`);\n }\n\n return propList.map(prop => decl(prop.replace(\"width\", \"color\"), `var(${value})`));\n },\n description: `${name} utility (number, arbitrary, custom property support)`,\n category: \"borders\",\n });\n});\n\n// --- Border Color ---\n// border-color documentation\n\n// Static border color utilities\nstaticUtility(\"border-inherit\", [[\"border-color\", \"inherit\"]], { category: 'borders' });\nstaticUtility(\"border-current\", [[\"border-color\", \"currentColor\"]], { category: 'borders' });\nstaticUtility(\"border-transparent\", [[\"border-color\", \"transparent\"]], { category: 'borders' });\n\n// --- Border Style ---\n// border-style documentation\n\n// Static border style utilities\nstaticUtility(\"border-solid\", [[\"--baro-border-style\", \"solid\"], [\"border-style\", \"solid\"]], { category: 'borders' });\nstaticUtility(\"border-dashed\", [[\"--baro-border-style\", \"dashed\"], [\"border-style\", \"dashed\"]], { category: 'borders' });\nstaticUtility(\"border-dotted\", [[\"--baro-border-style\", \"dotted\"], [\"border-style\", \"dotted\"]], { category: 'borders' });\nstaticUtility(\"border-double\", [[\"--baro-border-style\", \"double\"], [\"border-style\", \"double\"]], { category: 'borders' });\nstaticUtility(\"border-hidden\", [[\"--baro-border-style\", \"hidden\"], [\"border-style\", \"hidden\"]], { category: 'borders' });\nstaticUtility(\"border-none\", [[\"--baro-border-style\", \"none\"], [\"border-style\", \"none\"]], { category: 'borders' });\n\n// --- Divide Width --- (Tailwind 4: `:where(& > :not(:last-child))`, style from the registered border-style var)\nconst divideSides = { x: [\"border-inline-start\", \"border-inline-end\", \"border-inline-style\"], y: [\"border-top\", \"border-bottom\", \"border-bottom-style\", \"border-top-style\"] };\nObject.entries(divideSides).forEach(([axis, [start, end, ...styles]]) => {\n const rev = `--baro-divide-${axis}-reverse`;\n const divide = (width: string) => [\n borderStyleProperty(),\n rule(\":where(& > :not(:last-child))\", [\n decl(rev, \"0\"),\n ...styles.map((s) => decl(s, \"var(--baro-border-style)\")),\n decl(`${start}-width`, `calc(${width} * var(${rev}))`),\n decl(`${end}-width`, `calc(${width} * calc(1 - var(${rev})))`),\n ]),\n ];\n staticUtility(`divide-${axis}`, divide(\"1px\"), { category: 'borders' });\n staticUtility(`divide-${axis}-reverse`, [rule(\":where(& > :not(:last-child))\", [decl(rev, \"1\")])], { category: 'borders' });\n functionalUtility({\n name: `divide-${axis}`,\n supportsArbitrary: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? `${value}px` : null),\n handle: (value) => divide(value),\n description: `divide-${axis} width utility`,\n category: \"borders\",\n });\n});\n\n\n// Functional border width utility\nfunctionalUtility({\n name: \"border\",\n themeKeys: [\"colors\", \"borderWidth\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n\n if (extra?.realThemeValue) return themeColorDecls(\"border-color\", value, extra);\n\n if (token.arbitrary) {\n if (parseLength(value)) {\n return withBorderStyle([\"border-width\"], value);\n }\n return [decl(\"border-color\", value)];\n }\n\n if (parseNumber(value)) {\n return withBorderStyle([\"border-width\"], `${value}px`);\n }\n if (parseColor(value)) {\n return [decl(\"border-color\", value)];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"length:\")) {\n return withBorderStyle([\"border-width\"], `var(${value.replace(\"length:\", \"\")})`);\n }\n return [decl(\"border-color\", `var(${value})`)];\n },\n description: \"border-width utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Outline Width ---\n// outline-width documentation\n\n// Like border (and Tailwind v4), outline width utilities set outline-style through a registered var whose initial value\n// is solid, so outline-2/focus-visible:outline-1 render; outline-dashed/none/hidden set the var and win in either order.\nconst outlineStyleProperty = () => atRoot([property(\"--baro-outline-style\", \"solid\")]);\nconst withOutlineStyle = (width: string) => [\n outlineStyleProperty(),\n decl(\"outline-style\", \"var(--baro-outline-style)\"),\n decl(\"outline-width\", width),\n];\n\n// Static outline width utilities\n[[\"outline-0\", \"0px\"], [\"outline-1\", \"1px\"], [\"outline-2\", \"2px\"], [\"outline-4\", \"4px\"], [\"outline-8\", \"8px\"]].forEach(([name, width]) => {\n staticUtility(name, [outlineStyleProperty, [\"outline-style\", \"var(--baro-outline-style)\"], [\"outline-width\", width]], { category: 'borders' });\n});\n\n// --- Outline Color ---\n// outline-color documentation\n\n// Static outline color utilities\nstaticUtility(\"outline-inherit\", [[\"outline-color\", \"inherit\"]], { category: 'borders' });\nstaticUtility(\"outline-current\", [[\"outline-color\", \"currentColor\"]], { category: 'borders' });\nstaticUtility(\"outline-transparent\", [[\"outline-color\", \"transparent\"]], { category: 'borders' });\n\n\n// --- Outline Style ---\n// outline-style documentation\n\n// Static outline style utilities\n// Tailwind v4: outline-none removes the outline; outline-hidden (v3's outline-none) hides it but keeps a transparent\n// outline in forced-colors mode for accessibility.\nstaticUtility(\"outline-none\", [[\"--baro-outline-style\", \"none\"], [\"outline-style\", \"none\"]], { category: 'borders' });\nstaticUtility(\"outline-hidden\", [\n [\"--baro-outline-style\", \"none\"],\n [\"outline-style\", \"none\"],\n atRule(\"media\", \"(forced-colors: active)\", [decl(\"outline\", \"2px solid transparent\"), decl(\"outline-offset\", \"2px\")]),\n], { category: 'borders' });\nstaticUtility(\"outline\", [outlineStyleProperty, [\"outline-style\", \"var(--baro-outline-style)\"], [\"outline-width\", \"1px\"]], { category: 'borders' });\n[\"solid\", \"dashed\", \"dotted\", \"double\"].forEach((style) => {\n staticUtility(`outline-${style}`, [[\"--baro-outline-style\", style], [\"outline-style\", style]], { category: 'borders' });\n});\n\n// --- Outline Offset ---\n// outline-offset documentation\n\n// Static outline offset utilities\nstaticUtility(\"outline-offset-0\", [[\"outline-offset\", \"0px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-1\", [[\"outline-offset\", \"1px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-2\", [[\"outline-offset\", \"2px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-4\", [[\"outline-offset\", \"4px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-8\", [[\"outline-offset\", \"8px\"]], { category: 'borders' });\n\n// Functional outline offset utility\nfunctionalUtility({\n name: \"outline-offset\",\n prop: \"outline-offset\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n description: \"outline-offset utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n\n// Functional outline color utility\nfunctionalUtility({\n name: \"outline\",\n themeKeys: [\"colors\", \"borderWidth\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n\n if (extra?.realThemeValue) return themeColorDecls(\"outline-color\", value, extra);\n\n if (parseColor(value)) {\n return [decl(\"outline-color\", value)];\n }\n\n if (parseNumber(value)) {\n return withOutlineStyle(`${value}px`);\n }\n\n // Handle arbitrary values\n if (token.arbitrary) {\n\n if (parseLength(value)) {\n return withOutlineStyle(value);\n }\n\n return [decl(\"outline-color\", value)];\n }\n\n\n\n return null;\n },\n handleCustomProperty: (value) => {\n\n if (value.startsWith(\"color:\")) {\n return [decl(\"outline-color\", value.replace(\"color:\", \"\"))];\n }\n\n if (value.startsWith(\"length:\")) {\n return withOutlineStyle(`var(${value.replace(\"length:\", \"\")})`);\n }\n\n return [decl(\"outline-color\", `var(${value})`)];\n },\n description: \"outline-color utility (theme colors, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n\n// Functional outline width utility\nfunctionalUtility({\n name: \"outline\",\n prop: \"outline-width\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n description: \"outline-width utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Divide Color --- (Tailwind 4: `:where(& > :not(:last-child)) { border-color: … }`, same selector as divide-x/y)\nconst divideColor = (value: string) => [rule(\":where(& > :not(:last-child))\", [decl(\"border-color\", value)])];\nstaticUtility(\"divide-inherit\", divideColor(\"inherit\"), { category: 'borders' });\nstaticUtility(\"divide-current\", divideColor(\"currentColor\"), { category: 'borders' });\nstaticUtility(\"divide-transparent\", divideColor(\"transparent\"), { category: 'borders' });\nfunctionalUtility({\n name: \"divide\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _ctx, _token, extra) => {\n // Theme colours go through the shared helper (var(--color-*) and Tailwind's /alpha form, #228).\n if (extra?.realThemeValue) {\n return [rule(\":where(& > :not(:last-child))\", themeColorDecls(\"border-color\", value, extra))];\n }\n // Arbitrary values only when they are colours: divide-[3px] is not a divide colour (Tailwind emits nothing).\n if (parseColor(value)) return divideColor(value);\n return null;\n },\n handleCustomProperty: (value) => divideColor(`var(${value})`),\n description: \"divide-color utility (theme, alpha, arbitrary, custom property)\",\n category: \"borders\",\n});\n","// --- Transform Utilities ---\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { parseFractionOrNumber, parseNumber } from \"../core/utils\";\n\n// Like Tailwind v4, the per-axis rotate/scale/translate utilities set only their own --baro-* var and a shared composite\n// declaration reads all axes: rotate/skew with empty fallbacks, scale/translate through @property-registered defaults.\n// A lone rotate-x-*/scale-y-*/translate-x-* therefore never references an undefined var, and axes combine.\nconst ROTATE_SKEW =\n \"var(--baro-rotate-x,) var(--baro-rotate-y,) var(--baro-rotate-z,) var(--baro-skew-x,) var(--baro-skew-y,)\";\nconst rotateAxis = (axis: string, fn: string) => [decl(`--baro-rotate-${axis}`, fn), decl(\"transform\", ROTATE_SKEW)];\nconst skewAxis = (axis: string, fn: string) => [decl(`--baro-skew-${axis}`, fn), decl(\"transform\", ROTATE_SKEW)];\n\nconst scaleProperties = () =>\n atRoot([\n property(\"--baro-scale-x\", \"1\"),\n property(\"--baro-scale-y\", \"1\"),\n property(\"--baro-scale-z\", \"1\"),\n ]);\nconst scaleAxis = (axis: string, v: string) => [\n scaleProperties(),\n decl(`--baro-scale-${axis}`, v),\n decl(\"scale\", axis === \"z\" ? \"var(--baro-scale-x) var(--baro-scale-y) var(--baro-scale-z)\" : \"var(--baro-scale-x) var(--baro-scale-y)\"),\n];\n\n// --- Transform ---\n// transform-none: disables all transforms\nstaticUtility(\"transform-none\", [[\"transform\", \"none\"]], {\n category: \"transform\",\n});\n\n// transform-gpu: enables GPU acceleration for transforms\n// Output: transform: translateZ(0) <ROTATE_SKEW>\nstaticUtility(\n \"transform-gpu\",\n [\n [\n \"transform\",\n `translateZ(0) ${ROTATE_SKEW}`,\n ],\n ],\n { category: \"transform\" }\n);\n\n// transform-cpu: disables GPU acceleration, uses only CPU transforms\n// Output: transform: <ROTATE_SKEW>\nstaticUtility(\"transform-cpu\", [\n [\n \"transform\",\n ROTATE_SKEW,\n ],\n]);\n\n// --- Transform Style ---\n// transform-style documentation\n\n// transform-3d: transform-style: preserve-3d;\nstaticUtility(\"transform-3d\", [[\"transform-style\", \"preserve-3d\"]], {\n category: \"transform\",\n});\n// transform-flat: transform-style: flat;\nstaticUtility(\"transform-flat\", [[\"transform-style\", \"flat\"]], {\n category: \"transform\",\n});\n\n// transform-(<custom-property>): sets transform to a CSS custom property value\n// Example: transform-(--my-transform) → transform: var(--my-transform);\nfunctionalUtility({\n name: \"transform\",\n prop: \"transform\",\n supportsCustomProperty: true,\n handleCustomProperty: (value) => [decl(\"transform\", `var(${value})`)],\n description:\n \"transform utility for custom property (transform-(--my-transform))\",\n category: \"transform\",\n});\n\n// transform-[<value>]: sets transform to an arbitrary value\n// Example: transform-[matrix(1,2,3,4,5,6)] → transform: matrix(1,2,3,4,5,6);\nfunctionalUtility({\n name: \"transform\",\n prop: \"transform\",\n supportsArbitrary: true,\n handle: (value) => [decl(\"transform\", value)],\n description: \"transform utility for arbitrary value (transform-[...])\",\n category: \"transform\",\n});\n\n// --- Backface Visibility ---\n// backface-visibility documentation\nstaticUtility(\"backface-hidden\", [[\"backface-visibility\", \"hidden\"]], {\n category: \"transform\",\n});\nstaticUtility(\"backface-visible\", [[\"backface-visibility\", \"visible\"]], {\n category: \"transform\",\n});\n\n// --- Perspective ---\n// perspective documentation\nstaticUtility(\n \"perspective-dramatic\",\n [[\"perspective\", \"var(--perspective-dramatic)\"]],\n { category: \"transform\" }\n); // 100px\nstaticUtility(\n \"perspective-near\",\n [[\"perspective\", \"var(--perspective-near)\"]],\n { category: \"transform\" }\n); // 300px\nstaticUtility(\n \"perspective-normal\",\n [[\"perspective\", \"var(--perspective-normal)\"]],\n { category: \"transform\" }\n); // 500px\nstaticUtility(\n \"perspective-midrange\",\n [[\"perspective\", \"var(--perspective-midrange)\"]],\n { category: \"transform\" }\n); // 800px\nstaticUtility(\n \"perspective-distant\",\n [[\"perspective\", \"var(--perspective-distant)\"]],\n { category: \"transform\" }\n); // 1200px\nstaticUtility(\"perspective-none\", [[\"perspective\", \"none\"]], {\n category: \"transform\",\n});\n\n// --- Perspective Origin ---\n// perspective-origin documentation\nstaticUtility(\"perspective-origin-center\", [[\"perspective-origin\", \"center\"]], {\n category: \"transform\",\n});\nstaticUtility(\"perspective-origin-top\", [[\"perspective-origin\", \"top\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-top-right\",\n [[\"perspective-origin\", \"top right\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-right\", [[\"perspective-origin\", \"right\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-bottom-right\",\n [[\"perspective-origin\", \"bottom right\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-bottom\", [[\"perspective-origin\", \"bottom\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-bottom-left\",\n [[\"perspective-origin\", \"bottom left\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-left\", [[\"perspective-origin\", \"left\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-top-left\",\n [[\"perspective-origin\", \"top left\"]],\n { category: \"transform\" }\n);\n\nfunctionalUtility({\n name: \"perspective-origin\",\n prop: \"perspective-origin\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"perspective-origin\", value)],\n handleCustomProperty: (value) => [\n decl(\"perspective-origin\", `var(${value})`),\n ],\n description:\n \"perspective-origin utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// perspective-(<custom-property>) → perspective: var(--custom-property)\nfunctionalUtility({\n name: \"perspective\",\n prop: \"perspective\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n // perspective-[750px] → perspective: 750px\n return [decl(\"perspective\", value)];\n },\n handleCustomProperty: (value) => [decl(\"perspective\", `var(${value})`)],\n description:\n \"perspective utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Rotate ---\n// rotate documentation\n\n// rotate-none\nstaticUtility(\"rotate-none\", [[\"rotate\", \"none\"]], { category: \"transform\" });\n\n// rotate-x-<number>, -rotate-x-<number>, rotate-x-(<custom-property>), rotate-x-[<value>]\nfunctionalUtility({\n name: \"rotate-x\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-x-45 → --baro-rotate-x: rotateX(45deg); transform: ROTATE_SKEW\n // -rotate-x-45 → --baro-rotate-x: rotateX(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"x\", `rotateX(${sign}${deg})`);\n }\n // rotate-x-[3.142rad] → --baro-rotate-x: rotateX(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"x\", `rotateX(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"x\", `rotateX(var(${value}))`),\n description: \"rotate-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-y-<number>, -rotate-y-<number>, rotate-y-(<custom-property>), rotate-y-[<value>]\nfunctionalUtility({\n name: \"rotate-y\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-y-45 → --baro-rotate-y: rotateY(45deg); transform: ROTATE_SKEW\n // -rotate-y-45 → --baro-rotate-y: rotateY(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"y\", `rotateY(${sign}${deg})`);\n }\n // rotate-y-[3.142rad] → --baro-rotate-y: rotateY(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"y\", `rotateY(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"y\", `rotateY(var(${value}))`),\n description: \"rotate-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-z-<number>, -rotate-z-<number>, rotate-z-(<custom-property>), rotate-z-[<value>]\nfunctionalUtility({\n name: \"rotate-z\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-z-45 → --baro-rotate-z: rotateZ(45deg); transform: ROTATE_SKEW\n // -rotate-z-45 → --baro-rotate-z: rotateZ(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"z\", `rotateZ(${sign}${deg})`);\n }\n // rotate-z-[3.142rad] → --baro-rotate-z: rotateZ(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"z\", `rotateZ(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"z\", `rotateZ(var(${value}))`),\n description: \"rotate-z utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-<number>, -rotate-<number>, rotate-(<custom-property>), rotate-[<value>]\nfunctionalUtility({\n name: \"rotate\",\n prop: \"rotate\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-45 → rotate: 45deg\n // -rotate-45 → rotate: calc(45deg * -1)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n if (negative || String(value).startsWith(\"-\")) {\n return [decl(\"rotate\", `calc(${deg} * -1)`)];\n }\n\n return [decl(\"rotate\", deg)];\n }\n // rotate-[3.142rad] → rotate: 3.142rad\n return [decl(\"rotate\", value)];\n },\n handleCustomProperty: (value) => [decl(\"rotate\", `var(${value})`)],\n description: \"rotate utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Scale ---\n// scale documentation\n\n// scale-none\nstaticUtility(\"scale-none\", [[\"scale\", \"none\"]], { category: \"transform\" });\n// scale-3d\nstaticUtility(\n \"scale-3d\",\n [scaleProperties, [\"scale\", \"var(--baro-scale-x) var(--baro-scale-y) var(--baro-scale-z)\"]],\n { category: \"transform\" }\n);\n\n// scale-x-<number>, -scale-x-<number>, scale-x-(<custom-property>), scale-x-[<value>]\nfunctionalUtility({\n name: \"scale-x\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"x\", value);\n }\n\n // scale-x-75 → --baro-scale-x: 75%; scale reads all axes\n // -scale-x-75 → --baro-scale-x: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"x\", `calc(${pct} * ${sign}1)`);\n }\n // scale-x-[1.7] → --baro-scale-x: 1.7; scale reads all axes\n return scaleAxis(\"x\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"x\", `var(${value})`),\n description: \"scale-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-y-<number>, -scale-y-<number>, scale-y-(<custom-property>), scale-y-[<value>]\nfunctionalUtility({\n name: \"scale-y\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"y\", value);\n }\n\n // scale-y-75 → --baro-scale-y: 75%; scale reads all axes\n // -scale-y-75 → --baro-scale-y: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"y\", `calc(${pct} * ${sign}1)`);\n }\n // scale-y-[1.7] → --baro-scale-y: 1.7; scale reads all axes\n return scaleAxis(\"y\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"y\", `var(${value})`),\n description: \"scale-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-z-<number>, -scale-z-<number>, scale-z-(<custom-property>), scale-z-[<value>]\nfunctionalUtility({\n name: \"scale-z\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"z\", value);\n }\n\n // scale-z-75 → --baro-scale-z: 75%; scale reads all axes\n // -scale-z-75 → --baro-scale-z: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"z\", `calc(${pct} * ${sign}1)`);\n }\n // scale-z-[1.7] → --baro-scale-z: 1.7; scale reads all axes\n return scaleAxis(\"z\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"z\", `var(${value})`),\n description: \"scale-z utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-<number>, -scale-<number>, scale-(<custom-property>), scale-[<value>]\nfunctionalUtility({\n name: \"scale\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return [decl(\"scale\", `${value}`)];\n }\n\n // scale-75 → scale: 75% 75%\n // -scale-75 → scale: calc(75% * -1) calc(75% * -1)\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n if (negative || String(value).startsWith(\"-\")) {\n return [decl(\"scale\", `calc(${pct} * -1) calc(${pct} * -1)`)];\n }\n return [decl(\"scale\", `${pct} ${pct}`)];\n }\n // scale-[1.7] → scale: 1.7\n return [decl(\"scale\", value)];\n },\n handleCustomProperty: (value) => [\n decl(\"scale\", `var(${value}) var(${value})`),\n ],\n description: \"scale utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Skew ---\n// skew documentation\n\n// skew-x-<number>, -skew-x-<number>, skew-x-(<custom-property>), skew-x-[<value>]\nfunctionalUtility({\n name: \"skew-x\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-x-4 → transform: skewX(4deg)\n // -skew-x-4 → transform: skewX(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return skewAxis(\"x\", `skewX(${sign}${deg})`);\n }\n // skew-x-[3.142rad] → transform: skewX(3.142rad)\n return skewAxis(\"x\", `skewX(${value})`);\n },\n handleCustomProperty: (value) => skewAxis(\"x\", `skewX(var(${value}))`),\n description: \"skew-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// skew-y-<number>, -skew-y-<number>, skew-y-(<custom-property>), skew-y-[<value>]\nfunctionalUtility({\n name: \"skew-y\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-y-4 → transform: skewY(4deg)\n // -skew-y-4 → transform: skewY(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return skewAxis(\"y\", `skewY(${sign}${deg})`);\n }\n // skew-y-[3.142rad] → transform: skewY(3.142rad)\n return skewAxis(\"y\", `skewY(${value})`);\n },\n handleCustomProperty: (value) => skewAxis(\"y\", `skewY(var(${value}))`),\n description: \"skew-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// skew-<number>, -skew-<number>, skew-(<custom-property>), skew-[<value>]\nfunctionalUtility({\n name: \"skew\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-4 → transform: skewX(4deg) skewY(4deg)\n // -skew-4 → transform: skewX(-4deg) skewY(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return [decl(\"--baro-skew-x\", `skewX(${sign}${deg})`), decl(\"--baro-skew-y\", `skewY(${sign}${deg})`), decl(\"transform\", ROTATE_SKEW)];\n }\n // skew-[3.142rad] → transform: skewX(3.142rad) skewY(3.142rad)\n return [decl(\"--baro-skew-x\", `skewX(${value})`), decl(\"--baro-skew-y\", `skewY(${value})`), decl(\"transform\", ROTATE_SKEW)];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-skew-x\", `skewX(var(${value}))`),\n decl(\"--baro-skew-y\", `skewY(var(${value}))`),\n decl(\"transform\", ROTATE_SKEW),\n ],\n description: \"skew utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Transform Origin ---\n// transform-origin documentation\n\n// origin-center: transform-origin: center;\nstaticUtility(\"origin-center\", [[\"transform-origin\", \"center\"]], {\n category: \"transform\",\n});\n// origin-top: transform-origin: top;\nstaticUtility(\"origin-top\", [[\"transform-origin\", \"top\"]], {\n category: \"transform\",\n});\n// origin-top-right: transform-origin: top right;\nstaticUtility(\"origin-top-right\", [[\"transform-origin\", \"top right\"]], {\n category: \"transform\",\n});\n// origin-right: transform-origin: right;\nstaticUtility(\"origin-right\", [[\"transform-origin\", \"right\"]], {\n category: \"transform\",\n});\n// origin-bottom-right: transform-origin: bottom right;\nstaticUtility(\"origin-bottom-right\", [[\"transform-origin\", \"bottom right\"]], {\n category: \"transform\",\n});\n// origin-bottom: transform-origin: bottom;\nstaticUtility(\"origin-bottom\", [[\"transform-origin\", \"bottom\"]], {\n category: \"transform\",\n});\n// origin-bottom-left: transform-origin: bottom left;\nstaticUtility(\"origin-bottom-left\", [[\"transform-origin\", \"bottom left\"]], {\n category: \"transform\",\n});\n// origin-left: transform-origin: left;\nstaticUtility(\"origin-left\", [[\"transform-origin\", \"left\"]], {\n category: \"transform\",\n});\n// origin-top-left: transform-origin: top left;\nstaticUtility(\"origin-top-left\", [[\"transform-origin\", \"top left\"]], {\n category: \"transform\",\n});\n\n// origin-(<custom-property>): transform-origin: var(--custom-property);\nfunctionalUtility({\n name: \"origin\",\n prop: \"transform-origin\",\n supportsCustomProperty: true,\n supportsArbitrary: true,\n description:\n \"transform-origin utility for custom property (origin-(--my-transform-origin))\",\n category: \"transform\",\n});\n\n// --- Translate ---\n// translate documentation\n\nconst translateProperties = () =>\n atRoot([\n property(\"--baro-translate-x\", \"0\"),\n property(\"--baro-translate-y\", \"0\"),\n property(\"--baro-translate-z\", \"0\"),\n ]);\n\nconst translateAxis = (axis: string, v: string) => [\n translateProperties(),\n decl(`--baro-translate-${axis}`, v),\n decl(\n \"translate\",\n axis === \"z\"\n ? \"var(--baro-translate-x) var(--baro-translate-y) var(--baro-translate-z)\"\n : \"var(--baro-translate-x) var(--baro-translate-y)\"\n ),\n];\nconst staticTranslateAxis = (axis: string, v: string) => [\n translateProperties,\n [`--baro-translate-${axis}`, v] as [string, string],\n [\n \"translate\",\n axis === \"z\"\n ? \"var(--baro-translate-x) var(--baro-translate-y) var(--baro-translate-z)\"\n : \"var(--baro-translate-x) var(--baro-translate-y)\",\n ] as [string, string],\n];\n\n// --- Static translate utilities ---\n// translate-none: disables all translation\nstaticUtility(\"translate-none\", [[\"translate\", \"none\"]], {\n category: \"transform\",\n});\n\n// translate-px, -translate-px, translate-full, -translate-full\nstaticUtility(\"translate-px\", [[\"translate\", \"1px 1px\"]], {\n category: \"transform\",\n});\nstaticUtility(\"-translate-px\", [[\"translate\", \"-1px -1px\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"translate-full\",\n [\n translateProperties,\n [\"--baro-translate-x\", \"100%\"],\n [\"--baro-translate-y\", \"100%\"],\n [\"translate\", \"var(--baro-translate-x) var(--baro-translate-y)\"],\n ],\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-full\",\n [\n translateProperties,\n [\"--baro-translate-x\", \"-100%\"],\n [\"--baro-translate-y\", \"-100%\"],\n [\"translate\", \"var(--baro-translate-x) var(--baro-translate-y)\"],\n ],\n { category: \"transform\" }\n);\n\n// translate-x-px, -translate-x-px, translate-x-full, -translate-x-full\nstaticUtility(\n \"translate-x-px\",\n staticTranslateAxis(\"x\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-x-px\",\n staticTranslateAxis(\"x\", \"-1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"translate-x-full\",\n staticTranslateAxis(\"x\", \"100%\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-x-full\",\n staticTranslateAxis(\"x\", \"-100%\"),\n { category: \"transform\" }\n);\n\n// translate-y-px, -translate-y-px, translate-y-full, -translate-y-full\nstaticUtility(\n \"translate-y-px\",\n staticTranslateAxis(\"y\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-y-px\",\n staticTranslateAxis(\"y\", \"-1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"translate-y-full\",\n staticTranslateAxis(\"y\", \"100%\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-y-full\",\n staticTranslateAxis(\"y\", \"-100%\"),\n { category: \"transform\" }\n);\n\n// translate-z-px, -translate-z-px\nstaticUtility(\n \"translate-z-px\",\n staticTranslateAxis(\"z\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-z-px\",\n staticTranslateAxis(\"z\", \"-1px\"),\n { category: \"transform\" }\n);\n\n// --- Functional translate utilities ---\n\n// translate-x-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-x\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"x\", v);\n }\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"x\", v);\n }\n return translateAxis(\"x\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"x\", `var(${value})`),\n description:\n \"translate-x utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-y-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-y\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"y\", v);\n }\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"y\", v);\n }\n return translateAxis(\"y\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"y\", `var(${value})`),\n description:\n \"translate-y utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-z-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-z\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"z\", v);\n }\n\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"z\", v);\n }\n\n return translateAxis(\"z\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"z\", `var(${value})`),\n description:\n \"translate-z utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n // Fraction\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return [decl(\"translate\", `${v} ${v}`)];\n }\n // Number (spacing scale)\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return [decl(\"translate\", `${v} ${v}`)];\n }\n // Arbitrary value\n return [decl(\"translate\", `${value} ${value}`)];\n },\n handleCustomProperty: (value) => [\n decl(\"translate\", `var(${value}) var(${value})`),\n ],\n description:\n \"translate utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n","import { decl } from \"../core/ast\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Fill Utilities ---\n// fill documentation\n\n// Static fill values\nstaticUtility(\"fill-inherit\", [[\"fill\", \"inherit\"]], { category: 'svg' });\nstaticUtility(\"fill-current\", [[\"fill\", \"currentColor\"]], { category: 'svg' });\nstaticUtility(\"fill-transparent\", [[\"fill\", \"transparent\"]], { category: 'svg' });\nstaticUtility(\"fill-black\", [[\"fill\", \"#000\"]], { category: 'svg' });\nstaticUtility(\"fill-white\", [[\"fill\", \"#fff\"]], { category: 'svg' });\n\n// Functional: theme color, arbitrary, custom property\nfunctionalUtility({\n name: \"fill\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) {\n return [decl(\"fill\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"fill\", value)];\n },\n description: \"fill utility (static, theme, arbitrary, custom property supported)\",\n category: \"svg\",\n});\n\n// --- Stroke Utilities ---\n// stroke documentation\nstaticUtility(\"stroke-inherit\", [[\"stroke\", \"inherit\"]], { category: 'svg' });\nstaticUtility(\"stroke-current\", [[\"stroke\", \"currentColor\"]], { category: 'svg' });\nstaticUtility(\"stroke-transparent\", [[\"stroke\", \"transparent\"]], { category: 'svg' });\nstaticUtility(\"stroke-black\", [[\"stroke\", \"#000\"]], { category: 'svg' });\nstaticUtility(\"stroke-white\", [[\"stroke\", \"#fff\"]], { category: 'svg' });\n\nfunctionalUtility({\n name: \"stroke\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n\n if (parseNumber(value)) {\n return [decl(\"stroke-width\", value)];\n }\n\n if (extra?.realThemeValue) {\n return [decl(\"stroke\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"stroke\", value)];\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"length:\")) {\n const cp = value.replace(\"length:\", \"\");\n return [decl(\"stroke-width\", `var(${cp})`)];\n }\n return [decl(\"stroke\", `var(${value})`)];\n },\n description: \"stroke utility (static, theme, arbitrary, custom property supported)\",\n category: \"svg\",\n});\n\n","import { staticUtility } from \"../core/registry\";\n\n// --- Forced Color Adjust Utilities ---\n// forced-color-adjust documentation\nstaticUtility(\"forced-color-adjust-auto\", [[\"forced-color-adjust\", \"auto\"]], { category: 'accessibility' });\nstaticUtility(\"forced-color-adjust-none\", [[\"forced-color-adjust\", \"none\"]], { category: 'accessibility' }); ","import { staticModifier } from \"../../core/registry\";\nimport { atRule } from '../../core/ast';\n\n// --- Basic pseudo-class variants ---\nstaticModifier('hover', ['&:hover'], {\n order: 50,\n source: 'pseudo',\n wrap: () => [atRule('media', '(hover: hover)', [])],\n});\nstaticModifier('focus', ['&:focus'], { order: 50, source: 'pseudo' });\nstaticModifier('active', ['&:active'], { order: 50, source: 'pseudo' });\nstaticModifier('visited', ['&:visited'], { order: 50, source: 'pseudo' });\nstaticModifier('focus-visible', ['&:focus-visible'], { order: 50, source: 'pseudo' });\nstaticModifier('focus-within', ['&:focus-within'], { order: 50, source: 'pseudo' });\n","import { staticModifier } from \"../../core/registry\";\n\n// --- Form state variants ---\nstaticModifier('disabled', ['&:disabled'], { source: 'pseudo' });\nstaticModifier('checked', ['&:checked'], { source: 'pseudo' });\nstaticModifier('required', ['&:required'], { source: 'pseudo' });\nstaticModifier('invalid', ['&:invalid'], { source: 'pseudo' });\nstaticModifier('enabled', ['&:enabled'], { source: 'pseudo' });\nstaticModifier('indeterminate', ['&:indeterminate'], { source: 'pseudo' });\nstaticModifier('default', ['&:default'], { source: 'pseudo' });\nstaticModifier('optional', ['&:optional'], { source: 'pseudo' });\nstaticModifier('valid', ['&:valid'], { source: 'pseudo' });\nstaticModifier('user-valid', ['&:user-valid'], { source: 'pseudo' });\nstaticModifier('user-invalid', ['&:user-invalid'], { source: 'pseudo' });\nstaticModifier('in-range', ['&:in-range'], { source: 'pseudo' });\nstaticModifier('out-of-range', ['&:out-of-range'], { source: 'pseudo' });\nstaticModifier('placeholder-shown', ['&:placeholder-shown'], { source: 'pseudo' });\nstaticModifier('autofill', ['&:autofill'], { source: 'pseudo' });\nstaticModifier('read-only', ['&:read-only'], { source: 'pseudo' }); ","import { staticModifier } from \"../../core/registry\";\n\n// --- Structural selector variants ---\nstaticModifier('first', ['&:first-child'], { source: 'pseudo' });\nstaticModifier('last', ['&:last-child'], { source: 'pseudo' });\nstaticModifier('only', ['&:only-child'], { source: 'pseudo' });\nstaticModifier('odd', ['&:nth-child(odd)'], { source: 'pseudo' });\nstaticModifier('even', ['&:nth-child(even)'], { source: 'pseudo' });\nstaticModifier('first-of-type', ['&:first-of-type'], { source: 'pseudo' });\nstaticModifier('last-of-type', ['&:last-of-type'], { source: 'pseudo' });\nstaticModifier('only-of-type', ['&:only-of-type'], { source: 'pseudo' });\nstaticModifier('empty', ['&:empty'], { source: 'pseudo' }); ","import { staticModifier } from \"../../core/registry\";\nimport { AstNode, atRule } from \"../../core/ast\";\n\n// --- Media feature variants ---\nstaticModifier('prefers-contrast-more', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-contrast: more)', [], 'media')],\n source: 'media'\n});\nstaticModifier('prefers-contrast-less', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-contrast: less)', [], 'media')],\n source: 'media'\n});\nstaticModifier('forced-colors', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(forced-colors: active)', [], 'media')],\n source: 'media'\n});\nstaticModifier('pointer-coarse', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(pointer: coarse)', [], 'media')],\n source: 'media'\n});\nstaticModifier('pointer-fine', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(pointer: fine)', [], 'media')],\n source: 'media'\n});\nstaticModifier('any-pointer-coarse', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(any-pointer: coarse)', [], 'media')],\n source: 'media'\n});\nstaticModifier('any-pointer-fine', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(any-pointer: fine)', [], 'media')],\n source: 'media'\n});\n\n// Motion variants\nstaticModifier('motion-safe', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-reduced-motion: no-preference)', [], 'media')],\n source: 'media'\n});\nstaticModifier('motion-reduce', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-reduced-motion: reduce)', [], 'media')],\n source: 'media'\n});\n\n// Print and orientation variants\nstaticModifier('print', ['&'], {\n order: 5,\n wrap: () => [atRule('media', 'print', [], 'media')],\n source: 'media'\n});\nstaticModifier('portrait', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(orientation: portrait)', [], 'media')],\n source: 'media'\n});\nstaticModifier('landscape', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(orientation: landscape)', [], 'media')],\n source: 'media'\n}); ","import { staticModifier } from \"../../core/registry\";\n \n// --- Attribute selector variants ---\nstaticModifier('rtl', ['&[dir=rtl]'], { order: 20, source: 'attribute' });\nstaticModifier('ltr', ['&[dir=ltr]'], { order: 20, source: 'attribute' });\nstaticModifier('inert', ['&[inert]'], { order: 40, source: 'attribute' });\nstaticModifier('open', ['&:is([open], :popover-open, :open)'], { order: 40, source: 'attribute' }); ","import { staticModifier } from \"../../core/registry\";\nimport { AstNode, atRule, atRoot, decl, property } from \"../../core/ast\";\n\n// Import separated variant modules\nimport \"./pseudo-classes\";\nimport \"./form-states\";\nimport \"./structural-selectors\";\nimport \"./media-features\";\nimport \"./attribute-selectors\";\n\n// --- Pseudo-elements (cross-browser) ---\n// Like Tailwind, before:/after: create the pseudo-element: `content` defaults to\n// var(--baro-content) (initial \"\"), which content-* utilities set.\nconst withPseudoContent = (ast: AstNode[]): AstNode[] => [\n atRoot([property(\"--baro-content\", '\"\"')]),\n ...ast,\n decl(\"content\", \"var(--baro-content)\"),\n];\nstaticModifier('before', ['&::before'], { source: 'pseudo', astHandler: withPseudoContent });\nstaticModifier('after', ['&::after'], { source: 'pseudo', astHandler: withPseudoContent });\nstaticModifier('placeholder', [\n '&::placeholder',\n '&::-webkit-input-placeholder',\n '&::-moz-placeholder',\n '&:-ms-input-placeholder',\n], { source: 'pseudo' });\nstaticModifier('selection', [\n '&::selection',\n '&::-moz-selection',\n], { source: 'pseudo' });\nstaticModifier('file', [\n '&::file-selector-button',\n '&::-webkit-file-upload-button',\n], { source: 'pseudo' });\nstaticModifier('marker', [\n '&::marker',\n '&::-webkit-details-marker',\n '&::-moz-list-bullet',\n '&::-moz-list-number',\n], { source: 'pseudo' });\nstaticModifier('details-content', ['&::details-content'], { source: 'pseudo' });\nstaticModifier('first-line', ['&::first-line'], { source: 'pseudo' });\nstaticModifier('first-letter', ['&::first-letter'], { source: 'pseudo' });\nstaticModifier('backdrop', ['&::backdrop'], { source: 'pseudo' });\n\n// --- starting: variant (maps to @starting-style) ---\nstaticModifier('starting', ['&'], {\n wrap: () => [atRule('starting-style', '', [], 'starting')],\n source: 'starting'\n}); ","import { AstNode } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\n\n/**\n * Create container query parameters\n */\nexport function createContainerParams(type: 'min' | 'max', value: string, name?: string, negate = false): string {\n const condition = type === 'min' ? 'width >=' : 'width <';\n const query = `${negate ? 'not ' : ''}(${condition} ${value})`;\n return name ? `${name} ${query}` : query;\n}\n\n/**\n * Create media query parameters\n */\nexport function createMediaParams(type: 'min' | 'max', value: string): string {\n return type === 'min' ? `(min-width: ${value})` : `(width < ${value})`;\n}\n\n/**\n * Get size value from theme\n */\nexport function getThemeSize(ctx: Context, key: string): string | undefined {\n return ctx.theme('container.' + key) as string || ctx.theme('breakpoint.' + key) as string;\n}\n\n/**\n * Create container query AST\n */\nexport function createContainerRule(params: string, ast: AstNode | AstNode[]): AstNode {\n return {\n type: 'at-rule',\n name: 'container',\n params,\n nodes: Array.isArray(ast) ? ast : [ast],\n source: 'container'\n };\n}\n\n/**\n * Create media query AST\n */\nexport function createMediaRule(params: string, ast: AstNode | AstNode[]): AstNode {\n return {\n type: 'at-rule',\n name: 'media',\n params,\n nodes: Array.isArray(ast) ? ast : [ast],\n };\n}\n\n// Default breakpoint values (fallback)\nexport function getDefaultBreakpoint(breakpoint: string): string {\n const defaults: Record<string, string> = {\n 'sm': '(min-width: 640px)',\n 'md': '(min-width: 768px)', \n 'lg': '(min-width: 1024px)',\n 'xl': '(min-width: 1280px)',\n '2xl': '(min-width: 1536px)'\n };\n return defaults[breakpoint] || `(min-width: ${breakpoint})`;\n}\n\n/**\n * Arbitrary selector value as Tailwind reads it: `_` is a space, `\\_` a literal underscore.\n */\nexport function decodeArbitrarySelector(value: string): string {\n return value.replace(/\\\\_|_/g, (m) => (m === '_' ? ' ' : '_'));\n}\n\n/**\n * `data-[state=open]` / `aria-[expanded=true]` / `data-avatar` → `[data-state=\"open\"]`, as Tailwind emits it.\n * Returns undefined for anything else.\n */\nexport function attributeVariantSelector(variant: string): string | undefined {\n const bracket = /^(data|aria)-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(variant);\n if (bracket) {\n const [, kind, key, raw] = bracket;\n if (raw === undefined) return `[${kind}-${key}]`;\n const value = /^([\"']).*\\1$/.test(raw) ? raw : `\"${decodeArbitrarySelector(raw)}\"`;\n return `[${kind}-${key}=${value}]`;\n }\n const bare = /^data-([a-zA-Z0-9_-]+)$/.exec(variant);\n return bare ? `[data-${bare[1]}]` : undefined;\n}\n\n/**\n * The argument of a `:has()`/`:not()` built from an arbitrary value: a selector list is wrapped as `*:is(…)`\n * (Tailwind's form); a relative selector (`>svg`) or a single selector is kept.\n */\nexport function functionalArgument(value: string): string {\n const v = decodeArbitrarySelector(value);\n return /^[>+~]/.test(v.trim()) || !hasTopLevelComma(v) ? v : `*:is(${v})`;\n}\n\nfunction hasTopLevelComma(value: string): boolean {\n let depth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') i++;\n else if (c === '(' || c === '[') depth++;\n else if (c === ')' || c === ']') depth--;\n else if (c === ',' && depth === 0) return true;\n }\n return false;\n}","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\nimport { getDefaultBreakpoint } from \"./utils\";\n\n// responsive (media queries) - dynamic breakpoint support\nfunctionalModifier(\n (mod: string, context: Context) => {\n // 1. Check breakpoints defined in config (matches actual implementation)\n const breakpoints = context.theme('breakpoints') || context.config('theme.breakpoints') || {};\n const breakpointKeys = Object.keys(breakpoints);\n \n // 2. Check basic breakpoints (all breakpoints defined in config)\n if (breakpointKeys.includes(mod)) {\n return true;\n }\n \n // 3. Check max-width breakpoint (max-{breakpoint})\n if (mod.startsWith('max-')) {\n const baseBreakpoint = mod.replace('max-', '');\n // 3-1. When it is a defined breakpoint\n if (breakpointKeys.includes(baseBreakpoint)) {\n return true;\n }\n // 3-2. When it is an arbitrary max-width (max-[960px])\n if (/^\\[.*\\]$/.test(baseBreakpoint)) {\n return true;\n }\n }\n \n // 4. Check arbitrary min-width (min-[600px])\n if (/^min-\\[.*\\]$/.test(mod)) {\n return true; // arbitrary values are always valid\n }\n \n // 5. Check arbitrary max-width (max-[960px])\n if (/^max-\\[.*\\]$/.test(mod)) {\n return true; // arbitrary values are always valid\n }\n \n return false;\n },\n undefined,\n (mod: ParsedModifier, context: Context) => {\n const breakpoint = mod.type;\n \n // 1. Handle breakpoints defined in config (v4.1 standard)\n const breakpoints = context.theme('breakpoints') || context.config('theme.breakpoints') || {};\n \n // 2. Handle basic breakpoints (all breakpoints defined in config)\n if (Object.keys(breakpoints).includes(breakpoint)) {\n let mediaQuery: string = context.theme(`breakpoints.${breakpoint}`) as string || \n getDefaultBreakpoint(breakpoint);\n // If only a number (px/em/rem etc.) is provided, wrap with (min-width: ...)\n if (/^\\d*\\.?\\d+(px|em|rem)?$/.test(mediaQuery)) {\n mediaQuery = `(min-width: ${mediaQuery})`;\n }\n return [atRule('media', mediaQuery, [], 'responsive')];\n }\n \n // 3. Handle max-width breakpoint (max-{breakpoint})\n if (breakpoint.startsWith('max-')) {\n const baseBreakpoint = breakpoint.replace('max-', '');\n \n // 3-1. When it is a defined breakpoint (max-sm, max-md, etc.)\n if (Object.keys(breakpoints).includes(baseBreakpoint)) {\n let mediaQuery = context.theme(`breakpoints.${baseBreakpoint}`) as string || \n getDefaultBreakpoint(baseBreakpoint);\n \n // Convert min-width to max-width\n if (mediaQuery.includes('min-width:')) {\n const value = mediaQuery.match(/min-width:\\s*([^)]+)/)?.[1];\n if (value) {\n mediaQuery = `(width < ${value})`;\n }\n } else if (mediaQuery.includes('width >=')) {\n const value = mediaQuery.match(/width >=\\s*([^)]+)/)?.[1];\n if (value) {\n mediaQuery = `(width < ${value})`;\n }\n } else if (/^\\d*\\.?\\d+(px|em|rem)?$/.test(mediaQuery)) {\n // A bare theme value (`48rem`), as `md` wraps it with (min-width: …)\n mediaQuery = `(width < ${mediaQuery})`;\n }\n \n return [atRule('media', mediaQuery, [], 'responsive')];\n }\n \n // 3-2. When it is an arbitrary max-width (max-[960px])\n if (/^\\[(.*)\\]$/.test(baseBreakpoint)) {\n const value = baseBreakpoint.match(/^\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width < ${value})`, [], 'responsive')];\n }\n }\n }\n \n // 4. Handle arbitrary min-width (min-[600px])\n if (/^min-\\[(.*)\\]$/.test(breakpoint)) {\n const value = breakpoint.match(/^min-\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width >= ${value})`, [], 'responsive')];\n }\n }\n \n // 5. Handle arbitrary max-width (max-[960px])\n if (/^max-\\[(.*)\\]$/.test(breakpoint)) {\n const value = breakpoint.match(/^max-\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width < ${value})`, [], 'responsive')];\n }\n }\n return [];\n }\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { AstNode, atRule, rule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\n\n// Dark variant plugin\nconst getDarkSelectors = (ctx: Context) => {\n const mode = ctx.config(\"darkMode\") || \"media\";\n const custom = ctx.config(\"darkModeSelector\");\n const selectors: { type: \"media\" | \"selector\"; value: string }[] = [];\n\n if (mode === \"media\") {\n selectors.push({ type: \"media\", value: \"(prefers-color-scheme: dark)\" });\n if (custom) {\n const joined = Array.isArray(custom) ? custom.join(\", \") : custom;\n selectors.push({ type: \"selector\", value: joined as string });\n }\n return selectors;\n }\n if (mode === \"class\") {\n if (custom) {\n const joined = Array.isArray(custom) ? custom.join(\", \") : custom;\n selectors.push({ type: \"selector\", value: joined as string });\n return selectors;\n }\n selectors.push({ type: \"selector\", value: \".dark\" });\n return selectors;\n }\n selectors.push({ type: \"selector\", value: \".dark\" });\n return selectors;\n};\n\nfunctionalModifier(\n (mod: string) => mod === \"dark\",\n undefined, // modifySelector is not used\n (_mod: ParsedModifier, ctx: Context) => {\n const selectors = getDarkSelectors(ctx);\n \n const result: AstNode[] = [];\n\n selectors.forEach((sel) => {\n if (sel.type === \"media\") {\n const atRuleNode = atRule(\"media\", sel.value, [], 'dark');\n result.push(atRuleNode);\n } else {\n const ruleNode = rule(sel.value, [], 'dark');\n result.push(ruleNode);\n }\n });\n\n return result;\n }\n); \n","import { functionalModifier } from \"../../core/registry\";\nimport { AstNode, atRule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\nimport { createContainerRule, createContainerParams } from \"./utils\";\n\n// --- @container query variants ---\n\n// @container/<name> is a utility (container-type + container-name, presets/layout.ts), not a variant: a bare\n// `@container <name> { }` has no condition and is invalid CSS.\n\n// 3. [not-]@<size>, @min-<size>, @max-<size>, each with an optional /<name>. <size> is a --container-* theme key\n// (3xs…7xl) or an arbitrary [value]; unknown theme keys emit nothing (Tailwind 4 behaviour).\nconst SIZE_VARIANT = /^(not-)?@(?:(min|max)-)?(\\[[^\\]]+\\]|[a-zA-Z0-9.]+)(?:\\/([a-zA-Z0-9_-]+))?$/;\nfunctionalModifier(\n (mod: string) => SIZE_VARIANT.test(mod) && !/^(?:not-)?@container(?:\\/|$)/.test(mod),\n undefined,\n (mod: ParsedModifier, context: Context) => {\n const m = SIZE_VARIANT.exec(mod.type);\n if (!m) return [];\n const [, not, type, size, name] = m;\n const value = size.startsWith('[')\n ? size.slice(1, -1).replace(/_/g, ' ')\n : (context.theme('container.' + size) as string | undefined);\n if (!value) return [];\n // #311: not-@<size> negates the condition (Tailwind 4.3.3: `@container [name] not (width >= …)`).\n return [createContainerRule(createContainerParams(type === 'max' ? 'max' : 'min', value, name, !!not), [])];\n }\n);\n","import { functionalModifier, getModifier, type ModifierRegistration } from \"../../core/registry\";\nimport type { Context } from \"../../core/context\";\nimport type { ParsedModifier } from \"../../core/parser\";\nimport { attributeVariantSelector, decodeArbitrarySelector, functionalArgument } from \"./utils\";\n\n/** A bracketed selector that opens with an at-rule is not a selector: the variant does not match. */\nexport const startsAtRule = (bracket: string) => /^[\\s_]*@/.test(bracket);\n\n// has-[]: functionalModifier\nfunctionalModifier(\n (mod: string) => /^has-\\[.*\\]$/.test(mod) && !startsAtRule(mod.slice(5)),\n ({ selector, mod }) => {\n const m = /^has-\\[(.+)\\]$/.exec(mod.type);\n\n return m ? {\n selector: `&:has(${functionalArgument(m[1])})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined,\n);\n\n// has-data-[slot=x] / has-aria-[…]: `&:has(*[data-slot=\"x\"])`, as Tailwind emits it\nfunctionalModifier(\n (mod: string) => /^has-(data|aria)-/.test(mod) && !!attributeVariantSelector(mod.slice(4)),\n ({ mod }) => ({\n selector: `&:has(*${attributeVariantSelector(mod.type.slice(4))})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n }),\n undefined,\n);\n\n/**\n * `has-<v>` / `in-<v>` for a simple variant `<v>` whose selector is `&<compound>` (hover, focus, checked, first,\n * open, data-*, aria-*, …): `&:has(*<compound>)` / `:where(*<compound>) &`, as Tailwind 4.1.13 emits them; `<v>`'s\n * wrap (hover's `@media (hover: hover)`) is kept. `in-[sel]` → `:where(*:is(sel)) &`.\n * Tokens reach here only after the #220 variant-scope guard in the parser / jsonToAst.\n */\ntype HasIn = { kind: string; compound: string; inner?: ModifierRegistration };\n\nfunction innerCompound(variant: string, ctx: Context): Omit<HasIn, 'kind'> | undefined {\n const attr = attributeVariantSelector(variant);\n if (attr) return { compound: attr };\n if (/^(has|in|not|group|peer)-|[^a-z0-9-]/.test(variant)) return undefined;\n const inner = getModifier(ctx).find((m) => m.match(variant, ctx));\n if (!inner?.modifySelector || inner.astHandler) return undefined;\n const out = inner.modifySelector({ selector: '&', fullClassName: '', mod: { type: variant } as ParsedModifier, context: ctx });\n const list = typeof out === 'string' ? [{ selector: out }] : Array.isArray(out) ? out : [out];\n if (list.length !== 1) return undefined;\n const sel = list[0].selector;\n // one compound on `&` only: no combinator, no top-level list, no second `&`\n if (!/^&[:[]/.test(sel) || sel.slice(1).includes('&') || /[\\s,>+~]/.test(sel.replace(/\\([^()]*\\)/g, ''))) return undefined;\n return { compound: sel.slice(1), inner };\n}\n\nfunction resolveHasIn(mod: string, ctx: Context): HasIn | undefined {\n const m = /^(has|in)-(.+)$/.exec(mod);\n if (!m) return undefined;\n const [, kind, v] = m;\n if (kind === 'in' && /^\\[.+\\]$/.test(v)) {\n if (startsAtRule(v.slice(1))) return undefined;\n const sel = decodeArbitrarySelector(v.slice(1, -1));\n return { kind, compound: sel.startsWith('&') ? sel.slice(1) : `:is(${sel})` };\n }\n if (kind === 'has' && (v.startsWith('[') || /^(data|aria)-/.test(v))) return undefined; // handled above\n const r = innerCompound(v, ctx);\n return r && { kind, ...r };\n}\n\nconst hasInSelector: ModifierRegistration['modifySelector'] = ({ selector, mod, context }) => {\n const r = resolveHasIn(mod.type, context);\n if (!r) return { selector };\n return {\n selector: r.kind === 'has' ? `&:has(*${r.compound})` : `:where(*${r.compound}) &`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n};\n\n// Two registrations: the engine applies any `wrap` it finds, so only inner variants that wrap get one.\nfunctionalModifier(\n (mod: string, ctx: Context) => !!resolveHasIn(mod, ctx)?.inner?.wrap,\n hasInSelector,\n (mod, context) => resolveHasIn(mod.type, context)!.inner!.wrap!({ ...mod, type: mod.type.replace(/^(has|in)-/, '') }, context),\n);\nfunctionalModifier(\n (mod: string, ctx: Context) => { const r = resolveHasIn(mod, ctx); return !!r && !r.inner?.wrap; },\n hasInSelector,\n);\n\n/**\n * `group-has-<v>` / `peer-has-<v>` (optionally `/name`): `&:is(:where(.group):has(*<compound>) *)` /\n * `&:is(:where(.peer):has(*<compound>) ~ *)`, as Tailwind 4.1.13 emits them; `[sel]` → `*:is(sel)` (a relative\n * selector is kept), and `<v>`'s wrap (hover's `@media (hover: hover)`) is kept. Registered before the generic\n * group-/peer- handlers so it matches first; tokens reach here only after the #220 variant-scope guard.\n */\ntype GroupHas = { kind: 'group' | 'peer'; base: string; arg: string; inner?: ModifierRegistration; v: string };\n\nfunction resolveGroupHas(mod: string, ctx: Context): GroupHas | undefined {\n const m = /^(group|peer)-has-(.+?)(?:\\/([a-zA-Z0-9_-]+))?$/.exec(mod);\n if (!m) return undefined;\n const kind = m[1] as 'group' | 'peer';\n const v = m[2];\n const base = m[3] ? `.${kind}\\\\/${m[3]}` : `.${kind}`;\n if (/^\\[.+\\]$/.test(v)) {\n if (startsAtRule(v.slice(1))) return undefined;\n const sel = decodeArbitrarySelector(v.slice(1, -1));\n return { kind, base, v, arg: /^[>+~]/.test(sel.trim()) ? sel : `*:is(${sel})` };\n }\n const r = innerCompound(v, ctx);\n return r && { kind, base, v, arg: `*${r.compound}`, inner: r.inner };\n}\n\nconst groupHasSelector: ModifierRegistration['modifySelector'] = ({ selector, mod, context }) => {\n const r = resolveGroupHas(mod.type, context);\n if (!r) return { selector };\n const tail = r.kind === 'group' ? ' *' : ' ~ *';\n return { selector: `&:is(:where(${r.base}):has(${r.arg})${tail})`, wrappingType: 'rule', source: r.kind };\n};\n\nfunctionalModifier(\n (mod: string, ctx: Context) => !!resolveGroupHas(mod, ctx)?.inner?.wrap,\n groupHasSelector,\n (mod, context) => {\n const r = resolveGroupHas(mod.type, context)!;\n return r.inner!.wrap!({ ...mod, type: r.v }, context);\n },\n);\nfunctionalModifier(\n (mod: string, ctx: Context) => { const r = resolveGroupHas(mod, ctx); return !!r && !r.inner?.wrap; },\n groupHasSelector,\n);\n","import { functionalModifier } from \"../../core/registry\";\nimport { functionalArgument } from \"./utils\";\n\n// not-[]: functionalModifier for arbitrary negation\nfunctionalModifier(\n (mod: string) => /^not-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^not-\\[(.+)\\]$/.exec(mod.type);\n if (m) {\n\n if (!/^[a-zA-Z0-9_-]+(=.+)?$/.test(m[1])) {\n return {\n selector: `&:not(${functionalArgument(m[1])})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n\n return {\n selector: `&:not([${m[1]}])`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n \n return {\n selector,\n source: 'attribute'\n };\n }\n);\n\n// not-: functionalModifier for pseudo-class negation. not-@… is container-query negation (container-queries.ts);\n// anything it does not accept (e.g. not-@container) emits nothing, like Tailwind 4.3.3 (#311).\nfunctionalModifier(\n (mod: string) => /^not-/.test(mod) && !mod.startsWith('not-@'),\n ({ selector, mod }) => {\n const m = /^not-(.+)$/.exec(mod.type);\n return {\n selector: m ? `&:not(:${m[1]})` : selector,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Universal selector variants ( 4.x style, supports chaining/:is wrapping) ---\nfunctionalModifier(\n (mod) => mod === '*',\n () => {\n // Tailwind: `:is(.cls > *)` — the direct children, not the element itself.\n return { selector: ':is(& > *)', wrappingType: 'rule', source: 'universal' };\n },\n undefined,\n);\n\nfunctionalModifier(\n (mod) => mod === '**',\n () => ({ selector: ':is(& *)', wrappingType: 'rule', source: 'universal' }),\n undefined,\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { decodeArbitrarySelector } from \"./utils\";\n\n// Master CSS-style arbitrary variant ([...]) support (order: 999, always last)\nfunctionalModifier(\n (mod: string) => /^\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^\\[(.+)\\]$/.exec(mod.type);\n if (!m) return { selector };\n // `_` is a space (`[&_svg]` → `& svg`), as in Tailwind\n const inner = decodeArbitrarySelector(m[1]).trim();\n // For attribute selectors (attr=val) or simple attributes ([open]), wrap with brackets\n if (/^[a-zA-Z0-9_-]+(=.+)?$/.test(inner)) {\n return { selector: `&[${inner}]`, wrappingType: 'rule', source: 'attribute' };\n }\n\n if (inner.startsWith('&')) {\n return { selector: `${inner}`, wrappingType: 'rule', source: 'pseudo' };\n }\n\n // No `&`: Tailwind matches the element itself (`[:root]` → `&:is(:root)`).\n return { selector: `&:is(${inner})`, wrappingType: 'rule', source: 'base' };\n },\n undefined\n); ","import { functionalArgument } from \"./utils\";\nimport { functionalModifier } from \"../../core/registry\";\n\n// --- Standard aria and not- variants ---\nfunctionalModifier(\n (mod: string) => /^aria-/.test(mod),\n ({ selector, mod }) => {\n // aria-[expanded=true] → &[aria-expanded=\"true\"] { ... }\n const bracket = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(mod.type);\n if (bracket) {\n const key = bracket[1];\n const value = bracket[2] ?? 'true';\n return {\n selector: `&[aria-${key}=\"${value}\"]`,\n source: 'aria'\n };\n }\n // aria-pressed → &[aria-pressed=\"true\"] { ... }\n const m2 = /^aria-([a-zA-Z0-9_]+)$/.exec(mod.type);\n if (m2) {\n const key = m2[1];\n return {\n selector: `&[aria-${key}=\"true\"]`,\n source: 'aria'\n };\n }\n return {\n selector,\n source: 'aria'\n };\n },\n undefined\n);\n\nfunctionalModifier(\n (mod: string) => mod.startsWith('not-') && !mod.startsWith('not-@'), // not-@… is container negation (#311)\n ({ selector, mod }) => {\n const pseudo = mod.type.replace('not-', '');\n if (pseudo.startsWith('[')) {\n const inner = pseudo.slice(1, -1);\n // Attribute pattern: identifier(=value)? (e.g., open, dir=rtl, aria-pressed=true)\n if (/^[a-zA-Z0-9_-]+(=.+)?$/.test(inner)) {\n return {\n selector: `&:not([${inner}])`,\n source: 'attribute'\n };\n } else {\n // Otherwise, treat as a selector\n return {\n selector: `&:not(${functionalArgument(inner)})`,\n source: 'attribute'\n };\n }\n } else {\n // not-hover → :not(:hover)\n return {\n selector: `&:not(:${pseudo})`,\n source: 'attribute'\n };\n }\n },\n undefined\n);\n\n// --- Standard data- variants (similar to aria-) ---\nfunctionalModifier(\n (mod: string) => /^data-/.test(mod),\n ({ selector, mod }) => {\n \n // data-[state=open] → [data-state=\"open\"] & { ... }\n const bracket = /^data-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(mod.type);\n if (bracket) {\n const key = bracket[1];\n const value = bracket[2] ?? 'true';\n return {\n selector: `&[data-${key}=\"${value}\"]`,\n source: 'data'\n };\n }\n // data-avatar → [data-avatar] & { ... }\n const m2 = /^data-([a-zA-Z0-9_]+)$/.exec(mod.type);\n if (m2) {\n const key = m2[1];\n return {\n selector: `&[data-${key}]`,\n source: 'data'\n };\n }\n return {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Nth-child, nth-last-child, nth-of-type, nth-last-of-type (숫자/패턴 기반) ---\nfunctionalModifier(\n (mod: string) => /^nth-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-child(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-last-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-last-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-last-child(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-of-type-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-of-type-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-of-type(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-last-of-type-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-last-of-type-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-last-of-type(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Functional selector variants ---\nfunctionalModifier(\n (mod: string) => /^is-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^is-\\[(.+)\\]$/.exec(mod.type);\n return m ? {\n selector: `&:is(${m[1]})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^where-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^where-\\[(.+)\\]$/.exec(mod.type);\n return m ? {\n selector: `&:where(${m[1]})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\n\n// --- At-rule variants ---\n\n// supports-[]: functionalModifier\nfunctionalModifier(\n (mod: string) => /^supports-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^supports-\\[(.+)\\]$/.exec(mod.type);\n if (m) {\n return [atRule('supports', `(${m[1]})`, [], 'supports')];\n }\n return [];\n }\n);\n\n// --- layer-[]: @layer 쿼리 variant ---\nfunctionalModifier(\n (mod: string) => /^layer-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^layer-\\[(.+)\\]$/.exec(mod.type);\n return m ? [atRule('layer', m[1], [])] : [];\n }\n);\n\n// --- scope-[]: @scope 쿼리 variant ---\nfunctionalModifier(\n (mod: string) => /^scope-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^scope-\\[(.+)\\]$/.exec(mod.type);\n return m ? [atRule('scope', m[1], [])] : [];\n }\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\nimport { attributeVariantSelector, decodeArbitrarySelector, functionalArgument } from \"./utils\";\nimport { startsAtRule } from \"./has-variants\";\n\n// `group-has-[@…]` / `peer-has-[@…]`: an at-rule is not a selector, the variant does not match (as has-[…]).\nconst atRuleHas = (mod: string) => /^(group|peer)-has-\\[/.test(mod) && startsAtRule(mod.slice(mod.indexOf(\"[\") + 1));\n\n// `group-x/name` → ['x', '.group\\/name']; the name is a plain identifier, as Tailwind requires.\nfunction splitGroupName(kind: 'group' | 'peer', variant: string): [string, string] {\n const named = /^(.+)\\/([a-zA-Z0-9_-]+)$/.exec(variant);\n return named ? [named[1], `.${kind}\\\\/${named[2]}`] : [variant, `.${kind}`];\n}\n\n// group-hover / peer-hover (optionally named): like `hover:`, only where hover is real (`@media (hover: hover)`).\n// Registered before the generic group-/peer- handlers so it matches first.\nfunctionalModifier(\n (mod: string) => /^(group|peer)-hover(\\/[a-zA-Z0-9_-]+)?$/.test(mod),\n ({ mod }) => {\n const kind = mod.type.startsWith('group') ? 'group' : 'peer';\n const [, base] = splitGroupName(kind, mod.type.slice(kind.length + 1));\n const tail = kind === 'group' ? ' *' : ' ~ *';\n return { selector: `&:is(:where(${base}):hover${tail})`, wrappingType: 'rule', source: kind };\n },\n () => [atRule('media', '(hover: hover)', [])],\n);\n\n// `group-not-[x]` / `peer-not-[x]` → `:not(*:is(x))`; `group-not-focus` → `:not(:focus)`.\nfunction negated(value: string): string {\n const v = value.slice(4);\n return v.startsWith('[') && v.endsWith(']') ? `:not(*:is(${decodeArbitrarySelector(v.slice(1, -1))}))` : `:not(:${v})`;\n}\n\n// --- group/peer/parent/child extensions (examples: group-focus, peer-active, etc.) ---\nfunctionalModifier(\n (mod: string) => /^group-(.+)$/.test(mod) && !atRuleHas(mod),\n ({ selector, mod }) => {\n const raw = /^group-(.+)$/.exec(mod.type);\n const [variant, base] = splitGroupName('group', raw?.[1] ?? '');\n const m = raw ? [raw[0], variant] as const : null;\n const g = `:where(${base})`;\n\n // group-data-[state=open] / group-aria-[…] → `:where(.group)[data-state=\"open\"] *`\n const attr = m ? attributeVariantSelector(m[1]) : undefined;\n if (attr) return { selector: `&:is(${g}${attr} *)`, wrappingType: 'rule', source: 'group' };\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n const value = m?.[1].slice(1, -1).replace(/_/g, '');\n return {\n selector: `&:is(${g}:is(${value}) *)`,\n wrappingType: 'rule',\n source: 'group'\n };\n }\n\n if (m?.[1]?.startsWith('not-')) {\n return { selector: `&:is(${g}${negated(m[1])} *)`, wrappingType: 'rule', source: 'group' };\n }\n\n if (m?.[1]?.startsWith('has-')) {\n const pattern = /^has-\\[([a-zA-Z0-9_-]+)\\]$/.exec(m?.[1]);\n if (pattern) {\n const value = pattern[1];\n return {\n selector: `&:is(${g}:has(:is(${value})) *)`,\n source: 'group'\n };\n }\n return {\n selector: `&:is(${g}:has(${functionalArgument(m[1].slice(5, -1))}) *)`,\n source: 'group'\n };\n }\n\n if (m?.[1]?.startsWith('aria-')) {\n const pattern = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(m?.[1]);\n if (pattern) {\n const value = pattern[1];\n if (pattern[2]) {\n return {\n selector: `&:is(${g}[aria-${value}=\"${pattern[2]}\"] *)`,\n source: 'group'\n };\n } else {\n return {\n selector: `&:is(${g}[aria-${value}] *)`,\n source: 'group'\n };\n }\n }\n }\n\n return m ? {\n selector: `&:is(${g}:${m[1]} *)`,\n wrappingType: 'rule',\n source: 'group'\n } : {\n selector,\n source: 'group'\n };\n },\n undefined,\n);\n\nfunctionalModifier(\n (mod: string) => /^peer-(.+)$/.test(mod) && !atRuleHas(mod),\n ({ selector, mod }) => {\n const raw = /^peer-(.+)$/.exec(mod.type);\n const [variant, base] = splitGroupName('peer', raw?.[1] ?? '');\n const m = raw ? [raw[0], variant] as const : null;\n const g = `:where(${base})`;\n\n // peer-data-[state=open] / peer-aria-[…] → `:where(.peer)[data-state=\"open\"] ~ *`\n const attr = m ? attributeVariantSelector(m[1]) : undefined;\n if (attr) return { selector: `&:is(${g}${attr} ~ *)`, wrappingType: 'rule', source: 'peer' };\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n const value = m?.[1].slice(1, -1).replace(/_/g, '');\n return {\n selector: `&:is(${g}:is(${value})~*)`,\n wrappingType: 'rule',\n source: 'peer'\n };\n }\n\n const value = m?.[1];\n\n // has-xxxx, not-xxxx, aria-xxxx\n\n if (value?.startsWith('has-[') && value.endsWith(']')) {\n return { selector: `&:is(${g}:has(${functionalArgument(value.slice(5, -1))}) ~ *)`, source: 'peer' };\n }\n\n if (value?.startsWith('has-')) {\n return {\n selector: `&:is(${g}:has(:${value.slice(4)})~*)`,\n source: 'peer'\n };\n }\n\n if (value?.startsWith('not-')) {\n return {\n selector: `&:is(${g}${negated(value)} ~ *)`,\n source: 'peer'\n };\n }\n \n if (value?.startsWith('aria-')) {\n\n let pattern = /^aria-([a-zA-Z0-9_]+)$/.exec(value);\n if (pattern) {\n const key = pattern[1];\n return {\n selector: `&:is(${g}[aria-${key}]~*)`,\n source: 'peer'\n };\n }\n\n pattern = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(value);\n if (pattern) {\n const key = pattern[1];\n const value = pattern[2];\n\n if (pattern[2]) {\n return {\n selector: `&:is(${g}[aria-${key}=\"${value}\"]~*)`,\n source: 'peer'\n };\n } else {\n return {\n selector: `&:is(${g}[aria-${key}]~*)`,\n source: 'peer'\n };\n }\n }\n }\n\n return m ? {\n selector: `&:is(${g}:${value}~*)`,\n source: 'peer'\n } : {\n selector,\n source: 'peer'\n };\n },\n undefined,\n);\n\n// --- parent/child extensions (not in the actual spec, but extensibility example) ---\nfunctionalModifier(\n (mod: string) => /^parent-(.+)$/.test(mod),\n ({ selector, mod }) => {\n const m = /^parent-(.+)$/.exec(mod.type);\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n return {\n selector: `.parent\\\\:\\\\[${m[1].slice(1, -1)}\\\\] &`,\n wrappingType: 'rule',\n source: 'parent'\n };\n }\n\n return m ? {\n selector: `.parent:${m[1]} &`,\n source: 'parent'\n } : {\n selector,\n source: 'parent'\n };\n },\n undefined,\n);\nfunctionalModifier(\n (mod: string) => /^child-(.+)$/.test(mod),\n ({ selector, mod }) => {\n const m = /^child-(.+)$/.exec(mod.type);\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n return {\n selector: `& > .child\\\\:\\\\[${m[1].slice(1, -1)}\\\\]`,\n wrappingType: 'rule',\n source: 'child'\n };\n }\n return m ? {\n selector: `& > .child:${m[1]}`,\n source: 'child'\n } : {\n selector,\n source: 'child'\n };\n },\n undefined,\n); ","/**\n * Tailwind-compatible cascade order for runtime-inserted rules (#254); shared by @barocss/server (#267).\n *\n * The runtime discovers classes in DOM order, so without sorting `lg:px-8`\n * seen before `sm:px-6` would land earlier and lose at >= 1024px. Each rule\n * gets a sort key derived from its leading `@media` / `@container` preludes:\n *\n * 0 base, state media (hover), motion/contrast, unknown\n * 1 max-* breakpoints (larger width first)\n * 2 min-* breakpoints (smaller width first)\n * 3 @max-* container queries (larger width first)\n * 4 @min-* container queries (smaller width first)\n * 5 orientation, dark (prefers-color-scheme), print, forced-colors\n *\n * Nested at-rules (e.g. `sm:dark:`) contribute one key pair per level, so\n * `sm:` < `sm:dark:` < `md:`. Equal keys keep discovery order.\n */\nexport type RuleKey = number[];\n\nconst LEADING_AT = /^\\s*@(media|container)\\s+([^{]*)\\{/;\nconst LATE_MEDIA = /prefers-color-scheme|\\bprint\\b|forced-colors|orientation/;\nconst MIN_W = /(?:min-width\\s*:\\s*|width\\s*>=?\\s*)([\\d.]+)(px|rem|em)?/;\nconst MAX_W = /(?:max-width\\s*:\\s*|width\\s*<=?\\s*)([\\d.]+)(px|rem|em)?/;\n\nfunction toPx(n: string, unit?: string): number {\n const v = parseFloat(n);\n return unit === \"rem\" || unit === \"em\" ? v * 16 : v;\n}\n\nfunction preludeKey(kind: string, prelude: string): [number, number] {\n const container = kind === \"container\";\n const min = MIN_W.exec(prelude);\n if (min) return [container ? 4 : 2, toPx(min[1], min[2])];\n const max = MAX_W.exec(prelude);\n if (max) return [container ? 3 : 1, -toPx(max[1], max[2])];\n if (!container && LATE_MEDIA.test(prelude)) return [5, 0];\n return [0, 0];\n}\n\nexport function ruleSortKey(rule: string): RuleKey {\n const key: number[] = [];\n let rest = rule;\n let m: RegExpExecArray | null;\n while ((m = LEADING_AT.exec(rest))) {\n const [g, v] = preludeKey(m[1], m[2]);\n key.push(g, v);\n rest = rest.slice(m[0].length);\n }\n return key;\n}\n\nexport function compareKeys(a: RuleKey, b: RuleKey): number {\n const n = Math.min(a.length, b.length);\n for (let i = 0; i < n; i++) {\n if (a[i] !== b[i]) return a[i] - b[i];\n }\n return a.length - b.length;\n}\n\n/** Index after the last key <= `key` (stable upper bound) in sorted `keys`. */\nexport function upperBound(keys: RuleKey[], key: RuleKey): number {\n let lo = 0;\n let hi = keys.length;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (compareKeys(keys[mid], key) <= 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n}\n","/**\n * StylePartitionManager\n *\n * StylePartitionManager is a singleton class that manages the partition of styles into different parts.\n * It is used to manage the partition of styles into different parts.\n *\n */\n\nimport { GenerateCssRulesResult } from \"@barocss/kit\";\nimport { parseClassName, isDebug } from \"@barocss/kit\";\nimport { compareKeys, ruleSortKey, upperBound, type RuleKey } from \"./rule-order\";\n\nexport interface StylePartition {\n id: string;\n styles: string[];\n styleElement: HTMLStyleElement;\n /** Sort keys parallel to `styles` / the sheet's cssRules (#254). */\n keys?: RuleKey[];\n}\n\nexport class StylePartitionManager {\n /**\n * Insert `rule` at its Tailwind variant position within `partition` (#254):\n * one insertRule at a binary-searched index, no sheet rewrite.\n */\n private insertSorted(partition: StylePartition, rule: string, key: RuleKey) {\n const keys = (partition.keys ??= []);\n const index = upperBound(keys, key);\n const sheet = partition.styleElement.sheet;\n if (sheet && sheet.cssRules.length === keys.length) {\n sheet.insertRule(this.escapeCssRule(rule), index);\n partition.styles.splice(index, 0, rule);\n } else {\n // No CSSOM (detached) or sheet not solely ours: rebuild text in order.\n partition.styles.splice(index, 0, rule);\n partition.styleElement.textContent = partition.styles.join(\"\\n\") + \"\\n\";\n }\n keys.splice(index, 0, key);\n }\n\n private partitions: StylePartition[] = [];\n private categoryPartitions: Map<string, StylePartition> = new Map();\n private partitionCounter = 0;\n private maxRulesPerPartition = 50;\n private insertionPoint: HTMLElement;\n private classToPartitionMap = new Map<string, number>();\n private classToCategoryPartitionMap = new Map<string, string>();\n private styleIdPrefix = \"barocss-style-partition-\";\n private getCategory: (cls: string) => string | undefined;\n\n constructor(\n insertionPoint: HTMLElement,\n maxRulesPerPartition: number = 50,\n styleIdPrefix: string = \"barocss-style-partition-\",\n getCategory: (cls: string) => string | undefined = cls => parseClassName(cls).utility?.category\n ) {\n this.insertionPoint = insertionPoint;\n this.maxRulesPerPartition = maxRulesPerPartition;\n this.styleIdPrefix = styleIdPrefix;\n this.getCategory = getCategory;\n\n this.initializeDefaultPartition();\n }\n\n private initializeDefaultPartition() {\n this.createNewPartition();\n }\n\n private createNewCategoryPartition(category: string, atDocumentStart = false) {\n const newPartition: StylePartition = {\n id: this.styleIdPrefix + `-${category}`,\n styles: [],\n styleElement: document.createElement(\"style\"),\n };\n\n // set id\n newPartition.styleElement.id = newPartition.id;\n newPartition.styleElement.setAttribute(\"data-barocss\", \"partition\");\n newPartition.styleElement.setAttribute(\"data-category\", category);\n\n // set insertion point\n const head = this.insertionPoint.ownerDocument?.head;\n if (atDocumentStart && head) {\n // Layered base styles (preflight) must be the first stylesheet so their\n // cascade layer is declared before any app layer (e.g. Tailwind `base`).\n head.insertBefore(newPartition.styleElement, head.firstChild);\n } else {\n this.insertionPoint.appendChild(newPartition.styleElement);\n }\n\n this.categoryPartitions.set(category, newPartition);\n\n return newPartition;\n }\n\n private createNewPartition() {\n const newPartition: StylePartition = {\n id: this.styleIdPrefix + `-${this.partitionCounter++}`,\n styles: [],\n styleElement: document.createElement(\"style\"),\n };\n this.partitions.push(newPartition);\n\n // set id\n newPartition.styleElement.id = newPartition.id;\n newPartition.styleElement.setAttribute(\"data-barocss\", \"partition\");\n newPartition.styleElement.setAttribute(\n \"data-partition-index\",\n this.partitionCounter.toString()\n );\n\n // set insertion point\n this.insertionPoint.appendChild(newPartition.styleElement);\n\n return newPartition;\n }\n\n hasRule(rule: string) {\n return this.classToPartitionMap.has(rule);\n }\n\n hasCategoryRule(rule: string, category: string) {\n return this.classToCategoryPartitionMap.get(rule) === category;\n }\n\n setRuleCache(rule: string, partitionIndex: number) {\n this.classToPartitionMap.set(rule, partitionIndex);\n }\n\n setCategoryRuleCache(rule: string, category: string) {\n this.classToCategoryPartitionMap.set(rule, category);\n }\n\n get currentPartition() {\n return this.partitions[this.partitions.length - 1];\n }\n\n getCategoryPartition(category: string) {\n return this.categoryPartitions.get(category);\n }\n\n hasDetachedPartitions(): boolean {\n return [...this.partitions, ...this.categoryPartitions.values()]\n .some(partition => !partition.styleElement.isConnected);\n }\n\n /**\n * Escape CSS rule text\n * - Properly escape special characters\n * - Prevent CSS syntax errors\n */\n private escapeCssRule(rule: string): string {\n // Basic CSS string normalization\n const escaped = rule.replace(/\\\\\\//g, '\\\\/');\n\n return escaped;\n }\n\n addRule(rule: string) {\n if (this.hasRule(rule)) {\n return false;\n }\n\n const key = ruleSortKey(rule);\n // Earliest partition holding a rule that must come after this one; the\n // chunks are consecutive <style> elements, so this keeps global order.\n let partitionIndex = this.partitions.findIndex(p => {\n const keys = p.keys;\n return !!keys && keys.length > 0 && compareKeys(keys[keys.length - 1], key) > 0;\n });\n if (partitionIndex === -1) {\n if (this.currentPartition.styles.length >= this.maxRulesPerPartition) {\n this.createNewPartition();\n }\n partitionIndex = this.partitions.length - 1;\n }\n const partition = this.partitions[partitionIndex];\n\n try {\n this.insertSorted(partition, rule, key);\n this.setRuleCache(rule, partitionIndex);\n return true;\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule: ${rule}`,\n error\n );\n return false;\n }\n }\n\n addCategoryRule(rule: string, category: string) {\n if (this.hasCategoryRule(rule, category)) {\n return false;\n }\n\n let categoryPartition = this.getCategoryPartition(category);\n if (!categoryPartition) {\n categoryPartition = this.createNewCategoryPartition(category);\n }\n\n try {\n this.insertSorted(categoryPartition, rule, ruleSortKey(rule));\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule in category: ${category} ${rule}`,\n error\n );\n return false;\n }\n\n this.setCategoryRuleCache(rule, category);\n\n return true;\n }\n \n addRootRules(rules: string[]) {\n let categoryPartition = this.getCategoryPartition(\"root\");\n if (!categoryPartition) {\n categoryPartition = this.createNewCategoryPartition(\"root\");\n } \n\n try {\n\n const sheet = categoryPartition.styleElement.sheet;\n\n for (const rule of rules) {\n if (sheet) {\n sheet.insertRule(this.escapeCssRule(rule), sheet.cssRules.length);\n } else {\n categoryPartition.styleElement.textContent += rule + \"\\n\";\n }\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule in category: root ${rules.join(\"\\n\")}`,\n error\n );\n return { success: 0, failed: rules.length };\n }\n\n return { success: rules.length, failed: 0 };\n }\n\n addRules(rules: GenerateCssRulesResult[]) {\n let success = 0;\n let failed = 0;\n\n for (const rule of rules) {\n const category = this.getCategory(rule.cls);\n\n if (category) {\n for (const css of rule.cssList) {\n this.addCategoryRule(css, category);\n }\n } else {\n for (const css of rule.cssList) {\n if (this.addRule(css)) {\n success++;\n } else {\n failed++;\n }\n }\n }\n }\n\n return { success, failed };\n }\n\n /**\n * Remove one generated rule (#269 GC). Keeps `styles`, the #254 `keys` and the\n * sheet's cssRules parallel: one deleteRule at the rule's index, or a text\n * rebuild when the sheet isn't solely ours / has no CSSOM. Returns whether\n * the rule was found.\n */\n removeRule(rule: string, category?: string): boolean {\n let partition: StylePartition | undefined;\n if (category) {\n if (this.classToCategoryPartitionMap.get(rule) !== category) return false;\n partition = this.categoryPartitions.get(category);\n } else {\n const partitionIndex = this.classToPartitionMap.get(rule);\n partition = partitionIndex === undefined ? undefined : this.partitions[partitionIndex];\n }\n if (!partition) return false;\n const index = partition.styles.indexOf(rule);\n if (index === -1) return false;\n const sheet = partition.styleElement.sheet;\n const inSync = !!sheet && sheet.cssRules.length === partition.styles.length;\n partition.styles.splice(index, 1);\n partition.keys?.splice(index, 1);\n if (inSync && sheet) {\n sheet.deleteRule(index);\n } else {\n partition.styleElement.textContent = partition.styles.length ? partition.styles.join(\"\\n\") + \"\\n\" : \"\";\n }\n if (category) this.classToCategoryPartitionMap.delete(rule);\n else this.classToPartitionMap.delete(rule);\n return true;\n }\n\n /** Number of generated (non-root, non-preflight) rules currently held. */\n get ruleCount(): number {\n return this.classToPartitionMap.size + this.classToCategoryPartitionMap.size;\n }\n\n /**\n * 특정 규칙이 어느 파티션에 있는지 찾기\n */\n findRulePartition(rule: string): StylePartition | null {\n const partitionIndex = this.classToPartitionMap.get(rule);\n if (partitionIndex !== undefined && this.partitions[partitionIndex]) {\n return this.partitions[partitionIndex];\n }\n\n const categoryPartition = this.classToCategoryPartitionMap.get(rule);\n if (categoryPartition !== undefined) {\n return this.categoryPartitions.get(categoryPartition) || null;\n }\n\n return null;\n }\n\n\n updateRuleContent(category: string, ruleContent: string, atDocumentStart = false) {\n const partition = this.getCategoryPartition(category);\n if (partition) {\n partition.styleElement.textContent = ruleContent;\n } else {\n const newPartition = this.createNewCategoryPartition(category, atDocumentStart);\n // eslint-disable-next-line no-console\n if (isDebug()) console.log(`[StylePartitionManager] Created new partition for category: ${category}`);\n newPartition.styleElement.textContent = ruleContent;\n }\n }\n\n /**\n * 모든 파티션 정리\n */\n cleanup(): void {\n // DOM에서 모든 스타일 엘리먼트 제거\n this.partitions.forEach((partition) => {\n if (partition.styleElement.parentNode) {\n partition.styleElement.parentNode.removeChild(partition.styleElement);\n }\n });\n\n this.categoryPartitions.forEach((partition) => {\n if (partition.styleElement.parentNode) {\n partition.styleElement.parentNode.removeChild(partition.styleElement);\n }\n });\n\n // 상태 초기화\n this.partitions = [];\n this.categoryPartitions.clear();\n this.partitionCounter = 0;\n this.classToPartitionMap.clear();\n this.classToCategoryPartitionMap.clear();\n }\n}\n","export function normalizeClassName(className: any): string {\n if (!className) return '';\n \n if (typeof className === 'object' && typeof className.baseVal === 'string') {\n return className.baseVal;\n }\n \n return className.toString();\n }\n \nexport function normalizeClassNameList(className: any): string[] {\n if (!className) return [];\n return normalizeClassName(className).split(/\\s+/).filter(Boolean);\n}\n","import { IncrementalParser, parseClassName } from \"@barocss/kit\";\nimport { BrowserRuntime } from \"./browser-runtime\";\nimport { normalizeClassNameList } from \"./utils\";\nimport type { ClassGc } from \"./class-gc\";\n\n/**\n * Change detection system for DOM mutations\n * \n * ⚠️ BROWSER-ONLY: This class is designed for browser environments only.\n * It uses MutationObserver and DOM APIs that are not available in Node.js.\n * \n * This class monitors DOM changes and automatically processes new CSS classes\n * that are added to elements. It uses MutationObserver to detect:\n * - Class attribute changes on existing elements\n * - New elements being added to the DOM\n * - Changes in child elements\n * \n * For server-side usage, use IncrementalParser directly with processClassesSync()\n * or processClasses() methods.\n */\nexport class ChangeDetector {\n /** MutationObserver instance for DOM change detection */\n private observer: MutationObserver | null = null;\n \n /** Reference to IncrementalParser for class processing */\n private incrementalParser: IncrementalParser;\n \n /** Reference to BrowserRuntime for CSS injection (optional) */\n private BrowserRuntime?: BrowserRuntime;\n private getCategory: (cls: string) => string | undefined;\n \n /**\n * Create a new ChangeDetector instance\n * \n * @param incrementalParser - IncrementalParser instance for class processing\n * @param BrowserRuntime - Optional BrowserRuntime instance for CSS injection\n */\n constructor(incrementalParser: IncrementalParser, BrowserRuntime?: BrowserRuntime, getCategory: (cls: string) => string | undefined = cls => parseClassName(cls).utility?.category) {\n this.incrementalParser = incrementalParser;\n this.BrowserRuntime = BrowserRuntime;\n this.getCategory = getCategory;\n }\n\n /** #269: refcount/GC tracker, when the runtime has GC enabled. */\n private gc: ClassGc | null = null;\n\n setGc(gc: ClassGc | null): void {\n this.gc = gc;\n }\n\n setParser(parser: IncrementalParser): void {\n this.incrementalParser = parser;\n }\n \n /**\n * Starts observing DOM changes for new CSS classes\n * \n * This method sets up a MutationObserver that monitors:\n * - Attribute changes (specifically class attribute modifications)\n * - Child list changes (new elements being added)\n * - Subtree changes (changes in descendant elements)\n * \n * The observer automatically processes any new classes it discovers\n * by adding them to the IncrementalParser's pending queue.\n * \n * @param root - The root element to observe (defaults to document.body)\n * @param options - Configuration options including initial scan and onReady callback\n * @returns The MutationObserver instance for external control\n */\n observe(root: HTMLElement = document.body, options?: { scan?: boolean; onReady?: () => void }): MutationObserver {\n if (typeof window === 'undefined') {\n // Return dummy observer for Node.js environment\n return new MutationObserver(() => {});\n }\n \n if (this.observer) {\n this.observer.disconnect();\n }\n \n this.gc?.setRoot(root);\n\n this.observer = new MutationObserver((mutations) => {\n const newClasses = new Set<string>();\n const gc = this.gc;\n\n mutations.forEach(mutation => {\n if (gc) {\n if (mutation.type === 'attributes') {\n gc.reconcile(mutation.target as Element);\n } else if (mutation.type === 'childList') {\n mutation.removedNodes.forEach(node => gc.reconcileTree(node));\n mutation.addedNodes.forEach(node => gc.reconcileTree(node));\n }\n }\n // Handle attribute changes (class modifications)\n if (mutation.type === 'attributes' && mutation.attributeName === 'class' && root.contains(mutation.target)) {\n const target = mutation.target as HTMLElement;\n if (target.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(target.className);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n newClasses.add(cls);\n }\n });\n }\n }\n \n // Handle new nodes\n if (mutation.type === 'childList') {\n mutation.addedNodes.forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE && root.contains(node)) {\n const element = node as Element;\n this.processElement(element, newClasses);\n // Process child elements\n element.querySelectorAll('[class]').forEach(el => {\n this.processElement(el, newClasses);\n });\n }\n });\n }\n });\n \n // Process new classes in batch\n if (newClasses.size > 0) {\n const classesArray = Array.from(newClasses);\n \n // Process classes directly and update BrowserRuntime cache\n const results = this.incrementalParser.processClasses(classesArray);\n // If BrowserRuntime is available, apply results via public API\n this.BrowserRuntime?.applyParseResults(results);\n } else {\n this.BrowserRuntime?.applyParseResults([]);\n }\n gc?.afterBatch();\n });\n \n this.observer.observe(root, {\n attributes: true,\n subtree: true,\n attributeFilter: ['class'],\n childList: true\n });\n \n // Handle scan option - process existing classes\n if (options?.scan) {\n this.scanExistingClasses(root, options);\n }\n \n return this.observer;\n }\n \n /**\n * Scan existing classes in the DOM and process them\n */\n private scanExistingClasses(root: HTMLElement, options?: { onReady?: () => void }): void {\n const existingClasses = new Set<string>();\n \n // Include root itself\n if (root.className) {\n const classes = normalizeClassNameList(root.className);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n existingClasses.add(cls);\n }\n });\n }\n \n // Scan all child elements\n const elementsWithClass = root.querySelectorAll('[class]') as unknown as HTMLElement[];\n // console.log('[BrowserRuntime] scanExistingClasses', elementsWithClass);\n for (const el of elementsWithClass) {\n if (el.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(el.className);\n // console.log('[BrowserRuntime] scanExistingClasses', classes);\n \n for (const cls of classes) {\n if (!this.incrementalParser.isProcessed(cls)) {\n existingClasses.add(cls);\n }\n };\n }\n }\n \n // console.log('[BrowserRuntime] scanExistingClasses', existingClasses);\n \n if (existingClasses.size > 0) {\n // Process classes using IncrementalParser\n const classes = Array.from(existingClasses);\n const results = this.incrementalParser.processClasses(classes);\n \n const layoutResults = results.filter(result => this.getCategory(result.cls) === 'layout');\n const nonLayoutResults = results.filter(result => this.getCategory(result.cls) !== 'layout');\n \n \n // Apply layout results\n this.BrowserRuntime?.applyParseResults(layoutResults);\n options?.onReady?.();\n \n // Apply non-layout results\n this.BrowserRuntime?.applyParseResults(nonLayoutResults);\n } else {\n options?.onReady?.();\n }\n }\n \n /**\n * Processes an individual element and extracts new classes\n * \n * This method is called for each element discovered during DOM mutations.\n * It:\n * - Extracts all class names from the element's className\n * - Filters out already processed classes\n * - Adds new classes to the collection for batch processing\n * \n * @param element - The HTML element to process\n * @param newClasses - Set to collect newly discovered class names\n */\n private processElement(element: Element, newClasses: Set<string>): void {\n if (element.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(element.className);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n newClasses.add(cls);\n }\n });\n }\n \n }\n \n /**\n * Stops observing DOM changes and cleans up resources\n * \n * This method disconnects the MutationObserver and clears the\n * observer reference to prevent memory leaks and allow the\n * ChangeDetector to be properly garbage collected.\n */\n disconnect(): void {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n }\n }\n","/** #210 internal helpers (not re-exported from index.ts). */\n/** Unescape a CSS identifier (`\\:` -> `:`, `\\31 ` -> `1`). */\nexport function unescapeCssIdent(s: string): string {\n return s.replace(/\\\\([0-9a-fA-F]{1,6})\\s?|\\\\(.)/g, (_m, hex, ch) => (hex ? String.fromCodePoint(parseInt(hex, 16)) : ch));\n}\n\n// `:where(.divide-y > ...)` / `:is(.x ...)` count too: Tailwind 4 and BaroCSS emit divide/space rules that way (#268).\nconst LEADING_CLASS = /^\\s*(?::(?:where|is)\\(\\s*)?\\.((?:\\\\[0-9a-fA-F]{1,6}\\s?|\\\\.|[\\w-]|[^\\x00-\\x7F])+)/;\n\nexport function splitTopLevel(sel: string): string[] {\n const parts: string[] = []; let depth = 0, start = 0;\n for (let i = 0; i < sel.length; i++) {\n const c = sel[i];\n if (c === '\\\\') i++;\n else if (c === '(' || c === '[') depth++;\n else if (c === ')' || c === ']') depth--;\n else if (c === ',' && depth === 0) { parts.push(sel.slice(start, i)); start = i + 1; }\n }\n parts.push(sel.slice(start));\n return parts;\n}\n\n/** #274: `@keyframes` names defined in the given rules (walks grouping rules). */\nexport function collectKeyframeNames(rules: CSSRuleList | CSSRule[], out: Set<string> = new Set()): Set<string> {\n for (const rule of Array.from(rules)) {\n if ((rule as CSSKeyframesRule).type === 7 && typeof (rule as CSSKeyframesRule).name === 'string') {\n out.add((rule as CSSKeyframesRule).name);\n continue;\n }\n const inner = (rule as CSSGroupingRule).cssRules;\n if (inner && inner.length) collectKeyframeNames(inner, out);\n }\n return out;\n}\n\n/** Classes that lead a selector in the given rules (walks grouping rules such as @layer/@media/@supports). */\nexport function collectLeadingClasses(rules: CSSRuleList | CSSRule[], out: Set<string> = new Set()): Set<string> {\n for (const rule of Array.from(rules)) {\n const selectorText = (rule as CSSStyleRule).selectorText;\n if (typeof selectorText === 'string') {\n for (const part of splitTopLevel(selectorText)) {\n const m = LEADING_CLASS.exec(part);\n if (m) out.add(unescapeCssIdent(m[1]));\n }\n }\n const inner = (rule as CSSGroupingRule).cssRules;\n if (inner && inner.length) collectLeadingClasses(inner, out);\n }\n return out;\n}\n","import { normalizeClassNameList } from \"./utils\";\n\n/**\n * #269: per-class refcount over the observed root, plus a delayed sweep that\n * reclaims classes no live element carries any more.\n *\n * Counting is reconciliation, not delta arithmetic: for every element a\n * mutation batch touches (attribute target, added subtree, removed subtree) we\n * compare the classes we last counted for it with what it carries *now*\n * (nothing if it is no longer inside the root). That makes the count\n * independent of record order, so remove-then-re-add in one batch, moves\n * between parents and edits made while detached all settle to the true state.\n * An element we miss can only leak a count (rule kept), never drop one.\n *\n * Before a class is reclaimed the sweep re-checks the live DOM\n * (`getElementsByClassName`), so even a miscount cannot unstyle a live element.\n */\nexport interface ClassGcHost {\n /** Delete the rules of these classes. */\n reclaim(classes: string[]): void;\n /** Whether a class must never be reclaimed (pinned, found in a pre-existing sheet, ...). */\n isPermanent(cls: string): boolean;\n /** Number of generated rules/classes currently cached (for the LRU cap). */\n cachedCount(): number;\n}\n\nexport class ClassGc {\n private counts = new Map<string, number>();\n private counted = new WeakMap<Element, string[]>();\n /** class -> time its count reached 0 (insertion order = oldest first). */\n private candidates = new Map<string, number>();\n private timer: ReturnType<typeof setTimeout> | null = null;\n private root: Element | null = null;\n\n constructor(\n private host: ClassGcHost,\n private graceMs: number,\n private maxRules: number,\n private now: () => number = () => Date.now(),\n ) {}\n\n /** Start counting for a new root: count every element currently inside it. */\n setRoot(root: Element): void {\n this.counts.clear();\n this.counted = new WeakMap();\n this.candidates.clear();\n this.cancel();\n this.root = root;\n this.reconcileTree(root);\n }\n\n count(cls: string): number {\n return this.counts.get(cls) ?? 0;\n }\n\n /** Re-count `el` and (optionally) all its descendants from their current state. */\n reconcileTree(node: Node): void {\n if (node.nodeType !== 1) return;\n const el = node as Element;\n this.reconcile(el);\n el.querySelectorAll('[class]').forEach(child => this.reconcile(child));\n }\n\n reconcile(el: Element): void {\n const root = this.root;\n const live = !!root && root.contains(el);\n const next = live ? Array.from(new Set(normalizeClassNameList(el.getAttribute('class')))) : [];\n const prev = this.counted.get(el);\n if (!prev && next.length === 0) return;\n const prevSet = new Set(prev ?? []);\n const nextSet = new Set(next);\n for (const cls of nextSet) {\n if (prevSet.has(cls)) continue;\n const c = (this.counts.get(cls) ?? 0) + 1;\n this.counts.set(cls, c);\n this.candidates.delete(cls);\n }\n for (const cls of prevSet) {\n if (nextSet.has(cls)) continue;\n const c = (this.counts.get(cls) ?? 0) - 1;\n if (c > 0) {\n this.counts.set(cls, c);\n } else {\n this.counts.delete(cls);\n this.candidates.delete(cls); // re-insert so order stays oldest-first\n this.candidates.set(cls, this.now());\n }\n }\n if (next.length) this.counted.set(el, next);\n else this.counted.delete(el);\n }\n\n /** Call after a mutation batch has been counted and its classes inserted. */\n afterBatch(): void {\n if (this.candidates.size === 0) return;\n if (this.host.cachedCount() > this.maxRules) {\n this.schedule(0);\n } else {\n this.schedule(this.graceMs);\n }\n }\n\n private schedule(delay: number): void {\n if (this.timer !== null) {\n if (delay > 0) return;\n clearTimeout(this.timer);\n }\n this.timer = setTimeout(() => {\n this.timer = null;\n this.sweep();\n }, delay);\n }\n\n /** Reclaim candidates whose grace period elapsed (plus LRU overflow). Public for tests. */\n sweep(): void {\n const now = this.now();\n const overflow = Math.max(0, this.host.cachedCount() - this.maxRules);\n const doomed: string[] = [];\n let evicted = 0;\n for (const [cls, since] of this.candidates) {\n const expired = now - since >= this.graceMs;\n if (!expired && evicted >= overflow) continue;\n this.candidates.delete(cls);\n if (this.count(cls) > 0 || this.inDom(cls) || this.host.isPermanent(cls)) continue;\n doomed.push(cls);\n if (!expired) evicted++;\n }\n if (doomed.length) this.host.reclaim(doomed);\n if (this.candidates.size) this.schedule(this.graceMs);\n }\n\n private inDom(cls: string): boolean {\n const root = this.root;\n if (!root) return false;\n // Document-wide: an element outside the observed root (portal, <html class>) may share the class.\n const doc = root.ownerDocument ?? document;\n return root.classList.contains(cls)\n || doc.documentElement.classList.contains(cls)\n || doc.getElementsByClassName(cls).length > 0;\n }\n\n cancel(): void {\n if (this.timer !== null) clearTimeout(this.timer);\n this.timer = null;\n }\n\n stats() {\n return { trackedClasses: this.counts.size, candidates: this.candidates.size };\n }\n}\n","import { GenerateCssRulesResult } from '@barocss/kit';\nimport { createContext, clearAstCache, IncrementalParser, parseClassName, isDebug } from '@barocss/kit';\nimport type { Config, Context } from '@barocss/kit';\nimport { StylePartitionManager } from './style-partition-manager';\nimport { ChangeDetector } from './change-detector';\nimport { collectKeyframeNames, collectLeadingClasses } from './existing-classes';\nimport { ClassGc } from './class-gc';\n\nexport interface BrowserRuntimeOptions {\n config?: Config; // full config object\n styleId?: string;\n insertionPoint?: 'head' | 'body' | HTMLElement;\n maxRulesPerPartition?: number;\n /**\n * #210: skip classes the page's existing (non-BaroCSS, same-origin) stylesheets already define,\n * so a built app plus the runtime injects only what the build is missing. Opt-in. A class counts\n * as covered only when a rule's selector starts with it (e.g. `.p-4`, `.md\\:p-4` inside @media,\n * `.hover\\:x:hover`), so a class seen only as a descendant (`.group:hover .x`) is not skipped.\n * The index is rebuilt when `document.styleSheets.length` changes. A page class that leads a selector\n * with the same name is treated as covered, and rules added later to an already-indexed sheet aren't seen.\n */\n skipExisting?: boolean;\n /**\n * #269: reclaim the rules of classes that no element inside the observed root carries any more.\n * On by default; it only acts on classes seen through `observe()`. A class is deleted only after\n * its refcount has stayed 0 for `gcGraceMs` and a live-DOM re-check finds no element with it.\n * Never reclaimed: classes passed to `addClass()`, classes any pre-existing (non-BaroCSS) sheet\n * defines (build output, server sheet), root/@property/preflight rules. `false` disables it.\n */\n gc?: boolean;\n /** #269: how long a class must stay unused before its rules are deleted (default 3000 ms). */\n gcGraceMs?: number;\n /**\n * #269: soft cap on cached classes. When exceeded, unused (refcount 0) classes are evicted\n * oldest-first without waiting for the grace period; classes in use are never evicted. Default: no cap.\n */\n maxRules?: number;\n}\n\n/** #268: marks a server-rendered sheet (`@barocss/server` `ssrStyleTag()`); the runtime adopts its class rules. */\nexport const SSR_STYLE_SELECTOR = 'style[data-barocss-ssr]';\n\n/** Tailwind 4 layer order, declared by BaroCSS's first <style> in <head>. */\nexport const LAYER_ORDER = \"@layer theme, base, components, utilities;\";\n\nexport class BrowserRuntime {\n private cache: Map<string, GenerateCssRulesResult> = new Map(); // class name -> generated CSS mapping\n private rootCache: Set<string> = new Set(); // class name -> generated CSS mapping\n private context: Context;\n private options: Required<BrowserRuntimeOptions>;\n private isDestroyed = false;\n private existing: Set<string> | null = null;\n /** #274: @keyframes names the page's own sheets define (filled with `existing`). */\n private existingKeyframes = new Set<string>();\n private existingSheetCount = -1;\n /** #269: classes requested explicitly through addClass(); never reclaimed. */\n private pinned = new Set<string>();\n private gc: ClassGc | null = null;\n private reclaimedCount = 0;\n /** #268: class rules adopted from `<style data-barocss-ssr>`, in sheet order, and the classes they lead. */\n private ssrRules: Array<{ css: string; cls: string }> = [];\n private ssrClasses = new Set<string>();\n private observedOnce = false;\n\n private incrementalParser: IncrementalParser;\n private changeDetector: ChangeDetector;\n private stylePartitionManager: StylePartitionManager;\n\n private getCategory = (cls: string) => parseClassName(cls, this.context).utility?.category;\n\n constructor(options: BrowserRuntimeOptions = {}) {\n // Default config - createContext handles defaultTheme automatically\n const defaultConfig: Config = {};\n\n this.options = {\n config: options.config || defaultConfig,\n styleId: options.styleId || 'barocss-runtime',\n insertionPoint: options.insertionPoint || 'head',\n maxRulesPerPartition: options.maxRulesPerPartition || 50,\n skipExisting: options.skipExisting ?? false,\n gc: options.gc ?? true,\n gcGraceMs: options.gcGraceMs ?? 3000,\n maxRules: options.maxRules ?? Infinity,\n };\n\n // Pass full config to createContext (defaultTheme auto-included)\n this.context = createContext(this.options.config);\n\n this.incrementalParser = new IncrementalParser(this.context);\n this.changeDetector = new ChangeDetector(this.incrementalParser, this, this.getCategory);\n\n this.stylePartitionManager = new StylePartitionManager(this.getInsertionPoint(), this.options.maxRulesPerPartition, `${this.options.styleId}-partition`, this.getCategory);\n\n if (this.options.gc) {\n this.gc = new ClassGc({\n reclaim: classes => this.reclaim(classes),\n isPermanent: cls => this.isPermanent(cls),\n cachedCount: () => this.cache.size,\n }, this.options.gcGraceMs, this.options.maxRules);\n this.changeDetector.setGc(this.gc);\n }\n\n this.init();\n }\n\n // Debugging and logging helpers\n \n /**\n * Add debug logs (by level)\n */\n private debugLog(level: 'info' | 'warn' | 'error' | 'debug', message: string, data?: unknown): void {\n // Silent unless the kit debug flag is on (`debug: true` in config, or setDebug(true)).\n if (!isDebug()) return;\n // console-ok: gated by the isDebug() early return above\n // eslint-disable-next-line no-console\n const consoleMethod = console[level] || console.log;\n consoleMethod(`[BrowserRuntime:${level.toUpperCase()}] ${message}`, data || '');\n }\n\n private init() {\n this.debugLog('debug', 'init');\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.adoptSsrSheets();\n }\n\n /**\n * #268: adopt the class rules of server-rendered `<style data-barocss-ssr>` sheets in <head>, at startup\n * (constructor and the first observe()). Each rule moves\n * (same task, so no paint in between) into the partition its class would get if generated here, at\n * its #254 sorted position, so a later client `sm:` rule lands before a server `lg:` rule. Its classes\n * are never regenerated and never reclaimed. `:root`, `@property` and `@keyframes` stay in the sheet.\n */\n private adoptSsrSheets(): void {\n if (typeof document === 'undefined') return;\n const adopted: Array<{ css: string; cls: string }> = [];\n // Only sheets in <head> at startup (constructor / observe()): a marked <style> injected later or into\n // <body> (model or user HTML) must not suppress generation or GC for its classes (#268 review).\n if (!document.head) return;\n for (const el of Array.from(document.head.querySelectorAll<HTMLStyleElement>(`${SSR_STYLE_SELECTOR}:not([data-barocss-adopted])`))) {\n const sheet = el.sheet;\n if (!sheet) continue;\n el.setAttribute('data-barocss-adopted', '');\n const moved: Array<{ css: string; cls: string }> = [];\n for (let i = sheet.cssRules.length - 1; i >= 0; i--) {\n const rule = sheet.cssRules[i];\n const classes = collectLeadingClasses([rule]);\n if (classes.size === 0) continue;\n classes.forEach(cls => this.ssrClasses.add(cls));\n moved.unshift({ css: rule.cssText, cls: classes.values().next().value! });\n sheet.deleteRule(i);\n }\n adopted.push(...moved);\n }\n if (adopted.length === 0) return;\n this.ssrRules.push(...adopted);\n this.insertSsrRules(adopted);\n }\n\n private insertSsrRules(rules: Array<{ css: string; cls: string }>): void {\n for (const { css, cls } of rules) {\n const category = this.getCategory(cls);\n if (category) this.stylePartitionManager.addCategoryRule(css, category);\n else this.stylePartitionManager.addRule(css);\n }\n }\n\n private injectPreflightCSS() {\n // Kit documents `preflight: true` (full) as the default; only an explicit\n // `false` disables it.\n const level = this.options.config.preflight ?? true;\n if (level) {\n const preflightCSS = this.context.getPreflightCSS(level);\n // #208: preflight joins the `base` layer from the first <style> in\n // <head>, which also fixes the layer order. Unlayered author CSS and\n // BaroCSS utilities (unlayered) beat it, and an app's own\n // `@layer base` rules come later within `base`, so they win too.\n this.stylePartitionManager.updateRuleContent(\n \"preflight\",\n `${LAYER_ORDER}\\n@layer base {\\n${preflightCSS}\\n}`,\n true,\n );\n }\n }\n\n private ensureCssVars() {\n if (this.isDestroyed) return;\n\n const cssVars = this.context.themeToCssVars ? this.context.themeToCssVars() : ':root { /* CSS Variables will be generated here */ }';\n this.stylePartitionManager.updateRuleContent(\"css-vars\", cssVars);\n }\n\n private getInsertionPoint(): HTMLElement {\n if (typeof this.options.insertionPoint !== 'string') {\n return this.options.insertionPoint;\n }\n switch (this.options.insertionPoint) {\n case 'body':\n return document.body || document.head;\n case 'head':\n default:\n return document.head;\n }\n }\n\n /**\n * Dynamically add one or more class names and generate/insert CSS\n */\n addClass(classes: string | string[]): void {\n if (this.isDestroyed) return;\n \n const classList = this.normalizeClasses(classes).filter(Boolean);\n classList.forEach(cls => this.pinned.add(cls));\n \n this.processClasses(classList);\n }\n\n /**\n * Process classes\n */\n private processClasses(classList: string[]): void { \n // Use incremental parsing by default (always enabled)\n \n this.processClassesIncremental(classList);\n }\n\n /**\n * Process classes using incremental parsing\n */\n private processClassesIncremental(classList: string[]): void {\n const isBrowser = typeof window !== 'undefined';\n \n // Process classes immediately for testing environment\n const results = this.incrementalParser.processClasses(classList);\n \n this.debugLog('debug', 'results', { results, classList });\n // Apply results and inject CSS\n this.applyParseResults(results, { isBrowser });\n }\n\n /**\n * Public method to apply parser results, update internal caches, and inject CSS\n */\n public applyParseResults(results: Array<GenerateCssRulesResult>, _opts?: { isBrowser?: boolean }): void {\n if (this.isDestroyed) return;\n if (this.getInsertionPoint().isConnected && this.stylePartitionManager.hasDetachedPartitions()) {\n const existingResults = Array.from(this.cache.values());\n this.reset();\n results = [...existingResults, ...results];\n results.forEach(result => this.incrementalParser.markProcessed(result.cls));\n }\n if (this.ssrClasses.size > 0) results = results.filter(result => !this.ssrClasses.has(result.cls));\n if (this.options.skipExisting && results.length > 0 && typeof document !== 'undefined') {\n const existing = this.getExistingClasses();\n results = results.filter(result => !existing.has(result.cls));\n }\n if (results.length === 0) return;\n const cssRules: GenerateCssRulesResult[] = [];\n const rootCssRules: string[] = [];\n // #274: companion mode leaves a @keyframes the page's own sheets define to them.\n const pageKeyframes = this.options.skipExisting && typeof document !== 'undefined'\n ? (this.getExistingClasses(), this.existingKeyframes) : null;\n\n for (const result of results) {\n if (result.css && Array.isArray(result.cssList)) {\n cssRules.push(result);\n this.cache.set(result.cls, result);\n }\n\n if (result.rootCss && Array.isArray(result.rootCssList)) {\n for (const rootCss of result.rootCssList) {\n if (pageKeyframes?.size) {\n const kf = /^\\s*@keyframes\\s+([^\\s{]+)/.exec(rootCss)?.[1];\n if (kf && pageKeyframes.has(kf)) continue;\n }\n if (!this.rootCache.has(rootCss)) {\n this.rootCache.add(rootCss);\n rootCssRules.push(rootCss);\n }\n }\n }\n }\n\n if (rootCssRules.length > 0) {\n this.stylePartitionManager.addRootRules(rootCssRules.filter(Boolean));\n }\n\n if (cssRules.length > 0) {\n this.stylePartitionManager.addRules(cssRules);\n }\n\n this.debugLog('info', `Applied ${results.length} parser results`, {\n cssRuleCount: cssRules.length,\n rootCssCount: rootCssRules.length,\n });\n }\n\n /** #269: a class that must never be reclaimed. */\n private isPermanent(cls: string): boolean {\n if (this.pinned.has(cls) || this.ssrClasses.has(cls)) return true;\n if (typeof document === 'undefined') return true;\n return this.getExistingClasses().has(cls);\n }\n\n /**\n * #269: delete the generated rules of classes no live element uses. Root/@property/@keyframes rules stay\n * (they are shared and harmless); a rule text another cached class still emits is kept.\n */\n private reclaim(classes: string[]): void {\n if (this.isDestroyed) return;\n const victims = classes.filter(cls => this.cache.has(cls));\n if (victims.length === 0) return;\n const results = victims.map(cls => this.cache.get(cls)!);\n victims.forEach(cls => {\n this.cache.delete(cls);\n this.incrementalParser.unmarkProcessed(cls);\n });\n const stillUsed = new Set<string>();\n for (const result of this.cache.values()) result.cssList.forEach(css => stillUsed.add(css));\n for (const result of results) {\n const category = this.getCategory(result.cls);\n for (const css of result.cssList) {\n if (!stillUsed.has(css)) this.stylePartitionManager.removeRule(css, category);\n }\n }\n this.reclaimedCount += victims.length;\n }\n\n /** Class names defined by the page's own stylesheets (BaroCSS's sheets and cross-origin sheets excluded). */\n getExistingClasses(): Set<string> {\n // Our own <style> elements, matched by sheet identity too (jsdom leaves ownerNode unset).\n const own = new Set(Array.from(document.querySelectorAll<HTMLStyleElement>('style[data-barocss]'), s => s.sheet));\n const sheets = Array.from(document.styleSheets).filter(sheet => {\n if (own.has(sheet)) return false;\n const owner = sheet.ownerNode as Element | null;\n return !(owner && typeof owner.hasAttribute === 'function'\n && (owner.hasAttribute('data-barocss') || (owner.id || '').startsWith(this.options.styleId)));\n });\n if (this.existing && sheets.length === this.existingSheetCount) return this.existing;\n const out = new Set<string>();\n const keyframes = new Set<string>();\n for (const sheet of sheets) {\n let rules: CSSRuleList;\n try { rules = sheet.cssRules; } catch { continue; } // cross-origin\n collectLeadingClasses(rules, out);\n collectKeyframeNames(rules, keyframes);\n }\n this.existingKeyframes = keyframes;\n this.existing = out;\n this.existingSheetCount = sheets.length;\n return out;\n }\n\n /**\n * MutationObserver instance method to automatically call addClass when class attributes change in DOM\n */\n observe(root: HTMLElement = document.body, options?: { scan?: boolean; onReady?: () => void }): MutationObserver {\n if (!this.observedOnce) { this.observedOnce = true; this.adoptSsrSheets(); }\n return this.changeDetector.observe(root, options);\n }\n\n private normalizeClasses(classes: string | string[]): string[] {\n return Array.isArray(classes)\n ? classes.flatMap(cls => cls.split(/\\s+/))\n : classes.split(/\\s+/);\n }\n\n has(cls: string): boolean {\n const result = this.cache.has(cls);\n return result;\n }\n\n getCss(cls: string): string | undefined {\n const css = this.cache.get(cls)?.cssList.join('\\n');\n return css;\n }\n\n getAllCss(): string {\n const all = [...this.rootCache, ...Array.from(this.cache.values()).flatMap(result => result.cssList)].join('\\n');\n return all;\n }\n\n getClasses(): string[] {\n const keys = Array.from(this.cache.keys());\n return keys;\n }\n\n /**\n * Get comprehensive cache statistics\n */\n getCacheStats() {\n const incremental = this.incrementalParser.getStats();\n return {\n runtime: {\n cachedClasses: this.cache.size,\n rootCacheSize: this.rootCache.size,\n ruleCount: this.stylePartitionManager.ruleCount,\n reclaimedClasses: this.reclaimedCount,\n gc: this.gc?.stats() ?? null,\n },\n ast: incremental.cacheStats.ast,\n incremental,\n };\n }\n\n /**\n * Clear all caches (useful for debugging or memory management)\n */\n clearCaches(): void {\n if (this.isDestroyed) return;\n this.cache.clear();\n this.rootCache.clear();\n clearAstCache(this.context);\n this.incrementalParser.clearProcessed();\n this.stylePartitionManager.cleanup();\n this.stylePartitionManager = new StylePartitionManager(this.getInsertionPoint(), this.options.maxRulesPerPartition, `${this.options.styleId}-partition`, this.getCategory);\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.insertSsrRules(this.ssrRules);\n }\n\n\n reset(): void {\n if (this.isDestroyed) return;\n this.cache.clear();\n this.rootCache.clear();\n this.incrementalParser.clearProcessed();\n this.stylePartitionManager.cleanup();\n this.stylePartitionManager = new StylePartitionManager(this.getInsertionPoint(), this.options.maxRulesPerPartition, `${this.options.styleId}-partition`, this.getCategory);\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.insertSsrRules(this.ssrRules);\n }\n\n updateConfig(newConfig: Config): void {\n if (this.isDestroyed) return;\n const existingClasses = Array.from(this.cache.keys());\n this.options.config = newConfig;\n this.context = createContext(newConfig);\n this.incrementalParser = new IncrementalParser(this.context);\n this.changeDetector.setParser(this.incrementalParser);\n this.reset();\n if (existingClasses.length > 0) {\n this.addClass(existingClasses);\n }\n }\n\n removeClass(classes: string | string[]): void {\n if (this.isDestroyed) return;\n const classList = new Set(this.normalizeClasses(classes));\n const retainedResults = Array.from(this.cache.values()).filter(result => !classList.has(result.cls));\n if (retainedResults.length === this.cache.size) return;\n\n this.reset();\n retainedResults.forEach(result => this.incrementalParser.markProcessed(result.cls));\n this.applyParseResults(retainedResults);\n }\n\n destroy(): void {\n if (this.isDestroyed) return;\n this.changeDetector.disconnect();\n this.gc?.cancel();\n this.stylePartitionManager.cleanup();\n\n this.cache.clear();\n this.rootCache.clear();\n this.isDestroyed = true;\n\n }\n\n getStats() {\n const stats = {\n cachedClasses: this.cache.size,\n styleElementId: this.options.styleId,\n isDestroyed: this.isDestroyed,\n config: this.options.config,\n cacheStats: this.getCacheStats(),\n };\n return stats;\n }\n}\n","import { BrowserRuntime, BrowserRuntimeOptions } from \"./browser-runtime\";\n\nlet runtime: BrowserRuntime | null = null;\nlet runtimeConfig: BrowserRuntimeOptions['config'];\n\n/**\n * Returns the shared runtime, creating it on first use. If a live runtime\n * already exists and `options.config` is a different config object, it is\n * applied via `updateConfig` (which replaces the whole config), so an early\n * `getRuntime()` never makes a later `baroStart({ config })` lose its config.\n */\nexport function getRuntime(options: BrowserRuntimeOptions = {}) {\n if (!runtime || runtime.getStats().isDestroyed) {\n runtime = new BrowserRuntime(options);\n runtimeConfig = options.config;\n } else if (options.config && options.config !== runtimeConfig) {\n runtime.updateConfig(options.config);\n runtimeConfig = options.config;\n }\n return runtime;\n}\n\ntype BaroBootOptions = BrowserRuntimeOptions & { loadingClassName?: string };\n\nexport function baroBoot({ loadingClassName = 'baro-boot', ...options }: BaroBootOptions = {}) {\n if (!document.body) {\n document.addEventListener('DOMContentLoaded', () => baroBoot({ loadingClassName, ...options }), { once: true });\n return;\n }\n const startClassName = `${loadingClassName}-doing`;\n const endClassName = `${loadingClassName}-done`;\n try { \n\n document.body.classList.add(startClassName);\n\n const runtime = getRuntime(options);\n runtime.observe(document.body, { scan: true, onReady: () => {\n document.body.classList.remove(startClassName);\n document.body.classList.add(endClassName);\n }});\n } catch (error) {\n document.body?.classList.remove(startClassName);\n // console-ok: one-shot boot failure; otherwise the page stays unstyled with no signal\n // eslint-disable-next-line no-console\n console.error('BaroCSS boot failed:', error);\n }\n}\n\nexport const baroStart = baroBoot;\n","import type { BrowserRuntime } from './browser-runtime';\n\n/** Collect literal className tokens from a json-render Spec's flat elements map. */\nexport function collectJsonRenderClassNames(spec: unknown): string[] {\n if (!spec || typeof spec !== 'object' || Array.isArray(spec)) return [];\n const elements = (spec as { elements?: unknown }).elements;\n if (!elements || typeof elements !== 'object' || Array.isArray(elements)) return [];\n\n const classes = new Set<string>();\n for (const key of Object.keys(elements)) {\n const element = (elements as Record<string, unknown>)[key];\n if (!element || typeof element !== 'object' || Array.isArray(element)) continue;\n const props = (element as { props?: unknown }).props;\n if (!props || typeof props !== 'object' || Array.isArray(props)) continue;\n const className = (props as { className?: unknown }).className;\n if (typeof className !== 'string') continue;\n for (const cls of className.split(/\\s+/)) {\n if (cls) classes.add(cls);\n }\n }\n return Array.from(classes);\n}\n\n/** Submit literal classes synchronously before UI mount; the caller validates class support. */\nexport function preloadJsonRenderClasses(spec: unknown, runtime: Pick<BrowserRuntime, 'addClass'>): void {\n const classes = collectJsonRenderClassNames(spec);\n if (classes.length > 0) runtime.addClass(classes);\n}\n","/**\n * shadcn/ui theme preset for the BaroCSS browser runtime.\n *\n * Use it next to a Tailwind-4 shadcn build so runtime-generated classes\n * (`bg-primary`, `bg-primary/90`, `rounded-lg`, ...) resolve to the app's theme:\n *\n * baroStart({ config: { theme: { extend: shadcnTheme } } });\n *\n * It references the RAW `:root` variables shadcn defines (`--primary`, `--radius`),\n * not `--color-*`: `@theme inline` does not emit `--color-*` / `--radius-*` to the page.\n * Custom tokens must be added by extending the colors yourself.\n */\nconst SHADCN_COLOR_NAMES = [\n 'background', 'foreground',\n 'card', 'card-foreground', 'popover', 'popover-foreground',\n 'primary', 'primary-foreground', 'secondary', 'secondary-foreground',\n 'muted', 'muted-foreground', 'accent', 'accent-foreground',\n 'destructive', 'border', 'input', 'ring',\n 'chart-1', 'chart-2', 'chart-3', 'chart-4', 'chart-5',\n 'sidebar', 'sidebar-foreground', 'sidebar-primary', 'sidebar-primary-foreground',\n 'sidebar-accent', 'sidebar-accent-foreground', 'sidebar-border', 'sidebar-ring',\n] as const;\n\nexport const shadcnTheme = {\n colors: Object.fromEntries(SHADCN_COLOR_NAMES.map((n) => [n, `var(--${n})`])) as Record<string, string>,\n borderRadius: {\n sm: 'calc(var(--radius) - 4px)',\n md: 'calc(var(--radius) - 2px)',\n lg: 'var(--radius)',\n xl: 'calc(var(--radius) + 4px)',\n } as Record<string, string>,\n};\n"],"mappings":"AAqBA,SAAgBI,EACdC,EACAC,EACAC,GAEA,MAAO,CAAEC,KAAM,OAAQH,OAAMC,QAAOC,SACtC,CACA,SAAgBE,EAAOC,EAAkBH,GACvC,MAAO,CACLC,KAAM,UACNE,QACAH,SAEJ,CAEA,SAAgBI,EACdC,EACAC,EACAH,EACAH,GAEA,MAAO,CAAEC,KAAM,UAAWI,OAAMC,SAAQH,QAAOH,SACjD,CAIA,SAAgBO,EAAKC,EAAkBL,EAAkBH,GACvD,MAAO,CAAEC,KAAM,OAAQO,WAAUL,QAAOH,SAC1C,CAQA,SAAgBS,EAASJ,EAAcK,EAAuBC,EAAiBX,GAC7E,MAAMG,EAAmB,CACvBN,EAAK,SAAU,IAAIc,GAAU,OAAQX,GACrCH,EAAK,WAAY,QAASG,IAO5B,OAJIU,GACFP,EAAMS,KAAKf,EAAK,gBAAiBa,EAAcV,IAG1CI,EAAO,WAAYC,EAAMF,EAAOH,EACzC,CC/DA,IAAIa,GAAe,EAMnB,SAAgBC,IACd,OAAOD,CACT,CAOA,SAAgBE,KAAaC,GAEvBH,GAAcI,QAAQC,QAAQF,EACpC,CChBA,IA2HIG,EA3HSC,EAAb,oBACkBE,KAAAC,qBAAA,IAAIC,IACFF,KAAAG,QAAA,IAElB,GAAAC,CAAIC,EAAaC,GACf,GAAIN,KAAKC,MAAMM,MAAQP,KAAKG,QAAS,CA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8Z,GAASA,EAAQ,IACnD,CAiBA,SAAgBK,GAAYL,GAC1B,MAAO,6DAA6D9Z,KAAK8Z,GAASA,EAAQ,IAC5F,CAqBA,SAAgBM,GAAsBpiB,EAAesF,EAAgD,CAAC,GACpG,GAAI,QAAQ0C,KAAKhI,GACf,OAAIsF,EAAK+c,OAAe,UAAUriB,qBAC3BA,EAET,GAAIA,EAAM2G,SAAS,KAAM,CACvB,MAAO2b,EAAWC,GAAeviB,EAAM6G,MAAM,KAAKrC,IAAIoF,QACtD,IAAKqY,MAAMK,KAAeL,MAAMM,IAAgC,IAAhBA,EAAmB,CACjE,MAAM7f,EAAS4f,EAAYC,EAC3B,OAAIjd,EAAKkd,QAA4B,IAAT9f,EAAH,IAClBA,EAAO4H,UAChB,CACF,CACA,OAAO,IACT,CAEA,IAAMmY,kBAAkB,IAAI7Z,IAAI,CAC9B,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,OACA,QACA,cACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA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C,GAAI"}
|
|
1
|
+
{"version":3,"file":"barocss.js","names":["targetFunction","finalSelector","CLASS_SEPARATOR","themeFunction","filters","decl","prop","value","source","type","atRoot","nodes","atRule","name","params","rule","selector","property","initialValue","syntax","push","debugEnabled","isDebug","debugWarn","args","console","warn","resetContextCaches","AstCache","constructor","this","cache","Map","maxSize","set","key","ast","size","firstKey","keys","next","delete","get","has","clear","getStats","hitRate","astCache","ParseResultCache","result","parseResultCache","UtilityCache","utilityCache","clearAllCaches","log","debugLog","states","WeakMap","cacheGeneration","getContextState","ctx","state","clearContextCaches","failures","utilityRegistry","registerUtility","util","Error","utilities","getUtility","modifierRegistry","staticModifier","selectors","options","registerModifier","match","mod","modifySelector","_rest","map","sel","functionalModifier","wrap","modifier","modifiers","getModifier","ESCAPE_REGEX","escapeRest","className","replace","c","staticUtility","decls","opts","handler","flatMap","a","b","Array","isArray","description","category","priority","themeKeyEntry","namespace","test","theme","table","Object","prototype","hasOwnProperty","call","themeKeyValue","v","themeKeyVar","varPrefix","functionalUtility","startsWith","token","_options","finalValue","parsedUtility","extra","opacity","supportsOpacity","arbitrary","customProperty","includes","list","split","length","pop","join","supportsArbitrary","processedValue","normalizeMathSpacing","expandThemeFunctions","handle","supportsCustomProperty","handleCustomProperty","customValue","themeValue","themeKey","themeScalar","themeKeys","themeNamespace","realThemeValue","supportsFraction","spacingKey","spacingKeys","negative","ref","spacingKeyValue","String","supportsNegative","handleNegativeBareValue","bare","handleBareValue","MATH_FNS","Set","arbitraryPropertyRegistration","_ctx","stack","out","i","ch","exec","toLowerCase","inMath","prev","trimEnd","p","binary","exponent","Number","isFinite","isUtilityPrefix","str","isUtility","filter","prefix","some","isModifier","modName","toString","parseClassName","realClassName","classPrefix","configured","config","configuredClassPrefix","none","utility","slice","important","endsWith","tokens","utilityIndex","t","hasCommentToken","m","FUNCTIONAL_VALUE_VARIANT","isSafeVariantValue","isSafeVariantToken","quote","depth","isWellFormedVariantBrackets","isStructureSafeValue","parseUtility","firstToken","secondToken","parsed","parseModifier","parseTokens","current","start","inBracket","inParen","char","end","tokenize","hasCommentDelimiter","text","n","hasHtmlEndTagOpener","allowTopLevelComma","parenDepth","modStr","nameSort","utilityValue","hasUnquotedAt","closeIdx","lastIndexOf","sortedUtilities","sort","matchedUtility","find","parts","isSafePrelude","isBalancedPrelude","uniqueDescriptors","node","seen","add","isSafeDecl","astToCss","baseSelector","_indent","minify","indent","nextIndent","importantString","dedupedAst","seenProps","unshift","escBase","lead","charCodeAt","escapeClassName","trim","Boolean","finalResult","rootToCss","body","child","escapeKey","colorsToCssVars","colors","walk","obj","varName","boxShadowToCssVars","boxShadow","fontSizeLineHeight","second","lh","lineHeight","fontSizeToCssVars","fontSize","fontWeightToCssVars","fontWeight","fontFamilyToCssVars","fontFamily","letterSpacingToCssVars","letterSpacing","spacingToCssVars","spacing","borderRadiusToCssVars","borderRadius","zIndexToCssVars","zIndex","opacityToCssVars","animationToCssVars","animations","COMMENT_OR_BLOCK","referencedKeyframes","css","all","names","matchAll","whole","word","frames","step","props","entries","keyframesBlock","transitionTimingFunctionToCssVars","transition","transitionDurationToCssVars","transitionDuration","transitionDelayToCssVars","transitionDelay","blurToCssVars","blur","containerToCssVars","container","SAFE_VAR_NAME","toCssVarsBlock","vars","k","isSafeThemeVar","isSelfReferencingVar","BARO_VAR","PREFIXED_KEYS","failureCache","collectDeclPaths","path","curr","concat","getPriority","sourcePriority","media","supports","responsive","group","peer","dark","universal","data","aria","attribute","pseudo","base","starting","getRulePriority","declPathToAst","declPath","variants","sortedVariants","last","mergedVariants","ruleSelectors","nonRuleVariants","sortedRuleSelectors","grouped","reduce","acc","mergedBySource","reduceRight","mergeSelectorsBySource","extractAtRootNodes","parent","atRootNodes","parseClassToAst","fullClassName","utilRegs","u","utilReg","wrappers","variant","plugin","astHandler","items","context","variantChain","index","wrappingType","flatten","r","item","normalizePrefix","val","applyVarPrefix","CLASS_SEPARATOR$1","generateCssRules","classList","cls","dedup","parsedResult","cleanAst","astList","declPaths","merge","groupMap","JSON","stringify","children","mergeAstTreeList","optimizeAst","allAtRootNodes","flat","allCleanAst","cssList","forEach","rootCssList","rootCss","IncrementalParser","processedClasses","batchSize","debounceMs","pendingClasses","batchTimer","processClass","rules","error","processClasses","classes","results","newClasses","batch","addToPending","scheduleBatchProcessing","clearTimeout","window","setTimeout","processPendingClasses","classesToProcess","from","applyClasses","markProcessed","cacheStats","clearProcessed","isProcessed","unmarkProcessed","processClassesSync","getProcessedClasses","spin","ping","pulse","bounce","defaultTheme","inherit","transparent","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","mauve","olive","mist","taupe","px","xs","sm","DEFAULT","md","lg","xl","full","breakpoints","sans","serif","mono","thin","extralight","light","normal","medium","semibold","bold","extrabold","tighter","tight","wide","wider","widest","snug","relaxed","loose","inner","auto","transitionProperty","shadow","transform","transitionTimingFunction","linear","in","keyframes","to","animationVars","textShadow","dropShadow","aspect","video","customUtilityName","customUtilityProp","validateCustomUtility","raw","preflightFullCSS","deepMerge","override","skey","baseVal","overrideVal","themeLookupsInProgress","themeGetter","themeObj","colorKey","inProgress","pathKey","themeToCssVars","animation","fromEntries","themeToCssVarsAll","createContext","configObj","enabled","debug","configWithDefaults","presets","preset","extend","overrideTheme","resolveTheme","hasPreset","configGetter","extendTheme","values","existingValues","getPreflightCSS","level","initializeContextState","builtins","before","safe","shadowed","reg","splice","registerCustomUtilities","parseFraction","input","num","denom","isNaN","parseNumber","parseLength","parseFractionOrNumber","repeat","numerator","denominator","percent","CSS_COLOR_NAMES","parseColor","COLOR_KEYWORDS","themeColorDecls","alpha","bracketed","amount","isVar","toFixed","normalizeAlpha","_token","cursor","_extra","stripColorHint","part","compose","withOpacity","color","defaultTiming","defaultDuration","borderSpacingProperties","BORDER_SPACING","borderSpacing","axes","parseAlpha","op","pct","cp","splitTop","sep","cur","LENGTH","shadowLayers","layer","l","findIndex","shadowValueDecls","render","alphaDecl","shadowColorDecls","filters$1","dropShadowProperties","wrapDropShadow","layers","namedDropShadow","dropShadowValue","named","keepNamed","composed","cut","indexOf","dropShadowColor","keyword","filters","SHADOW_COMPOSITE","ringShadowProperties","shadowColorProperties","NAMED_SHADOWS","NAMED_INSET_SHADOWS","INSET_EXTENSIONS","insetEach","own","boxShadowLayer","namedBoxShadow","custom","KEYWORD_COLORS","layerColor","main","textShadowProperties","namedTextShadow","textShadowValue","ringShadowValue","width","ringOffsetWidth","createRingColorDecls","colorVar","colorMix","fallback","Math","round","padStart","NAMED_CONTAINER","CONTAINER_TYPE","_value","toRem","NaN","bps","frac","SPACE_SELECTOR","axis","rev","reverseProperty","spaceRule","w","h","containers","common","inlineVp","blockVp","families","statics","leadingProperty","fontWeightUtility","family","numbered","FONT_SIZE_HINTS","FONT_SIZE_KEYWORDS","LENGTH_RE","textArbitraryKind","hint","sizeKey","kind","placeholderColor","gradientStopProperties","positionValue","position","legacyPositionValue","gradientImage","fn","_context","G","stopsDecls","stop","colorDecls","parsedColor","FULL","roundedFull","propList","logical","borderStyleProperty","withBorderStyle","styled","x","y","styles","divide","s","outlineStyleProperty","withOutlineStyle","style","divideColor","ROTATE_SKEW","rotateAxis","skewAxis","scaleProperties","scaleAxis","deg","abs","sign","translateProperties","translateAxis","staticTranslateAxis","order","withPseudoContent","createContainerParams","negate","query","getDefaultBreakpoint","breakpoint","decodeArbitrarySelector","attributeVariantSelector","bracket","functionalArgument","hasTopLevelComma","pseudoClassOf","negatableSelectorOf","attr","pc","negatedAtRuleOf","breakpointKeys","baseBreakpoint","mediaQuery","_mod","mode","joined","getDarkSelectors","atRuleNode","ruleNode","SIZE_VARIANT","not","startsAtRule","innerCompound","compound","resolveHasIn","hasInSelector","resolveGroupHas","arg","groupHasSelector","tail","m2","atRuleHas","splitGroupName","negated","g","neg","pattern","LEADING_AT","LATE_MEDIA","MIN_W","MAX_W","toPx","unit","parseFloat","preludeKey","prelude","min","max","ruleSortKey","rest","compareKeys","upperBound","lo","hi","mid","StylePartitionManager","insertSorted","partition","sheet","styleElement","cssRules","insertRule","escapeCssRule","textContent","insertionPoint","maxRulesPerPartition","styleIdPrefix","getCategory","nonce","partitions","categoryPartitions","partitionCounter","classToPartitionMap","classToCategoryPartitionMap","initializeDefaultPartition","createStyleElement","el","document","createElement","setAttribute","createNewPartition","createNewCategoryPartition","atDocumentStart","newPartition","id","head","ownerDocument","insertBefore","firstChild","appendChild","hasRule","hasCategoryRule","setRuleCache","partitionIndex","setCategoryRuleCache","currentPartition","getCategoryPartition","hasDetachedPartitions","isConnected","addRule","addCategoryRule","categoryPartition","addRootRules","success","failed","addRules","removeRule","inSync","deleteRule","ruleCount","findRulePartition","updateRuleContent","ruleContent","cleanup","parentNode","removeChild","CLASS_SEPARATOR","normalizeClassName","normalizeClassNameList","ChangeDetector","incrementalParser","BrowserRuntime","observer","gc","setGc","setParser","parser","observe","root","MutationObserver","disconnect","setRoot","mutations","mutation","reconcile","target","removedNodes","reconcileTree","addedNodes","attributeName","contains","nodeType","Node","ELEMENT_NODE","element","processElement","querySelectorAll","classesArray","applyParseResults","afterBatch","attributes","subtree","attributeFilter","childList","scan","scanExistingClasses","existingClasses","rootClass","elementsWithClass","layoutResults","nonLayoutResults","onReady","unescapeCssIdent","_m","hex","fromCodePoint","parseInt","LEADING_CLASS","splitTopLevel","collectKeyframeNames","collectLeadingClasses","selectorText","ClassGc","host","graceMs","maxRules","now","Date","counts","counted","candidates","timer","cancel","count","getAttribute","prevSet","nextSet","cachedCount","schedule","delay","sweep","overflow","doomed","evicted","since","expired","inDom","isPermanent","reclaim","doc","documentElement","getElementsByClassName","stats","trackedClasses","hash","imul","canConstruct","proto","Document","ShadowRoot","CSSStyleSheet","replaceSync","SharedRootSheet","fullKey","generations","prologueSheet","rulesSheet","prologue","preflight","segments","refs","attached","constructable","rootCount","attach","adoptedStyleSheets","pro","prologueText","allRules","detach","remove","setPrologue","offset","segment","retain","segmentName","seg","isRoot","local","insertAt","release","deleteAt","total","cssText","registry","acquireSharedRootSheet","label","_k","RegExp","stableKey","entry","runtimeConfig","SharedIncrementalParser","shared","super","cached","ShadowRootStyles","owned","scopePreflight","bodyDecls","ws","block","sels","d","mapped","scopePreflightForShadowRoot","take","_category","SSR_STYLE_SELECTOR","LAYER_ORDER","rootCache","shadowRoot","isDestroyed","existing","existingKeyframes","existingSheetCount","pinned","reclaimedCount","ssrRules","ssrClasses","observedOnce","styleId","skipExisting","gcGraceMs","Infinity","changeDetector","stylePartitionManager","createStyles","init","getInsertionPoint","message","toUpperCase","injectPreflightCSS","ensureCssVars","adoptSsrSheets","adopted","moved","insertSsrRules","preflightCSS","cssVars","addClass","normalizeClasses","processClassesIncremental","isBrowser","_opts","existingResults","reset","getExistingClasses","rootCssRules","pageKeyframes","kf","cssRuleCount","rootCssCount","victims","stillUsed","sheets","styleSheets","owner","ownerNode","hasAttribute","getCss","getAllCss","getClasses","getCacheStats","incremental","runtime","cachedClasses","rootCacheSize","reclaimedClasses","clearCaches","updateConfig","newConfig","removeClass","retainedResults","destroy","styleElementId","sharedSheet","roots","runtimeNonce","runtimeConstructable","mismatchWarned","getRuntime","badNonce","badConstructable","what","baroBoot","loadingClassName","addEventListener","once","startClassName","endClassName","baroStart","collectJsonRenderClassNames","spec","elements","preloadJsonRenderClasses","shadcnTheme"],"sources":["../../../barocss/src/core/ast.ts","../../../barocss/src/utils/debug.ts","../../../barocss/src/utils/cache.ts","../../../barocss/src/core/contextState.ts","../../../barocss/src/core/registry.ts","../../../barocss/src/core/tokenizer.ts","../../../barocss/src/core/parser.ts","../../../barocss/src/core/astToCss.ts","../../../barocss/src/core/cssVars.ts","../../../barocss/src/core/engine.ts","../../../barocss/src/core/incremental-parser.ts","../../../barocss/src/theme/colors.ts","../../../barocss/src/theme/spacing.ts","../../../barocss/src/theme/border-radius.ts","../../../barocss/src/theme/font-size.ts","../../../barocss/src/theme/font-family.ts","../../../barocss/src/theme/font-weight.ts","../../../barocss/src/theme/line-height.ts","../../../barocss/src/theme/box-shadow.ts","../../../barocss/src/theme/z-index.ts","../../../barocss/src/theme/opacity.ts","../../../barocss/src/theme/transition-property.ts","../../../barocss/src/theme/transition-timing-function.ts","../../../barocss/src/theme/transition-duration.ts","../../../barocss/src/theme/transition-delay.ts","../../../barocss/src/theme/animations.ts","../../../barocss/src/theme/keyframes.ts","../../../barocss/src/theme/animation-vars.ts","../../../barocss/src/theme/breakpoints.ts","../../../barocss/src/theme/container.ts","../../../barocss/src/theme/letter-spacing.ts","../../../barocss/src/theme/blur.ts","../../../barocss/src/theme/text-shadow.ts","../../../barocss/src/theme/default-theme.ts","../../../barocss/src/core/customUtilities.ts","../../../barocss/src/css/preflight.ts","../../../barocss/src/core/context.ts","../../../barocss/src/core/utils.ts","../../../barocss/src/presets/interactivity.ts","../../../barocss/src/presets/transitions.ts","../../../barocss/src/presets/table.ts","../../../barocss/src/presets/shadow-color.ts","../../../barocss/src/presets/filter.ts","../../../barocss/src/presets/backdrop-filter.ts","../../../barocss/src/presets/effects.ts","../../../barocss/src/presets/layout.ts","../../../barocss/src/presets/flexbox-grid.ts","../../../barocss/src/presets/spacing.ts","../../../barocss/src/presets/sizing.ts","../../../barocss/src/presets/typography.ts","../../../barocss/src/presets/background.ts","../../../barocss/src/presets/border.ts","../../../barocss/src/presets/transform.ts","../../../barocss/src/presets/svg.ts","../../../barocss/src/presets/accessibility.ts","../../../barocss/src/presets/variants/pseudo-classes.ts","../../../barocss/src/presets/variants/form-states.ts","../../../barocss/src/presets/variants/structural-selectors.ts","../../../barocss/src/presets/variants/media-features.ts","../../../barocss/src/presets/variants/attribute-selectors.ts","../../../barocss/src/presets/variants/basic-variants.ts","../../../barocss/src/presets/variants/utils.ts","../../../barocss/src/presets/variants/responsive.ts","../../../barocss/src/presets/variants/dark-mode.ts","../../../barocss/src/presets/variants/container-queries.ts","../../../barocss/src/presets/variants/has-variants.ts","../../../barocss/src/presets/variants/negation-variants.ts","../../../barocss/src/presets/variants/universal-selectors.ts","../../../barocss/src/presets/variants/arbitrary-variants.ts","../../../barocss/src/presets/variants/attribute-variants.ts","../../../barocss/src/presets/variants/nth-selectors.ts","../../../barocss/src/presets/variants/functional-selectors.ts","../../../barocss/src/presets/variants/at-rules.ts","../../../barocss/src/presets/variants/group-peer-extensions.ts","../../../barocss/src/core/rule-order.ts","../../src/style-partition-manager.ts","../../src/utils.ts","../../src/change-detector.ts","../../src/existing-classes.ts","../../src/class-gc.ts","../../src/shadow-root-sheet.ts","../../src/browser-runtime.ts","../../src/baro-boot.ts","../../src/json-render-preload.ts","../../src/presets/shadcn.ts"],"sourcesContent":["// AST node types for barocss\nexport type AstNode =\n | { type: \"wrap\"; items: AstNode[], source?: string }\n | { type: \"decl\"; prop: string; value: string | [string, string][], source?: string }\n | { type: \"at-rule\"; name: string; params: string; nodes: AstNode[], source?: string }\n | { type: \"style-rule\"; selector: string; nodes: AstNode[], source?: string }\n | { type: \"rule\"; selector: string; nodes: AstNode[], source?: string }\n | { type: \"at-root\"; nodes: AstNode[], source?: string }\n | { type: \"comment\"; text: string, source?: string }\n | { type: \"raw\"; value: string, source?: string };\n\nexport type HasNodes = { nodes?: AstNode[] };\nexport type HasSource = { source?: string };\nexport type HasSelector = { selector?: string };\nexport type HasName = { name?: string };\nexport type HasParams = { params?: string };\nexport type HasValue = { value?: string | [string, string][] };\nexport type HasProp = { prop?: string };\nexport type HasItems = { items?: AstNode[] };\nexport type HasText = { text?: string };\n\nexport function decl(\n prop: string,\n value: string | [string, string][],\n source?: string\n): AstNode {\n return { type: \"decl\", prop, value, source };\n}\nexport function atRoot(nodes: AstNode[], source?: string): AstNode {\n return {\n type: \"at-root\",\n nodes,\n source\n };\n}\n\nexport function atRule(\n name: string,\n params: string,\n nodes: AstNode[],\n source?: string\n): AstNode {\n return { type: \"at-rule\", name, params, nodes, source };\n}\nexport function styleRule(selector: string, nodes: AstNode[], source?: string): AstNode {\n return { type: \"style-rule\", selector, nodes, source };\n}\nexport function rule(selector: string, nodes: AstNode[], source?: string): AstNode {\n return { type: \"rule\", selector, nodes, source };\n}\nexport function comment(text: string, source?: string): AstNode {\n return { type: \"comment\", text, source };\n}\nexport function raw(value: string, source?: string): AstNode {\n return { type: \"raw\", value, source };\n}\n\nexport function property(name: string, initialValue?: string, syntax?: string, source?: string): AstNode {\n const nodes: AstNode[] = [\n decl(\"syntax\", `\"${syntax || \"*\"}\"`, source),\n decl(\"inherits\", \"false\", source),\n ];\n \n if (initialValue) {\n nodes.push(decl(\"initial-value\", initialValue, source));\n }\n \n return atRule(\"property\", name, nodes, source);\n}","/**\n * Kit diagnostics are silent by default so untrusted runtime class names\n * cannot spam the console. Enable with `setDebug(true)` or `debug: true`\n * in the config passed to `createContext`.\n */\nlet debugEnabled = false;\n\nexport function setDebug(enabled: boolean): void {\n debugEnabled = enabled;\n}\n\nexport function isDebug(): boolean {\n return debugEnabled;\n}\n\nexport function debugLog(...args: unknown[]): void {\n // eslint-disable-next-line no-console\n if (debugEnabled) console.log(...args);\n}\n\nexport function debugWarn(...args: unknown[]): void {\n // eslint-disable-next-line no-console\n if (debugEnabled) console.warn(...args);\n}\n","import { debugLog } from \"./debug\";\nimport type { AstNode } from '../core/ast';\nimport { ParsedModifier, ParsedUtility } from '../core/parser';\n\n/**\n * AST cache management\n */\nexport class AstCache {\n private cache = new Map<string, AstNode[]>();\n private maxSize = 1000; // Prevent memory leaks\n \n set(key: string, ast: AstNode[]): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, ast);\n }\n \n get(key: string): AstNode[] | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global AST cache instance\nexport const astCache = new AstCache();\n\n/**\n * Parse result cache management\n */\nexport class ParseResultCache {\n private cache = new Map<string, { modifiers: ParsedModifier[]; utility: ParsedUtility | null }>();\n private maxSize = 2000; // Prevent memory leaks\n \n set(key: string, result: { modifiers: ParsedModifier[]; utility: ParsedUtility | null }): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, result);\n }\n \n get(key: string): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global parse result cache instance\nexport const parseResultCache = new ParseResultCache();\n\n/**\n * Utility cache management\n */\nexport class UtilityCache {\n private cache = new Map<string, boolean>();\n private maxSize = 1000; // Prevent memory leaks\n \n set(key: string, value: boolean): void {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entries (simple LRU)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, value);\n }\n \n get(key: string): boolean | undefined {\n return this.cache.get(key);\n }\n \n has(key: string): boolean {\n return this.cache.has(key);\n }\n \n clear(): void {\n this.cache.clear();\n }\n \n getStats() {\n return {\n size: this.cache.size,\n maxSize: this.maxSize,\n hitRate: this.cache.size / this.maxSize\n };\n }\n}\n\n// Global utility cache instance\nexport const utilityCache = new UtilityCache();\n\nlet resetContextCaches: (() => void) | undefined;\n\n/** Internal hook for caches owned by contexts. */\nexport function setContextCacheReset(reset: () => void): void {\n resetContextCaches = reset;\n}\n\n/**\n * Clear all caches (for context changes or testing)\n */\nexport function clearAllCaches(): void {\n astCache.clear();\n parseResultCache.clear();\n utilityCache.clear();\n resetContextCaches?.();\n debugLog('[clearAllCaches] All caches cleared');\n}\n\n/**\n * WeakMap-based cache for memory optimization\n */\nexport class WeakCache<T> {\n private cache = new WeakMap<object, T>();\n private keyMap = new Map<string, object>();\n private maxSize = 1000;\n\n set(key: string, value: T): void {\n if (this.keyMap.size >= this.maxSize) {\n // Remove oldest entry\n const firstKey = this.keyMap.keys().next().value;\n if (firstKey) {\n const obj = this.keyMap.get(firstKey);\n if (obj) {\n this.cache.delete(obj);\n }\n this.keyMap.delete(firstKey);\n }\n }\n\n const obj = { key };\n this.cache.set(obj, value);\n this.keyMap.set(key, obj);\n }\n\n get(key: string): T | undefined {\n const obj = this.keyMap.get(key);\n if (obj) {\n return this.cache.get(obj);\n }\n return undefined;\n }\n\n has(key: string): boolean {\n return this.keyMap.has(key);\n }\n\n clear(): void {\n this.keyMap.clear();\n }\n\n getStats() {\n return {\n size: this.keyMap.size,\n maxSize: this.maxSize,\n hitRate: this.keyMap.size / this.maxSize\n };\n }\n}\n","import type { Context } from './context';\nimport type { ModifierRegistration, UtilityRegistration } from './registry';\nimport { AstCache, ParseResultCache, UtilityCache, setContextCacheReset } from '../utils/cache';\n\ninterface ContextState {\n utilities: UtilityRegistration[];\n modifiers: ModifierRegistration[];\n astCache: AstCache;\n parseResultCache: ParseResultCache;\n utilityCache: UtilityCache;\n failures: Set<string>;\n cacheGeneration: number;\n}\n\nconst states = new WeakMap<Context, ContextState>();\nlet cacheGeneration = 0;\n\nsetContextCacheReset(() => { cacheGeneration += 1; });\n\nexport function initializeContextState(\n ctx: Context,\n utilities: UtilityRegistration[],\n modifiers: ModifierRegistration[],\n): void {\n states.set(ctx, {\n utilities: [...utilities],\n modifiers: [...modifiers],\n astCache: new AstCache(),\n parseResultCache: new ParseResultCache(),\n utilityCache: new UtilityCache(),\n failures: new Set<string>(),\n cacheGeneration,\n });\n}\n\nexport function getContextState(ctx: Context): ContextState | undefined {\n const state = states.get(ctx);\n if (state && state.cacheGeneration !== cacheGeneration) {\n clearContextCaches(ctx);\n state.cacheGeneration = cacheGeneration;\n }\n return state;\n}\n\nexport function clearContextCaches(ctx: Context): void {\n const state = states.get(ctx);\n if (!state) return;\n state.astCache.clear();\n state.parseResultCache.clear();\n state.utilityCache.clear();\n state.failures.clear();\n}\n","import type { AstNode } from './ast';\nimport { decl, rule } from './ast';\nimport type { Context } from './context';\nimport { clearContextCaches, getContextState } from './contextState';\nimport { ParsedModifier, ParsedUtility } from './parser';\nimport { parseResultCache, utilityCache } from '../utils/cache';\n\n// Utility registration\nexport interface UtilityRegistration {\n /**\n * The name of the utility\n */\n name: string;\n /**\n * The match function for the utility\n * @param className The class name of the utility\n * @returns {boolean} Whether the utility matches the class name\n */\n match: (className: string) => boolean;\n /**\n * Handler for utility value\n * @param value Utility value (e.g. 'red-500')\n * @param ctx Context\n * @param token Parsed token\n * @param options Registration options\n */\n handler: (value: string, ctx: Context, token: ParsedUtility, options: UtilityRegistration) => AstNode[] | null | undefined;\n /**\n * The description of the utility\n * @example\n * ```\n * description: 'Custom utility description',\n * ```\n */\n description?: string;\n /**\n * The category of the utility\n * @example\n * ```\n * category: 'background',\n * ```\n */\n category?: string;\n /**\n * The priority of the utility\n * @example\n * ```\n * priority: 10,\n * ```\n */\n priority?: number;\n [key: string]: unknown;\n}\n\nconst utilityRegistry: UtilityRegistration[] = [];\nexport function registerUtility(util: UtilityRegistration, ctx?: Context) {\n const state = ctx && getContextState(ctx);\n if (ctx && !state) throw new Error('Utility registration requires a context from createContext');\n (state?.utilities || utilityRegistry).push(util);\n if (ctx) {\n clearContextCaches(ctx);\n } else {\n parseResultCache.clear();\n utilityCache.clear();\n }\n}\n\nexport function getUtility(ctx?: Context): UtilityRegistration[] {\n return (ctx && getContextState(ctx)?.utilities) || utilityRegistry;\n}\n\n// --- Modifier Registration ---\nexport type ModifierSelector = {\n selector: string;\n flatten?: boolean;\n wrappingType?: 'rule' | 'style-rule' | 'at-rule';\n override?: boolean;\n source?: string;\n};\n\nexport type ModifierRegistration = {\n match: (mod: string, context: Context) => boolean;\n modifySelector?: (params: { selector: string; fullClassName: string; mod: ParsedModifier; context: Context; variantChain?: ParsedModifier[]; index?: number }) => string | ModifierSelector | ModifierSelector[] | null;\n wrap?: (mod: ParsedModifier, context: Context) => AstNode[];\n astHandler?: (ast: AstNode[], mod: ParsedModifier, context: Context, variantChain?: ParsedModifier[], index?: number) => AstNode[];\n sort?: number;\n description?: string;\n source?: string;\n /** Static variant name; lets the parser tell `placeholder-shown:` (variant) from a `placeholder-*` utility (#307). */\n name?: string;\n};\n\nexport const modifierRegistry: ModifierRegistration[] = [];\n\n/**\n * staticModifier: A helper that registers a modifier name and an array of CSS selectors directly to the registry\n * \n * @example\n * ```\n * staticModifier('disabled', ['&:disabled'], { source: 'pseudo' });\n * ```\n * \n * @param name The name of the modifier\n * @param selectors The selectors of the modifier\n * @param options The options of the modifier\n * \n * @returns {void}\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function staticModifier(name: string, selectors: string[], options: any = {}, ctx?: Context): void {\n registerModifier({\n name,\n match: (mod: string) => mod === name,\n modifySelector: ({ ..._rest }) => {\n return selectors.map(sel => ({\n selector: sel,\n source: options.source\n }));\n },\n ...options\n }, ctx);\n}\n\nexport function functionalModifier(match: ModifierRegistration['match'], modifySelector: ModifierRegistration['modifySelector'], wrap?: ModifierRegistration['wrap'], options: Partial<ModifierRegistration> = {}, ctx?: Context) {\n registerModifier({ match, modifySelector, wrap, ...options }, ctx);\n}\n\nexport function registerModifier(modifier: ModifierRegistration, ctx?: Context): void {\n const state = ctx && getContextState(ctx);\n if (ctx && !state) throw new Error('Modifier registration requires a context from createContext');\n (state?.modifiers || modifierRegistry).push(modifier);\n if (ctx) clearContextCaches(ctx);\n}\n\nexport function getModifier(ctx?: Context): ModifierRegistration[] {\n return (ctx && getContextState(ctx)?.modifiers) || modifierRegistry;\n}\n\n// escapeClassName\nconst ESCAPE_REGEX = /[^A-Za-z0-9_-]/g;\nexport function escapeClassName(className: string) {\n // #334: CSS.escape first-char rules — an identifier can't start with a digit, or `-` + digit, or be a lone `-`.\n if (className === '-') return '\\\\-';\n const lead = /^-?[0-9]/.exec(className);\n if (lead) {\n const i = lead[0].length - 1;\n return className.slice(0, i) + '\\\\' + className.charCodeAt(i).toString(16) + ' ' + escapeRest(className.slice(i + 1));\n }\n return escapeRest(className);\n}\nfunction escapeRest(className: string) {\n return className.replace(ESCAPE_REGEX, (c) => {\n if (c === ' ') return '\\\\x20 ';\n if (c === '.') return '\\\\.';\n if (c === '/') return '\\\\/';\n if (c === ':') return '\\\\:';\n if (c === '[') return '\\\\[';\n if (c === ']') return '\\\\]';\n if (c === '(') return '\\\\(';\n if (c === ')') return '\\\\)';\n if (c === '%') return '\\\\%';\n if (c === '#') return '\\\\#';\n if (c === ',') return '\\\\,';\n if (c === '=') return '\\\\=';\n if (c === '&') return '\\\\&';\n if (c === '~') return '\\\\~';\n if (c === '*') return '\\\\*';\n if (c === '$') return '\\\\$';\n if (c === '^') return '\\\\^';\n if (c === '+') return '\\\\+';\n if (c === '?') return '\\\\?';\n if (c === '!') return '\\\\!';\n if (c === '@') return '\\\\@';\n if (c === \"'\") return \"\\\\'\";\n if (c === '\"') return '\\\\\"';\n if (c === '`') return '\\\\`';\n if (c === ';') return '\\\\;';\n if (c === '<') return '\\\\<';\n if (c === '>') return '\\\\>';\n if (c === '{') return '\\\\{';\n if (c === '}') return '\\\\}';\n if (c === '|') return '\\\\|';\n if (c === '\\\\') return '\\\\\\\\';\n return '\\\\' + c;\n });\n}\n\n// --- Utility Helper Factories ---\n\ntype StaticUtilityValue = \n | AstNode // ast\n | [string, string] // [prop, value]\n | [string, [string, string][]] // [selector, [prop, value][]]\n | ((value: string) => AstNode); // function\n\n\n/**\n * staticUtility: A helper that registers a utility name and an array of CSS declaration pairs directly to the registry\n *\n * @example\n * ```\n * staticUtility('block', [['display', 'block']]);\n * staticUtility('hidden', [['display', 'none']]);\n * staticUtility('space-x-px', [\n * [\n * '& > :not([hidden]) ~ :not([hidden])', // selector\n * [\n * ['margin-inline-start', '1px'], // [prop, value]\n * ['margin-inline-end', '1px'], // [prop, value]\n * ],\n * ],\n * ]);\n * ```\n * \n * @param name The name of the utility\n * @param decls The declarations of the utility\n * @param opts The options of the utility\n * \n * @returns {void}\n */\nexport function staticUtility(\n name: string,\n decls: StaticUtilityValue[],\n opts?: { description?: string; category?: string; priority?: number },\n ctx?: Context,\n): void {\n registerUtility({\n name,\n match: (className: string) => {\n return className === name;\n },\n handler: (value: string): AstNode[] | null | undefined => {\n return decls.flatMap((params) => {\n\n if ((params as AstNode).type) {\n return [params as AstNode];\n }\n\n if (typeof params === 'function') {\n const targetFunction = params as (value: string) => AstNode;\n return [targetFunction(value)];\n }\n const [a, b] = params as [string, string | [string, string][]];\n\n if (typeof b === 'string') {\n // [prop, value]\n return [decl(a, b)];\n } else if (Array.isArray(b)) {\n // selector, [prop, value][]\n return [rule(a, b.map(([prop, value]) => decl(prop, value)))];\n }\n return [];\n });\n },\n description: opts?.description,\n category: opts?.category,\n priority: opts?.priority,\n }, ctx);\n}\n\nexport type FunctionalUtilityExtra = {\n opacity?: string;\n /** The theme key that matched, set when it is a colour key (or the utility lists no `colors` namespace). */\n realThemeValue?: string;\n /**\n * #338: the theme namespace that resolved the key and the key itself. On a root shared by colours and another\n * namespace (`border-*`: colors + borderWidth), a key from the other namespace leaves `realThemeValue` unset so the\n * colour branch does not claim it; the handler dispatches on `themeNamespace` instead.\n */\n themeNamespace?: string;\n themeKey?: string;\n}\n\nexport type FunctionalUtilityOptions = {\n /**\n * The name of the utility\n * \n * prefix is automatically added to the name\n */\n name: string;\n /**\n * The CSS property to set\n * \n * css property is automatically added to the prop\n */\n prop?: string;\n /**\n * The theme key to look up values\n * \n * theme key is automatically added to the themeKey\n * \n * @example\n * ```\n * themeKey: 'colors'\n * ```\n */\n themeKey?: string;\n /**\n * The theme keys to look up values\n * \n * theme keys are automatically added to the themeKeys\n * \n * @example\n * ```\n * themeKeys: ['colors', 'spacing']\n * ```\n */\n themeKeys?: string[];\n /**\n * Whether to support arbitrary values\n * \n * `bg-[#ff0000]`\n * \n * @example\n * ```\n * supportsArbitrary: true\n * ```\n */\n supportsArbitrary?: boolean;\n /**\n * Whether to support fraction values\n * \n * `m-4`\n * \n * @example\n * ```\n * supportsFraction: true\n * ```\n */\n supportsFraction?: boolean;\n /**\n * Whether to support custom properties\n * \n * `bg-(--my-bg)`\n * \n * @example\n * ```\n * supportsCustomProperty: true\n * ```\n */\n supportsCustomProperty?: boolean;\n /**\n * Whether to support negative values\n * \n * `-m-4`\n * \n * @example\n * ```\n * supportsNegative: true\n * ```\n */\n supportsNegative?: boolean;\n /**\n * Whether to support opacity values\n */\n supportsOpacity?: boolean;\n /**\n * The handler function that processes values\n * \n * @example\n * ```\n * handle: (value, ctx, token, extra) => {\n * return [decl('background-color', value)];\n * }\n * ```\n * \n * @param value The value to process\n * @param ctx The context\n * @param token The parsed utility\n * @param extra The extra metadata\n * \n * @returns {AstNode[] | null | undefined} The AST nodes or null | undefined\n */\n handle?: (value: string, ctx: Context, token: ParsedUtility, extra?: FunctionalUtilityExtra) => AstNode[] | null | undefined;\n /**\n * The handler function that processes bare values\n * \n * @example\n * ```\n * handleBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * ```\n * \n * @param args The arguments\n * @param args.value The value to process\n * @param args.ctx The context\n * @param args.token The parsed utility\n * @param args.extra The extra metadata\n * \n * @returns {string | null | undefined} The processed value or null | undefined\n */\n handleBareValue?: (args: { value: string; ctx: Context; token: ParsedUtility, extra?: FunctionalUtilityExtra }) => string | null | undefined;\n /**\n * The handler function that processes negative bare values\n * \n * @example\n * ```\n * handleNegativeBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * ```\n */\n /**\n * #261: the utility uses the spacing scale, so a named `theme.spacing` key (`p-gutter`) resolves to\n * `var(--spacing-<key>)` (negative: `calc(var(--spacing-<key>) * -1)`), as in Tailwind 4. Only tried\n * after the bare-value handler rejects the value, so built-in keywords keep precedence.\n */\n spacingKeys?: boolean;\n handleNegativeBareValue?: (args: { value: string; ctx: Context; token: ParsedUtility, extra?: FunctionalUtilityExtra }) => string | null | undefined;\n\n /**\n * The handler function that processes custom property values\n * \n * \n * @example\n * ```\n * handleCustomProperty: (value, ctx, token, extra) => [decl('background-color', value)],\n * ```\n * \n * @param args The arguments\n * @param args.value The value to process\n * @param args.ctx The context\n * @param args.token The parsed utility\n * @param args.extra The extra metadata\n * \n * @returns {AstNode[] | null | undefined} The AST nodes or null | undefined\n */\n handleCustomProperty?: (value: string, ctx: Context, token: ParsedUtility, extra?: FunctionalUtilityExtra) => AstNode[] | null | undefined;\n /**\n * The description of the utility\n * \n * @example\n * ```\n * description: 'Custom utility description',\n * ```\n */\n description?: string;\n /**\n * The category of the utility\n * \n * It is used to group utilities in the documentation and styles\n * \n * \n * @example\n * ```\n * category: 'background',\n * ```\n */\n category?: string;\n /**\n * The priority of the utility\n * \n * It is used to sort utilities in the styles\n * \n * @example\n * ```\n * priority: 10,\n * ```\n * \n * The higher the number, the higher the priority\n * \n * @default 0\n */\n priority?: number;\n}\n\n/**\n * functionalUtility: A helper that registers dynamic utilities (theme, arbitrary, custom, negative, fraction, etc.) directly\n *\n * Example:\n * functionalUtility({\n * name: 'z',\n * supportsNegative: true,\n * themeKeys: ['--z-index'],\n * handleBareValue: ({ value }) => isPositiveInteger(value) ? value : null,\n * handle: (value) => [decl('z-index', value)],\n * description: 'z-index utility',\n * category: 'layout',\n * });\n */\n/**\n * #300: a theme key that no built-in utility names (`theme.extend.borderRadius.card`) still resolves, as in\n * Tailwind 4 where `--radius-card` gives `rounded-card`. Only word keys that start with a letter (numbers stay\n * bare values), never `DEFAULT`; unknown keys return null so the utility emits nothing (#213).\n */\nfunction themeKeyEntry(ctx: Context, namespace: string, key: string): unknown {\n if (key === 'DEFAULT' || !/^[a-zA-Z][\\w-]*$/.test(key) || typeof ctx?.theme !== 'function') return undefined;\n // An own key of the namespace only: ctx.theme() also resolves dashed paths (`shadow-lg` → shadow.lg).\n const table = ctx.theme(namespace) as Record<string, unknown> | undefined;\n if (!table || typeof table !== 'object' || !Object.prototype.hasOwnProperty.call(table, key)) return undefined;\n return table[key] ?? undefined;\n}\n\n/** #300: the literal value of `theme.<namespace>.<key>` when it is a string, else null. */\nexport function themeKeyValue(ctx: Context, namespace: string, key: string): string | null {\n const v = themeKeyEntry(ctx, namespace, key);\n return typeof v === 'string' ? v : null;\n}\n\n/** #300: `var(--<varPrefix>-<key>)` when `theme.<namespace>.<key>` exists (the :root var BaroCSS emits for it), else null. */\nexport function themeKeyVar(ctx: Context, namespace: string, key: string, varPrefix: string): string | null {\n return themeKeyEntry(ctx, namespace, key) === undefined ? null : `var(--${varPrefix}-${key})`;\n}\n\n/** #261: `var(--spacing-<key>)` for a named (non-numeric) `theme.spacing` key, else null. */\nfunction spacingKeyValue(ctx: Context, key: string, negative: boolean): string | null {\n if (key === 'px' || !/^[a-zA-Z][\\w-]*$/.test(key) || ctx.theme('spacing', key) == null) return null;\n const ref = `var(--spacing-${key})`;\n return negative ? `calc(${ref} * -1)` : ref;\n}\n\nexport function functionalUtility(opts: FunctionalUtilityOptions, ctx?: Context) {\n registerUtility({\n name: opts.name,\n match: (className: string) => className.startsWith(opts.name + '-'),\n handler: (value, ctx, token, _options) => {\n let finalValue = value;\n const parsedUtility = token;\n const extra: FunctionalUtilityExtra = {\n opacity: token.opacity,\n };\n\n if (opts.supportsOpacity && !token.arbitrary && !token.customProperty && value.includes('/')) {\n const list = value.split('/');\n\n if (list.length >= 2) {\n extra.opacity = list.pop();\n finalValue = list.join('/');\n }\n }\n\n // 1. Arbitrary value - already parsed in parser.ts\n if (opts.supportsArbitrary && parsedUtility.arbitrary) {\n const processedValue = normalizeMathSpacing(expandThemeFunctions(finalValue.replace(/_/g, ' ')));\n // console.log('[functionalUtility] arbitrary', { processedValue });\n // 7. handle (custom AST generation)\n if (opts.handle) {\n const result = opts.handle(processedValue, ctx, token, extra);\n // console.log('[functionalUtility] arbitrary handle result', result);\n if (result) return result;\n }\n // 8. default decl\n if (opts.prop) {\n // console.log('[functionalUtility] arbitrary default decl', { prop: opts.prop, processedValue });\n return [decl(opts.prop, processedValue)];\n }\n return [];\n }\n // 2. Custom property - already parsed in parser.ts\n if (opts.supportsCustomProperty && parsedUtility.customProperty) {\n // console.log('[functionalUtility] customProperty', { finalValue });\n if (opts.handleCustomProperty) {\n const result = opts.handleCustomProperty(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] customProperty handleCustomProperty result', result);\n return result;\n }\n const customValue = `var(${finalValue})`;\n if (opts.handle) {\n const result = opts.handle(customValue, ctx, token, extra);\n // console.log('[functionalUtility] customProperty handle result', result);\n if (result) return result;\n }\n if (opts.prop) {\n // console.log('[functionalUtility] customProperty default decl', { prop: opts.prop, customValue });\n return [decl(opts.prop, customValue)];\n }\n return [];\n }\n // 3. Theme lookup (themeKey or themeKeys); only scalar results count as a value (#333)\n let themeValue: string | undefined;\n if (opts.themeKey && ctx.theme) {\n themeValue = themeScalar(ctx.theme(opts.themeKey, finalValue));\n // console.log('[functionalUtility] themeKey lookup', { themeKey: opts.themeKey, finalValue, themeValue });\n }\n let namespace = themeValue !== undefined ? opts.themeKey : undefined;\n if (!themeValue && opts.themeKeys && ctx.theme) {\n // themeKeys are tried in order, so their order is the precedence for a key present in several (#338).\n for (const key of opts.themeKeys) {\n themeValue = themeScalar(ctx.theme(key, finalValue));\n if (themeValue !== undefined) { namespace = key; break; }\n }\n }\n if (themeValue !== undefined) {\n extra.themeNamespace = namespace;\n extra.themeKey = finalValue;\n // #338: only a colour key (or any key of a utility with no colour namespace) is flagged as realThemeValue.\n if (namespace === 'colors' || !(opts.themeKeys ?? [opts.themeKey]).includes('colors')) extra.realThemeValue = finalValue;\n finalValue = themeValue;\n if (opts.prop) {\n // console.log('[functionalUtility] themeValue default decl', { prop: opts.prop, finalValue });\n return [decl(opts.prop, finalValue)];\n }\n if (opts.handle) {\n const result = opts.handle(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] themeValue handle result', result);\n if (result) return result;\n }\n return [];\n }\n // 4. Fraction value (e.g., 1/2, -2/5)\n // console.log('[functionalUtility] fraction', { value });\n if (opts.supportsFraction && /^-?\\d+\\/\\d+$/.test(value)) {\n finalValue = value;\n // console.log('[functionalUtility] fraction', { finalValue });\n }\n const spacingKey = opts.spacingKeys ? spacingKeyValue(ctx, String(finalValue).replace(/^-/, ''), !!parsedUtility.negative) : null;\n // 5. handleNegativeBareValue (only check negative bare value)\n if (parsedUtility.negative && opts.supportsNegative && opts.handleNegativeBareValue) {\n const bare = opts.handleNegativeBareValue({ value: String(finalValue).replace(/^-/, ''), ctx, token, extra }) ?? spacingKey;\n // console.log('[functionalUtility] negative bare', { bare });\n if (bare == null) return [];\n finalValue = bare;\n }\n // 6. handleBareValue (only check bare value) - only when negative is not true\n else if (opts.handleBareValue) {\n const bare = opts.handleBareValue({ value: finalValue, ctx, token, extra }) ?? spacingKey;\n // console.log('[functionalUtility] bare', { bare });\n if (bare == null) return [];\n finalValue = bare;\n }\n else if (spacingKey) {\n finalValue = spacingKey;\n }\n // A non-numeric bare value that no theme key or bare-value validator accepted is unknown (#213):\n // Tailwind emits nothing for it (`text-balanc`, `bg-notacolor`, `border-foo`), so don't pass it\n // through to handle()/prop as a raw CSS value. Numeric values stay with handle() to validate.\n else if (!/^-?(\\d|\\.\\d)/.test(String(finalValue))) {\n return [];\n }\n // 7. handle (custom AST generation)\n if (opts.handle) {\n // console.log('[functionalUtility] handle', { finalValue });\n const result = opts.handle(finalValue, ctx, token, extra);\n // console.log('[functionalUtility] handle result', result);\n if (result) return result;\n }\n // 8. default decl\n if (opts.prop) {\n // console.log('[functionalUtility] default decl', { prop: opts.prop, finalValue });\n return [decl(opts.prop, finalValue)];\n }\n // console.log('[functionalUtility] fallback empty', { finalValue });\n return [];\n },\n description: opts.description,\n category: opts.category,\n priority: opts.priority,\n }, ctx);\n}\n\nconst MATH_FNS = new Set(['calc', 'min', 'max', 'clamp']);\n\n/**\n * Add Tailwind-style spacing inside calc()/min()/max()/clamp():\n * `calc(100%-2rem)` -> `calc(100% - 2rem)`. Leaves nested non-math functions\n * (var(--x-y)), unary signs and exponents (1e-3) alone.\n */\nexport function expandThemeFunctions(value: string): string {\n // Tailwind 4: `--spacing(8)` → `calc(var(--spacing) * 8)`.\n return value.replace(/--spacing\\(\\s*([^()]+?)\\s*\\)/g, 'calc(var(--spacing) * $1)');\n}\n\n/** Arbitrary property class `[prop:value]` (parser sets token.property). */\nexport const arbitraryPropertyRegistration: UtilityRegistration = {\n name: '[arbitrary-property]',\n match: () => false,\n handler: (value, _ctx, token) => {\n const prop = (token as { property?: string }).property;\n if (!prop || !value) return [];\n return [decl(prop, normalizeMathSpacing(expandThemeFunctions(value.replace(/_/g, ' '))))];\n },\n};\n\nexport function normalizeMathSpacing(value: string): string {\n if (!/(calc|min|max|clamp)\\(/.test(value)) return value;\n const stack: boolean[] = [];\n let out = '';\n for (let i = 0; i < value.length; i++) {\n const ch = value[i];\n if (ch === '(') {\n const name = (/([a-z-]*)$/i.exec(out)?.[1] ?? '').toLowerCase();\n const inMath = stack.length > 0 && stack[stack.length - 1];\n stack.push(MATH_FNS.has(name) || (name === '' && inMath));\n out += ch;\n continue;\n }\n if (ch === ')') { stack.pop(); out += ch; continue; }\n const inMath = stack.length > 0 && stack[stack.length - 1];\n if (!inMath) { out += ch; continue; }\n if (ch === ',') { out = out.trimEnd() + ', '; while (value[i + 1] === ' ') i++; continue; }\n if ('+-*/'.includes(ch)) {\n const prev = out.trimEnd();\n const p = prev[prev.length - 1] ?? '';\n const binary = /[\\w%)]/.test(p);\n const exponent = (ch === '+' || ch === '-') && /\\de$/i.test(prev) && prev.length === out.length && /\\d/.test(value[i + 1] ?? '');\n if (binary && !exponent) {\n out = prev + ' ' + ch + ' ';\n while (value[i + 1] === ' ') i++;\n continue;\n }\n }\n out += ch;\n }\n return out;\n}\n\n/**\n * A theme lookup result usable as a CSS value (#333): strings as-is, finite numbers stringified; anything else\n * (a nested palette object when no shade is given, arrays, functions) counts as \"no value\".\n */\nfunction themeScalar(v: unknown): string | undefined {\n if (typeof v === 'string') return v;\n if (typeof v === 'number' && Number.isFinite(v)) return String(v);\n return undefined;\n}\n","export interface Token {\n value: string;\n start: number;\n end: number;\n}\n\n/**\n * Tokenizes a class name string into an array of tokens\n * Only handles separation by ':' while respecting brackets and parentheses\n * \n * Examples:\n * - 'hover:bg-red-500' → [{ value: 'hover' }, { value: 'bg-red-500' }]\n * - 'bg-[#ff0000]:hover' → [{ value: 'bg-[#ff0000]' }, { value: 'hover' }]\n * - 'text-[color:var(--foo)]' → [{ value: 'text-[color:var(--foo)]' }]\n * - '!bg-[red]' → [{ value: '!bg-[red]' }]\n */\nexport function tokenize(className: string): Token[] {\n const tokens: Token[] = [];\n let current = '';\n let start = 0;\n let inBracket = 0;\n let inParen = 0;\n \n for (let i = 0; i < className.length; i++) {\n const char = className[i];\n \n // Bracket tracking\n if (char === '[') inBracket++;\n if (char === ']') inBracket--;\n if (char === '(') inParen++;\n if (char === ')') inParen--;\n \n // Separator (only when not inside brackets or parentheses)\n if (char === ':' && inBracket === 0 && inParen === 0) {\n if (current) {\n tokens.push({\n value: current,\n start,\n end: i\n });\n }\n current = '';\n start = i + 1;\n } else {\n current += char;\n }\n }\n \n // Add remaining token\n if (current) {\n tokens.push({\n value: current,\n start,\n end: className.length\n });\n }\n \n return tokens;\n} ","// Types for parsed modifier and utility\nexport interface ParsedModifier {\n type: string;\n value?: string;\n negative?: boolean;\n arbitrary?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ParsedUtility {\n category?: string;\n prefix: string;\n value?: string;\n arbitrary?: boolean;\n customProperty?: boolean;\n negative?: boolean;\n opacity?: string;\n priority?: number;\n important?: boolean;\n /** Set for an arbitrary property class (`[prop:value]`); `value` holds the raw value. */\n property?: string;\n [key: string]: unknown;\n}\n\nimport { getUtility, getModifier, UtilityRegistration } from './registry';\nimport { tokenize, Token } from './tokenizer';\nimport { parseResultCache, utilityCache } from '../utils/cache';\nimport type { Context } from './context';\nimport { getContextState } from './contextState';\n\n// Cache systems\n\n/**\n * Checks if a string is a utility prefix by checking against registered utilities\n * Optimized with prefix filtering and caching\n * @param str The string to check\n * @returns true if it's a utility prefix\n */\nfunction isUtilityPrefix(str: string, ctx?: Context): boolean {\n const cache = (ctx && getContextState(ctx)?.utilityCache) || utilityCache;\n // Check cache\n if (cache.has(str)) {\n return cache.get(str)!;\n }\n \n const utilities = getUtility(ctx);\n const modifiers = getModifier(ctx);\n \n // 1. Fast prefix filtering (O(1) prefix check)\n const candidateUtilities = utilities.filter(util => {\n const prefix = util.name;\n return str.startsWith(prefix + '-') || str === prefix || str.startsWith(prefix);\n });\n \n // 2. Exact match check only on filtered candidates\n const isUtility = candidateUtilities.some(util => util.match(str));\n \n // 3. Filter modifiers similarly\n const candidateModifiers = modifiers.filter(mod => {\n // Use modifier name if available, otherwise extract from match function\n const modName = (mod as unknown as { name: string }).name || mod.match.toString().split('(')[0];\n return str.startsWith(modName + ':') || str === modName;\n });\n \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const isModifier = candidateModifiers.some(mod => mod.match(str, {} as any));\n \n // 4. Calculate result\n const result = isUtility && !isModifier;\n \n // 5. Cache result\n cache.set(str, result);\n \n return result;\n}\n\n/**\n * Parses a class name string into modifiers and utility using tokenization\n * Supports both directions:\n * - modifier:utility (traditional CSS)\n * - utility:modifier (Master CSS style)\n * \n * Examples:\n * - 'group-hover:sm:bg-[red]' → modifier:utility\n * - 'bg-red-500:hover' → utility:modifier\n * - 'text-[color:var(--foo)]' → utility only\n * \n * @param className e.g. 'group-hover:sm:bg-[red]', 'text-[color:var(--foo)]'\n * @returns { modifiers, utility }\n */\nexport function parseClassName(className: string, ctx?: Context): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } {\n const cache = (ctx && getContextState(ctx)?.parseResultCache) || parseResultCache;\n // Check parse result cache first\n if (cache.has(className)) {\n return cache.get(className)!;\n }\n\n // #286: config.prefix (Tailwind 4 `prefix(tw)`): the prefix is the first `:` segment (`tw:hover:flex`) and is\n // stripped before the `!` forms and the variant split, so every #220/#248/#273 guard still runs on the rest.\n // A class without the prefix (including `!tw:flex` and `hover:tw:flex`, as in Tailwind 4) generates nothing.\n let realClassName = className;\n const classPrefix = ctx ? configuredClassPrefix(ctx) : '';\n if (classPrefix) {\n if (!className.startsWith(classPrefix + ':')) {\n const none = { modifiers: [], utility: null };\n cache.set(className, none);\n return none;\n }\n realClassName = className.slice(classPrefix.length + 1);\n }\n\n // Examples: !bg-[red]\n let important = false;\n if (realClassName.startsWith('!')) {\n important = true;\n realClassName = realClassName.slice(1);\n } else if (realClassName.length > 1 && realClassName.endsWith('!')) {\n // Tailwind 4 trailing form: p-4!, hover:size-5!. A `!` inside an arbitrary\n // value (`[...!...]`) never ends the class, so it is unaffected.\n important = true;\n realClassName = realClassName.slice(0, -1);\n }\n \n // 1. Tokenize string into tokens\n const tokens = tokenize(realClassName);\n // 2. Convert tokens to parsed result\n const result = parseTokens(tokens, ctx);\n if (result.utility) {\n result.utility.important = important;\n }\n \n // Cache the result\n cache.set(className, result);\n \n return result;\n}\n\n/**\n * The class prefix from config.prefix. Tailwind 4 only accepts lowercase letters (`prefix(tw)`); any other\n * value is ignored (no prefix) rather than guessed at.\n */\nfunction configuredClassPrefix(ctx: Context): string {\n const configured = ctx.config('prefix');\n return typeof configured === 'string' && /^[a-z]+$/.test(configured) ? configured : '';\n}\n\n/**\n * Parses tokens into modifiers and utility\n */\nfunction parseTokens(tokens: Token[], ctx?: Context): { modifiers: ParsedModifier[]; utility: ParsedUtility | null } {\n const modifiers: ParsedModifier[] = [];\n let utility: ParsedUtility | null = null;\n \n // Handle empty token array\n if (tokens.length === 0) {\n return { modifiers, utility: null };\n }\n \n // #220: every token but the utility is a variant; one that could end or widen the selector rejects the class.\n if (tokens.length > 1) {\n const utilityIndex = isUtilityPrefix(tokens[0].value, ctx) ? 0 : tokens.length - 1;\n if (tokens.some((t, i) => i !== utilityIndex && (!isSafeVariantToken(t.value) || !isWellFormedVariantBrackets(t.value)))) {\n return { modifiers, utility: null };\n }\n }\n\n // #224: the utility token carries the arbitrary / custom-property value that is pasted into a declaration;\n // one that could end or open a declaration, block or rule rejects the class (no rule).\n const utilityToken = tokens.length > 1 && !isUtilityPrefix(tokens[0].value, ctx) ? tokens[tokens.length - 1] : tokens[0];\n if (!isStructureSafeValue(utilityToken.value)) {\n return { modifiers, utility: null };\n }\n\n // Determine token types and parse in both directions\n if (tokens.length === 1) {\n // utility only\n utility = parseUtility(tokens[0].value, ctx);\n } else if (tokens.length === 2) {\n const firstToken = tokens[0];\n const secondToken = tokens[1];\n const isFirstUtility = isUtilityPrefix(firstToken.value, ctx);\n \n if (isFirstUtility) {\n // utility:modifier form\n utility = parseUtility(firstToken.value, ctx);\n const parsed = parseModifier(secondToken.value);\n if (parsed) modifiers.push(parsed);\n } else {\n // modifier:utility form\n const parsed = parseModifier(firstToken.value);\n if (parsed) modifiers.push(parsed);\n utility = parseUtility(secondToken.value, ctx);\n }\n } else {\n // Multiple tokens\n // Check if the first token is a utility\n const isFirstUtility = isUtilityPrefix(tokens[0].value, ctx);\n \n if (isFirstUtility) {\n // utility:modifier:modifier form\n utility = parseUtility(tokens[0].value, ctx);\n for (let i = 1; i < tokens.length; i++) {\n const parsed = parseModifier(tokens[i].value);\n if (parsed) modifiers.push(parsed);\n }\n } else {\n // modifier:modifier:utility form\n for (let i = 0; i < tokens.length - 1; i++) {\n const parsed = parseModifier(tokens[i].value);\n if (parsed) modifiers.push(parsed);\n }\n utility = parseUtility(tokens[tokens.length - 1].value, ctx);\n }\n }\n return { modifiers, utility };\n}\n\n/**\n * A variant token is pasted into a selector (or at-rule prelude), so it must not be able to end it or add a\n * member to the selector list. Rejects, outside quotes: unbalanced or mismatched ()/[], a quote left open,\n * `{`, `}`, `;`, and a `,` that is not inside parentheses (`:is(a,b)` stays valid, `[&,x]` does not).\n */\n// Variants that paste their whole `[...]` value inside a functional pseudo-class (`:has(…)`, `:not(…)`), so a comma\n// in the value can only ever separate that pseudo-class's arguments, never members of the generated selector list.\nconst FUNCTIONAL_VALUE_VARIANT = /^-?(?:(?:group|peer)-)?(?:has|not)-\\[(.*)\\](?:\\/[\\w-]+)?$/;\n\n/**\n * #221: isSafeVariantValue for a whole variant token, except that has-[…]/not-[…] (optionally group-/peer-) may\n * carry a comma at the top level of their bracket value: those variants wrap the value in `:has()`/`:not()`.\n * The value itself must still be balanced and free of `{`, `}` and `;`, so it cannot close the pseudo-class.\n */\nexport function isSafeVariantToken(value: string): boolean {\n if (hasCommentToken(value)) return false;\n const m = FUNCTIONAL_VALUE_VARIANT.exec(value);\n if (m) return isSafeVariantValue(m[1], true);\n return isSafeVariantValue(value);\n}\n\n/**\n * #224: true when a utility value (or a whole utility token) cannot change the structure of the declaration block it\n * is pasted into. Rejects, outside quotes: `{`, `}`, `;`, unbalanced or mismatched ()/[], and a quote left open.\n * Commas are allowed (values are not selector lists), so this is isSafeVariantValue with top-level commas allowed.\n */\n/**\n * #332: a variant token's bracket groups must be well formed. An empty group (`[]`, as in an empty\n * `has-[]`/`group-has-[]`/`[]` variant) has nothing to select and emits nothing. A token that opens with `[`\n * is one arbitrary variant: its first group must close at the token's last character, so two adjacent groups\n * are never read as a single variant whose inner text is unbalanced. CSS escapes and quoted strings are skipped.\n */\nexport function isWellFormedVariantBrackets(value: string): boolean {\n let quote = '';\n let depth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n if (c === '\"' || c === \"'\") { quote = c; continue; }\n if (c === '[') {\n if (value[i + 1] === ']') return false;\n depth++;\n } else if (c === ']') {\n depth--;\n if (depth === 0 && value.startsWith('[') && i !== value.length - 1) return false;\n }\n }\n return true;\n}\n\n/** #248: a comment opener or closer anywhere in a variant (quoted or not) could leave a comment unclosed in the output. */\nexport function hasCommentToken(value: string): boolean {\n return value.includes('/*') || value.includes('*/');\n}\n\n/**\n * #273: true when an emitted selector or at-rule prelude contains a comment opener or closer outside a CSS escape.\n * Backslash-escape pairs are skipped, so an escaped `\\/` or `\\*` from a class name never counts. Used by the\n * serializer on the final, composed string, where adjacent pieces that were each safe alone can join into one.\n */\nexport function hasCommentDelimiter(text: string): boolean {\n for (let i = 0; i < text.length - 1; i++) {\n const c = text[i];\n if (c === '\\\\') { i++; continue; }\n const n = text[i + 1];\n if ((c === '/' && n === '*') || (c === '*' && n === '/')) return true;\n }\n return false;\n}\n\n/**\n * #332: true when an emitted selector or at-rule prelude has balanced, correctly nested `()`, `[]` and `{}` and\n * no open quote. CSS escapes (backslash pairs) and quoted strings are skipped, so escaped brackets from a class\n * name never count. Top-level commas are allowed (selector lists, `:is(a, b)`). Checked on the final composed\n * string: an unbalanced prelude in concatenated CSS text would swallow the rules that follow it.\n */\nexport function isBalancedPrelude(text: string): boolean {\n const stack: string[] = [];\n let quote = '';\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n switch (c) {\n case '\"': case \"'\": quote = c; break;\n case '(': stack.push(')'); break;\n case '[': stack.push(']'); break;\n case '{': stack.push('}'); break;\n case ')': case ']': case '}':\n if (stack.pop() !== c) return false;\n break;\n }\n }\n return stack.length === 0 && !quote;\n}\n\n/**\n * #323: true when emitted text contains a markup end-tag opener (less-than then slash). Generated CSS can be\n * placed inside an HTML style element, where that sequence could end the element early. CSS escapes in the\n * output never form it, and a lone less-than (range media queries) stays allowed.\n */\nexport function hasHtmlEndTagOpener(text: string): boolean {\n return text.includes('</');\n}\n\nexport function isStructureSafeValue(value: string): boolean {\n // #247 review: a comment opener/closer in any arbitrary value could swallow the rest of the stylesheet.\n if (hasCommentToken(value)) return false;\n return isSafeVariantValue(value, true);\n}\n\n/** An unquoted `@` would start an at-rule token; no declaration value of an arbitrary property needs one. */\nfunction hasUnquotedAt(value: string): boolean {\n let quote = '';\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n if (c === '\"' || c === \"'\") quote = c;\n else if (c === '@') return true;\n }\n return false;\n}\n\nexport function isSafeVariantValue(value: string, allowTopLevelComma = false): boolean {\n const stack: string[] = [];\n let quote = '';\n let parenDepth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') { i++; continue; }\n if (quote) { if (c === quote) quote = ''; continue; }\n switch (c) {\n case '\"': case \"'\": quote = c; break;\n case '(': stack.push(')'); parenDepth++; break;\n case '[': stack.push(']'); break;\n case ')': case ']':\n if (stack.pop() !== c) return false;\n if (c === ')') parenDepth--;\n break;\n case '{': case '}': case ';': return false;\n case ',': if (parenDepth === 0 && !allowTopLevelComma) return false; break;\n }\n }\n return stack.length === 0 && !quote;\n}\n\n/**\n * Parse modifier token\n */\nfunction parseModifier(value: string): ParsedModifier | null {\n let negative = false;\n let modStr = value;\n \n if (modStr.startsWith('-')) {\n negative = true;\n modStr = modStr.slice(1);\n }\n \n // Arbitrary variant support\n if (modStr.startsWith('[') && modStr.endsWith(']')) {\n return { type: modStr, negative, arbitrary: true };\n }\n \n return { type: modStr, negative };\n}\n\nfunction nameSort(a: UtilityRegistration, b: UtilityRegistration): number {\n return b.name.length - a.name.length;\n}\n\n/**\n * Parse utility token\n */\nfunction parseUtility(value: string, ctx?: Context): ParsedUtility {\n // Examples: bg-[red], text-[color:var(--foo)], bg-(--my-bg), -m-4, -bg-[red]\n let prefix = '';\n let utilityValue = '';\n let arbitrary = false;\n let customProperty = false;\n let negative = false;\n let opacity = '';\n let category = '';\n let priority = 0;\n \n // Tailwind arbitrary property: [--cell-size:8px], [mask-type:luminance]\n const prop = /^\\[(--[a-zA-Z_][a-zA-Z0-9_-]*|-?[a-z][a-z-]*):(.+)\\]$/.exec(value);\n if (prop) {\n // Same #224 guard as every other arbitrary value, plus no at-rule token.\n if (!isStructureSafeValue(prop[2]) || hasUnquotedAt(prop[2])) return { prefix: '', value: '' };\n return { prefix: '', value: prop[2], arbitrary: true, property: prop[1] };\n }\n\n if (value.startsWith('-')) {\n negative = true;\n }\n\n // Handle arbitrary values\n if (value.includes('-[')) {\n [prefix, utilityValue] = value.split('-[');\n // Closing bracket position\n const closeIdx = utilityValue.lastIndexOf(']');\n if (closeIdx !== -1 && closeIdx < utilityValue.length - 1 && utilityValue[closeIdx + 1] === '/') {\n // If '/' follows the closing bracket, split opacity\n opacity = utilityValue.slice(closeIdx + 2); // after '/'\n utilityValue = utilityValue.slice(0, closeIdx); // keep inside brackets only\n } else {\n // If ends with ']', no opacity\n utilityValue = utilityValue.replace(/]$/, '');\n }\n arbitrary = true;\n } \n // Handle custom properties\n else if (value.includes('-(')) {\n [prefix, utilityValue] = value.split('-(');\n utilityValue = utilityValue.replace(/\\)$/, '');\n customProperty = true;\n } \n // Handle regular utilities\n else {\n const sortedUtilities = [...getUtility(ctx)].sort(nameSort);\n \n let matchedUtility = sortedUtilities.find(p => value === p.name);\n if (matchedUtility) {\n prefix = matchedUtility.name;\n utilityValue = \"\";\n negative = value.startsWith('-');\n category = matchedUtility.category!;\n priority = matchedUtility.priority!;\n } else {\n if (value.startsWith('-')) {\n negative = true;\n value = value.slice(1);\n }\n \n matchedUtility = sortedUtilities.find(p => value.startsWith(p.name + '-'));\n if (matchedUtility) {\n prefix = matchedUtility.name;\n utilityValue = value.slice(matchedUtility.name.length + 1);\n category = matchedUtility.category!;\n priority = matchedUtility.priority!;\n } else {\n const parts = value.split('-');\n prefix = parts[0];\n utilityValue = parts.slice(1).join('-');\n }\n }\n }\n \n return {\n prefix,\n value: utilityValue,\n arbitrary: !!arbitrary,\n customProperty: !!customProperty,\n negative: !!negative,\n opacity,\n category,\n priority,\n };\n}\n","import { debugWarn } from \"../utils/debug\";\nimport { type AstNode } from \"./ast\";\nimport { escapeClassName } from \"./registry\";\nimport { isStructureSafeValue, hasCommentDelimiter, hasHtmlEndTagOpener, isBalancedPrelude } from \"./parser\";\n\n// #273: a selector or at-rule prelude that contains a comment delimiter is never emitted (with its whole subtree).\n// #323: nor one carrying a markup end-tag opener (hasHtmlEndTagOpener).\n// #332: nor one whose brackets, parens or braces do not balance and close (isBalancedPrelude).\n// #335: nor one carrying an unescaped `url(` (a selector or at-rule prelude never loads a resource).\nconst isSafePrelude = (text: unknown): boolean => {\n const t = String(text ?? \"\");\n return !hasCommentDelimiter(t) && !hasHtmlEndTagOpener(t) && isBalancedPrelude(t) && !/url\\s*\\(/i.test(t);\n};\n\n// #335: @property blocks merged from several classes carry each descriptor once (first wins).\nconst uniqueDescriptors = (node: AstNode): AstNode[] => {\n if (node.type !== \"at-rule\") return [];\n if (node.name !== \"property\") return node.nodes;\n const seen = new Set<string>();\n return node.nodes.filter((c) => c.type !== \"decl\" || (!seen.has(c.prop) && !!seen.add(c.prop)));\n};\n\n// #224 defensive layer: a declaration whose property or value could end or open a block is dropped.\nconst isSafeDecl = (prop: unknown, value: unknown): boolean =>\n isStructureSafeValue(String(prop)) && isStructureSafeValue(String(value ?? \"\")) &&\n !hasHtmlEndTagOpener(String(prop)) && !hasHtmlEndTagOpener(String(value ?? \"\"));\n\nconst importantPrefix = \"!important\";\n\n/**\n * Converts AST nodes to CSS string\n * @param ast { AstNode[] } - Array of AST nodes to convert\n * @param baseSelector { string } - Base selector for nested rules (e.g., \".parent\" for \".parent .child\")\n * @param opts { minify?: boolean } - Options for CSS generation\n * @param _indent { string } - Current indentation level for pretty formatting\n */\nfunction astToCss(\n ast: AstNode[],\n baseSelector?: string,\n opts?: { minify?: boolean, important?: boolean },\n _indent = \"\"\n): string {\n const minify = opts?.minify;\n const indent = _indent;\n const nextIndent = _indent + \" \"; // Next-level indentation: current + 2 spaces\n const important = opts?.important ?? false;\n const importantString = important ? ` ${importantPrefix}` : \"\";\n // Note: Caching is handled at a higher level (IncrementalParser); omit here\n\n // Debug logging for empty AST\n if (!ast || ast.length === 0) {\n debugWarn('[astToCss] Empty AST received:', { ast, baseSelector, minify });\n return '';\n }\n\n // Deduplication logic: remove duplicates only among CSS property declarations (decl)\n // \n // How it works:\n // 1. Iterate in reverse (the last defined property wins)\n // 2. Only check duplicates for decl nodes (skip rule/at-rule)\n // 3. Consider duplicates by property name (prop)\n // \n // Current limitations:\n // - Does not dedupe rule or at-rule nodes\n // - When background.ts returns @supports + decl together, dedupe may not apply\n // - This can yield duplicate CSS rules in output\n const dedupedAst = [];\n if (Array.isArray(ast)) {\n const seenProps = new Map(); // Tracks property names already seen\n \n // Reverse iteration: keep the last defined property\n // Example: [color: red, color: blue] → keep only [color: blue]\n for (let i = ast.length - 1; i >= 0; i--) {\n const node = ast[i];\n \n if (node.type === \"decl\") {\n // Handle CSS property declaration nodes\n // node.important is not present; handle safely\n const key = node.prop; // Property name (e.g., \"color\", \"background-color\")\n \n // Skip duplicate properties\n if (seenProps.has(key)) {\n continue;\n }\n \n // Record new property\n seenProps.set(key, true);\n }\n \n // Add node to result (use unshift to preserve original order)\n dedupedAst.unshift(node);\n }\n }\n\n // Generate CSS string from deduped AST\n const result = dedupedAst\n .map((node) => {\n switch (node.type) {\n case \"decl\": {\n // Handle CSS property declaration (e.g., color: red;)\n const value = node.value;\n if (!isSafeDecl(node.prop, value)) return \"\";\n // node.important is absent; ignore\n if (node.prop.startsWith(\"--\")) {\n // Handle CSS custom property (e.g., --primary-color: #007bff;)\n if (minify) {\n const css = `${node.prop}: ${value}${importantString};`;\n // console.log(\"[astToCss] decl custom property minify\", css);\n return css;\n } else {\n const css = `${indent}${node.prop}: ${value}${importantString};`;\n // console.log(\"[astToCss] decl custom property pretty\", css);\n return css;\n }\n } else {\n const localIndent = minify ? \"\" : indent;\n const css = `${localIndent}${node.prop}: ${value}${importantString};`;\n return css;\n }\n }\n case \"rule\": {\n // Handle nested rule (e.g., .parent .child { ... })\n // \n // baseSelector handling logic:\n // 1. If baseSelector exists: combine to form \".parent .child\"\n // 2. If no baseSelector: keep as standalone \".child\"\n // 3. Replace '&' with baseSelector\n // 4. Pseudo selectors (e.g., :hover) append after baseSelector\n let selector = node.selector;\n \n if (baseSelector) {\n // When baseSelector exists: create nested rule\n const escBase = \".\" + escapeClassName(baseSelector); // Convert baseSelector to class form\n \n if (selector && selector.includes(\"&\")) {\n // Replace '&' with baseSelector\n // Example: \"&:hover\" → \".parent:hover\"\n selector = selector.replace(/&/g, escBase);\n } else if (!selector.startsWith(escBase)) {\n // If it does not start with baseSelector: prepend it\n selector = selector\n .split(\",\") // Handle multiple selectors separated by comma\n .map((sel) => {\n sel = sel.trim();\n \n if (sel.startsWith(\":\") || sel.startsWith(\"::\")) {\n // Pseudo selector: append directly after baseSelector\n // Example: \":hover\" → \".parent:hover\"\n return escBase + sel;\n } else {\n // Normal selector: separate with space from baseSelector\n // Example: \".child\" → \".parent .child\"\n return escBase + (sel.startsWith(\".\") ? \"\" : \" \") + sel;\n }\n })\n .join(\", \");\n }\n }\n \n if (!isSafePrelude(selector)) return \"\";\n // Create CSS rule\n if (minify) {\n const css = `${indent}${selector}{${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] rule minify\", css);\n return css;\n } else {\n const css = `${indent}${selector} {\\n${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] rule pretty\", css);\n return css;\n }\n }\n case \"style-rule\": {\n // Handle style-rule: top-level rule with complete selector\n // \n // baseSelector handling:\n // - Currently: pass baseSelector as-is\n // - Caveat: nested rules may not handle baseSelector correctly\n // - Example: .bg-white/60 { .nested { ... } } → .bg-white/60 .nested { ... }\n if (!isSafePrelude(node.selector)) return \"\";\n if (minify) {\n const css = `${indent}${node.selector} {${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] style-rule minify\", css);\n return css;\n } else {\n const css = `${indent}${node.selector} {\\n${astToCss(\n node.nodes, // Recursively process child nodes\n baseSelector, // Pass baseSelector (used in nested rules)\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] style-rule pretty\", css, JSON.stringify(node, null, 2));\n return css;\n }\n }\n case \"at-rule\": {\n // Handle at-rule: @media, @supports, etc.\n // \n // baseSelector handling:\n // - Pass baseSelector to inner nodes of the at-rule\n // - Ensure nested rules get correct selectors\n // - Example: @media (min-width: 768px) { .parent .child { ... } }\n if (!isSafePrelude(node.name) || !isSafePrelude(node.params)) return \"\";\n if (minify) {\n const css = `${indent}@${node.name} ${node.params}{${astToCss(\n node.nodes, // Recursively process inner nodes of the at-rule\n baseSelector, // Always propagate baseSelector so '&' resolves inside at-rules\n opts,\n nextIndent\n )}}`;\n // console.log(\"[astToCss] at-rule minify\", css);\n return css;\n } else {\n const css = `${indent}@${node.name} ${node.params} {\\n${astToCss(\n node.nodes, // Recursively process inner nodes of the at-rule\n baseSelector, // Always propagate baseSelector so '&' resolves inside at-rules\n opts,\n nextIndent\n )}${indent}}`;\n // console.log(\"[astToCss] at-rule pretty\", css);\n return css;\n }\n }\n case \"comment\":\n // Handle CSS comments (removed in minify mode)\n return minify ? \"\" : `${indent}/* ${node.text} */`;\n case \"raw\":\n // Handle raw CSS code (output as-is)\n return `${indent}${node.value}`;\n default:\n debugWarn('[astToCss] Unknown node type:', node);\n return \"\";\n }\n })\n .filter(Boolean) // Remove empty strings\n .join(minify ? \"\" : \"\\n\"); // Join nodes (minify: no whitespace, pretty: newlines)\n\n // Add trailing newline for consistency with expected format\n const finalResult = result + (minify ? \"\" : \"\\n\");\n \n // Debug logging for empty result\n if (!finalResult || finalResult.trim() === '') {\n debugWarn('[astToCss] Empty result generated:', { \n ast, \n baseSelector, \n minify, \n result, \n finalResult,\n dedupedAst \n });\n }\n \n return finalResult;\n}\n\nfunction rootToCss(nodes: AstNode[], opts?: { minify?: boolean }): string {\n const minify = opts?.minify === true;\n const result = nodes\n .map((node) => {\n const list: string[] = [];\n\n if (node.type === \"decl\") {\n if (isSafeDecl(node.prop, node.value)) {\n list.push(minify ? `${node.prop}:${node.value};` : `${node.prop}: ${node.value};`);\n }\n } else if (node.type === \"at-rule\" && isSafePrelude(node.name) && isSafePrelude(node.params)) {\n if (minify) {\n const body = uniqueDescriptors(node)\n .filter((child) => child.type === \"decl\" && isSafeDecl(child.prop, child.value))\n .map((child) => child.type === \"decl\" ? `${child.prop}:${child.value};` : \"\")\n .join(\"\");\n list.push(`@${node.name} ${node.params}{${body}}`);\n } else {\n list.push(`@${node.name} ${node.params} {\n${uniqueDescriptors(node).map((node) => {\n if (node.type === \"decl\" && isSafeDecl(node.prop, node.value)) {\n return `\\t${node.prop}: ${node.value};`;\n }\n})\n.join(\"\\n\")}\n}`\n );\n }\n }\n\n return list.join(minify ? \"\" : \"\\n\");\n })\n .join(minify ? \"\" : \"\\n\");\n\n return result;\n}\n\nexport { astToCss, rootToCss };\n","// Collection of converters from theme categories to CSS variables (v4 style)\n// Each function takes a category theme object and returns Record<string, string>\n// Namespace/naming rules aligned with v4\n\nimport type { Context, Theme } from './context';\nimport { isStructureSafeValue, hasCommentDelimiter, hasHtmlEndTagOpener } from './parser';\n\n// Global CSS variable prefix helper\nlet CSS_VAR_PREFIX = '--bcss-';\n\nfunction normalizePrefix(prefix: string): string {\n let p = prefix.trim();\n if (!p.startsWith('--')) p = `--${p}`;\n if (!p.endsWith('-')) p = `${p}-`;\n return p;\n}\n\nexport function setVarPrefix(prefix: string | undefined): void {\n if (typeof prefix !== 'string' || prefix.trim() === '') {\n CSS_VAR_PREFIX = '--bcss-';\n return;\n }\n CSS_VAR_PREFIX = normalizePrefix(prefix);\n}\n\nexport function getVarName(key: string, ctx?: Context): string {\n const configured = ctx?.config('cssVarPrefix');\n const prefix = typeof configured === 'string' && configured.trim()\n ? normalizePrefix(configured)\n : ctx ? '--bcss-' : CSS_VAR_PREFIX;\n return `${prefix}${key}`;\n}\n\n// Aliases for brevity\nexport const varName = getVarName;\nexport function v(key: string, ctx?: Context): string { return getVarName(key, ctx); }\n\nfunction escapeKey(key: string): string {\n return key.replace('.', '\\\\.');\n}\n\n/**\n * colors: { blue: { 500: '#123456' }, red: { 500: '#ff0000' } }\n * → { '--color-blue-500': '#123456', '--color-red-500': '#ff0000' }\n */\nexport function colorsToCssVars(colors?: Record<string, unknown>): Record<string, string> {\n if (!colors) return {};\n const result: Record<string, string> = {};\n function walk(obj: Record<string, unknown>, prefix: string[] = []) {\n for (const key in obj) {\n const value = obj[key] as unknown;\n if (typeof value === 'object' && value !== null) {\n walk(value as Record<string, unknown>, [...prefix, key]);\n } else {\n const varName = '--color-' + [...prefix, key].join('-');\n result[varName] = value as string;\n }\n }\n }\n walk(colors);\n return result;\n}\n\n/**\n * boxShadow: { lg: '0 10px 15px ...', ... }\n * → { '--shadow-lg': '...' }\n */\nexport function boxShadowToCssVars(boxShadow?: Record<string, unknown>): Record<string, string> {\n if (!boxShadow) return {};\n const result: Record<string, string> = {};\n for (const key in boxShadow) {\n result[`--shadow-${key}`] = boxShadow[key] as string;\n }\n return result;\n}\n\n/**\n * fontSize: { xs: ['0.75rem', '1rem'], ... }\n * → { '--text-xs': '0.75rem', '--text-xs--line-height': '1rem' }\n */\n/** The line height of a fontSize tuple: `['4rem', '1.1']` or Tailwind's `['4rem', { lineHeight: '1.1' }]` (#300). */\nexport function fontSizeLineHeight(value: unknown): string | undefined {\n if (!Array.isArray(value)) return undefined;\n const second = value[1] as unknown;\n if (typeof second === 'string' || typeof second === 'number') return String(second);\n const lh = (second as { lineHeight?: unknown } | undefined)?.lineHeight;\n return lh == null ? undefined : String(lh);\n}\n\nexport function fontSizeToCssVars(fontSize?: Record<string, unknown>): Record<string, string> {\n if (!fontSize) return {};\n const result: Record<string, string> = {};\n for (const key in fontSize) {\n const value = fontSize[key] as unknown;\n if (Array.isArray(value)) {\n result[`--text-${key}`] = value[0] as string;\n const lineHeight = fontSizeLineHeight(value);\n if (lineHeight) result[`--text-${key}--line-height`] = lineHeight;\n } else {\n result[`--text-${key}`] = value as string;\n }\n }\n // console.log('[fontSizeToCssVars] result', result);\n return result;\n}\n\n/**\n * fontWeight: { normal: '400', ... }\n * → { '--font-weight-normal': '400' }\n */\nexport function fontWeightToCssVars(fontWeight?: Record<string, unknown>): Record<string, string> {\n if (!fontWeight) return {};\n const result: Record<string, string> = {};\n for (const key in fontWeight) {\n result[`--font-weight-${key}`] = fontWeight[key] as string;\n }\n return result;\n}\n\n/**\n * fontFamily: { sans: ['ui-sans-serif', ...], ... }\n * → { '--font-sans-0': 'ui-sans-serif', ... }\n */\nexport function fontFamilyToCssVars(fontFamily?: Record<string, unknown>): Record<string, string> {\n if (!fontFamily) return {};\n const result: Record<string, string> = {};\n for (const key in fontFamily) {\n const value = fontFamily[key] as unknown;\n if (Array.isArray(value)) {\n result[`--font-${key}`] = value.join(', ');\n } else {\n result[`--font-${key}`] = value as string;\n }\n }\n return result;\n}\n\n/**\n * letterSpacing: { tight: '0.05em', ... }\n * → { '--letter-spacing-tight': '0.05em' }\n */\nexport function letterSpacingToCssVars(letterSpacing?: Record<string, unknown>): Record<string, string> {\n if (!letterSpacing) return {};\n const result: Record<string, string> = {};\n for (const key in letterSpacing) {\n result[`--letter-spacing-${key}`] = letterSpacing[key] as string;\n }\n return result;\n}\n\n/**\n * spacing: { 0: '0px', 1: '0.25rem', ... }\n * → { '--spacing-0': '0px', '--spacing-1': '0.25rem', ... }\n */\nexport function spacingToCssVars(spacing?: Record<string, unknown>): Record<string, string> {\n if (!spacing) return {};\n const result: Record<string, string> = {};\n for (const key in spacing) {\n result[`--spacing-${escapeKey(key)}`] = spacing[key] as string;\n }\n return result;\n}\n\n/**\n * borderRadius: { xl: '0.75rem', ... }\n * → { '--radius-xl': '0.75rem' }\n */\nexport function borderRadiusToCssVars(borderRadius?: Record<string, unknown>): Record<string, string> {\n if (!borderRadius) return {};\n const result: Record<string, string> = {};\n for (const key in borderRadius) {\n result[`--radius-${escapeKey(key)}`] = borderRadius[key] as string;\n }\n return result;\n}\n\n/**\n * zIndex: { 10: '10', ... }\n * → { '--z-10': '10' }\n */\nexport function zIndexToCssVars(zIndex?: Record<string, unknown>): Record<string, string> {\n if (!zIndex) return {};\n const result: Record<string, string> = {};\n for (const key in zIndex) {\n result[`--z-${escapeKey(key)}`] = String(zIndex[key] as number);\n }\n return result;\n}\n\n/**\n * opacity: { 50: '0.5', ... }\n * → { '--opacity-50': '0.5' }\n */\nexport function opacityToCssVars(opacity?: Record<string, unknown>): Record<string, string> {\n if (!opacity) return {};\n const result: Record<string, string> = {};\n for (const key in opacity) {\n result[`--opacity-${escapeKey(key)}`] = String(opacity[key] as number);\n }\n return result;\n}\n\n/**\n * animations: { spin: 'spin 1s linear infinite', ... }\n * → { '--animate-spin': 'spin 1s linear infinite' }\n */\nexport function animationToCssVars(animations?: Record<string, unknown>): Record<string, string> {\n if (!animations) return {};\n const result: Record<string, string> = {};\n for (const key in animations) {\n result[`--animate-${escapeKey(key)}`] = animations[key] as string;\n }\n return result;\n}\n\n/**\n * keyframes: { spin: { 'to': { transform: 'rotate(360deg)' } }, ... }\n * → Requires separate @keyframes block generation (variable conversion omitted here)\n */\nexport function keyframesToCss(keyframes?: Record<string, unknown>): string {\n if (!keyframes) return '';\n let css = '';\n for (const name in keyframes) {\n const frames = keyframes[name] as unknown;\n css += `@keyframes ${name} {\\n`;\n for (const step in frames as Record<string, unknown>) {\n css += ` ${step} {`;\n const props = (frames as Record<string, unknown>)[step] as Record<string, unknown>;\n for (const prop in props) {\n css += ` ${prop}: ${props[prop] as string};`;\n }\n css += ' }\\n';\n }\n css += '}\\n';\n }\n return css;\n}\n\nconst COMMENT_OR_BLOCK = /\\/\\*|\\*\\/|[{};]|<\\//; // #323: also a markup end-tag opener\n\n/** #274: one `@keyframes` block in Tailwind's layout, or '' when a name/step/declaration could break out of it (#273). */\nexport function keyframesBlock(name: string, frames: unknown): string {\n if (!name || COMMENT_OR_BLOCK.test(name) || /\\s/.test(name) || !frames || typeof frames !== 'object') return '';\n let body = '';\n for (const [step, props] of Object.entries(frames as Record<string, unknown>)) {\n if (COMMENT_OR_BLOCK.test(step) || !props || typeof props !== 'object') return '';\n let decls = '';\n for (const [prop, value] of Object.entries(props as Record<string, unknown>)) {\n const v = String(value);\n if (COMMENT_OR_BLOCK.test(prop) || COMMENT_OR_BLOCK.test(v)) return '';\n decls += ` ${prop}: ${v};\\n`;\n }\n body += ` ${step} {\\n${decls} }\\n`;\n }\n return `@keyframes ${name} {\\n${body}}`;\n}\n\n/**\n * #274: the `@keyframes` blocks generated CSS needs: every theme keyframes name that an `animation` /\n * `animation-name` declaration mentions, directly or through a theme `var(--animate-*)`.\n */\nexport function referencedKeyframes(css: string, ctx: Context): string[] {\n if (!css.includes('animation')) return [];\n const all = ctx.theme('keyframes') as Record<string, unknown> | undefined;\n if (!all || typeof all !== 'object') return [];\n const names = new Set<string>();\n for (const m of css.matchAll(/(?:^|[\\s;{])animation(?:-name)?\\s*:\\s*([^;}]+)/g)) {\n const value = m[1].replace(/var\\(--animate-([\\w-]+)\\)/g, (whole, key: string) => {\n const v = ctx.theme('animations', key) ?? ctx.theme('animation', key);\n return typeof v === 'string' ? v : whole;\n });\n for (const word of value.split(/[\\s,()]+/)) {\n if (word && Object.prototype.hasOwnProperty.call(all, word)) names.add(word);\n }\n }\n return [...names].map((n) => keyframesBlock(n, all[n])).filter(Boolean);\n}\n\n/**\n * transition: { duration: '150ms', ... }\n * → { '--transition-duration': '150ms' }\n */\nexport function transitionTimingFunctionToCssVars(transition: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in transition) {\n\n if (key === 'DEFAULT') {\n result[`--default-transition-timing-function`] = transition[key];\n } else {\n result[`--transition-timing-function-${escapeKey(key)}`] = transition[key];\n // Tailwind v4 names: --ease-in / --ease-out / --ease-in-out (ease-linear uses a literal `linear`).\n if (key !== 'linear') result[`--ease-${escapeKey(key)}`] = transition[key];\n }\n }\n return result;\n}\n\n/**\n * transitionDuration: { DEFAULT: '150ms', ... }\n * → { '--default-transition-duration': '150ms' }\n */\nexport function transitionDurationToCssVars(transitionDuration: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in transitionDuration) {\n if (key === 'DEFAULT') {\n result[`--default-transition-duration`] = transitionDuration[key];\n } else {\n result[`--transition-duration-${escapeKey(key)}`] = transitionDuration[key];\n }\n }\n return result;\n}\n\n\n/**\n * transitionDelay: { DEFAULT: '0ms', ... }\n * → { '--default-transition-delay': '0ms' }\n */\nexport function transitionDelayToCssVars(transitionDelay: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const key in transitionDelay) {\n if (key === 'DEFAULT') {\n result[`--default-transition-delay`] = transitionDelay[key];\n } else {\n result[`--transition-delay-${escapeKey(key)}`] = transitionDelay[key];\n }\n } \n return result;\n}\n\n/**\n * blur: { DEFAULT: '0px', ... }\n * → { '--default-blur': '0px' }\n */\nexport function blurToCssVars(blur: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in blur) {\n if (key === 'DEFAULT') {\n result[`--default-blur`] = blur[key];\n } else {\n result[`--blur-${escapeKey(key)}`] = blur[key];\n }\n }\n return result;\n}\n\n/**\n * container: { 1: '1rem', ... }\n * → { '--container-1': '1rem' }\n */\nexport function containerToCssVars(container: Record<string, string>): Record<string, string> {\n const result: Record<string, string> = {};\n for (const key in container) {\n result[`--container-${escapeKey(key)}`] = container[key];\n }\n return result;\n}\n\n/**\n * themeToCssVarsAll: merge CSS variables from major theme categories\n */\nexport function themeToCssVarsAll(theme: Theme): Record<string, string> {\n return {\n ...colorsToCssVars(theme.colors! as Record<string, unknown>),\n ...boxShadowToCssVars(theme.boxShadow! as Record<string, unknown>),\n ...fontSizeToCssVars(theme.fontSize! as Record<string, unknown>),\n ...fontWeightToCssVars(theme.fontWeight! as Record<string, unknown>),\n ...fontFamilyToCssVars(theme.fontFamily! as Record<string, unknown>),\n ...letterSpacingToCssVars(theme.letterSpacing! as Record<string, unknown>),\n '--spacing': (theme.spacing! as Record<string, unknown>)['1'] as string,\n ...spacingToCssVars(theme.spacing! as Record<string, unknown>),\n ...containerToCssVars(theme.container! as Record<string, string>),\n ...borderRadiusToCssVars(theme.borderRadius! as Record<string, unknown>),\n ...zIndexToCssVars(theme.zIndex! as Record<string, unknown>),\n ...opacityToCssVars(theme.opacity! as Record<string, unknown>),\n ...animationToCssVars({ ...(theme.animations as Record<string, unknown>), ...(theme.animation as Record<string, unknown>) }),\n ...transitionTimingFunctionToCssVars(theme.transitionTimingFunction! as Record<string, string>),\n ...transitionDurationToCssVars(theme.transitionDuration! as Record<string, string>),\n ...transitionDelayToCssVars(theme.transitionDelay! as Record<string, string>),\n ...blurToCssVars(theme.blur! as Record<string, string>),\n ...Object.fromEntries(Object.entries((theme.textShadow ?? {}) as Record<string, string>).map(([k, v]) => [`--text-shadow-${escapeKey(k)}`, v])),\n ...Object.fromEntries(Object.entries((theme.dropShadow ?? {}) as Record<string, string>).map(([k, v]) => [`--drop-shadow-${escapeKey(k)}`, v])),\n ...Object.fromEntries(Object.entries((theme.aspect ?? {}) as Record<string, string>).map(([k, v]) => [`--aspect-${escapeKey(k)}`, v])),\n // keyframes handled separately\n };\n}\n\n/**\n * #260: a theme value that points at its own variable (`--color-brand-600: var(--color-brand-600)`,\n * optionally with a fallback) is cyclic. Emitting it on :root would override the site's own definition\n * with an invalid value, so the root var is skipped; utilities still reference the var.\n */\nexport function isSelfReferencingVar(name: string, value: unknown): boolean {\n if (typeof value !== 'string') return false;\n const m = /^var\\(\\s*(--[\\w-]+)\\s*(?:,[\\s\\S]*)?\\)$/.exec(value.trim());\n return !!m && m[1] === name.trim();\n}\n\n/**\n * toCssVarsBlock: convert Record<string, string> → :root { ... } CSS block string\n */\n// #323: a custom-property name is `--` plus word characters and hyphens; `\\.` is the only escape the\n// theme converters produce (fractional spacing keys).\nconst SAFE_VAR_NAME = /^--(?:[\\w-]|\\\\\\.)+$/;\n\n/**\n * #323: true when one theme variable can be printed as `name: value;` inside the :root block without\n * changing the block's structure. Theme config may come from an untrusted source, so a name must be a plain\n * custom-property ident and a value must be structure-safe and comment-free.\n */\nexport function isSafeThemeVar(name: unknown, value: unknown): boolean {\n if (typeof name !== 'string' || !SAFE_VAR_NAME.test(name) || hasHtmlEndTagOpener(name)) return false;\n if (typeof value !== 'string' && typeof value !== 'number') return false;\n const v = String(value);\n return v.trim() !== '' && isStructureSafeValue(v) && !hasCommentDelimiter(v) && !hasHtmlEndTagOpener(v);\n}\n\nexport function toCssVarsBlock(vars: Record<string, string>, extra: string = ''): string {\n return ':root,:host {\\n' + Object.entries(vars).filter(([k, v]) => isSafeThemeVar(k, v) && !isSelfReferencingVar(k, v)).map(([k, v]) => ` ${k}: ${v};`).join('\\n') + '\\n}\\n' + extra + '\\n';\n}\n\n// Presets write their internal composite variables as `--baro-*` (--baro-shadow, --baro-ring-shadow,\n// --baro-translate-x, --baro-border-style, ...). A configured `cssVarPrefix` renames them in the generated\n// AST, so a runtime next to a Tailwind build can set `cssVarPrefix: 'tw'` and compose with the build's\n// `--tw-*` composites (#222). Unset, empty or 'baro' leaves the output untouched.\nconst BARO_VAR = /--baro-/g;\nconst PREFIXED_KEYS = new Set(['prop', 'value', 'params', 'selector', 'nodes', 'items']);\n\nexport function applyVarPrefix<T>(ast: T, ctx?: Context): T {\n const configured = ctx?.config('cssVarPrefix');\n if (typeof configured !== 'string' || !configured.trim()) return ast;\n const prefix = normalizePrefix(configured);\n if (prefix === '--baro-') return ast;\n const walk = (node: unknown): unknown => {\n if (typeof node === 'string') return node.includes('--baro-') ? node.replace(BARO_VAR, prefix) : node;\n if (Array.isArray(node)) return node.map(walk);\n if (!node || typeof node !== 'object') return node;\n const out: Record<string, unknown> = {};\n for (const [k, val] of Object.entries(node)) out[k] = PREFIXED_KEYS.has(k) ? walk(val) : val;\n return out;\n };\n return walk(ast) as T;\n}\n","import { debugLog, debugWarn } from \"../utils/debug\";\nimport { HasItems, HasName, HasParams, HasSelector, type AstNode, type HasNodes } from \"./ast\";\nimport { parseClassName } from \"./parser\";\nimport { astCache, parseResultCache } from \"../utils/cache\";\nimport { getUtility, getModifier, arbitraryPropertyRegistration } from \"./registry\";\nimport { Context } from \"./context\";\nimport { astToCss, rootToCss } from \"./astToCss\";\nimport { clearAllCaches } from \"../utils/cache\";\nimport { clearContextCaches, getContextState } from './contextState';\nimport { applyVarPrefix, referencedKeyframes } from \"./cssVars\";\n\n// Failure cache for invalid class names\nconst failureCache = new Set<string>();\n\n/**\n * decl-to-root path collection function (reused in normalizeAstOrder, etc.)\n */\nexport type PathNode = Partial<AstNode>;\nexport type DeclPath = PathNode[];\n\n/**\n * collectDeclPaths\n * Collects all paths from AST tree to decl(leaf) (including variant chains).\n * - Input: AST node array\n * - Output: decl-to-root path(variant chain) array\n * - Usage: Used for path extraction for AST optimization/merging in optimizeAst, declPathToAst, etc.\n *\n * @param nodes AstNode[] - AST tree\n * @param path PathNode[] - Recursive use (initial value omitted)\n * @returns DeclPath[] - Array of paths to decl (variant chains)\n */\nexport function collectDeclPaths(\n nodes: AstNode[] = [],\n path: PathNode[] = []\n): DeclPath[] {\n let result: DeclPath[] = [];\n for (const node of nodes) {\n const curr = { ...node} as HasNodes;\n delete curr.nodes;\n\n const nodes = (node as HasNodes).nodes;\n if (node.type === \"decl\") {\n result.push([...path, curr]);\n } else if (nodes && nodes.length > 0) {\n result = result.concat(\n collectDeclPaths(nodes, [...path, curr])\n );\n }\n }\n return result;\n}\n\n// Sort criteria: at-rule > style-rule > rule > decl, depth first, sibling order preserved\nfunction getPriority(type: string): number {\n if (type === \"at-root\") return -1;\n if (type === \"at-rule\") return 0;\n if (type === \"style-rule\") return 10;\n if (type === \"rule\") return 20;\n return 30; // decl\n}\n\nconst sourcePriority: Record<string, number> = {\n media: 0, // @media\n supports: 1, // @supports\n container: 2, // @container\n responsive: 10, // sm:, md: etc.\n group: 20, // .group:hover &\n peer: 30, // .peer:focus ~ &\n dark: 40, // dark:\n universal: 50, // :is(), :where()\n data: 60, // [data-state=...]\n aria: 70, // [aria-pressed=...]\n attribute: 80, // [type=...]\n pseudo: 90, // :hover, :focus\n base: 100, // &\n starting: 110, // (root)\n};\n\nfunction getRulePriority(rule: Partial<AstNode>): number {\n return sourcePriority[rule.source || \"base\"] || 100;\n}\n\nconst mergeSelectorsBySource = (source: string, nodes: Partial<AstNode>[]) => {\n if (source === \"pseudo\") {\n // Inside → outside (reduce)\n return nodes.reduce((acc, sel) => {\n const selector = (sel as HasSelector).selector as string;\n if (acc === \"\") return selector;\n if (selector?.includes(\"&\")) return selector.replace(/&/, acc);\n return selector + \" \" + acc;\n }, \"\");\n } else {\n // Outside → inside (reduceRight)\n return nodes.reduceRight((acc, sel) => {\n const selector = (sel as HasSelector).selector as string;\n if (acc === \"\") return selector;\n if (selector?.includes(\"&\")) return selector.replace(/&/, acc);\n return selector + \" \" + acc;\n }, \"\");\n }\n};\n\n/**\n * declPathToAst\n * Converts decl-to-root path(variant chain) to actual nested AST.\n * - Input: DeclPath(variant chain)\n * - Output: Nested AstNode[]\n * - Consecutive same variants (same key) are merged, nested in outside→inside order\n *\n * @param declPath DeclPath\n * @returns AstNode[]\n */\nexport function declPathToAst(declPath: DeclPath): AstNode[] {\n if (!declPath || declPath.length === 0) return [];\n // Log type/selector/source for each node in declPath\n // 1. Separate decl (leaf) and variant chain\n const variants = declPath.slice(0, -1);\n const decl = declPath[declPath.length - 1];\n\n // 2. Keep existing sort/merge (hoist) logic\n const sortedVariants = [...variants].sort(\n (a, b) => getPriority(a.type!) - getPriority(b.type!)\n );\n\n // Add default rule handling for decl\n // 1. If first element is decl, add rule('&', [decl])\n // 2. If rule lacks '&' while child is decl, add current rule and rule('&', [decl])\n if (sortedVariants.length === 0) {\n if (decl.type === \"decl\") {\n // If first element is decl, add rule('&', [decl])\n sortedVariants.push({\n type: \"rule\",\n selector: \"&\",\n source: \"base\",\n });\n }\n } else {\n const last = sortedVariants[sortedVariants.length - 1];\n if (\n (last.type == \"at-rule\" && last.name !== \"property\") ||\n last.type == \"style-rule\" ||\n (last.type === \"rule\" && last.selector?.includes(\"&\") === false)\n ) {\n // console.log(\"[declPathToAst] add rule\", last);\n sortedVariants.push({\n type: \"rule\",\n selector: \"&\",\n source: \"base\",\n });\n }\n }\n\n const mergedVariants: typeof sortedVariants = [];\n for (const v of sortedVariants) {\n if (mergedVariants.length === 0) {\n mergedVariants.push(v);\n } else {\n const prev = mergedVariants[mergedVariants.length - 1];\n const isSame =\n v.type === prev.type &&\n ((v.type === \"at-rule\" &&\n prev.type === \"at-rule\" &&\n v.name === prev.name &&\n v.params === prev.params) ||\n ((v.type === \"rule\" || v.type === \"style-rule\") &&\n v.selector === (prev as HasSelector).selector));\n if (!isSame) {\n mergedVariants.push(v);\n }\n // else: skip(merge)\n }\n }\n // 3. Gather only rule nodes (consecutive rules only)\n const ruleSelectors: Partial<AstNode>[] = [];\n const nonRuleVariants: Partial<AstNode>[] = [];\n for (const v of mergedVariants) {\n if (v.type === \"rule\") ruleSelectors.push(v);\n else nonRuleVariants.push(v);\n }\n\n // 5. Compose selector and create a single rule\n let node: Partial<AstNode> = { ...decl };\n const sortedRuleSelectors = [...ruleSelectors].sort(\n (a, b) => getRulePriority(a) - getRulePriority(b)\n );\n if (sortedRuleSelectors.length > 0) {\n const grouped = sortedRuleSelectors.reduce((acc, rule) => {\n const key = rule.source || \"base\";\n if (!acc[key]) acc[key] = [];\n acc[key].push(rule);\n return acc;\n }, {} as Record<string, Partial<AstNode>[]>);\n // Detailed grouped log\n\n // 1. Sort by sourcePriority\n const mergedBySource = Object.entries(grouped)\n .sort(\n ([a], [b]) => (sourcePriority[a] ?? 999) - (sourcePriority[b] ?? 999)\n )\n .map(([source, nodes]) => {\n const merged = mergeSelectorsBySource(source, nodes);\n return merged;\n });\n\n // 2. Reduce from outside→inside (pseudo is always innermost)\n let acc = \"\";\n for (let i = 0; i < mergedBySource.length; i++) {\n const sel = mergedBySource[i];\n if (acc === \"\") acc = sel;\n else if (sel.includes(\"&\")) acc = sel.replace(/&/, acc);\n else acc = sel + \" \" + acc;\n }\n const finalSelector = acc;\n node = { type: \"rule\", selector: finalSelector, nodes: [node as AstNode] };\n }\n\n // 6. Nest remaining variants (e.g., at-rule) outside\n for (let i = nonRuleVariants.length - 1; i >= 0; i--) {\n node = { ...nonRuleVariants[i], nodes: [node as AstNode] };\n }\n\n return [node as AstNode];\n}\n\n/**\n * extractAtRootNodes\n * Extracts at-root nodes from AST tree and returns them as an array.\n * - Input: AstNode[]\n * - Output: AstNode[]\n * - Usage: Used in parseClassToAst for at-root node extraction\n *\n * @param nodes AstNode[]\n * @param parent AstNode\n * @param atRootNodes AstNode[]\n */\nfunction extractAtRootNodes(\n nodes: AstNode[],\n parent?: AstNode,\n atRootNodes: AstNode[] = []\n) {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === \"at-root\") {\n atRootNodes.push(node);\n delete nodes[i];\n } else if (node.type === \"rule\" || node.type === \"style-rule\" || node.type === \"at-rule\") {\n // at-rule too: a media/container variant (hover:, md:, dark: …) wraps the utility's nodes in an at-rule, and an\n // at-root @property left inside it would render as an empty @media block instead of being hoisted.\n extractAtRootNodes((node as HasNodes).nodes ?? [], node, atRootNodes);\n }\n }\n\n if (parent) {\n (parent as HasNodes).nodes = nodes.filter(Boolean) as AstNode[];\n }\n}\n\n/**\n * parseClassToAst\n * Parses className(including variant chain) to generate AST tree.\n * - Input: className(string), Context\n * - Output: AstNode[] (multiple roots possible for variant wrapping path)\n * - Perfectly supports variant wrapping structure (Cartesian product, nesting, siblings, etc.)\n * - Accumulates wrappers in wrappers and applies them from right to left.\n * - Can return multiple root asts.\n *\n * @param fullClassName string (e.g., 'sm:dark:hover:bg-red-500')\n * @param ctx Context\n * @returns AstNode[]\n *\n * @example\n * const ast = parseClassToAst('sm:dark:hover:bg-red-500', ctx);\n * // ast is an AST tree with sm, dark, hover variants nested\n */\nexport function parseClassToAst(\n fullClassName: string,\n ctx: Context\n): AstNode[] {\n const state = getContextState(ctx);\n const failures = state?.failures || failureCache;\n const cache = state?.astCache || astCache;\n // Check failure cache first\n if (failures.has(fullClassName)) {\n return [];\n }\n\n // Check AST cache first\n if (cache.has(fullClassName)) {\n return cache.get(fullClassName)!;\n }\n\n const { modifiers, utility } = parseClassName(fullClassName, ctx);\n\n // console.log('[parseClassToAst] modifiers', modifiers, utility);\n\n if (!utility) {\n debugWarn(`[BAROCSS] Invalid class name format: \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n const utilRegs = utility.property ? [arbitraryPropertyRegistration] : getUtility(ctx).filter((u) => {\n const fullClassName = utility.value\n ? `${utility.prefix}-${utility.value}`\n : utility.prefix;\n return u.match(fullClassName);\n });\n // console.log('[parseClassToAst] utilReg', utilReg);\n if (utilRegs.length === 0) {\n const utilityName = utility.value\n ? `${utility.prefix}-${utility.value}`\n : utility.prefix;\n debugWarn(`[BAROCSS] Unknown utility class: \"${utilityName}\" in \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n let value = utility.value;\n if (utility.negative && value) value = \"-\" + value;\n // console.log('[parseClassToAst] value', value, utility);\n // Several registrations can match one class (e.g. functional `text-*` and static `text-balance`, or\n // `transform` for custom properties and for arbitrary values). The first one that produces a rule wins;\n // a registration that rejects the value (empty result) falls through to the next (#213).\n let ast: AstNode[] = [];\n for (const utilReg of utilRegs) {\n ast = utilReg.handler(value!, ctx, utility, utilReg) || [];\n if (ast.length > 0) break;\n }\n\n // console.log('[parseClassToAst] ast', ast);\n\n const wrappers = [];\n const selector = \"&\";\n\n for (let i = 0; i < modifiers.length; i++) {\n const variant = modifiers[i];\n\n const plugin = getModifier(ctx).find((p) => p.match(variant.type, ctx));\n\n if (!plugin) {\n debugWarn(`[BAROCSS] Unknown variant: \"${variant.type}\" in \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n\n if (plugin.astHandler) {\n ast = plugin.astHandler(ast, variant, ctx, modifiers, i);\n }\n if (plugin.wrap) {\n const items = plugin.wrap(variant, ctx);\n wrappers.push({\n type: \"wrap\",\n items: items,\n });\n }\n if (plugin.modifySelector) {\n const result = plugin.modifySelector({\n selector,\n fullClassName,\n mod: variant,\n context: ctx,\n variantChain: modifiers,\n index: i,\n });\n // #335: null means the variant matched the shape but its inner variant is unknown: emit nothing.\n if (result == null) {\n debugWarn(`[BAROCSS] Unknown variant: \"${variant.type}\" in \"${fullClassName}\"`);\n failures.add(fullClassName);\n return [];\n }\n // A wrapped identity selector adds no rule. Media-only modifiers use it.\n if (plugin.wrap && (\n result === '&' ||\n (typeof result === 'object' && !Array.isArray(result) && result.selector === '&') ||\n (Array.isArray(result) && result.length === 1 && result[0].selector === '&')\n )) continue;\n if (typeof result === \"string\" && result.includes(\"&\")) {\n wrappers.push({ type: \"rule\", selector: result });\n } else if (typeof result === \"object\" && !Array.isArray(result) && result.selector) {\n const wrappingType = result.wrappingType || \"rule\";\n wrappers.push({\n type: wrappingType,\n selector: result.selector,\n flatten: result.flatten,\n source: result.source,\n });\n } else if (Array.isArray(result)) {\n wrappers.push({\n type: \"wrap\",\n items: result.map((r) => ({\n type: r.wrappingType || \"rule\",\n selector: r.selector,\n source: r.source,\n flatten: r.flatten,\n })),\n });\n }\n }\n }\n\n // Nest wrappers in N→0 (right→left) order\n for (let i = wrappers.length - 1; i >= 0; i--) {\n const wrap = wrappers[i];\n\n if (wrap.type === \"wrap\") {\n ast = ((wrap as HasItems).items as AstNode[]).map((item) => (\n item.type === 'rule' || item.type === 'style-rule' || item.type === 'at-rule' || item.type === 'at-root'\n ? { ...item, nodes: [...(item.nodes || []), ...ast] }\n : item\n ));\n } else if (wrap.type === \"style-rule\") {\n ast = [\n {\n type: \"style-rule\",\n selector: wrap.selector!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n } else if (wrap.type === \"at-rule\") {\n ast = [\n {\n type: \"at-rule\",\n name: (wrap as HasName).name || \"media\",\n params: (wrap as HasParams).params!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n } else if (wrap.type === \"rule\") {\n ast = [\n {\n type: \"rule\",\n selector: wrap.selector!,\n source: wrap.source,\n nodes: Array.isArray(ast) ? ast : [ast],\n },\n ];\n }\n }\n\n // console.log(\"[parseClassToAst] ast\", ast);\n\n // ast 에서 at-root 노드만 추출해서 ast 앞으로 추가\n // ast 내부에서는 at-root 노드를 제거\n // 재귀적으로 실행되어야 함\n const atRootNodes: AstNode[] = [];\n\n extractAtRootNodes(ast, undefined, atRootNodes);\n\n ast = applyVarPrefix([...atRootNodes, ...ast].filter(Boolean), ctx);\n\n // console.log(\"[parseClassToAst] ast\", ast);\n // Cache the result\n cache.set(fullClassName, ast);\n\n return ast;\n}\n\n/**\n * Clear all AST caches (mainly for testing)\n */\nexport function clearAstCache(ctx?: Context): void {\n if (ctx) {\n clearContextCaches(ctx);\n } else {\n clearAllCaches();\n failureCache.clear();\n }\n}\n\n/** Read AST cache statistics for one context, or the legacy global cache. */\nexport function getAstCacheStats(ctx?: Context) {\n return (ctx && getContextState(ctx)?.astCache || astCache).getStats();\n}\n\n/**\n * generateCss\n * Takes multiple classNames and generates CSS for each, joining them.\n * - Input: classList(string), Context, options\n * - Output: string (result of joining multiple CSS blocks)\n * - Processes internally parseClassToAst → optimizeAst → astToCss in sequence\n * - Supports options like dedup, minify\n *\n * @param classList string (e.g., 'bg-red-500 text-lg hover:bg-blue-500')\n * @param ctx Context\n * @param opts { minify?: boolean, dedup?: boolean }\n * @returns string\n *\n * @example\n * const css = generateCss('sm:dark:hover:bg-red-500 sm:focus:bg-blue-500', ctx);\n */\n// #335: class lists split on ASCII whitespace only, as HTML classList and Tailwind's candidate scanner do;\n// a non-ASCII space (U+00A0, U+3000, ...) is part of a token, which then matches no utility.\nconst CLASS_SEPARATOR = /[ \\t\\n\\f\\r]+/;\n\nexport function generateCss(\n classList: string,\n ctx: Context,\n opts?: { minify?: boolean; dedup?: boolean }\n): string {\n const seen = new Set<string>();\n const allAtRootNodes: AstNode[] = [];\n\n const results = classList\n .split(CLASS_SEPARATOR)\n .filter((cls) => {\n if (!cls) return false;\n if (opts?.dedup) {\n if (seen.has(cls)) return false;\n seen.add(cls);\n }\n return true;\n })\n .map((cls) => {\n // #333: a class whose generation throws contributes nothing; the other classes still generate.\n try {\n return generateOne(cls);\n } catch (err) {\n debugWarn(\"[generateCss] class generation failed:\", cls, err);\n return \"\";\n }\n })\n .join(opts?.minify ? \"\" : \"\\n\");\n\n function generateOne(cls: string): string {\n const ast = parseClassToAst(cls, ctx);\n const parsedResult = (getContextState(ctx)?.parseResultCache || parseResultCache).get(cls);\n const cleanAst = optimizeAst(ast);\n\n cleanAst.forEach((node) => {\n if (node.type === \"at-root\") {\n allAtRootNodes.push(...node.nodes);\n }\n });\n\n // If style-rule already has a complete selector, do not pass baseSelector\n const hasStyleRule = cleanAst.some((node) => node.type === \"style-rule\");\n const css = astToCss(cleanAst.filter((node) => node.type !== \"at-root\"), hasStyleRule ? undefined : cls, {\n minify: opts?.minify,\n important: parsedResult?.utility?.important ?? false,\n }); // Conditional baseSelector\n\n const result = css;\n\n // Debug logging for empty CSS\n if (!result || result.trim() === \"\") {\n debugWarn(\"[generateCss] Empty CSS generated for class:\", {\n class: cls,\n ast: cleanAst,\n hasStyleRule,\n css,\n result,\n });\n }\n\n return result;\n }\n\n const rootRules = [...new Set([\n ...allAtRootNodes\n .filter((node) => node.type === \"at-rule\")\n .map((node) => rootToCss([node], { minify: opts?.minify })),\n // #274: the @keyframes the class rules reference, once per sheet.\n ...referencedKeyframes(results, ctx),\n ])];\n const rootDeclarations = [...new Set(allAtRootNodes\n .filter((node) => node.type === \"decl\")\n .map((node) => rootToCss([node], { minify: opts?.minify }))\n .filter((decl) => decl !== \"\"))];\n const rootCss = [\n ...rootRules,\n ...(rootDeclarations.length\n ? [`:root,:host${opts?.minify ? \"\" : \" \"}{${rootDeclarations.join(opts?.minify ? \"\" : \"\\n\")}}`]\n : []),\n ].join(opts?.minify ? \"\" : \"\\n\");\n\n if (allAtRootNodes.length > 0) {\n debugLog(\"[generateCss] All collected atRoot nodes:\", allAtRootNodes);\n }\n\n // Debug logging for final result\n if (!results || results.trim() === \"\") {\n debugWarn(\"[generateCss] Empty final result:\", {\n classList,\n results,\n allAtRootNodes,\n });\n }\n\n return `${rootCss}${rootCss && results ? (opts?.minify ? \"\" : \"\\n\") : \"\"}${results}`;\n}\n\nexport type GenerateCssRulesResult = {\n cls: string;\n ast: AstNode[];\n css: string;\n cssList: string[];\n rootCss: string;\n rootCssList: string[];\n};\n\n/**\n * Returns an array of optimized results for multiple class names with dedup/filter.\n * - Each object: { cls, ast, css }\n * - Supports minify, dedup options\n * - Applies astToCss(cleanAst, cls, opts) per class\n * @param classList string (space-separated)\n * @param ctx Context\n * @param opts { minify?: boolean; dedup?: boolean }\n * @returns Array<{ cls: string; ast: AstNode[]; css: string }>\n */\nexport function generateCssRules(\n classList: string,\n ctx: Context,\n opts?: { minify?: boolean; dedup?: boolean }\n): Array<GenerateCssRulesResult> {\n const seen = new Set<string>();\n return classList\n .split(CLASS_SEPARATOR)\n .filter((cls) => {\n if (!cls) return false;\n if (opts?.dedup) {\n if (seen.has(cls)) return false;\n seen.add(cls);\n }\n return true;\n })\n .map((cls) => {\n // console.log(\"[generateCssRules] cls\", cls);\n const ast = parseClassToAst(cls, ctx);\n const parsedResult = (getContextState(ctx)?.parseResultCache || parseResultCache).get(cls);\n const options = {\n minify: opts?.minify,\n important: parsedResult?.utility?.important ?? false,\n };\n const cleanAst = optimizeAst(ast);\n\n // console.log(\"[generateCssRules] cleanAst\", cleanAst);\n\n const allAtRootNodes: AstNode[] = cleanAst\n .filter(\n (node) => node.type === \"at-root\" && !node.source\n )\n .map((node) => (node as HasNodes).nodes || [])\n .flat();\n const allCleanAst: AstNode[] = cleanAst.filter(\n (node) =>\n node.type !== \"at-root\" ||\n (node.type === \"at-root\" && node.source)\n );\n\n\n const cssList = [];\n for (const node of allCleanAst) {\n if (node.type === \"at-root\") {\n node.nodes.forEach((node) => {\n const css = astToCss([node], \"\", options);\n cssList.push(css);\n });\n } else {\n const css = astToCss([node], cls, options);\n cssList.push(css);\n }\n }\n // console.log('[generateCssRules] css', cls);\n const rootCssList = [];\n for (const node of allAtRootNodes) {\n const css = rootToCss([node]);\n rootCssList.push(css);\n }\n // #274: referenced @keyframes are root-level blocks too (deduped by content by every consumer).\n rootCssList.push(...referencedKeyframes(cssList.join(\"\\n\"), ctx));\n // console.log(\"[generateCssRules] rootCss\", rootCssList, allAtRootNodes);\n return {\n cls,\n ast: allCleanAst,\n css: cssList.join(options.minify ? \"\" : \"\\n\"),\n cssList,\n rootCss: rootCssList.join(options.minify ? \"\" : \"\\n\"),\n rootCssList,\n };\n });\n}\n\n/**\n * mergeAstTreeList\n * Takes a list of declPathToAst results (AstNode[][]), merges same at-rule(name, params) etc., and returns the final AST tree.\n * - Input: AstNode[][] (nested ASTs of multiple decl-to-root paths)\n * @returns AstNode[]\n * - Usage: Used in optimizeAst for final AST merging/optimization\n *\n * @param astList AstNode[][]\n * @returns AstNode[]\n */\nexport function mergeAstTreeList(astList: AstNode[][]): AstNode[] {\n // AstNode[][] → DeclPath[]\n const declPaths: DeclPath[] = astList.map((ast) => {\n // declPathToAst always returns [rootNode]\n const path: AstNode[] = [];\n let node = ast[0];\n while (node) {\n path.push({ ...node, nodes: undefined } as AstNode & HasNodes);\n if ((node as HasNodes).nodes && (node as HasNodes)?.nodes?.length === 1)\n node = (node as HasNodes).nodes?.[0] as AstNode;\n else break;\n }\n return path;\n });\n // Recursive merge\n function merge(declPaths: DeclPath[], depth = 0): AstNode[] {\n if (declPaths.length === 0) return [];\n if (declPaths[0].length === depth + 1) {\n // All decls remain\n return declPaths.map((path) => path[depth]) as AstNode[];\n }\n // Group by variant(type+key) at current depth\n const groupMap = new Map<string, DeclPath[]>();\n for (const path of declPaths) {\n const node = path[depth];\n let key = node.type;\n if (node.type === \"at-rule\") key += \":\" + node.name + \":\" + node.params;\n else if (node.type === \"rule\" || node.type === \"style-rule\")\n key += \":\" + node.selector;\n else key += \":\" + JSON.stringify(node);\n if (!groupMap.has(key!)) groupMap.set(key!, []);\n groupMap.get(key!)!.push(path);\n }\n // Recursive merge for each group\n const result: AstNode[] = [];\n for (const [, group] of groupMap.entries()) {\n const node = group[0][depth];\n const children = merge(group, depth + 1);\n result.push(\n children.length\n ? ({ ...node, nodes: children as AstNode[] } as AstNode & HasNodes)\n : ({ ...node } as AstNode & HasNodes)\n );\n }\n return result;\n }\n const merged = merge(declPaths);\n return merged;\n}\n/**\n * optimizeAst\n * Merges/organizes AST generated by parseClassToAst into an optimized AST tree based on decl-to-root path.\n * - Input: AstNode[] (result of parseClassToAst)\n * - Output: Optimized AST tree (AstNode[])\n * - Uses collectDeclPaths, declPathToAst, mergeAstTreeList internally\n * - Reflects all variant wrapping structures (nesting, siblings, merging, etc.)\n *\n * @param ast AstNode[]\n * @returns AstNode[]\n */\nexport function optimizeAst(ast: AstNode[]): AstNode[] {\n // console.log(\"[optimizeAst] ast\", ast);\n const declPaths = collectDeclPaths(ast);\n // console.log(\"[optimizeAst] declPaths\", declPaths);\n const astList = declPaths.map(declPathToAst);\n // console.log(\"[optimizeAst] astList\", astList);\n const merged = mergeAstTreeList(astList);\n // console.log(\"[optimizeAst] merged\", merged);\n\n return merged;\n}\n","import { debugWarn } from \"../utils/debug\";\nimport { parseClassName } from './parser';\nimport { parseClassToAst, generateCssRules, GenerateCssRulesResult } from './engine';\nimport type { Context } from './context';\nimport { astCache } from '../utils/cache';\nimport { getContextState } from './contextState';\n\n/**\n * Incremental parsing system for efficient class processing\n * \n * This class provides an optimized approach to CSS class processing by:\n * - Tracking processed classes to avoid redundant work\n * - Batching multiple class operations for better performance\n * - Supporting both synchronous and asynchronous processing modes\n * \n * ## Usage Patterns\n * \n * ### Universal Usage (Node.js & Browser)\n * ```typescript\n * const parser = new IncrementalParser(ctx);\n * \n * // Process classes synchronously\n * const results = parser.processClasses(['bg-blue-500', 'text-lg']);\n * \n * // Process single class\n * const result = parser.processClass('bg-red-500');\n * \n * // Get statistics\n * const stats = parser.getStats();\n * ```\n * \n * ### Browser Integration\n * ```typescript\n * const parser = new IncrementalParser(ctx);\n * const BrowserRuntime = new BrowserRuntime();\n * \n * // Process classes and manually inject CSS\n * const results = parser.processClasses(['bg-blue-500', 'text-lg']);\n * results.forEach(result => {\n * if (result.css) {\n * BrowserRuntime.insertRule(result.css);\n * }\n * });\n * \n * // Use with ChangeDetector for automatic DOM monitoring\n * const detector = new ChangeDetector(parser);\n * detector.observe(document.body, { scan: true });\n * ```\n * \n * ## Architecture\n * \n * - **IncrementalParser**: Pure CSS processing (works in Node.js and browser)\n * - **ChangeDetector**: Browser-only DOM monitoring (uses MutationObserver)\n * - **BrowserRuntime**: Browser-only CSS injection (uses DOM APIs)\n */\nexport class IncrementalParser {\n /** Set of class names that have already been processed to avoid duplicates */\n private processedClasses = new Set<string>();\n \n /** BAROCSS context for theme and utility resolution */\n private ctx: Context;\n \n /** Maximum number of classes to process in a single batch */\n private batchSize = 50;\n \n /** Debounce delay for batch processing in milliseconds */\n private debounceMs = 16;\n \n /** Set of classes waiting to be processed */\n private pendingClasses = new Set<string>();\n \n /** Timer for debounced batch processing */\n private batchTimer: number | null = null;\n\n /**\n * Create a new IncrementalParser instance\n * \n * @param ctx - BAROCSS context for theme and utility resolution\n */\n constructor(ctx: Context) {\n this.ctx = ctx;\n }\n\n /**\n * Processes a single CSS class and generates its AST and CSS representation\n * \n * This method performs the complete pipeline for a single class:\n * 1. Checks if the class has already been processed\n * 2. Parses the class name to extract utility information\n * 3. Generates the Abstract Syntax Tree (AST)\n * 4. Converts the AST to CSS rules\n * 5. Marks the class as processed to avoid future duplicates\n * \n * @param className - The CSS class name to process (e.g., 'bg-blue-500')\n * @returns Object containing AST and CSS, or null if processing failed or class was already processed\n */\n processClass(className: string): GenerateCssRulesResult | null {\n // Check if already processed\n if (this.processedClasses.has(className)) {\n // console.log('[IncrementalParser] Class already processed:', className);\n return null; // Already processed\n }\n\n try { \n // Parse class\n const parseResult = parseClassName(className, this.ctx);\n \n if (!parseResult.utility) {\n return null;\n }\n\n // Generate AST\n const ast = parseClassToAst(className, this.ctx);\n\n // console.log('[IncrementalParser] ast', className, ast);\n \n if (ast.length === 0) {\n debugWarn('[IncrementalParser] ast is empty', className);\n return null;\n }\n\n // Generate CSS using the same method as runtime\n const rules = generateCssRules(className, this.ctx, { dedup: false });\n \n if (rules.length === 0) {\n return null;\n }\n\n const rule = rules[0];\n if (!rule.css) {\n return null;\n }\n\n // Mark as processed\n this.processedClasses.add(className);\n\n return { \n cls: className, \n ast, \n css: rule.css, \n cssList: rule.cssList, \n rootCss: rule.rootCss,\n rootCssList: rule.rootCssList\n };\n } catch (error) {\n debugWarn('[IncrementalParser] Failed to process class:', className, error);\n return null;\n }\n }\n\n /**\n * Processes multiple CSS classes in batches for optimal performance\n * \n * This method handles multiple classes efficiently by:\n * - Filtering out already processed classes to avoid redundant work\n * - Processing classes in configurable batch sizes\n * - Returning comprehensive results for each processed class\n * \n * @param classes - Array of CSS class names to process\n * @returns Array of processing results, each containing className, AST, and CSS\n */\n processClasses(classes: string[]): Array<GenerateCssRulesResult> {\n const results: Array<GenerateCssRulesResult> = [];\n const newClasses = classes.filter(cls => !this.processedClasses.has(cls));\n\n if (newClasses.length === 0) {\n return results; // All classes already processed\n }\n\n // Process in batches for better performance\n for (let i = 0; i < newClasses.length; i += this.batchSize) {\n const batch = newClasses.slice(i, i + this.batchSize);\n \n for (const className of batch) {\n const result = this.processClass(className);\n if (result) {\n results.push(result);\n }\n };\n }\n\n return results;\n }\n\n /**\n * Adds classes to the pending queue for asynchronous batch processing\n * \n * This method is used by the ChangeDetector when new classes are discovered\n * in the DOM. Classes are queued and processed together to minimize\n * performance impact from frequent DOM mutations.\n * \n * @param classes - Array of CSS class names to queue for processing\n */\n addToPending(classes: string[]): void {\n classes.forEach(cls => this.pendingClasses.add(cls));\n this.scheduleBatchProcessing();\n }\n\n /**\n * Schedule batch processing with debouncing\n * \n * This method uses setTimeout to debounce rapid class additions\n * and process them in batches for better performance.\n */\n private scheduleBatchProcessing(): void {\n if (this.batchTimer) {\n clearTimeout(this.batchTimer);\n }\n\n if (typeof window !== 'undefined') {\n this.batchTimer = window.setTimeout(() => {\n this.processPendingClasses();\n }, this.debounceMs);\n } else {\n // In server environment, process immediately\n this.processPendingClasses();\n }\n }\n\n /**\n * Process pending classes from the queue\n * \n * This method is called by the debounced timer to process\n * all classes that have been added to the pending queue.\n */\n private processPendingClasses(): void {\n if (this.pendingClasses.size === 0) return;\n\n const classesToProcess = Array.from(this.pendingClasses);\n this.pendingClasses.clear();\n\n // Use common method for processing\n this.applyClasses(classesToProcess);\n }\n\n /**\n * Core method that processes classes and marks them as processed\n * \n * This is the common processing logic used by both pending and synchronous\n * processing methods. It:\n * 1. Processes the provided classes using the batch processor\n * 2. Marks classes as processed to prevent duplicates\n * \n * @param classes - Array of CSS class names to process\n */\n private applyClasses(classes: string[]): void {\n this.processClasses(classes);\n \n // Mark classes as processed\n classes.forEach(cls => {\n this.markProcessed(cls);\n });\n }\n\n /**\n * Returns comprehensive statistics about the incremental parser's state\n * \n * This method provides detailed metrics including:\n * - Number of processed classes\n * - Number of pending classes\n * - Cache statistics from AST and CSS caches\n * \n * @returns Object containing processing statistics and cache information\n */\n getStats() {\n return {\n processedClasses: this.processedClasses.size,\n pendingClasses: this.pendingClasses.size,\n cacheStats: {\n ast: (getContextState(this.ctx)?.astCache || astCache).getStats(),\n css: {} // No CSS cache, so return empty object\n }\n };\n }\n\n /**\n * Clears all processed classes and pending queue\n * \n * This method is useful when the theme or configuration changes,\n * requiring all classes to be reprocessed. It:\n * - Clears the processed classes set\n * - Clears the pending classes queue\n * - Cancels any pending batch processing timer\n */\n clearProcessed(): void {\n this.processedClasses.clear();\n this.pendingClasses.clear();\n if (this.batchTimer && typeof window !== 'undefined') {\n clearTimeout(this.batchTimer);\n this.batchTimer = null;\n }\n }\n\n /**\n * Checks if a specific class has been processed\n * \n * @param cls - The CSS class name to check\n * @returns True if the class has been processed, false otherwise\n */\n isProcessed(cls: string): boolean {\n return this.processedClasses.has(cls);\n }\n\n /**\n * Marks a class as processed to prevent future duplicate processing\n * \n * @param cls - The CSS class name to mark as processed\n */\n markProcessed(cls: string): void {\n this.processedClasses.add(cls);\n }\n\n /**\n * Forgets that a class was processed, so a later request generates it again\n * (used when the browser runtime reclaims an unused class's rules, #269).\n *\n * @param cls - The CSS class name to forget\n */\n unmarkProcessed(cls: string): void {\n this.processedClasses.delete(cls);\n }\n\n /**\n * Process classes synchronously and update BrowserRuntime cache\n * This method is used by ChangeDetector for scan operations\n */\n processClassesSync(classes: string[]): void {\n this.applyClasses(classes);\n }\n\n /**\n * Returns all currently processed class names\n * \n * This method is useful for debugging and monitoring purposes,\n * providing visibility into which classes have been processed.\n * \n * @returns Array of all processed class names\n */\n getProcessedClasses(): string[] {\n return Array.from(this.processedClasses);\n }\n}\n","// complete color palette (OKLCH/HEX, etc.)\n// Default theme reference\n\nexport const colors = {\n inherit: 'inherit',\n current: 'currentcolor',\n transparent: 'transparent',\n black: '#000',\n white: '#fff',\n slate: {\n '50': 'oklch(98.4% 0.003 247.858)',\n '100': 'oklch(96.8% 0.007 247.896)',\n '200': 'oklch(92.9% 0.013 255.508)',\n '300': 'oklch(86.9% 0.022 252.894)',\n '400': 'oklch(70.4% 0.04 256.788)',\n '500': 'oklch(55.4% 0.046 257.417)',\n '600': 'oklch(44.6% 0.043 257.281)',\n '700': 'oklch(37.2% 0.044 257.287)',\n '800': 'oklch(27.9% 0.041 260.031)',\n '900': 'oklch(20.8% 0.042 265.755)',\n '950': 'oklch(12.9% 0.042 264.695)',\n },\n gray: {\n '50': 'oklch(98.5% 0.002 247.839)',\n '100': 'oklch(96.7% 0.003 264.542)',\n '200': 'oklch(92.8% 0.006 264.531)',\n '300': 'oklch(87.2% 0.01 258.338)',\n '400': 'oklch(70.7% 0.022 261.325)',\n '500': 'oklch(55.1% 0.027 264.364)',\n '600': 'oklch(44.6% 0.03 256.802)',\n '700': 'oklch(37.3% 0.034 259.733)',\n '800': 'oklch(27.8% 0.033 256.848)',\n '900': 'oklch(21% 0.034 264.665)',\n '950': 'oklch(13% 0.028 261.692)',\n },\n zinc: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(96.7% 0.001 286.375)',\n '200': 'oklch(92% 0.004 286.32)',\n '300': 'oklch(87.1% 0.006 286.286)',\n '400': 'oklch(70.5% 0.015 286.067)',\n '500': 'oklch(55.2% 0.016 285.938)',\n '600': 'oklch(44.2% 0.017 285.786)',\n '700': 'oklch(37% 0.013 285.805)',\n '800': 'oklch(27.4% 0.006 286.033)',\n '900': 'oklch(21% 0.006 285.885)',\n '950': 'oklch(14.1% 0.005 285.823)',\n },\n neutral: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(97% 0 none)',\n '200': 'oklch(92.2% 0 none)',\n '300': 'oklch(87% 0 none)',\n '400': 'oklch(70.8% 0 none)',\n '500': 'oklch(55.6% 0 none)',\n '600': 'oklch(43.9% 0 none)',\n '700': 'oklch(37.1% 0 none)',\n '800': 'oklch(26.9% 0 none)',\n '900': 'oklch(20.5% 0 none)',\n '950': 'oklch(14.5% 0 none)',\n },\n stone: {\n '50': 'oklch(98.5% 0.001 106.423)',\n '100': 'oklch(97% 0.001 106.424)',\n '200': 'oklch(92.3% 0.003 48.717)',\n '300': 'oklch(86.9% 0.005 56.366)',\n '400': 'oklch(70.9% 0.01 56.259)',\n '500': 'oklch(55.3% 0.013 58.071)',\n '600': 'oklch(44.4% 0.011 73.639)',\n '700': 'oklch(37.4% 0.01 67.558)',\n '800': 'oklch(26.8% 0.007 34.298)',\n '900': 'oklch(21.6% 0.006 56.043)',\n '950': 'oklch(14.7% 0.004 49.25)',\n },\n red: {\n '50': 'oklch(97.1% 0.013 17.38)',\n '100': 'oklch(93.6% 0.032 17.717)',\n '200': 'oklch(88.5% 0.062 18.334)',\n '300': 'oklch(80.8% 0.114 19.571)',\n '400': 'oklch(70.4% 0.191 22.216)',\n '500': 'oklch(63.7% 0.237 25.331)',\n '600': 'oklch(57.7% 0.245 27.325)',\n '700': 'oklch(50.5% 0.213 27.518)',\n '800': 'oklch(44.4% 0.177 26.899)',\n '900': 'oklch(39.6% 0.141 25.723)',\n '950': 'oklch(25.8% 0.092 26.042)',\n },\n orange: {\n '50': 'oklch(98% 0.016 73.684)',\n '100': 'oklch(95.4% 0.038 75.164)',\n '200': 'oklch(90.1% 0.076 70.697)',\n '300': 'oklch(83.7% 0.128 66.29)',\n '400': 'oklch(75% 0.183 55.934)',\n '500': 'oklch(70.5% 0.213 47.604)',\n '600': 'oklch(64.6% 0.222 41.116)',\n '700': 'oklch(55.3% 0.195 38.402)',\n '800': 'oklch(47% 0.157 37.304)',\n '900': 'oklch(40.8% 0.123 38.172)',\n '950': 'oklch(26.6% 0.079 36.259)',\n },\n amber: {\n '50': 'oklch(98.7% 0.022 95.277)',\n '100': 'oklch(96.2% 0.059 95.617)',\n '200': 'oklch(92.4% 0.12 95.746)',\n '300': 'oklch(87.9% 0.169 91.605)',\n '400': 'oklch(82.8% 0.189 84.429)',\n '500': 'oklch(76.9% 0.188 70.08)',\n '600': 'oklch(66.6% 0.179 58.318)',\n '700': 'oklch(55.5% 0.163 48.998)',\n '800': 'oklch(47.3% 0.137 46.201)',\n '900': 'oklch(41.4% 0.112 45.904)',\n '950': 'oklch(27.9% 0.077 45.635)',\n },\n yellow: {\n '50': 'oklch(98.7% 0.026 102.212)',\n '100': 'oklch(97.3% 0.071 103.193)',\n '200': 'oklch(94.5% 0.129 101.54)',\n '300': 'oklch(90.5% 0.182 98.111)',\n '400': 'oklch(85.2% 0.199 91.936)',\n '500': 'oklch(79.5% 0.184 86.047)',\n '600': 'oklch(68.1% 0.162 75.834)',\n '700': 'oklch(55.4% 0.135 66.442)',\n '800': 'oklch(47.6% 0.114 61.907)',\n '900': 'oklch(42.1% 0.095 57.708)',\n '950': 'oklch(28.6% 0.066 53.813)',\n },\n lime: {\n '50': 'oklch(98.6% 0.031 120.757)',\n '100': 'oklch(96.7% 0.067 122.328)',\n '200': 'oklch(93.8% 0.127 124.321)',\n '300': 'oklch(89.7% 0.196 126.665)',\n '400': 'oklch(84.1% 0.238 128.85)',\n '500': 'oklch(76.8% 0.233 130.85)',\n '600': 'oklch(64.8% 0.2 131.684)',\n '700': 'oklch(53.2% 0.157 131.589)',\n '800': 'oklch(45.3% 0.124 130.933)',\n '900': 'oklch(40.5% 0.101 131.063)',\n '950': 'oklch(27.4% 0.072 132.109)',\n },\n green: {\n '50': 'oklch(98.2% 0.018 155.826)',\n '100': 'oklch(96.2% 0.044 156.743)',\n '200': 'oklch(92.5% 0.084 155.995)',\n '300': 'oklch(87.1% 0.15 154.449)',\n '400': 'oklch(79.2% 0.209 151.711)',\n '500': 'oklch(72.3% 0.219 149.579)',\n '600': 'oklch(62.7% 0.194 149.214)',\n '700': 'oklch(52.7% 0.154 150.069)',\n '800': 'oklch(44.8% 0.119 151.328)',\n '900': 'oklch(39.3% 0.095 152.535)',\n '950': 'oklch(26.6% 0.065 152.934)',\n },\n emerald: {\n '50': 'oklch(97.9% 0.021 166.113)',\n '100': 'oklch(95% 0.052 163.051)',\n '200': 'oklch(90.5% 0.093 164.15)',\n '300': 'oklch(84.5% 0.143 164.978)',\n '400': 'oklch(76.5% 0.177 163.223)',\n '500': 'oklch(69.6% 0.17 162.48)',\n '600': 'oklch(59.6% 0.145 163.225)',\n '700': 'oklch(50.8% 0.118 165.612)',\n '800': 'oklch(43.2% 0.095 166.913)',\n '900': 'oklch(37.8% 0.077 168.94)',\n '950': 'oklch(26.2% 0.051 172.552)',\n },\n teal: {\n '50': 'oklch(98.4% 0.014 180.72)',\n '100': 'oklch(95.3% 0.051 180.801)',\n '200': 'oklch(91% 0.096 180.426)',\n '300': 'oklch(85.5% 0.138 181.071)',\n '400': 'oklch(77.7% 0.152 181.912)',\n '500': 'oklch(70.4% 0.14 182.503)',\n '600': 'oklch(60% 0.118 184.704)',\n '700': 'oklch(51.1% 0.096 186.391)',\n '800': 'oklch(43.7% 0.078 188.216)',\n '900': 'oklch(38.6% 0.063 188.416)',\n '950': 'oklch(27.7% 0.046 192.524)',\n },\n cyan: {\n '50': 'oklch(98.4% 0.019 200.873)',\n '100': 'oklch(95.6% 0.045 203.388)',\n '200': 'oklch(91.7% 0.08 205.041)',\n '300': 'oklch(86.5% 0.127 207.078)',\n '400': 'oklch(78.9% 0.154 211.53)',\n '500': 'oklch(71.5% 0.143 215.221)',\n '600': 'oklch(60.9% 0.126 221.723)',\n '700': 'oklch(52% 0.105 223.128)',\n '800': 'oklch(45% 0.085 224.283)',\n '900': 'oklch(39.8% 0.07 227.392)',\n '950': 'oklch(30.2% 0.056 229.695)',\n },\n sky: {\n '50': 'oklch(97.7% 0.013 236.62)',\n '100': 'oklch(95.1% 0.026 236.824)',\n '200': 'oklch(90.1% 0.058 230.902)',\n '300': 'oklch(82.8% 0.111 230.318)',\n '400': 'oklch(74.6% 0.16 232.661)',\n '500': 'oklch(68.5% 0.169 237.323)',\n '600': 'oklch(58.8% 0.158 241.966)',\n '700': 'oklch(50% 0.134 242.749)',\n '800': 'oklch(44.3% 0.11 240.79)',\n '900': 'oklch(39.1% 0.09 240.876)',\n '950': 'oklch(29.3% 0.066 243.157)',\n },\n blue: {\n '50': 'oklch(97% 0.014 254.604)',\n '100': 'oklch(93.2% 0.032 255.585)',\n '200': 'oklch(88.2% 0.059 254.128)',\n '300': 'oklch(80.9% 0.105 251.813)',\n '400': 'oklch(70.7% 0.165 254.624)',\n '500': 'oklch(62.3% 0.214 259.815)',\n '600': 'oklch(54.6% 0.245 262.881)',\n '700': 'oklch(48.8% 0.243 264.376)',\n '800': 'oklch(42.4% 0.199 265.638)',\n '900': 'oklch(37.9% 0.146 265.522)',\n '950': 'oklch(28.2% 0.091 267.935)',\n },\n indigo: {\n '50': 'oklch(96.2% 0.018 272.314)',\n '100': 'oklch(93% 0.034 272.788)',\n '200': 'oklch(87% 0.065 274.039)',\n '300': 'oklch(78.5% 0.115 274.713)',\n '400': 'oklch(67.3% 0.182 276.935)',\n '500': 'oklch(58.5% 0.233 277.117)',\n '600': 'oklch(51.1% 0.262 276.966)',\n '700': 'oklch(45.7% 0.24 277.023)',\n '800': 'oklch(39.8% 0.195 277.366)',\n '900': 'oklch(35.9% 0.144 278.697)',\n '950': 'oklch(25.7% 0.09 281.288)',\n },\n violet: {\n '50': 'oklch(96.9% 0.016 293.756)',\n '100': 'oklch(94.3% 0.029 294.588)',\n '200': 'oklch(89.4% 0.057 293.283)',\n '300': 'oklch(81.1% 0.111 293.571)',\n '400': 'oklch(70.2% 0.183 293.541)',\n '500': 'oklch(60.6% 0.25 292.717)',\n '600': 'oklch(54.1% 0.281 293.009)',\n '700': 'oklch(49.1% 0.27 292.581)',\n '800': 'oklch(43.2% 0.232 292.759)',\n '900': 'oklch(38% 0.189 293.745)',\n '950': 'oklch(28.3% 0.141 291.089)',\n },\n purple: {\n '50': 'oklch(97.7% 0.014 308.299)',\n '100': 'oklch(94.6% 0.033 307.174)',\n '200': 'oklch(90.2% 0.063 306.703)',\n '300': 'oklch(82.7% 0.119 306.383)',\n '400': 'oklch(71.4% 0.203 305.504)',\n '500': 'oklch(62.7% 0.265 303.9)',\n '600': 'oklch(55.8% 0.288 302.321)',\n '700': 'oklch(49.6% 0.265 301.924)',\n '800': 'oklch(43.8% 0.218 303.724)',\n '900': 'oklch(38.1% 0.176 304.987)',\n '950': 'oklch(29.1% 0.149 302.717)',\n },\n fuchsia: {\n '50': 'oklch(97.7% 0.017 320.058)',\n '100': 'oklch(95.2% 0.037 318.852)',\n '200': 'oklch(90.3% 0.076 319.62)',\n '300': 'oklch(83.3% 0.145 321.434)',\n '400': 'oklch(74% 0.238 322.16)',\n '500': 'oklch(66.7% 0.295 322.15)',\n '600': 'oklch(59.1% 0.293 322.896)',\n '700': 'oklch(51.8% 0.253 323.949)',\n '800': 'oklch(45.2% 0.211 324.591)',\n '900': 'oklch(40.1% 0.17 325.612)',\n '950': 'oklch(29.3% 0.136 325.661)',\n },\n pink: {\n '50': 'oklch(97.1% 0.014 343.198)',\n '100': 'oklch(94.8% 0.028 342.258)',\n '200': 'oklch(89.9% 0.061 343.231)',\n '300': 'oklch(82.3% 0.12 346.018)',\n '400': 'oklch(71.8% 0.202 349.761)',\n '500': 'oklch(65.6% 0.241 354.308)',\n '600': 'oklch(59.2% 0.249 0.584)',\n '700': 'oklch(52.5% 0.223 3.958)',\n '800': 'oklch(45.9% 0.187 3.815)',\n '900': 'oklch(40.8% 0.153 2.432)',\n '950': 'oklch(28.4% 0.109 3.907)',\n },\n rose: {\n '50': 'oklch(96.9% 0.015 12.422)',\n '100': 'oklch(94.1% 0.03 12.58)',\n '200': 'oklch(89.2% 0.058 10.001)',\n '300': 'oklch(81% 0.117 11.638)',\n '400': 'oklch(71.2% 0.194 13.428)',\n '500': 'oklch(64.5% 0.246 16.439)',\n '600': 'oklch(58.6% 0.253 17.585)',\n '700': 'oklch(51.4% 0.222 16.935)',\n '800': 'oklch(45.5% 0.188 13.697)',\n '900': 'oklch(41% 0.159 10.272)',\n '950': 'oklch(27.1% 0.105 12.094)',\n },\n mauve: {\n '50': 'oklch(98.5% 0 none)',\n '100': 'oklch(96% 0.003 325.6)',\n '200': 'oklch(92.2% 0.005 325.62)',\n '300': 'oklch(86.5% 0.012 325.68)',\n '400': 'oklch(71.1% 0.019 323.02)',\n '500': 'oklch(54.2% 0.034 322.5)',\n '600': 'oklch(43.5% 0.029 321.78)',\n '700': 'oklch(36.4% 0.029 323.89)',\n '800': 'oklch(26.3% 0.024 320.12)',\n '900': 'oklch(21.2% 0.019 322.12)',\n '950': 'oklch(14.5% 0.008 326)',\n },\n olive: {\n '50': 'oklch(98.8% 0.003 106.5)',\n '100': 'oklch(96.6% 0.005 106.5)',\n '200': 'oklch(93% 0.007 106.5)',\n '300': 'oklch(88% 0.011 106.6)',\n '400': 'oklch(73.7% 0.021 106.9)',\n '500': 'oklch(58% 0.031 107.3)',\n '600': 'oklch(46.6% 0.025 107.3)',\n '700': 'oklch(39.4% 0.023 107.4)',\n '800': 'oklch(28.6% 0.016 107.4)',\n '900': 'oklch(22.8% 0.013 107.4)',\n '950': 'oklch(15.3% 0.006 107.1)',\n },\n mist: {\n '50': 'oklch(98.7% 0.002 197.1)',\n '100': 'oklch(96.3% 0.002 197.1)',\n '200': 'oklch(92.5% 0.005 214.3)',\n '300': 'oklch(87.2% 0.007 219.6)',\n '400': 'oklch(72.3% 0.014 214.4)',\n '500': 'oklch(56% 0.021 213.5)',\n '600': 'oklch(45% 0.017 213.2)',\n '700': 'oklch(37.8% 0.015 216)',\n '800': 'oklch(27.5% 0.011 216.9)',\n '900': 'oklch(21.8% 0.008 223.9)',\n '950': 'oklch(14.8% 0.004 228.8)',\n },\n taupe: {\n '50': 'oklch(98.6% 0.002 67.8)',\n '100': 'oklch(96% 0.002 17.2)',\n '200': 'oklch(92.2% 0.005 34.3)',\n '300': 'oklch(86.8% 0.007 39.5)',\n '400': 'oklch(71.4% 0.014 41.2)',\n '500': 'oklch(54.7% 0.021 43.1)',\n '600': 'oklch(43.8% 0.017 39.3)',\n '700': 'oklch(36.7% 0.016 35.7)',\n '800': 'oklch(26.8% 0.011 36.5)',\n '900': 'oklch(21.4% 0.009 43.1)',\n '950': 'oklch(14.7% 0.004 49.3)',\n },\n}; ","// complete spacing scale\n// Default theme reference\n\nexport const spacing = {\n px: '1px',\n 0: '0px',\n 0.5: '0.125rem',\n 1: '0.25rem',\n 1.5: '0.375rem',\n 2: '0.5rem',\n 2.5: '0.625rem',\n 3: '0.75rem',\n 3.5: '0.875rem',\n 4: '1rem',\n 5: '1.25rem',\n 6: '1.5rem',\n 7: '1.75rem',\n 8: '2rem',\n 9: '2.25rem',\n 10: '2.5rem',\n 11: '2.75rem',\n 12: '3rem',\n 14: '3.5rem',\n 16: '4rem',\n 20: '5rem',\n 24: '6rem',\n 28: '7rem',\n 32: '8rem',\n 36: '9rem',\n 40: '10rem',\n 44: '11rem',\n 48: '12rem',\n 52: '13rem',\n 56: '14rem',\n 60: '15rem',\n 64: '16rem',\n 72: '18rem',\n 80: '20rem',\n 96: '24rem',\n 112: '28rem',\n 128: '32rem',\n}; ","// Tailwind 4.1.13 --radius-* scale (bare `rounded` is 0.25rem).\nexport const borderRadius = {\n none: '0px',\n xs: '0.125rem',\n sm: '0.25rem',\n DEFAULT: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n xl: '0.75rem',\n '2xl': '1rem',\n '3xl': '1.5rem',\n '4xl': '2rem',\n full: '9999px',\n};\n","// Complete fontSize scale\n// Default theme reference\n\nexport const fontSize = {\n xs: ['0.75rem', 'calc(1 / 0.75)'],\n sm: ['0.875rem', 'calc(1.25 / 0.875)'],\n base: ['1rem', 'calc(1.5 / 1)'],\n lg: ['1.125rem', 'calc(1.75 / 1.125)'],\n xl: ['1.25rem', 'calc(1.75 / 1.25)'],\n '2xl': ['1.5rem', 'calc(2 / 1.5)'],\n '3xl': ['1.875rem', 'calc(2.25 / 1.875)'],\n '4xl': ['2.25rem', 'calc(2.5 / 2.25)'],\n '5xl': ['3rem', '1'],\n '6xl': ['3.75rem', '1'],\n '7xl': ['4.5rem', '1'],\n '8xl': ['6rem', '1'],\n '9xl': ['8rem', '1'],\n}; ","// complete fontFamily list\n// Default theme reference\n\nexport const fontFamily = {\n sans: [\n '-apple-system',\n 'BlinkMacSystemFont',\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n 'Noto Sans',\n 'Arial',\n 'sans-serif',\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji',\n ],\n serif: [\n 'ui-serif',\n 'Georgia',\n 'Cambria',\n 'Times New Roman',\n 'Times',\n 'serif',\n ],\n mono: [\n 'ui-monospace',\n 'SFMono-Regular',\n 'Menlo',\n 'Monaco',\n 'Consolas',\n 'Liberation Mono',\n 'Courier New',\n 'monospace',\n ],\n}; ","// complete fontWeight scale\n// Default theme reference\n\nexport const fontWeight = {\n thin: '100',\n extralight: '200',\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n}; ","// complete lineHeight scale\n// Default theme reference\n\nexport const lineHeight = {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '2',\n 3: '.75rem',\n 4: '1rem',\n 5: '1.25rem',\n 6: '1.5rem',\n 7: '1.75rem',\n 8: '2rem',\n 9: '2.25rem',\n 10: '2.5rem',\n 11: '2.75rem',\n 12: '3rem',\n}; ","// Complete boxShadow map\n// Default theme reference\n\nexport const boxShadow = {\n '2xs': '0 1px rgb(0 0 0 / 0.05)',\n xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',\n sm: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',\n DEFAULT: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06)',\n md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',\n xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',\n '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',\n inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',\n none: 'none',\n}; ","// complete zIndex scale\n// Default theme reference\n\nexport const zIndex = {\n auto: 'auto',\n 0: '0',\n 10: '10',\n 20: '20',\n 30: '30',\n 40: '40',\n 50: '50',\n}; ","// complete opacity scale\n// Default theme reference\n\nexport const opacity = {\n 0: '0',\n 5: '0.05',\n 10: '0.1',\n 20: '0.2',\n 25: '0.25',\n 30: '0.3',\n 40: '0.4',\n 50: '0.5',\n 60: '0.6',\n 70: '0.7',\n 75: '0.75',\n 80: '0.8',\n 90: '0.9',\n 95: '0.95',\n 100: '1',\n}; ","// complete transitionProperty map\n// Default theme reference\n\nexport const transitionProperty = {\n none: 'none',\n all: 'all',\n DEFAULT: 'color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter',\n colors: 'color, background-color, border-color, text-decoration-color, fill, stroke',\n opacity: 'opacity',\n shadow: 'box-shadow',\n transform: 'transform',\n}; ","// complete transitionTimingFunction scale\n// Default theme reference\n\nexport const transitionTimingFunction = {\n DEFAULT: 'cubic-bezier(0.4, 0, 0.2, 1)',\n linear: 'linear',\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',\n}; ","// complete transitionDuration scale\n// Default theme reference\n\nexport const transitionDuration = {\n DEFAULT: '150ms',\n 75: '75ms',\n 100: '100ms',\n 150: '150ms',\n 200: '200ms',\n 300: '300ms',\n 500: '500ms',\n 700: '700ms',\n 1000: '1000ms',\n}; ","// complete transitionDelay scale\n// Default theme reference\n\nexport const transitionDelay = {\n 75: '75ms',\n 100: '100ms',\n 150: '150ms',\n 200: '200ms',\n 300: '300ms',\n 500: '500ms',\n 700: '700ms',\n 1000: '1000ms',\n}; ","// animation preset\n// default theme reference\n\nexport const animations = {\n spin: 'spin 1s linear infinite',\n ping: 'ping 1s cubic-bezier(0,0,0.2,1) infinite',\n pulse: 'pulse 2s cubic-bezier(0.4,0,0.6,1) infinite',\n bounce: 'bounce 1s infinite',\n}; ","// keyframes preset\n// default theme reference\n\nexport const keyframes = {\n spin: {\n to: {\n transform: 'rotate(360deg)',\n },\n },\n ping: {\n '75%, 100%': {\n transform: 'scale(2)',\n opacity: '0',\n },\n },\n pulse: {\n '50%': {\n opacity: '0.5',\n },\n },\n // #274: Tailwind 4.1.13's frames (0%/100% share the up position; 50% is the floor).\n bounce: {\n '0%, 100%': {\n transform: 'translateY(-25%)',\n 'animation-timing-function': 'cubic-bezier(0.8, 0, 1, 1)',\n },\n '50%': {\n transform: 'none',\n 'animation-timing-function': 'cubic-bezier(0, 0, 0.2, 1)',\n },\n },\n};\n","// animationVars preset\n// default theme reference\nimport { animations } from './animations';\n\nexport const animationVars = {\n '--animate-spin': animations.spin,\n '--animate-ping': animations.ping,\n '--animate-pulse': animations.pulse,\n '--animate-bounce': animations.bounce,\n}; ","// responsive design documentation\n\nexport const breakpoints = {\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n '2xl': '96rem',\n};","// responsive design documentation\n\nexport const container = {\n '3xs': '16rem',\n '2xs': '18rem',\n xs: '20rem',\n sm: '24rem',\n md: '28rem',\n lg: '32rem',\n xl: '36rem',\n '2xl': '42rem',\n '3xl': '48rem',\n '4xl': '56rem',\n '5xl': '64rem',\n '6xl': '72rem',\n '7xl': '80rem',\n};","// complete letterSpacing scale\n// Default theme reference\n\nexport const letterSpacing = {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.1em',\n}; ","// Tailwind 4.1.13 --blur-* scale (bare `blur` / `backdrop-blur` are 8px).\nexport const blur = {\n DEFAULT: '8px',\n xs: '4px',\n sm: '8px',\n md: '12px',\n lg: '16px',\n xl: '24px',\n '2xl': '40px',\n '3xl': '64px',\n};\n","// Tailwind 4.3.3 --text-shadow-* and --drop-shadow-* scales (theme.css).\nexport const textShadow = {\n '2xs': '0px 1px 0px rgb(0 0 0 / 0.15)',\n xs: '0px 1px 1px rgb(0 0 0 / 0.2)',\n sm: '0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)',\n md: '0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)',\n lg: '0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)',\n};\n\nexport const dropShadow = {\n xs: '0 1px 1px rgb(0 0 0 / 0.05)',\n sm: '0 1px 2px rgb(0 0 0 / 0.15)',\n md: '0 3px 3px rgb(0 0 0 / 0.12)',\n lg: '0 4px 4px rgb(0 0 0 / 0.15)',\n xl: '0 9px 7px rgb(0 0 0 / 0.1)',\n '2xl': '0 25px 25px rgb(0 0 0 / 0.15)',\n};\n","// default theme structure implemented to closely match reference\n// Default theme reference\n\nimport { colors } from './colors';\nimport { spacing } from './spacing';\nimport { borderRadius } from './border-radius';\nimport { fontSize } from './font-size';\nimport { fontFamily } from './font-family';\nimport { fontWeight } from './font-weight';\nimport { lineHeight } from './line-height';\nimport { boxShadow } from './box-shadow';\nimport { zIndex } from './z-index';\nimport { opacity } from './opacity';\nimport { transitionProperty } from './transition-property';\nimport { transitionTimingFunction } from './transition-timing-function';\nimport { transitionDuration } from './transition-duration';\nimport { transitionDelay } from './transition-delay';\nimport { animations } from './animations';\nimport { keyframes } from './keyframes';\nimport { animationVars } from './animation-vars';\nimport { breakpoints } from './breakpoints';\nimport { container } from './container';\nimport { letterSpacing } from './letter-spacing';\nimport { blur } from './blur';\nimport { textShadow, dropShadow } from './text-shadow';\n\nexport interface UserTheme {\n [key: string]: unknown;\n}\n\nexport const defaultTheme = {\n colors,\n spacing,\n borderRadius,\n breakpoints,\n container,\n fontSize,\n fontFamily,\n fontWeight,\n letterSpacing,\n lineHeight,\n boxShadow,\n zIndex,\n opacity,\n transitionProperty,\n transitionTimingFunction,\n transitionDuration,\n transitionDelay,\n animations,\n keyframes,\n animationVars,\n blur,\n textShadow,\n dropShadow,\n // Tailwind 4.1.13 --aspect-* (aspect-video → var(--aspect-video))\n aspect: { video: '16 / 9' },\n} as UserTheme; ","// #287: config.utilities (static custom utilities). Internal module: not re-exported from the package index.\nimport type { AstNode } from './ast';\nimport { decl } from './ast';\nimport type { Context } from './context';\nimport { getUtility, registerUtility } from './registry';\nimport { isStructureSafeValue, hasCommentDelimiter } from './parser';\nimport { debugWarn } from '../utils/debug';\n\nconst customUtilityName = /^[A-Za-z_][A-Za-z0-9_-]*$/;\nconst customUtilityProp = /^(--[A-Za-z0-9_-]+|-?[A-Za-z][A-Za-z0-9-]*)$/;\n\n/** The safe declarations of a custom utility, or null when its name or any declaration is invalid. */\nexport function validateCustomUtility(name: unknown, decls: unknown): [string, string][] | null {\n if (typeof name !== 'string' || !customUtilityName.test(name)) return null;\n if (!decls || typeof decls !== 'object' || Array.isArray(decls)) return null;\n const out: [string, string][] = [];\n for (const [prop, raw] of Object.entries(decls as Record<string, unknown>)) {\n if (typeof raw !== 'string' && typeof raw !== 'number') return null;\n const value = String(raw).trim();\n if (!customUtilityProp.test(prop) || !value || !isStructureSafeValue(value) || hasCommentDelimiter(value)) return null;\n out.push([prop, value]);\n }\n return out.length ? out : null;\n}\n\n/**\n * Registers config.utilities on this context, ahead of the built-ins (the first match wins). Like\n * Tailwind 4's `@utility`, a custom utility named like a built-in emits the built-in's declarations\n * first and then its own.\n */\nexport function registerCustomUtilities(ctx: Context, utilities: unknown): void {\n if (!utilities || typeof utilities !== 'object' || Array.isArray(utilities)) return;\n const list = getUtility(ctx);\n const builtins = [...list];\n const before = list.length;\n for (const [name, decls] of Object.entries(utilities as Record<string, unknown>)) {\n const safe = validateCustomUtility(name, decls);\n if (!safe) {\n debugWarn(`[BAROCSS] Ignoring invalid custom utility \"${name}\"`);\n continue;\n }\n const shadowed = builtins.filter((u) => u.match(name));\n registerUtility({\n name,\n category: 'custom',\n match: (className: string) => className === name,\n handler: (value, c, token) => {\n let base: AstNode[] = [];\n for (const reg of shadowed) {\n base = reg.handler(value, c, token, reg) || [];\n if (base.length > 0) break;\n }\n return [...base, ...safe.map(([prop, v]) => decl(prop, v))];\n },\n }, ctx);\n }\n if (list.length > before) list.unshift(...list.splice(before));\n}\n","// BaroCSS Preflight CSS as TypeScript variables\n// This eliminates the need for ?raw imports and improves compatibility\n\nexport const preflightMinimalCSS = `\n/* BaroCSS Preflight - Minimal Reset */\n/* ================================= */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Remove default margin and padding */\n* {\n margin: 0;\n padding: 0;\n}\n\n/* Set core body defaults */\nbody {\n min-height: 100vh;\n scroll-behavior: smooth;\n text-rendering: optimizeSpeed;\n line-height: 1.5;\n}\n\n/* Remove list styles on ul, ol elements */\nul,\nol {\n list-style: none;\n}\n\n/* Make images easier to work with */\nimg,\npicture {\n max-width: 100%;\n display: block;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n html {\n scroll-behavior: auto;\n }\n \n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n`;\n\nexport const preflightStandardCSS = `\n/* BaroCSS Preflight - Standard Reset */\n/* ================================== */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Remove default margin and padding */\n* {\n margin: 0;\n padding: 0;\n}\n\n/* Set core body defaults */\nbody {\n min-height: 100vh;\n scroll-behavior: smooth;\n text-rendering: optimizeSpeed;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n/* Remove list styles on ul, ol elements */\nul,\nol {\n list-style: none;\n}\n\n/* Make images easier to work with */\nimg,\npicture {\n max-width: 100%;\n display: block;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n html {\n scroll-behavior: auto;\n }\n \n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n/* Additional standard resets */\nhtml {\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n /* Tailwind 4.1.13 root font (app --default-font-family / --font-sans win) */\n font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n}\n\n/* Remove the gray background on active links in IE 10 */\na {\n background-color: transparent;\n}\n\n/* Add the correct font weight in Chrome, Edge, and Safari */\nb,\nstrong {\n font-weight: bolder;\n}\n\n/* Prevent sub and sup elements from affecting the line height */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Improve media defaults */\nsvg {\n vertical-align: middle;\n}\n\n/* Remove border on iframe */\niframe {\n border: 0;\n}\n\n/* Table defaults */\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\n/* Form element defaults */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Remove the inner border and padding in Firefox */\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/* Restore the focus styles unset by the previous rule */\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/* Correct the padding in Firefox */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/* Remove padding so developers aren't caught out when they zero out fieldset elements */\nlegend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n}\n\n/* Add the correct vertical alignment in Chrome, Firefox, and Opera */\nprogress {\n vertical-align: baseline;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Remove the default vertical scrollbar in IE */\ntextarea {\n overflow: auto;\n}\n\n/* Correct the cursor style of increment and decrement buttons in Chrome */\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n/* Remove the inner padding in Chrome and Safari on macOS */\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/* Tailwind 4.1.13 monospace stack for code-like elements */\ncode,\nkbd,\nsamp,\npre {\n font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n}\n\n/* Tailwind 4.1.13 form-control reset: inherit typography and colour, drop native radius/background (#228) */\nbutton,\ninput,\nselect,\noptgroup,\ntextarea,\n::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\n:where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n}\n\n:where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n}\n\n::file-selector-button {\n margin-inline-end: 4px;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n}\n\ntextarea {\n resize: vertical;\n}\n`;\n\n/**\n * Full preflight: a port of Tailwind CSS v4.3.3's preflight.css (MIT), rule for rule (#336).\n * `--theme(--x, fallback)` becomes `var(--x, fallback)`; the default sans/mono families also fall back to\n * `--font-sans`/`--font-mono` so a BaroCSS theme applies. Checked by tests/compat/preflight-336.test.ts.\n */\nexport const preflightFullCSS = `\n/* BaroCSS Preflight - Full (Tailwind 4.3.3) */\n*,\n::after,\n::before,\n::backdrop,\n::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n}\n\nhtml,\n:host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n}\n\nhr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\na {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp,\npre {\n font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\ntable {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n\n:-moz-focusring:where(:not(iframe)) {\n outline: auto;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\nsummary {\n display: list-item;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n}\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* form-control reset */\nbutton,\ninput,\nselect,\noptgroup,\ntextarea,\n::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\n:where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n}\n\n:where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n}\n\n::file-selector-button {\n margin-inline-end: 4px;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n@supports (not (-webkit-appearance: -apple-pay-button)) or\n (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n}\n\ntextarea {\n resize: vertical;\n}\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n}\n\n::-webkit-datetime-edit {\n display: inline-flex;\n}\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-datetime-edit,\n::-webkit-datetime-edit-year-field,\n::-webkit-datetime-edit-month-field,\n::-webkit-datetime-edit-day-field,\n::-webkit-datetime-edit-hour-field,\n::-webkit-datetime-edit-minute-field,\n::-webkit-datetime-edit-second-field,\n::-webkit-datetime-edit-millisecond-field,\n::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n}\n\n::-webkit-calendar-picker-indicator {\n line-height: 1;\n}\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\nbutton,\ninput:where([type='button'], [type='reset'], [type='submit']),\n::file-selector-button {\n appearance: button;\n}\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n[hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n}\n`;\n","import { setDebug } from \"../utils/debug\";\nimport { defaultTheme } from \"../theme\";\nimport { themeToCssVarsAll, toCssVarsBlock } from \"./cssVars\";\nimport { getModifier, getUtility } from './registry';\nimport { clearContextCaches, initializeContextState } from './contextState';\nimport { registerCustomUtilities } from './customUtilities';\nimport { preflightMinimalCSS, preflightStandardCSS, preflightFullCSS } from \"../css/preflight\";\n\ntype PreflightLevel = 'minimal' | 'standard' | 'full' | true | false;\n\ntype Function = (...args: unknown[]) => unknown;\ntype ContextRecord = Record<string, unknown>;\n\nexport function getPreflightCSS(level: PreflightLevel = true): string {\n if (level === 'minimal') {\n return preflightMinimalCSS;\n } else if (level === 'standard') {\n return preflightStandardCSS;\n } else if (level === 'full') {\n return preflightFullCSS;\n } else if (level === true) {\n return preflightFullCSS;\n } else if (level === false) {\n return '';\n }\n return '';\n}\n\n// Types for theme/config/context\nexport interface Theme {\n extend?: Theme;\n [namespace: string]: unknown;\n}\n\nexport interface Config {\n prefix?: string; // class prefix, Tailwind 4 `prefix(tw)` syntax: 'tw' -> `tw:flex`, `tw:hover:p-4`; lowercase letters; default none\n cssVarPrefix?: string; // prefix for generated CSS custom properties, default '--bcss-'\n /**\n * Modern dark mode strategy\n * - 'media': uses @media (prefers-color-scheme: dark)\n * - 'class': uses .dark selector\n * - string[]: custom selectors (e.g. ['class', '[data-theme=\"dark\"]'])\n */\n darkMode?: 'media' | 'class' | string[];\n theme?: Theme;\n presets?: { theme: Theme }[];\n\n /**\n * Whether to include preflight CSS\n * - 'minimal': Minimal preflight CSS\n * - 'standard': Standard preflight CSS\n * - 'full': Full preflight CSS\n * - true: Full preflight CSS (default)\n * - false: No preflight CSS\n * \n * default: true (full preflight)\n */\n preflight?: PreflightLevel;\n /**\n * Enable kit console diagnostics (off by default).\n * This sets a process-wide flag (see setDebug): it affects every context, and a\n * config without this key leaves the current flag unchanged.\n */\n debug?: boolean;\n /**\n * @deprecated Contexts now own their caches. Creating a context does not\n * clear caches that belong to another context.\n */\n clearCacheOnContextChange?: boolean;\n /**\n * #287: static custom utilities, the runtime mirror of a stylesheet's static `@utility name { ... }`.\n * Name → declarations (property → value; CSS custom properties allowed). Each one is registered on\n * this context only; variants and `!` apply as usual. A name equal to a built-in extends it like\n * `@utility` in Tailwind 4: the built-in declarations are emitted first, then the custom ones (a later\n * duplicate property wins). An entry with an invalid name, property or value is skipped whole.\n * @example utilities: { 'max-w-app': { 'max-width': '72rem', 'margin-inline': 'auto' } }\n */\n utilities?: CustomUtilities;\n [key: string]: unknown;\n}\n\n/** #287: declarations of one static custom utility (property → value). */\nexport type CustomUtilityDeclarations = Record<string, string | number>;\n/** #287: static custom utilities by class name. */\nexport type CustomUtilities = Record<string, CustomUtilityDeclarations>;\n\n\nexport const defaultConfig: Config = {\n darkMode: 'media', // same as default\n};\n\nexport interface Context {\n hasPreset: (category: string, preset: string) => boolean;\n theme: (...path: (string|number)[]) => unknown;\n config: (...path: (string|number)[]) => unknown;\n themeToCssVars: (prefix?: string) => string;\n // Safe API for extending theme from plugins\n extendTheme: (category: string, values: Record<string, unknown> | Function) => void;\n getPreflightCSS: (level?: PreflightLevel) => string;\n}\n\n// Deep merge utility\nexport function deepMerge<T extends Record<string, unknown>>(base: T, override: Partial<T>): T {\n const result: Record<string, unknown> = {};\n const keys = new Set([\n ...Object.keys(base || {}),\n ...Object.keys(override || {}),\n ]);\n for (const key of keys) {\n const skey = String(key);\n const baseVal = base && typeof base === 'object' ? (base as T)[skey] : undefined;\n const overrideVal = override && typeof override === 'object' ? (override as T)[skey] : undefined;\n if (\n overrideVal &&\n typeof overrideVal === 'object' &&\n !Array.isArray(overrideVal)\n ) {\n result[skey] = deepMerge(\n (typeof baseVal === 'object' && baseVal !== null) ? baseVal as T : {} as T,\n overrideVal\n );\n } else if (overrideVal !== undefined) {\n result[skey] = overrideVal;\n } else {\n result[skey] = baseVal;\n }\n }\n return result as T;\n}\n\nexport type ThemeGetter = (...path: (string|number)[]) => unknown;\n\nconst themeLookupsInProgress = new WeakMap<Theme, Set<string>>();\n\n/**\n * Modern theme getter for BAROCSS\n *\n * - Supports category-level (first path segment) function values only.\n * - If the category (e.g., 'spacing', 'colors') is a function, it will be executed with the theme getter as argument.\n * - This allows dynamic theme extension and plugin-style patterns, e.g.:\n * spacing: (theme) => ({ ...theme('spacing'), '72': '18rem' })\n * - Leaf (property) functions are NOT supported and will be ignored (returns undefined).\n * - Infinite recursion is prevented: If the exact same path is being resolved recursively (directly or indirectly), undefined is returned for that call.\n * - Category-level functions can safely call theme('category.otherKey') for dynamic references.\n * - Only true recursion on the same path is blocked.\n * - All theme lookups (theme('category.key')) will always re-execute the category function if present, ensuring dynamic resolution.\n *\n * @param themeObj - The theme object (possibly with category functions)\n * @param path - Path segments (string or number), or dot-path string (e.g. 'colors.red.500')\n * @returns The resolved theme value, or undefined if not found or if a leaf function is encountered\n *\n * @example\n * const theme = {\n * spacing: (theme) => ({ 1: '0.25rem', 2: theme('spacing.1') }),\n * };\n * themeGetter(theme, 'spacing.2'); // '0.25rem'\n *\n * @example\n * // Infinite recursion is prevented:\n * const theme = {\n * spacing: (theme) => theme('spacing.1'),\n * };\n * themeGetter(theme, 'spacing.1'); // undefined\n */\nexport function themeGetter(themeObj: Theme, ...path: (string | number)[]): unknown {\n // The theme getter function itself, passed to category functions for dynamic resolution\n const theme: ThemeGetter = (...args: (string | number)[]) => themeGetter(themeObj, ...args);\n\n // Parse the path: support both dot-path string and array of segments\n let keys: (string | number)[] = [];\n if (path.length === 1 && typeof path[0] === 'string' && path[0].includes('.')) {\n keys = path[0].split('.');\n } else {\n if (path[0] === 'colors' && typeof path[1] === 'string' && path[1].includes('-')) {\n // colors.red-500 → colors.red.500 (only for color names with numbers)\n // But custom-blue should remain as custom-blue\n const colorKey = path[1] as string;\n if (colorKey.match(/^[a-zA-Z]+-\\d+$/)) {\n // Only split if it's a pattern like \"red-500\", \"blue-600\", etc.\n keys = colorKey.split('-');\n keys = [path[0], ...keys];\n } else {\n // For custom keys like \"custom-blue\", keep as is\n keys = path;\n }\n } else {\n keys = path;\n }\n }\n if (keys.length === 0) return undefined;\n\n // Infinite recursion protection: track currently resolving full paths\n // If the exact same path is being resolved recursively, return undefined\n let inProgress = themeLookupsInProgress.get(themeObj);\n if (!inProgress) {\n inProgress = new Set();\n themeLookupsInProgress.set(themeObj, inProgress);\n }\n const pathKey = keys.join('.');\n if (inProgress.has(pathKey)) return undefined;\n inProgress.add(pathKey);\n\n try {\n // Get the category value (could be a function or object)\n let value = themeObj[keys[0]];\n // If the category is a function, execute it with the theme getter.\n if (typeof value === 'function') {\n value = value(theme);\n }\n\n for (let i = 1; i < keys.length; i++) {\n if (value == null) return undefined;\n value = (value as Record<string, unknown>)[keys[i]];\n }\n\n // Leaf functions are not supported.\n if (typeof value === 'function') return undefined;\n return value;\n } finally {\n inProgress.delete(pathKey);\n }\n}\n\n// config getter\nexport function configGetter(config: ContextRecord, ...path: (string|number)[]): unknown {\n let keys: (string|number)[] = [];\n if (path.length === 1 && typeof path[0] === 'string' && path[0].includes('.')) {\n keys = path[0].split('.');\n } else {\n keys = path;\n }\n return keys.reduce((acc: unknown, key) => (acc ? (acc as Record<string, unknown>)[key] : undefined), config) as unknown as ContextRecord;\n}\n\n// hasPreset\nexport function hasPreset(themeObj: Theme, category: string, preset: string): boolean {\n return (themeObj[category] as string[])?.includes?.(preset) as boolean;\n}\n\n// resolveTheme\nexport function resolveTheme(config: Config): Theme {\n let theme: Theme = {};\n if (config.presets) {\n for (const preset of config.presets) {\n if (preset.theme) {\n theme = deepMerge(theme, preset.theme);\n }\n }\n }\n if (config.theme) {\n const { extend, ...overrideTheme } = config.theme as Theme;\n theme = deepMerge(theme, overrideTheme); // switch from shallowMerge to deepMerge\n if (extend) {\n theme = deepMerge(theme, extend);\n }\n }\n return theme;\n}\n\n\nexport function themeToCssVars(theme: Theme): string {\n const vars = themeToCssVarsAll(theme);\n // console.log('[themeToCssVars] vars', vars);\n // #274: @keyframes are emitted on demand next to the classes that reference them (referencedKeyframes),\n // so a page's own @keyframes of the same name is never overridden by an unused theme copy.\n const result = toCssVarsBlock(vars);\n\n// console.log('[themeToCssVars] result', result);\n\n return result;\n}\n\n// createContext\nexport function createContext(configObj: Config): Context {\n if (configObj.debug !== undefined) setDebug(!!configObj.debug);\n // Automatically include defaultTheme as the base preset\n const configWithDefaults = {\n presets: [\n { theme: defaultTheme }, // always include defaultTheme as base preset\n ...(configObj.presets || [])\n ],\n ...configObj\n };\n const themeObj = resolveTheme(configWithDefaults);\n\n // 1. Declare ctx first as an object\n const ctx: Context = {\n hasPreset: (category: string, preset: string): boolean => {\n const result = hasPreset(themeObj, category, preset);\n // console.log(`[hasPreset] category: ${category}, preset: ${preset} =>`, result);\n return result as boolean;\n },\n theme: (...args) => {\n const result = themeGetter(themeObj, ...args);\n // console.log(`[theme] path:`, args, `=>`, result);\n return result;\n },\n config: (...args) => {\n const result = configGetter(configWithDefaults, ...args);\n // console.log(`[config] path:`, args, `=>`, result);\n return result;\n },\n themeToCssVars: () => themeToCssVars(themeObj),\n // Safe API for theme extension from plugins\n extendTheme: (category: string, values: Record<string, unknown> | Function) => {\n // console.log(`[extendTheme] category: ${category}, values:`, values);\n \n if (typeof values === 'function') {\n // If it's a function, execute with theme getter\n const themeFunction = values as (theme: ThemeGetter) => unknown;\n const result = themeFunction(ctx.theme);\n if (result && typeof result === 'object') {\n // Merge with existing values\n const existingValues = themeObj[category] || {} as Record<string, unknown>;\n themeObj[category] = {\n ...existingValues,\n ...result\n };\n // console.log(`[extendTheme] function result merged for ${category}:`, themeObj[category]);\n }\n } else if (typeof values === 'object' && values !== null && !Array.isArray(values)) {\n // Get existing category values\n const existingValues = themeObj[category] || {} as Record<string, unknown>;\n \n // Merge existing and new values\n themeObj[category] = {\n ...existingValues,\n ...values\n };\n // console.log(`[extendTheme] merged ${category}:`, themeObj[category]);\n } else {\n // console.warn(`[extendTheme] Invalid values for category ${category}:`, values);\n }\n clearContextCaches(ctx);\n },\n getPreflightCSS: (level: PreflightLevel = true) => {\n return getPreflightCSS(level);\n }\n };\n\n // 2. Property assignment (functions reference themeObj, configWithDefaults, etc.)\n // ctx.hasPreset = (category: string, preset: string) => {\n // const result = hasPreset(themeObj, category, preset);\n // console.log(`[hasPreset] category: ${category}, preset: ${preset} =>`, result);\n // return result;\n // };\n // ctx.theme = (...args) => {\n // const value = themeGetter(themeObj, ...args);\n // console.log(`[theme] path:`, args, '=>', value);\n // return value;\n // };\n // ctx.config = (...args) => {\n // const value = configGetter(configWithDefaults, ...args);\n // console.log(`[config] path:`, args, '=>', value);\n // return value;\n // };\n // ctx.plugins = configWithDefaults.plugins ?? [];\n // ctx.themeToCssVars = () => themeToCssVars(themeObj);\n\n initializeContextState(ctx, getUtility(), getModifier());\n registerCustomUtilities(ctx, configObj.utilities);\n return ctx;\n}\n","import { atRule, decl, type AstNode } from \"./ast\";\n// Value parsing helpers inspired by value-parser.ts\n\n/**\n * Extracts the value from [arbitrary] syntax, or returns null if not arbitrary.\n */\nexport function parseArbitraryValue(input: string): string | null {\n return input.startsWith('[') && input.endsWith(']') ? input.slice(1, -1) : null;\n}\n\n/**\n * Parses a fraction string (e.g., '1/2') and returns a percentage string (e.g., '50%'), or null if not a valid fraction.\n */\nexport function parseFraction(input: string): string | null {\n if (input.includes('/')) {\n const [num, denom] = input.split('/').map(Number);\n if (!isNaN(num) && !isNaN(denom) && denom !== 0) {\n return `${(num / denom) * 100}%`;\n }\n }\n return null;\n}\n\n/**\n * Returns the input if it is a valid non-negative integer string, else null.\n * \n * @example\n * parseNumber(\"10\") // \"10\"\n * parseNumber(\"-10\") // \"-10\"\n * parseNumber(\"10.5\") // \"10.5\"\n */\nexport function parseNumber(input: string): string | null {\n // Accept integers and decimals (e.g., 1, -2, 1.5, -0.25)\n return /^-?\\d+(?:\\.\\d+)?$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input if it is a valid non-negative integer string, else null.\n * \n * @example\n * parseInteger(\"10\") // \"10\"\n * parseInteger(\"-10\") // null\n * parseInteger(\"10.5\") // null\n */\nexport function parseInteger(input: string): string | null {\n return /^-?\\d+$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input if it is a valid length string, else null.\n */\nexport function parseLength(input: string): string | null {\n return /^\\d+(px|em|rem|vh|vw|vmin|vmax|%|in|cm|mm|pt|pc|ex|ch|fr)$/.test(input) ? input : null;\n}\n\n/**\n * Returns the input without a leading '-' if negative, else null.\n */\nexport function parseNegative(input: string): string | null {\n return input.startsWith('-') ? input.slice(1) : null;\n}\n\n/**\n * Returns the input if it is a valid CSS var() expression, else null.\n */\nexport function parseVar(input: string): string | null {\n return input.startsWith('var(') && input.endsWith(')') ? input : null;\n}\n\n/**\n * Unified parser for fraction or number, with options for percent or repeat syntax.\n * - percent: if true, returns percentage for fraction (e.g., '1/2' -> '50%')\n * - repeat: if true, returns repeat() for number (e.g., '3' -> 'repeat(3, minmax(0, 1fr))')\n */\nexport function parseFractionOrNumber(value: string, opts: { percent?: boolean; repeat?: boolean } = {}): string | null {\n if (/^\\d+$/.test(value)) {\n if (opts.repeat) return `repeat(${value}, minmax(0, 1fr))`;\n return value;\n }\n if (value.includes('/')) {\n const [numerator, denominator] = value.split('/').map(Number);\n if (!isNaN(numerator) && !isNaN(denominator) && denominator !== 0) {\n const result = numerator / denominator;\n if (opts.percent) return `${result * 100}%`;\n return result.toString();\n }\n }\n return null;\n} \n\nconst CSS_COLOR_NAMES = new Set([\n \"aliceblue\",\n \"antiquewhite\",\n \"aqua\",\n \"aquamarine\",\n \"azure\",\n \"beige\",\n \"bisque\",\n \"black\",\n \"blanchedalmond\",\n \"blue\",\n \"blueviolet\",\n \"brown\",\n \"burlywood\",\n \"cadetblue\",\n \"chartreuse\",\n \"chocolate\",\n \"coral\",\n \"cornflowerblue\",\n \"cornsilk\",\n \"crimson\",\n \"cyan\",\n \"darkblue\",\n \"darkcyan\",\n \"darkgoldenrod\",\n \"darkgray\",\n \"darkgreen\",\n \"darkgrey\",\n \"darkkhaki\",\n \"darkmagenta\",\n \"darkolivegreen\",\n \"darkorange\",\n \"darkorchid\",\n \"darkred\",\n \"darksalmon\",\n \"darkseagreen\",\n \"darkslateblue\",\n \"darkslategray\",\n \"darkslategrey\",\n \"darkturquoise\",\n \"darkviolet\",\n \"deeppink\",\n \"deepskyblue\",\n \"dimgray\",\n \"dimgrey\",\n \"dodgerblue\",\n \"firebrick\",\n \"floralwhite\",\n \"forestgreen\",\n \"fuchsia\",\n \"gainsboro\",\n \"ghostwhite\",\n \"gold\",\n \"goldenrod\",\n \"gray\",\n \"grey\",\n \"green\",\n \"greenyellow\",\n \"honeydew\",\n \"hotpink\",\n \"indianred\",\n \"indigo\",\n \"ivory\",\n \"khaki\",\n \"lavender\",\n \"lavenderblush\",\n \"lawngreen\",\n \"lemonchiffon\",\n \"lightblue\",\n \"lightcoral\",\n \"lightcyan\",\n \"lightgoldenrodyellow\",\n \"lightgray\",\n \"lightgreen\",\n \"lightgrey\",\n \"lightpink\",\n \"lightsalmon\",\n \"lightseagreen\",\n \"lightskyblue\",\n \"lightslategray\",\n \"lightslategrey\",\n \"lightsteelblue\",\n \"lightyellow\",\n \"lime\",\n \"limegreen\",\n \"linen\",\n \"magenta\",\n \"maroon\",\n \"mediumaquamarine\",\n \"mediumblue\",\n \"mediumorchid\",\n \"mediumpurple\",\n \"mediumseagreen\",\n \"mediumslateblue\",\n \"mediumspringgreen\",\n \"mediumturquoise\",\n \"mediumvioletred\",\n \"midnightblue\",\n \"mintcream\",\n \"mistyrose\",\n \"moccasin\",\n \"navajowhite\",\n \"navy\",\n \"oldlace\",\n \"olive\",\n \"olivedrab\",\n \"orange\",\n \"orangered\",\n \"orchid\",\n \"palegoldenrod\",\n \"palegreen\",\n \"paleturquoise\",\n \"palevioletred\",\n \"papayawhip\",\n \"peachpuff\",\n \"peru\",\n \"pink\",\n \"plum\",\n \"powderblue\",\n \"purple\",\n \"red\",\n \"rosybrown\",\n \"royalblue\",\n \"saddlebrown\",\n \"salmon\",\n \"sandybrown\",\n \"seagreen\",\n \"seashell\",\n \"sienna\",\n \"silver\",\n \"skyblue\",\n \"slateblue\",\n \"slategray\",\n \"slategrey\",\n \"snow\",\n \"springgreen\",\n \"steelblue\",\n \"tan\",\n \"teal\",\n \"thistle\",\n \"tomato\",\n \"turquoise\",\n \"violet\",\n \"wheat\",\n \"white\",\n \"whitesmoke\",\n \"yellow\",\n \"yellowgreen\",\n]);\n\n/**\n * Returns the input if it is a valid color string, else null.\n *\n * #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(r, g, b), rgb(r, g, b, a), hsl(h, s, l), hsl(h, s, l, a), hwb(h, w, b), hwb(h, w, b, a), lab(l, a, b), lab(l, a, b, a), lch(l, c, h), lch(l, c, h, a), oklab(l, a, b), oklab(l, a, b, a), oklch(l, c, h), oklch(l, c, h, a), color-mix(in oklab, var(--color-blue-500) 60%, transparent)\n */\nexport function parseColor(input: string): string | null {\n\n // CSS named colors\n if (CSS_COLOR_NAMES.has(input.toLowerCase())) {\n return input;\n }\n\n if (input.startsWith('color:var(')) {\n return input.slice(6);\n }\n\n if (input.startsWith('color:')) {\n return parseColor(input.slice(6));\n }\n\n // hex\n if (input.startsWith('#') && input.length === 4) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 5) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 7) {\n return `#${input.slice(1)}`;\n }\n if (input.startsWith('#') && input.length === 9) {\n return `#${input.slice(1)}`;\n }\n\n\n // rgb\n if (input.startsWith('rgb(')) {\n return input.slice(4, -1);\n }\n\n // rgba\n if (input.startsWith('rgba(')) {\n return input.slice(5, -1);\n }\n\n // hsl\n if (input.startsWith('hsl(')) {\n return input.slice(4, -1);\n }\n\n // hsla\n if (input.startsWith('hsla(')) {\n return input.slice(5, -1);\n }\n\n // hwb\n if (input.startsWith('hwb(')) {\n return input.slice(4, -1);\n }\n\n // lab\n if (input.startsWith('lab(')) {\n return input.slice(4, -1);\n }\n\n // lch\n if (input.startsWith('lch(')) {\n return input.slice(4, -1);\n }\n\n // oklab\n if (input.startsWith('oklab(')) {\n return input.slice(5, -1);\n }\n\n // oklch\n if (input.startsWith('oklch(')) {\n return input.slice(6, -1);\n }\n\n // color-mix\n if (input.startsWith('color-mix(')) {\n return input.slice(9, -1);\n }\n\n\n return null;\n}\nconst COLOR_KEYWORDS = new Set(['inherit', 'currentcolor', 'transparent']);\n/**\n * Declarations for a theme colour (#228), as Tailwind v4 emits them: `var(--color-<key>)` so runtime theme\n * overrides apply; with an opacity modifier, a literal srgb color-mix fallback plus an oklab color-mix of the var.\n */\nexport function themeColorDecls(prop: string, value: string, extra: { realThemeValue?: string; opacity?: string | number }): AstNode[] {\n const key = String(extra.realThemeValue);\n // A value that is already a var (shadcn-style `@theme inline` tokens) is kept as-is, as Tailwind inlines it.\n const ref = COLOR_KEYWORDS.has(value.toLowerCase()) || value.startsWith(\"var(\") || !/^[\\w-]+$/.test(key) ? value : `var(--color-${key})`;\n if (!extra.opacity) return [decl(prop, ref)];\n const alpha = normalizeAlpha(String(extra.opacity));\n const supports = (amount: string) =>\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [decl(prop, `color-mix(in oklab, ${ref} ${amount}, transparent)`)]);\n // A variable alpha has no static fallback amount: Tailwind keeps the plain colour and mixes only under @supports.\n if (alpha.isVar) return [decl(prop, value), supports(alpha.amount)];\n return [decl(prop, `color-mix(in srgb, ${value} ${alpha.amount}, transparent)`), supports(alpha.amount)];\n}\n\n/**\n * Opacity modifier → color-mix amount, as Tailwind v4 does: `50` → `50%`, `[37%]` → `37%`, `[0.5]` / `[.8]` → `50%` /\n * `80%` (a bracketed number ≤ 1 is a fraction), `[var(--a)]` / `(--a)` → `var(--a)`.\n */\nexport function normalizeAlpha(raw: string): { amount: string; isVar: boolean } {\n let v = raw.trim();\n const bracketed = v.startsWith(\"[\") && v.endsWith(\"]\");\n if (bracketed) v = v.slice(1, -1).trim();\n if (v.startsWith(\"(\") && v.endsWith(\")\")) v = `var(${v.slice(1, -1).trim()})`;\n if (v.startsWith(\"var(\")) return { amount: v, isVar: true };\n if (v.endsWith(\"%\")) return { amount: v, isVar: false };\n const n = Number(v);\n if (v !== \"\" && Number.isFinite(n)) {\n const pct = bracketed && n <= 1 ? n * 100 : n;\n return { amount: `${+pct.toFixed(4)}%`, isVar: false };\n }\n return { amount: v, isVar: false };\n}\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRule, atRoot, decl, property, type AstNode } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Accent Color Utilities ---\n// accent-color documentation\n\n// Theme color utilities (e.g. accent-inherit, accent-blue-500)\n// (Assume theme color registration is handled elsewhere, or extend as needed)\n\nstaticUtility(\"accent-inherit\", [[\"accent-color\", \"inherit\"]], { category: 'interactivity' });\nstaticUtility(\"accent-current\", [[\"accent-color\", \"currentColor\"]], { category: 'interactivity' });\nstaticUtility(\"accent-transparent\", [[\"accent-color\", \"transparent\"]], { category: 'interactivity' });\n\n// Functional: arbitrary value (accent-[value])\nfunctionalUtility({\n name: \"accent\",\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token, extra) => {\n if (extra?.realThemeValue) {\n if (extra.opacity) {\n return [\n atRule(\"supports\", `(color:color-mix(in lab, red, red))`, [\n decl(\n \"accent-color\",\n `color-mix(in lab, ${value} ${extra.opacity}%, transparent)`\n ),\n ]),\n decl(\"accent-color\", value),\n ];\n }\n\n return [decl(\"accent-color\", `var(--color-${extra.realThemeValue})`)];\n }\n\n return [decl(\"accent-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"accent-color\", `var(${value})`)],\n description: \"accent-color utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Appearance Utilities ---\n// appearance documentation\n\n// appearance-none: removes native form control styling\nstaticUtility(\"appearance-none\", [[\"appearance\", \"none\"]], { category: 'interactivity' });\n// appearance-auto: restores default browser styling\nstaticUtility(\"appearance-auto\", [[\"appearance\", \"auto\"]], { category: 'interactivity' });\n\n// --- Caret Color Utilities ---\n// caret-color documentation\n\n// Static caret colors\nstaticUtility(\"caret-inherit\", [[\"caret-color\", \"inherit\"]], { category: 'interactivity' });\nstaticUtility(\"caret-current\", [[\"caret-color\", \"currentColor\"]], { category: 'interactivity' });\nstaticUtility(\"caret-transparent\", [[\"caret-color\", \"transparent\"]], { category: 'interactivity' });\n\n// Theme color utilities (e.g. caret-blue-500)\n// (Assume theme color registration is handled elsewhere)\n\n// Functional: arbitrary value (caret-[value]) and custom property (caret-(--my-caret))\nfunctionalUtility({\n name: \"caret\",\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) {\n if (extra.opacity) {\n return [\n atRule(\"supports\", `(color:color-mix(in lab, red, red))`, [\n decl(\n \"caret-color\",\n `color-mix(in lab, ${value} ${extra.opacity}%, transparent)`\n ),\n ]),\n decl(\"caret-color\", value),\n ];\n }\n\n return [decl(\"caret-color\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"caret-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"caret-color\", `var(${value})`)],\n description:\n \"caret-color utility (static, theme, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Color Scheme Utilities ---\n// color-scheme documentation\n\n// scheme-normal: color-scheme: normal;\nstaticUtility(\"scheme-normal\", [[\"color-scheme\", \"normal\"]], { category: 'interactivity' });\n// scheme-dark: color-scheme: dark;\nstaticUtility(\"scheme-dark\", [[\"color-scheme\", \"dark\"]], { category: 'interactivity' });\n// scheme-light: color-scheme: light;\nstaticUtility(\"scheme-light\", [[\"color-scheme\", \"light\"]], { category: 'interactivity' });\n// scheme-light-dark: color-scheme: light dark;\nstaticUtility(\"scheme-light-dark\", [[\"color-scheme\", \"light dark\"]], { category: 'interactivity' });\n// scheme-only-dark: color-scheme: only dark;\nstaticUtility(\"scheme-only-dark\", [[\"color-scheme\", \"only dark\"]], { category: 'interactivity' });\n// scheme-only-light: color-scheme: only light;\nstaticUtility(\"scheme-only-light\", [[\"color-scheme\", \"only light\"]], { category: 'interactivity' });\n\n// --- Cursor Utilities ---\n// cursor documentation\n\n// Static cursor values\n[\n \"auto\",\n \"default\",\n \"pointer\",\n \"wait\",\n \"text\",\n \"move\",\n \"help\",\n \"not-allowed\",\n \"none\",\n \"context-menu\",\n \"progress\",\n \"cell\",\n \"crosshair\",\n \"vertical-text\",\n \"alias\",\n \"copy\",\n \"no-drop\",\n \"grab\",\n \"grabbing\",\n \"all-scroll\",\n \"col-resize\",\n \"row-resize\",\n \"n-resize\",\n \"e-resize\",\n \"s-resize\",\n \"w-resize\",\n \"ne-resize\",\n \"nw-resize\",\n \"se-resize\",\n \"sw-resize\",\n \"ew-resize\",\n \"ns-resize\",\n \"nesw-resize\",\n \"nwse-resize\",\n \"zoom-in\",\n \"zoom-out\",\n].forEach((cursor) => {\n staticUtility(`cursor-${cursor}`, [[\"cursor\", cursor]], { category: 'interactivity' });\n});\n\n// Functional: custom property (cursor-(--my-cursor)) and arbitrary value (cursor-[value])\nfunctionalUtility({\n name: \"cursor\",\n prop: \"cursor\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"cursor utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Field Sizing Utilities ---\n// field-sizing documentation\n\n// field-sizing-fixed: field-sizing: fixed;\nstaticUtility(\"field-sizing-fixed\", [[\"field-sizing\", \"fixed\"]], { category: 'interactivity' });\n// field-sizing-content: field-sizing: content;\nstaticUtility(\"field-sizing-content\", [[\"field-sizing\", \"content\"]], { category: 'interactivity' });\n\n// --- Pointer Events Utilities ---\n// pointer-events documentation\n\n// pointer-events-auto: pointer-events: auto;\nstaticUtility(\"pointer-events-auto\", [[\"pointer-events\", \"auto\"]], { category: 'interactivity' });\n// pointer-events-none: pointer-events: none;\nstaticUtility(\"pointer-events-none\", [[\"pointer-events\", \"none\"]], { category: 'interactivity' });\n\n// --- Resize Utilities ---\n// resize documentation\n\n// resize: resize: both;\nstaticUtility(\"resize\", [[\"resize\", \"both\"]], { category: 'interactivity' });\n// resize-x: resize: horizontal;\nstaticUtility(\"resize-x\", [[\"resize\", \"horizontal\"]], { category: 'interactivity' });\n// resize-y: resize: vertical;\nstaticUtility(\"resize-y\", [[\"resize\", \"vertical\"]], { category: 'interactivity' });\n// resize-none: resize: none;\nstaticUtility(\"resize-none\", [[\"resize\", \"none\"]], { category: 'interactivity' });\n\n// --- Scroll Behavior Utilities ---\n// scroll-behavior documentation\n\n// scroll-auto: scroll-behavior: auto;\nstaticUtility(\"scroll-auto\", [[\"scroll-behavior\", \"auto\"]], { category: 'interactivity' });\n// scroll-smooth: scroll-behavior: smooth;\nstaticUtility(\"scroll-smooth\", [[\"scroll-behavior\", \"smooth\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Align Utilities ---\n// scroll-snap-align documentation\nstaticUtility(\"snap-start\", [[\"scroll-snap-align\", \"start\"]], { category: 'interactivity' });\nstaticUtility(\"snap-end\", [[\"scroll-snap-align\", \"end\"]], { category: 'interactivity' });\nstaticUtility(\"snap-center\", [[\"scroll-snap-align\", \"center\"]], { category: 'interactivity' });\nstaticUtility(\"snap-align-none\", [[\"scroll-snap-align\", \"none\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Stop Utilities ---\n// scroll-snap-stop documentation\nstaticUtility(\"snap-normal\", [[\"scroll-snap-stop\", \"normal\"]], { category: 'interactivity' });\nstaticUtility(\"snap-always\", [[\"scroll-snap-stop\", \"always\"]], { category: 'interactivity' });\n\n// --- Scroll Snap Type Utilities ---\n// scroll-snap-type documentation\nstaticUtility(\"snap-none\", [[\"scroll-snap-type\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"snap-x\", [[\"scroll-snap-type\", \"x var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-y\", [[\"scroll-snap-type\", \"y var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-both\", [[\"scroll-snap-type\", \"both var(--baro-scroll-snap-strictness)\"]], { category: 'interactivity' });\nstaticUtility(\"snap-mandatory\", [[\"--baro-scroll-snap-strictness\", \"mandatory\"]], { category: 'interactivity' });\nstaticUtility(\"snap-proximity\", [[\"--baro-scroll-snap-strictness\", \"proximity\"]], { category: 'interactivity' });\n\n\n[\n [\"mbs\", \"scroll-margin-block-start\"], // #311 (Tailwind 4.3), before `mb`\n [\"mbe\", \"scroll-margin-block-end\"],\n [\"mt\", \"scroll-margin-top\"],\n [\"mr\", \"scroll-margin-right\"],\n [\"mb\", \"scroll-margin-bottom\"],\n [\"ml\", \"scroll-margin-left\"],\n [\"mx\", \"scroll-margin-inline\"],\n [\"my\", \"scroll-margin-block\"],\n [\"ms\", \"scroll-margin-inline-start\"],\n [\"me\", \"scroll-margin-inline-end\"],\n [\"m\", \"scroll-margin\"],\n].forEach(([name, prop]) => {\n // #314: 1px keyword, as Tailwind 4.3.3 (negative too, for margin only).\n staticUtility(`scroll-${name}-px`, [[prop, \"1px\"]], { category: 'interactivity' });\n staticUtility(`-scroll-${name}-px`, [[prop, \"-1px\"]], { category: 'interactivity' });\n functionalUtility({\n name: `scroll-${name}`,\n spacingKeys: true,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token, _extra) => {\n if (parseNumber(value) || token.negative) {\n return [decl(prop, `calc(var(--spacing) * ${value})`)];\n }\n return [decl(prop, value)];\n },\n handleCustomProperty: (value) => [decl(prop, `var(${value})`)],\n description: `${name} utility (static, arbitrary, custom property supported)`,\n category: \"interactivity\",\n });\n});\n\n\n\n\n\n[\n [\"pbs\", \"scroll-padding-block-start\"], // #311 (Tailwind 4.3), before `pb`\n [\"pbe\", \"scroll-padding-block-end\"],\n [\"pt\", \"scroll-padding-top\"],\n [\"pr\", \"scroll-padding-right\"],\n [\"pb\", \"scroll-padding-bottom\"],\n [\"pl\", \"scroll-padding-left\"],\n [\"px\", \"scroll-padding-inline\"],\n [\"py\", \"scroll-padding-block\"],\n [\"ps\", \"scroll-padding-inline-start\"],\n [\"pe\", \"scroll-padding-inline-end\"],\n [\"p\", \"scroll-padding\"],\n].forEach(([name, prop]) => {\n functionalUtility({\n name: `scroll-${name}`,\n spacingKeys: true,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : /^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, token, _extra) => {\n // #314: Tailwind 4.3.3 has no negative scroll-padding; `px` is 1px.\n if (token.negative) return [];\n if (parseNumber(value)) {\n return [decl(prop, `calc(var(--spacing) * ${value})`)];\n }\n return [decl(prop, value)];\n },\n handleCustomProperty: (value, _ctx, token) => (token.negative ? [] : [decl(prop, `var(${value})`)]),\n description: `scroll-${name} utility (static, arbitrary, custom property supported)`,\n category: \"interactivity\",\n });\n});\n\n// --- Touch Action Utilities ---\n// touch-action documentation\nstaticUtility(\"touch-auto\", [[\"touch-action\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"touch-none\", [[\"touch-action\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-x\", [[\"touch-action\", \"pan-x\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-left\", [[\"touch-action\", \"pan-left\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-right\", [[\"touch-action\", \"pan-right\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-y\", [[\"touch-action\", \"pan-y\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-up\", [[\"touch-action\", \"pan-up\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pan-down\", [[\"touch-action\", \"pan-down\"]], { category: 'interactivity' });\nstaticUtility(\"touch-pinch-zoom\", [[\"touch-action\", \"pinch-zoom\"]], { category: 'interactivity' });\nstaticUtility(\"touch-manipulation\", [[\"touch-action\", \"manipulation\"]], { category: 'interactivity' });\n\n// --- User Select Utilities ---\n// user-select documentation\nstaticUtility(\"select-none\", [[\"-webkit-user-select\", \"none\"], [\"user-select\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"select-text\", [[\"-webkit-user-select\", \"text\"], [\"user-select\", \"text\"]], { category: 'interactivity' });\nstaticUtility(\"select-all\", [[\"-webkit-user-select\", \"all\"], [\"user-select\", \"all\"]], { category: 'interactivity' });\nstaticUtility(\"select-auto\", [[\"-webkit-user-select\", \"auto\"], [\"user-select\", \"auto\"]], { category: 'interactivity' });\n\n// --- Will Change Utilities ---\n// will-change documentation\nstaticUtility(\"will-change-auto\", [[\"will-change\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-scroll\", [[\"will-change\", \"scroll-position\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-contents\", [[\"will-change\", \"contents\"]], { category: 'interactivity' });\nstaticUtility(\"will-change-transform\", [[\"will-change\", \"transform\"]], { category: 'interactivity' });\n\n// Functional: will-change-[value], will-change-(--custom-property)\nfunctionalUtility({\n name: \"will-change\",\n prop: \"will-change\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"will-change utility (static, arbitrary, custom property supported)\",\n category: \"interactivity\",\n});\n\n// --- Scrollbar Utilities (#309, Tailwind 4.3) ---\nstaticUtility(\"scrollbar-auto\", [[\"scrollbar-width\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-thin\", [[\"scrollbar-width\", \"thin\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-none\", [[\"scrollbar-width\", \"none\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-auto\", [[\"scrollbar-gutter\", \"auto\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-stable\", [[\"scrollbar-gutter\", \"stable\"]], { category: 'interactivity' });\nstaticUtility(\"scrollbar-gutter-both\", [[\"scrollbar-gutter\", \"stable both-edges\"]], { category: 'interactivity' });\n\n// scrollbar-thumb-*/scrollbar-track-* set one half and re-emit the composite, with @property defaults (#0000)\n// so a lone thumb or track still yields a valid scrollbar-color.\nconst SCROLLBAR_COLOR = \"var(--baro-scrollbar-thumb) var(--baro-scrollbar-track)\";\nconst scrollbarProperties = () =>\n atRoot([\n property(\"--baro-scrollbar-thumb\", \"#0000\", \"<color>\"),\n property(\"--baro-scrollbar-track\", \"#0000\", \"<color>\"),\n ]);\nconst stripColorHint = (v: string) => v.replace(/^color:/, \"\");\n\nfor (const part of [\"thumb\", \"track\"] as const) {\n const key = `--baro-scrollbar-${part}`;\n const compose = (inner: AstNode[]) => [scrollbarProperties(), ...inner, decl(\"scrollbar-color\", SCROLLBAR_COLOR)];\n const withOpacity = (color: string, opacity?: string) =>\n opacity\n ? [decl(key, `color-mix(in oklab, ${color} ${opacity.replace(/^\\[(.*)\\]$/, \"$1\").replace(/%$/, \"\")}%, transparent)`)]\n : [decl(key, color)];\n functionalUtility({\n name: `scrollbar-${part}`,\n themeKeys: [\"colors\"],\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token, extra) => {\n if (extra?.realThemeValue) return compose(withOpacity(`var(--color-${extra.realThemeValue})`, extra.opacity));\n if (token.arbitrary) return compose(withOpacity(stripColorHint(value), extra?.opacity));\n if (value === \"inherit\" || value === \"transparent\") return compose([decl(key, value)]);\n if (value === \"current\") return compose(withOpacity(\"currentcolor\", extra?.opacity));\n return null;\n },\n handleCustomProperty: (value, _ctx, _token, extra) =>\n compose(withOpacity(`var(${stripColorHint(value)})`, extra?.opacity)),\n description: `scrollbar-color ${part} utility (theme, arbitrary, custom property, opacity)`,\n category: \"interactivity\",\n });\n}\n","import { staticUtility, functionalUtility, themeKeyVar } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Transition Property Utilities ---\n// transition-property documentation\n\n// Default variable\nconst defaultTiming = \"var(--default-transition-timing-function)\"; // cubic-bezier(0.4, 0, 0.2, 1)\nconst defaultDuration = \"var(--default-transition-duration)\"; // 150ms\n\n// transition\nstaticUtility(\"transition\", [\n [\n \"transition-property\",\n \"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --baro-gradient-from, --baro-gradient-via, --baro-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events\",\n ],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-all\nstaticUtility(\"transition-all\", [\n [\"transition-property\", \"all\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-colors\nstaticUtility(\"transition-colors\", [\n [\n \"transition-property\",\n \"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --baro-gradient-from, --baro-gradient-via, --baro-gradient-to\",\n ],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-opacity\nstaticUtility(\"transition-opacity\", [\n [\"transition-property\", \"opacity\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-shadow\nstaticUtility(\"transition-shadow\", [\n [\"transition-property\", \"box-shadow\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' });\n\n// transition-transform\nstaticUtility(\"transition-transform\", [\n [\"transition-property\", \"transform, translate, scale, rotate\"],\n [\"transition-timing-function\", defaultTiming],\n [\"transition-duration\", defaultDuration],\n], { category: 'transitions' } );\n\n\n// --- Transition Behavior ---\nstaticUtility(\"transition-normal\", [[\"transition-behavior\", \"normal\"]], { category: 'transitions' });\nstaticUtility(\"transition-discrete\", [[\"transition-behavior\", \"allow-discrete\"]], { category: 'transitions' }); \n\n// transition-none\nstaticUtility(\"transition-none\", [[\"transition-property\", \"none\"]], { category: 'transitions' });\n\n// transition-[value] (arbitrary value)\nfunctionalUtility({\n name: \"transition\",\n prop: \"transition-property\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n return [\n decl(\"transition-property\", value),\n decl(\"transition-timing-function\", defaultTiming),\n decl(\"transition-duration\", defaultDuration),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"transition-property\", `var(${value})`),\n decl(\"transition-timing-function\", defaultTiming),\n decl(\"transition-duration\", defaultDuration),\n ],\n description:\n \"transition-property utility (static, arbitrary value, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Duration ---\nstaticUtility(\"duration-initial\", [[\"transition-duration\", \"initial\"]], { category: 'transitions' });\n\nfunctionalUtility({\n name: \"duration\",\n prop: \"transition-duration\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"transition-duration\", `${value}ms`)];\n }\n return [decl(\"transition-duration\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-duration\", `var(${value})`)],\n description: \"transition-duration utility (static, number, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Timing Function ---\nstaticUtility(\"ease-linear\", [[\"transition-timing-function\", \"linear\"]], { category: 'transitions' });\nstaticUtility(\"ease-in\", [[\"transition-timing-function\", \"var(--ease-in)\"]], { category: 'transitions' });\nstaticUtility(\"ease-out\", [[\"transition-timing-function\", \"var(--ease-out)\"]], { category: 'transitions' });\nstaticUtility(\"ease-in-out\", [[\"transition-timing-function\", \"var(--ease-in-out)\"]], { category: 'transitions' });\nstaticUtility(\"ease-initial\", [[\"transition-timing-function\", \"initial\"]], { category: 'transitions' });\n\nfunctionalUtility({\n name: \"ease\",\n prop: \"transition-timing-function\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: ease-<any theme.transitionTimingFunction key> → var(--ease-<key>).\n handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, \"transitionTimingFunction\", value, \"ease\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, _token) => {\n return [decl(\"transition-timing-function\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-timing-function\", `var(${value})`)],\n description: \"transition-timing-function utility (static, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Transition Delay ---\nfunctionalUtility({\n name: \"delay\",\n prop: \"transition-delay\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"transition-delay\", `${value}ms`)];\n }\n return [decl(\"transition-delay\", value)];\n },\n handleCustomProperty: (value) => [decl(\"transition-delay\", `var(${value})`)],\n description: \"transition-delay utility (number, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n\n// --- Animation ---\nstaticUtility(\"animate-spin\", [\n [\"animation\", \"var(--animate-spin)\"],\n], { category: 'transitions' });\nstaticUtility(\"animate-ping\", [[\"animation\", \"var(--animate-ping)\"]], { category: 'transitions' });\nstaticUtility(\"animate-pulse\", [[\"animation\", \"var(--animate-pulse)\"]], { category: 'transitions' });\nstaticUtility(\"animate-bounce\", [[\"animation\", \"var(--animate-bounce)\"]], { category: 'transitions' });\nstaticUtility(\"animate-none\", [[\"animation\", \"none\"]], { category: 'transitions' } );\n\nfunctionalUtility({\n name: \"animate\",\n // #274: theme.animations (and Tailwind's theme.animation) names, e.g. theme.extend.animation.wiggle.\n themeKeys: [\"animations\", \"animation\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return [decl(\"animation\", `var(--animate-${extra.realThemeValue})`)];\n if (token.customProperty) {\n return [decl(\"animation\", `var(${value})`)];\n }\n return [decl(\"animation\", value)];\n },\n handleCustomProperty: (value) => [decl(\"animation\", `var(${value})`)],\n description: \"animation utility (static, arbitrary, custom property supported)\",\n category: \"transitions\",\n});\n","import { staticUtility } from \"../core/registry\";\nimport { functionalUtility } from \"../core/registry\";\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Table Layout Utilities (border-collapse, border-separate) ---\nstaticUtility(\"border-collapse\", [[\"border-collapse\", \"collapse\"]], { category: 'table' });\nstaticUtility(\"border-separate\", [[\"border-collapse\", \"separate\"]], { category: 'table' });\n\n// --- Table Layout ---\nstaticUtility(\"table-auto\", [[\"table-layout\", \"auto\"]], { category: 'table' });\nstaticUtility(\"table-fixed\", [[\"table-layout\", \"fixed\"]], { category: 'table' });\n\n// --- Border Spacing ---\n// #314: as Tailwind 4.3.3, each axis lives in --baro-border-spacing-x/y (with @property defaults) and\n// border-spacing composes both, so border-spacing-x-* and border-spacing-y-* combine on one element.\nconst borderSpacingProperties = () =>\n atRoot([\n property(\"--baro-border-spacing-x\", \"0\", \"<length>\"),\n property(\"--baro-border-spacing-y\", \"0\", \"<length>\"),\n ]);\nconst BORDER_SPACING = \"var(--baro-border-spacing-x) var(--baro-border-spacing-y)\";\nconst borderSpacing = (axes: string[], v: string) => [\n borderSpacingProperties(),\n ...axes.map((a) => decl(`--baro-border-spacing-${a}`, v)),\n decl(\"border-spacing\", BORDER_SPACING),\n];\n\n([\n [\"border-spacing-x\", [\"x\"]],\n [\"border-spacing-y\", [\"y\"]],\n [\"border-spacing\", [\"x\", \"y\"]],\n] as [string, string[]][]).forEach(([name, axes]) => {\n staticUtility(`${name}-px`, [\n borderSpacingProperties,\n ...axes.map((a) => [`--baro-border-spacing-${a}`, \"1px\"] as [string, string]),\n [\"border-spacing\", BORDER_SPACING],\n ], { category: \"table\" });\n functionalUtility({\n name,\n prop: \"border-spacing\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) =>\n borderSpacing(axes, parseNumber(value) ? `calc(var(--spacing) * ${value})` : value),\n handleCustomProperty: (value) => borderSpacing(axes, `var(${value})`),\n description: `${name} utility (number, px, arbitrary, custom property supported)`,\n category: \"table\",\n });\n});\n\n// --- Caption Side ---\nstaticUtility(\"caption-top\", [[\"caption-side\", \"top\"]], { category: 'table' });\nstaticUtility(\"caption-bottom\", [[\"caption-side\", \"bottom\"]], { category: 'table' });","import { atRule, decl, type AstNode } from \"../core/ast\";\n\n// #313: shared shadow colour/alpha handling for shadow-*, inset-shadow-*, text-shadow-* and drop-shadow-*,\n// matching Tailwind 4.3.3. Each shadow layer's colour is wrapped as var(--baro-<layer>-color, <colour>) so a\n// colour utility on the same element replaces it, and an opacity modifier (/50, /[20%], /(--o)) sets\n// --baro-<layer>-alpha and fades the default colour with oklab relative colour syntax.\nexport type ShadowLayer = \"shadow\" | \"inset-shadow\" | \"text-shadow\" | \"drop-shadow\";\n\n/** Opacity modifier to an alpha: `50` → 50%, `[20%]` → 20%, `(--o)` → var(--o); anything else is invalid. */\nexport function parseAlpha(op: string | undefined): { alpha: string; isVar: boolean } | null {\n if (!op) return null;\n if (/^\\d+(\\.\\d+)?$/.test(op)) return { alpha: `${op}%`, isVar: false };\n const pct = /^\\[(\\d+(?:\\.\\d+)?)%\\]$/.exec(op);\n if (pct) return { alpha: `${pct[1]}%`, isVar: false };\n const cp = /^\\((--[\\w-]+)\\)$/.exec(op);\n if (cp) return { alpha: `var(${cp[1]})`, isVar: true };\n return null;\n}\n\nfunction splitTop(value: string, sep: string): string[] {\n const out: string[] = [];\n let depth = 0;\n let cur = \"\";\n for (const ch of value) {\n if (ch === \"(\") depth++;\n else if (ch === \")\") depth--;\n if (depth === 0 && (sep === \" \" ? /\\s/.test(ch) : ch === sep)) {\n if (cur.trim()) out.push(cur.trim());\n cur = \"\";\n } else cur += ch;\n }\n if (cur.trim()) out.push(cur.trim());\n return out;\n}\n\nconst LENGTH = /^-?(\\d*\\.)?\\d+([a-z]+|%)?$/i;\n\n/** The shadow's layers with each colour wrapped in var(--baro-<layer>-color, …), faded by `alpha` if given. */\nexport function shadowLayers(value: string, layer: ShadowLayer, alpha?: string): string[] {\n return splitTop(value, \",\").map((l) => {\n const parts = splitTop(l, \" \");\n const i = parts.findIndex((p) => p !== \"inset\" && !LENGTH.test(p));\n // A layer without a colour gets Tailwind's currentcolor default.\n const c = i < 0 ? \"currentcolor\" : parts[i];\n parts[i < 0 ? parts.length : i] = `var(--baro-${layer}-color, ${alpha ? `oklab(from ${c} l a b / ${alpha})` : c})`;\n return parts.join(\" \");\n });\n}\n\n/**\n * Declarations for a shadow value on `prop`, honouring the opacity modifier the way Tailwind 4.3.3 does:\n * a numeric alpha fades the colour directly; a custom-property alpha keeps the plain value as a fallback\n * and fades it only where relative colour syntax is supported. Returns null for an invalid modifier.\n */\nexport function shadowValueDecls(\n layer: ShadowLayer,\n prop: string,\n value: string,\n opacity: string | undefined,\n render: (layers: string[]) => string = (l) => l.join(\", \"),\n): AstNode[] | null {\n const a = parseAlpha(opacity);\n if (opacity && !a) return null;\n if (!a) return [decl(prop, render(shadowLayers(value, layer)))];\n const alphaDecl = decl(`--baro-${layer}-alpha`, a.alpha);\n if (!a.isVar) return [alphaDecl, decl(prop, render(shadowLayers(value, layer, a.alpha)))];\n return [\n alphaDecl,\n decl(prop, render(shadowLayers(value, layer))),\n atRule(\"supports\", \"(color: lab(from red l a b))\", [decl(prop, render(shadowLayers(value, layer, a.alpha)))]),\n ];\n}\n\n/**\n * --baro-<layer>-color for a colour utility (shadow-red-500/50, text-shadow-(color:--c), …). `ref` is the\n * value used where color-mix is supported (the theme var), `color` the literal fallback. The colour is\n * always mixed with --baro-<layer>-alpha so a named size's opacity modifier also fades a custom colour.\n */\nexport function shadowColorDecls(layer: ShadowLayer, color: string, opacity: string | undefined, ref = color): AstNode[] | null {\n const key = `--baro-${layer}-color`;\n if (color === \"inherit\") return [decl(key, \"inherit\")];\n const a = parseAlpha(opacity);\n if (opacity && !a) return null;\n const inner = a ? `color-mix(in oklab, ${ref} ${a.alpha}, transparent)` : ref;\n const fallback = a ? `color-mix(in srgb, ${color} ${a.alpha}, transparent)` : color;\n return [\n decl(key, fallback),\n atRule(\"supports\", \"(color: color-mix(in lab, red, red))\", [\n decl(key, `color-mix(in oklab, ${inner} var(--baro-${layer}-alpha), transparent)`),\n ]),\n ];\n}\n","import { staticUtility, functionalUtility, registerUtility, themeKeyVar } from \"../core/registry\";\nimport { shadowColorDecls, shadowValueDecls } from \"./shadow-color\";\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\nimport { parseColor } from \"../core/utils\";\n\n// --- Filter ---\nstaticUtility(\"filter-none\", [[\"filter\", \"none\"]], { category: 'effects' });\n\nfunctionalUtility({\n name: \"filter\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\nconst filters = () => {\n return decl(\"filter\", \"var(--baro-blur, ) var(--baro-brightness, ) var(--baro-contrast, ) var(--baro-grayscale, ) var(--baro-hue-rotate, ) var(--baro-invert, ) var(--baro-saturate, ) var(--baro-sepia, ) var(--baro-drop-shadow, )\");\n}\n\n// --- Blur ---\n[\n [\"blur-xs\", \"var(--blur-xs)\"],\n [\"blur-sm\", \"var(--blur-sm)\"],\n [\"blur-md\", \"var(--blur-md)\"],\n [\"blur-lg\", \"var(--blur-lg)\"],\n [\"blur-xl\", \"var(--blur-xl)\"],\n [\"blur-2xl\", \"var(--blur-2xl)\"],\n [\"blur-3xl\", \"var(--blur-3xl)\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [\n decl(\"--baro-blur\", `blur(${value})`),\n filters()\n ], { category: 'effects' });\n});\nstaticUtility(\"blur\", [decl(\"--baro-blur\", \"blur(8px)\"), filters()], { category: 'effects' });\nstaticUtility(\"blur-none\", [decl(\"--baro-blur\", \"\"), filters()], { category: 'effects' });\n\nfunctionalUtility({\n name: \"blur\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: blur-<any theme.blur key> → blur(var(--blur-<key>)); numbers keep the previous pass-through.\n handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, \"blur\", value, \"blur\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, token) => {\n if (token.customProperty) return [decl(\"--baro-blur\", `blur(var(${value}))`), filters()];\n return [decl(\"--baro-blur\", `blur(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-blur\", `blur(var(${value}))`), filters()],\n description: \"blur filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Brightness ---\n\nfunctionalUtility({\n name: \"brightness\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (token.arbitrary) {\n return [decl(\"--baro-brightness\", `brightness(${value})`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-brightness\", `brightness(${value}%)`), filters()];\n }\n if (token.customProperty)\n return [decl(\"--baro-brightness\", `brightness(var(${value}))`), filters()];\n return [decl(\"--baro-brightness\", `brightness(${value})`), filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-brightness\", `brightness(var(${value}))`),\n filters()\n ],\n description:\n \"brightness filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Contrast ---\nfunctionalUtility({\n name: \"contrast\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [decl(\"--baro-contrast\", `contrast(${value})`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-contrast\", `contrast(${value}%)`), filters()];\n }\n if (token.customProperty)\n return [decl(\"--baro-contrast\", `contrast(var(${value}))`), filters()];\n return [decl(\"--baro-contrast\", `contrast(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-contrast\", `contrast(var(${value}))`), filters()],\n description:\n \"contrast filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Drop Shadow (#313: Tailwind 4.3.3 sizes, colours and opacity modifiers) ---\nconst dropShadowProperties = () =>\n atRoot([\n property(\"--baro-drop-shadow\"),\n property(\"--baro-drop-shadow-color\"),\n property(\"--baro-drop-shadow-alpha\", \"100%\", \"<percentage>\"),\n property(\"--baro-drop-shadow-size\"),\n ]);\nconst wrapDropShadow = (layers: string[]) => layers.map((l) => `drop-shadow(${l})`).join(\" \");\n// Bare `drop-shadow` is the deprecated two-layer theme reference.\nconst DROP_SHADOW_DEFAULT = \"0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)\";\nconst namedDropShadow = (ctx: { theme: (...k: string[]) => unknown }, name: string) => {\n const v = ctx.theme(\"dropShadow\", name);\n return typeof v === \"string\" && /^[\\w.-]+$/.test(name) ? v : null;\n};\n\n// A drop-shadow value: `named` keeps Tailwind's drop-shadow(var(--drop-shadow-<name>)) when unfaded.\nfunction dropShadowValue(value: string, opacity: string | undefined, named?: string, keepNamed = false) {\n const decls = shadowValueDecls(\"drop-shadow\", \"--baro-drop-shadow-size\", value, opacity, wrapDropShadow);\n if (!decls) return null;\n const composed = named !== undefined && (!opacity || keepNamed) ? named : \"var(--baro-drop-shadow-size)\";\n return [dropShadowProperties(), ...decls, decl(\"--baro-drop-shadow\", composed), filters()];\n}\n\nstaticUtility(\"drop-shadow-none\", [decl(\"--baro-drop-shadow\", \" \"), filters()]);\nregisterUtility({\n name: \"drop-shadow\",\n match: (className: string) => /^drop-shadow(\\/.+)?$/.test(className),\n handler: (value, _ctx, token) => {\n const full = value ? `${token.prefix}-${value}` : token.prefix;\n const cut = full.indexOf(\"/\");\n const opacity = cut < 0 ? undefined : full.slice(cut + 1);\n const literal = \"drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow( 0 1px 1px rgb(0 0 0 / 0.06))\";\n return dropShadowValue(DROP_SHADOW_DEFAULT, opacity, literal, true) ?? [];\n },\n category: \"effects\",\n});\n\nconst dropShadowColor = (color: string, opacity: string | undefined, ref?: string) => {\n const decls = shadowColorDecls(\"drop-shadow\", color, opacity, ref);\n return decls && [dropShadowProperties(), ...decls, decl(\"--baro-drop-shadow\", \"var(--baro-drop-shadow-size)\")];\n};\n\nfunctionalUtility({\n name: \"drop-shadow\",\n themeKeys: ['colors'],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handleBareValue: ({ value, ctx }) => (namedDropShadow(ctx, value) ? value : null),\n handle: (value, ctx, token, extra) => {\n const opacity = extra?.opacity;\n const keyword = token.arbitrary ? undefined : ({ inherit: \"inherit\", current: \"currentcolor\", transparent: \"transparent\" } as Record<string, string>)[extra?.realThemeValue ?? value];\n if (keyword) return dropShadowColor(keyword, opacity);\n // #338: a key that is both a drop shadow and a colour is the drop shadow, as in Tailwind 4.3.3.\n const key = extra?.realThemeValue ?? value;\n const named = token.arbitrary ? null : namedDropShadow(ctx, key);\n if (named) return dropShadowValue(named, opacity, `drop-shadow(var(--drop-shadow-${key}))`);\n if (extra?.realThemeValue) return dropShadowColor(value, opacity, `var(--color-${extra.realThemeValue})`);\n if (token.arbitrary) {\n if (parseColor(value)) return dropShadowColor(value, opacity);\n return dropShadowValue(value, opacity);\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) return dropShadowColor(`var(${value.slice(6)})`, undefined) ?? [];\n return [\n dropShadowProperties(),\n decl(\"--baro-drop-shadow-size\", `drop-shadow(var(${value}))`),\n decl(\"--baro-drop-shadow\", `var(--baro-drop-shadow-size)`),\n filters(),\n ];\n },\n description:\n \"drop-shadow filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Grayscale ---\nstaticUtility(\"grayscale\", [decl(\"--baro-grayscale\", \"grayscale(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"grayscale\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-grayscale\", `grayscale(${value}%)`), filters()];\n }\n return [decl(\"--baro-grayscale\", `grayscale(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-grayscale\", `grayscale(var(${value}))`), filters()],\n description: \"grayscale filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Hue Rotate ---\n\nfunctionalUtility({\n name: \"hue-rotate\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, _ctx, token) => {\n if (token.negative && parseNumber(token.value!)) {\n return [decl(\"--baro-hue-rotate\", `hue-rotate(calc(${token.value}deg * -1))`), filters()];\n }\n if (parseNumber(value)) {\n return [decl(\"--baro-hue-rotate\", `hue-rotate(${value}deg)`), filters()];\n }\n if (token.customProperty) return [decl(\"--baro-hue-rotate\", `hue-rotate(var(${value}))`), filters()];\n return [decl(\"--baro-hue-rotate\", `hue-rotate(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-hue-rotate\", `hue-rotate(var(${value}))`), filters()],\n description: \"hue-rotate filter utility (static, negative, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Invert ---\nstaticUtility(\"invert\", [decl(\"--baro-invert\", \"invert(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"invert\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-invert\", `invert(${value}%)`), filters()];\n }\n\n return [decl(\"--baro-invert\", `invert(${value})`), filters()];\n },\n description: \"invert filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Saturate ---\nfunctionalUtility({\n name: \"saturate\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-saturate\", `saturate(${value}%)`), filters()];\n }\n return [decl(\"--baro-saturate\", `saturate(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-saturate\", `saturate(var(${value}))`), filters()],\n description: \"saturate filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Sepia ---\nstaticUtility(\"sepia\", [decl(\"--baro-sepia\", \"sepia(100%)\"), filters()], { category: \"effects\" });\n\nfunctionalUtility({\n name: \"sepia\",\n prop: \"filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-sepia\", `sepia(${value}%)`), filters()];\n }\n return [decl(\"--baro-sepia\", `sepia(${value})`), filters()];\n },\n handleCustomProperty: (value) => [decl(\"--baro-sepia\", `sepia(var(${value}))`), filters()],\n description: \"sepia filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n","import { staticUtility, functionalUtility, themeKeyVar } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport { parseNumber } from \"../core/utils\";\n\nconst filters = () => {\n return [\n decl(\n \"-webkit-backdrop-filter\",\n \"var(--baro-backdrop-blur, ) var(--baro-backdrop-brightness, ) var(--baro-backdrop-contrast, ) var(--baro-backdrop-grayscale, ) var(--baro-backdrop-hue-rotate, ) var(--baro-backdrop-invert, ) var(--baro-backdrop-saturate, ) var(--baro-backdrop-sepia, )\"\n ),\n decl(\n \"backdrop-filter\",\n \"var(--baro-backdrop-blur, ) var(--baro-backdrop-brightness, ) var(--baro-backdrop-contrast, ) var(--baro-backdrop-grayscale, ) var(--baro-backdrop-hue-rotate, ) var(--baro-backdrop-invert, ) var(--baro-backdrop-saturate, ) var(--baro-backdrop-sepia, )\"\n ),\n ];\n};\n\n// --- Backdrop Filter ---\nstaticUtility(\n \"backdrop-filter\",\n [[\"backdrop-filter\", \"var(--baro-backdrop-filter)\"]],\n { category: \"effects\" }\n);\nstaticUtility(\"backdrop-filter-none\", [[\"backdrop-filter\", \"none\"]], {\n category: \"effects\",\n});\n\nfunctionalUtility({\n name: \"backdrop-filter\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Blur ---\n[\n [\"backdrop-blur-xs\", \"var(--blur-xs)\"],\n [\"backdrop-blur-sm\", \"var(--blur-sm)\"],\n [\"backdrop-blur-md\", \"var(--blur-md)\"],\n [\"backdrop-blur-lg\", \"var(--blur-lg)\"],\n [\"backdrop-blur-xl\", \"var(--blur-xl)\"],\n [\"backdrop-blur-2xl\", \"var(--blur-2xl)\"],\n [\"backdrop-blur-3xl\", \"var(--blur-3xl)\"],\n].forEach(([name, value]) => {\n staticUtility(\n name as string,\n [decl(\"--baro-backdrop-blur\", `blur(${value})`), ...filters()],\n { category: \"effects\" }\n );\n});\nstaticUtility(\"backdrop-blur\", [decl(\"--baro-backdrop-blur\", \"blur(8px)\"), ...filters()], { category: \"effects\" });\nstaticUtility(\n \"backdrop-blur-none\",\n [decl(\"--baro-backdrop-blur\", \"\"), ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-blur\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: backdrop-blur-<any theme.blur key> → blur(var(--blur-<key>)).\n handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, \"blur\", value, \"blur\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, token) => {\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-blur\", `blur(var(${value}))`),\n ...filters(),\n ];\n return [decl(\"--baro-backdrop-blur\", `blur(${value})`), ...filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-blur\", `blur(var(${value}))`),\n ...filters(),\n ],\n description:\n \"blur filter utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Brightness ---\n\nfunctionalUtility({\n name: \"backdrop-brightness\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value})`),\n ...filters(),\n ];\n }\n\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value}%)`),\n ...filters(),\n ];\n }\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(var(${value}))`),\n ...filters(),\n ];\n return [\n decl(\"--baro-backdrop-brightness\", `brightness(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-brightness\", `brightness(var(${value}))`),\n ...filters(),\n ],\n description:\n \"brightness filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Contrast ---\nfunctionalUtility({\n name: \"backdrop-contrast\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handle: (value, _ctx, token) => {\n if (token.arbitrary) {\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value})`),\n ...filters(),\n ];\n }\n\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value}%)`),\n ...filters(),\n ];\n }\n if (token.customProperty)\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(var(${value}))`),\n ...filters(),\n ];\n return [\n decl(\"--baro-backdrop-contrast\", `contrast(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-contrast\", `contrast(var(${value}))`),\n ...filters(),\n ],\n description:\n \"contrast filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Grayscale ---\nstaticUtility(\n \"backdrop-grayscale\",\n [[\"--baro-backdrop-grayscale\", \"grayscale(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-grayscale\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-grayscale\", `grayscale(${value}%)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-grayscale\", `grayscale(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-grayscale\", `grayscale(var(${value}))`),\n ...filters(),\n ],\n description:\n \"grayscale filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Hue Rotate ---\n\nfunctionalUtility({\n name: \"backdrop-hue-rotate\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, _ctx, token) => {\n if (token.negative && parseNumber(token.value!)) {\n return [\n decl(\n \"--baro-backdrop-hue-rotate\",\n `hue-rotate(calc(${token.value}deg * -1))`\n ),\n ...filters(),\n ];\n }\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(${value}deg)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-hue-rotate\", `hue-rotate(var(${value}))`),\n ...filters(),\n ],\n description:\n \"hue-rotate filter utility (static, negative, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Invert ---\nstaticUtility(\n \"backdrop-invert\",\n [[\"--baro-backdrop-invert\", \"invert(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-invert\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-invert\", `invert(${value}%)`),\n ...filters(),\n ];\n }\n\n return [decl(\"--baro-backdrop-invert\", `invert(${value})`), ...filters()];\n },\n description:\n \"invert filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Saturate ---\nfunctionalUtility({\n name: \"backdrop-saturate\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [\n decl(\"--baro-backdrop-saturate\", `saturate(${value}%)`),\n ...filters(),\n ];\n }\n return [\n decl(\"--baro-backdrop-saturate\", `saturate(${value})`),\n ...filters(),\n ];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-saturate\", `saturate(var(${value}))`),\n ...filters(),\n ],\n description:\n \"saturate filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Sepia ---\nstaticUtility(\n \"backdrop-sepia\",\n [[\"--baro-backdrop-sepia\", \"sepia(100%)\"], ...filters()],\n { category: \"effects\" }\n);\n\nfunctionalUtility({\n name: \"backdrop-sepia\",\n prop: \"backdrop-filter\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, _token) => {\n if (parseNumber(value)) {\n return [decl(\"--baro-backdrop-sepia\", `sepia(${value}%)`), ...filters()];\n }\n return [decl(\"--baro-backdrop-sepia\", `sepia(${value})`), ...filters()];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-backdrop-sepia\", `sepia(var(${value}))`),\n ...filters(),\n ],\n description:\n \"sepia filter utility (static, number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n","import { staticUtility, functionalUtility, registerUtility, themeKeyValue } from \"../core/registry\";\nimport type { Context } from \"../core/context\";\nimport { shadowColorDecls, shadowValueDecls, type ShadowLayer } from \"./shadow-color\";\nimport { atRule, atRoot, decl, property } from \"../core/ast\";\nimport { parseColor, parseLength, parseNumber, themeColorDecls } from \"../core/utils\";\n\n// --- Box Shadow ---\n// box-shadow documentation\n\n// Tailwind v4 composes every box-shadow layer into one declaration, so shadow-* and ring-* on the same element\n// both render: each utility sets only its own layer var and re-emits this composite.\nconst SHADOW_COMPOSITE =\n \"var(--baro-inset-shadow), var(--baro-inset-ring-shadow), var(--baro-ring-offset-shadow), var(--baro-ring-shadow), var(--baro-shadow)\";\n\n// Base values for the box-shadow composition layers, registered like Tailwind v4's @property layer so that a lone\n// shadow-*/ring-*/inset-ring-* composes a valid box-shadow when the other layers are unset.\n// Without these @property initial values the whole box-shadow declaration is invalid and nothing renders.\nconst ringShadowProperties = () =>\n atRoot([\n property(\"--baro-shadow\", \"0 0 #0000\"),\n property(\"--baro-inset-shadow\", \"0 0 #0000\"),\n property(\"--baro-inset-ring-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-offset-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-shadow\", \"0 0 #0000\"),\n property(\"--baro-ring-offset-width\", \"0px\", \"<length>\"),\n property(\"--baro-ring-offset-color\", \"#fff\"),\n ]);\n\n\n// #313: the colour/alpha registrations Tailwind 4.3.3 emits @property rules for, so a colour utility or an\n// opacity modifier composes with a size utility on the same element.\nconst shadowColorProperties = (layer: \"shadow\" | \"inset-shadow\") =>\n atRoot([\n property(`--baro-${layer}-color`),\n property(`--baro-${layer}-alpha`, \"100%\", \"<percentage>\"),\n ]);\n\n// Tailwind 4.3.3 named box shadows (\"\" is bare `shadow`, `inner` is the deprecated theme reference).\nconst NAMED_SHADOWS: Record<string, string> = {\n \"\": \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n \"2xs\": \"0 1px rgb(0 0 0 / 0.05)\",\n xs: \"0 1px 2px 0 rgb(0 0 0 / 0.05)\",\n sm: \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n md: \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n lg: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n xl: \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n \"2xl\": \"0 25px 50px -12px rgb(0 0 0 / 0.25)\",\n inner: \"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)\",\n};\n// Tailwind 4.3.3 named inset shadows; md..2xl are BaroCSS extensions (no opacity modifier).\nconst NAMED_INSET_SHADOWS: Record<string, string> = {\n \"2xs\": \"inset 0 1px rgb(0 0 0 / 0.05)\",\n xs: \"inset 0 1px 1px rgb(0 0 0 / 0.05)\",\n sm: \"inset 0 2px 4px rgb(0 0 0 / 0.05)\",\n};\nconst INSET_EXTENSIONS: Record<string, string> = {\n md: \"inset 0 4px 6px -1px rgb(0 0 0 / 0.05)\",\n lg: \"inset 0 10px 15px -3px rgb(0 0 0 / 0.05)\",\n xl: \"inset 0 20px 25px -5px rgb(0 0 0 / 0.05)\",\n \"2xl\": \"inset 0 25px 50px -12px rgb(0 0 0 / 0.05)\",\n};\nconst insetEach = (value: string) => value.split(/,(?![^(]*\\))/).map((l) => `inset ${l.trim()}`).join(\", \");\nconst own = (table: Record<string, string>, key: string) => Object.prototype.hasOwnProperty.call(table, key);\n\n// A box-shadow layer value (named or arbitrary) with its colour var and opacity modifier.\nfunction boxShadowLayer(layer: \"shadow\" | \"inset-shadow\", value: string, opacity: string | undefined) {\n const decls = shadowValueDecls(layer, `--baro-${layer}`, value, opacity);\n if (!decls) return null;\n return [ringShadowProperties(), shadowColorProperties(layer), ...decls, decl(\"box-shadow\", SHADOW_COMPOSITE)];\n}\n\nfunction namedBoxShadow(layer: \"shadow\" | \"inset-shadow\", name: string, opacity: string | undefined, ctx?: Context) {\n if (layer === \"shadow\") {\n if (own(NAMED_SHADOWS, name)) return boxShadowLayer(layer, NAMED_SHADOWS[name], opacity);\n } else {\n if (own(NAMED_INSET_SHADOWS, name)) return boxShadowLayer(layer, NAMED_INSET_SHADOWS[name], opacity);\n if (!opacity && own(INSET_EXTENSIONS, name)) return boxShadowLayer(layer, INSET_EXTENSIONS[name], undefined);\n }\n // #300: any other key of theme.boxShadow / theme.insetShadow (`shadow-card`), composed like the named sizes.\n const custom = ctx && name !== \"none\" ? themeKeyValue(ctx, layer === \"shadow\" ? \"boxShadow\" : \"insetShadow\", name) : null;\n return custom ? boxShadowLayer(layer, custom, opacity) : null;\n}\n\nstaticUtility(\"shadow-none\", [ringShadowProperties, [\"--baro-shadow\", \"0 0 #0000\"], [\"box-shadow\", SHADOW_COMPOSITE]], { category: 'effects' });\nstaticUtility(\"inset-shadow-none\", [ringShadowProperties, [\"--baro-inset-shadow\", \"inset 0 0 #0000\"], [\"box-shadow\", SHADOW_COMPOSITE]], { category: 'effects' });\n\n// Bare `shadow` and `shadow/<alpha>` (no dash, so the functional utility below never sees them).\nregisterUtility({\n name: \"shadow\",\n match: (className: string) => /^shadow(\\/.+)?$/.test(className),\n handler: (value, _ctx, token) => {\n const full = value ? `${token.prefix}-${value}` : token.prefix;\n const cut = full.indexOf(\"/\");\n return namedBoxShadow(\"shadow\", \"\", cut < 0 ? undefined : full.slice(cut + 1)) ?? [];\n },\n category: 'effects',\n});\n\nconst KEYWORD_COLORS: Record<string, string> = { inherit: \"inherit\", current: \"currentcolor\", transparent: \"transparent\" };\n\n// Colour for a shadow layer: theme colour, (color:--x), arbitrary colour, or a keyword.\nfunction layerColor(layer: ShadowLayer, main: string, opacity: string | undefined, token: { arbitrary?: boolean }, realThemeValue?: string) {\n const keyword = token.arbitrary ? undefined : KEYWORD_COLORS[realThemeValue ?? main];\n if (keyword) return shadowColorDecls(layer, keyword, opacity);\n if (realThemeValue) return shadowColorDecls(layer, main, opacity, `var(--color-${realThemeValue})`);\n if (main.startsWith(\"color:\")) return shadowColorDecls(layer, `var(${main.slice(6)})`, opacity);\n if (token.arbitrary && parseColor(main)) return shadowColorDecls(layer, main, opacity);\n return undefined;\n}\n\n// shadow-<size>[/alpha], shadow-<color>[/alpha], shadow-[<shadow>][/alpha], shadow-(--x)\nfor (const layer of [\"shadow\", \"inset-shadow\"] as const) {\n functionalUtility({\n name: layer,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\"],\n handleBareValue: ({ value, ctx, extra }) => (namedBoxShadow(layer, value, extra?.opacity, ctx) ? value : null),\n handle: (value, ctx, token, extra) => {\n const opacity = extra?.opacity;\n // #338: a key that is both a shadow and a colour is the shadow, as in Tailwind 4.3.3.\n const named = !token.arbitrary ? namedBoxShadow(layer, extra?.realThemeValue ?? value, opacity, ctx) : null;\n if (named) return named;\n const color = layerColor(layer, value, opacity, token, extra?.realThemeValue);\n if (color !== undefined) return color;\n // Tailwind prefixes every layer of an arbitrary inset shadow with `inset`.\n if (token.arbitrary) return boxShadowLayer(layer, layer === \"inset-shadow\" ? insetEach(value) : value, opacity);\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"color:\") ? shadowColorDecls(layer, `var(${value.slice(6)})`, undefined) ?? [] : [ringShadowProperties(), decl(`--baro-${layer}`, layer === \"inset-shadow\" ? `inset var(${value})` : `var(${value})`), decl(\"box-shadow\", SHADOW_COMPOSITE)],\n });\n}\n\n// --- Text Shadow (#313, Tailwind 4.3.3) ---\nconst textShadowProperties = () =>\n atRoot([\n property(\"--baro-text-shadow-color\"),\n property(\"--baro-text-shadow-alpha\", \"100%\", \"<percentage>\"),\n ]);\nconst namedTextShadow = (ctx: { theme: (...k: string[]) => unknown }, name: string) => {\n const v = ctx.theme(\"textShadow\", name);\n return typeof v === \"string\" && /^[\\w.-]+$/.test(name) ? v : null;\n};\nconst textShadowValue = (value: string, opacity: string | undefined) => {\n const decls = shadowValueDecls(\"text-shadow\", \"text-shadow\", value, opacity);\n return decls ? [textShadowProperties(), ...decls] : null;\n};\nstaticUtility(\"text-shadow-none\", [textShadowProperties, [\"text-shadow\", \"none\"]], { category: 'effects' });\nfunctionalUtility({\n name: \"text-shadow\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\"],\n handleBareValue: ({ value, ctx }) => (namedTextShadow(ctx, value) ? value : null),\n handle: (value, ctx, token, extra) => {\n const opacity = extra?.opacity;\n if (!token.arbitrary) {\n const named = namedTextShadow(ctx, extra?.realThemeValue ?? value); // #338: shadow before colour, as Tailwind\n if (named) return textShadowValue(named, opacity);\n }\n const color = layerColor(\"text-shadow\", value, opacity, token, extra?.realThemeValue);\n if (color !== undefined) return color && [textShadowProperties(), ...color];\n if (token.arbitrary) return textShadowValue(value, opacity);\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"color:\")\n ? [textShadowProperties(), ...(shadowColorDecls(\"text-shadow\", `var(${value.slice(6)})`, undefined) ?? [])]\n : [textShadowProperties(), decl(\"text-shadow\", `var(${value})`)],\n category: \"effects\",\n});\n\n// --- Ring ( multi-variable) ---\n// ring-width documentation\n\n// Static ring width utilities\n[\n [\"ring\", \"1px\"],\n [\"ring-0\", \"0px\"],\n [\"ring-1\", \"1px\"],\n [\"ring-2\", \"2px\"],\n [\"ring-4\", \"4px\"],\n [\"ring-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n ringShadowProperties,\n // Like Tailwind, ring-N does not set the offset vars (they come from @property defaults and ring-offset-*),\n // so `ring-N ring-offset-M` composes the same in either rule order.\n // No hardcoded ring color: Tailwind v4's default ring color is currentColor (via the var() fallback below).\n [\n \"--baro-ring-shadow\",\n ringShadowValue(px as string),\n ],\n [\n \"box-shadow\",\n \"var(--baro-inset-shadow), var(--baro-inset-ring-shadow), var(--baro-ring-offset-shadow), var(--baro-ring-shadow), var(--baro-shadow)\",\n ],\n ]);\n});\n\nfunction ringShadowValue(width: string) {\n return `var(--baro-ring-inset,) 0 0 0 calc(${width} + var(--baro-ring-offset-width)) var(--baro-ring-color, currentcolor)`;\n}\n\n// Ring offset width utilities (ring-offset-<n>). Matches Tailwind's .ring-offset-N: sets the offset width and the\n// offset shadow; it renders a visible offset ring only when combined with a ring-* utility, exactly like Tailwind.\n[\n [\"ring-offset-0\", \"0px\"],\n [\"ring-offset-1\", \"1px\"],\n [\"ring-offset-2\", \"2px\"],\n [\"ring-offset-4\", \"4px\"],\n [\"ring-offset-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n [\"--baro-ring-offset-width\", px as string],\n [\"--baro-ring-offset-color\", \"#fff\"],\n [\n \"--baro-ring-offset-shadow\",\n `var(--baro-ring-inset,) 0 0 0 var(--baro-ring-offset-width) var(--baro-ring-offset-color)`,\n ],\n ], { category: 'effects' });\n});\n\n// Inset ring width utilities\n// #338: ring-offset-<colour> / ring-offset-<width> (theme.ringOffsetWidth, bare number, arbitrary), as Tailwind 4.3.3.\n// A key in both colours and ringOffsetWidth is the width.\nconst ringOffsetWidth = (width: string) => [\n decl(\"--baro-ring-offset-width\", width),\n decl(\"--baro-ring-offset-shadow\", \"var(--baro-ring-inset,) 0 0 0 var(--baro-ring-offset-width) var(--baro-ring-offset-color)\"),\n];\nfunctionalUtility({\n name: \"ring-offset\",\n themeKeys: [\"ringOffsetWidth\", \"colors\"],\n supportsArbitrary: true,\n supportsOpacity: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? `${value}px` : null),\n handle: (value, _ctx, token, extra) => {\n if (extra?.themeNamespace === \"ringOffsetWidth\") return ringOffsetWidth(value);\n if (extra?.realThemeValue) return themeColorDecls(\"--baro-ring-offset-color\", value, extra);\n if (token.arbitrary) return parseColor(value) ? [decl(\"--baro-ring-offset-color\", value)] : parseLength(value) ? ringOffsetWidth(value) : null;\n if (/^\\d+px$/.test(value)) return ringOffsetWidth(value);\n return null;\n },\n category: \"effects\",\n});\n\n[\n [\"inset-ring\", \"1px\"],\n [\"inset-ring-0\", \"0px\"],\n [\"inset-ring-1\", \"1px\"],\n [\"inset-ring-2\", \"2px\"],\n [\"inset-ring-4\", \"4px\"],\n [\"inset-ring-8\", \"8px\"],\n].forEach(([name, px]) => {\n staticUtility(name as string, [\n // Tailwind 4.1.13: only the inset-ring layer; the colour defaults to currentcolor via the var() fallback.\n ringShadowProperties,\n [\"--baro-inset-ring-shadow\", `inset 0 0 0 ${px} var(--baro-inset-ring-color, currentcolor)`],\n [\"box-shadow\", SHADOW_COMPOSITE],\n ], { category: 'effects' });\n});\n\n// Ring inset\nstaticUtility(\"ring-inset\", [[\"--baro-ring-inset\", \"inset\"]], { category: 'effects' });\n\n// --- Ring color/opacity/arbitrary/custom property ( supports+fallback) ---\nfunction createRingColorDecls(\n key: string,\n main: string,\n opacity: string | undefined,\n realThemeValue: string\n) {\n const colorVar = `var(--color-${realThemeValue})`;\n let colorMix = colorVar;\n let fallback = colorVar;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${colorVar} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(key, colorMix),\n ]),\n decl(key, fallback),\n ];\n}\n\n// Ring color/opacity/arbitrary/custom property\nfunctionalUtility({\n name: \"ring\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\", \"ringWidth\"], // #338: a key in both is a colour, as in Tailwind\n handle: (value, ctx, token, extra) => {\n const main = value;\n if (extra?.themeNamespace === \"ringWidth\") {\n return [ringShadowProperties(), decl(\"--baro-ring-shadow\", ringShadowValue(value)), decl(\"box-shadow\", SHADOW_COMPOSITE)];\n }\n const opacity = extra?.opacity;\n const realThemeValue = extra?.realThemeValue;\n if (realThemeValue) {\n return createRingColorDecls(\n \"--baro-ring-color\",\n main,\n opacity,\n realThemeValue\n );\n }\n if (main.startsWith(\"color:\")) {\n const cp = main.replace(\"color:\", \"\");\n let colorMix = `var(${cp})`;\n let fallback = colorMix;\n if (opacity) {\n colorMix = `color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`;\n fallback = colorMix;\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-ring-color\", colorMix),\n ]),\n decl(\"--baro-ring-color\", fallback),\n ];\n }\n if (token.arbitrary) {\n let colorMix = main;\n let fallback = main;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-ring-color\", colorMix),\n ]),\n decl(\"--baro-ring-color\", fallback),\n ];\n }\n\n // ring-[3px]: an arbitrary length is a ring width (Tailwind's ring-[<length>]); anything else is a colour.\n if (!parseColor(main) && /^(-?(\\d+\\.?\\d*|\\.\\d+)(px|rem|em|%|vw|vh|vmin|vmax|ch|ex|pt|cm|mm|in|pc)|0|(length:.+)|calc\\(.+\\))$/i.test(main)) {\n const width = main.startsWith(\"length:\") ? main.slice(7) : main;\n return [\n ringShadowProperties(),\n decl(\"--baro-ring-shadow\", ringShadowValue(width)),\n decl(\"box-shadow\", SHADOW_COMPOSITE),\n ];\n }\n return [parseColor(main) ? decl(\"--baro-ring-color\", main) : decl(\"box-shadow\", main)];\n }\n if (main === \"inherit\" || main === \"current\" || main === \"transparent\") {\n return [\n decl(\"--baro-ring-color\", main === \"current\" ? \"currentColor\" : main),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) {\n const cp = value.replace(\"color:\", \"\");\n return [decl(\"--baro-ring-color\", `var(${cp})`)];\n }\n return [decl(\"--baro-ring-color\", `var(${value})`)];\n },\n});\n\n// Inset ring color/opacity/arbitrary/custom property ( supports+fallback)\nfunctionalUtility({\n name: \"inset-ring\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n themeKeys: [\"colors\", \"shadows\"],\n handle: (value, ctx, token, extra) => {\n const main = value;\n const opacity = extra?.opacity;\n const realThemeValue = extra?.realThemeValue;\n if (realThemeValue) {\n return createRingColorDecls(\n \"--baro-inset-ring-color\",\n main,\n opacity,\n realThemeValue\n );\n }\n if (main.startsWith(\"color:\")) {\n const cp = main.replace(\"color:\", \"\");\n let colorMix = `var(${cp})`;\n let fallback = colorMix;\n if (opacity) {\n colorMix = `color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`;\n fallback = colorMix;\n }\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-inset-ring-color\", colorMix),\n ]),\n decl(\"--baro-inset-ring-color\", fallback),\n ];\n }\n if (token.arbitrary) {\n let colorMix = main;\n let fallback = main;\n if (opacity) {\n colorMix = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;\n if (parseColor(main) && main.startsWith(\"#\")) {\n const opacityValue = Math.round((Number(opacity) / 100) * 255);\n fallback = `${main}${opacityValue.toString(16).padStart(2, \"0\")}`;\n } else {\n fallback = colorMix;\n }\n\n return [\n atRule(\"supports\", \"(color:color-mix(in lab, red, red))\", [\n decl(\"--baro-inset-ring-color\", colorMix),\n ]),\n decl(\"--baro-inset-ring-color\", fallback),\n ];\n }\n\n return [decl(\"box-shadow\", `inset ${main}`)];\n }\n\n if (main === \"inherit\" || main === \"current\" || main === \"transparent\") {\n return [\n decl(\n \"--baro-inset-ring-color\",\n main === \"current\" ? \"currentColor\" : main\n ),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"color:\")) {\n const cp = value.replace(\"color:\", \"\");\n return [decl(\"--baro-inset-ring-color\", `var(${cp})`)];\n }\n return [decl(\"--baro-inset-ring-color\", `var(${value})`)];\n },\n});\n\n// --- Opacity ---\n\nfunctionalUtility({\n name: \"opacity\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n // opacity-100, opacity-75, etc.\n if (parseNumber(value)) {\n let num = Number(value);\n if (num > 1) num = num / 100;\n return [decl(\"opacity\", String(num))];\n }\n // opacity-[.67] → .67\n if (token.arbitrary) {\n return [decl(\"opacity\", value)];\n }\n return null;\n },\n handleCustomProperty: (value) => [decl(\"opacity\", `var(${value})`)],\n description: \"opacity utility (number, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mix Blend Mode ---\n[\n [\"mix-blend-normal\", \"normal\"],\n [\"mix-blend-multiply\", \"multiply\"],\n [\"mix-blend-screen\", \"screen\"],\n [\"mix-blend-overlay\", \"overlay\"],\n [\"mix-blend-darken\", \"darken\"],\n [\"mix-blend-lighten\", \"lighten\"],\n [\"mix-blend-color-dodge\", \"color-dodge\"],\n [\"mix-blend-color-burn\", \"color-burn\"],\n [\"mix-blend-hard-light\", \"hard-light\"],\n [\"mix-blend-soft-light\", \"soft-light\"],\n [\"mix-blend-difference\", \"difference\"],\n [\"mix-blend-exclusion\", \"exclusion\"],\n [\"mix-blend-hue\", \"hue\"],\n [\"mix-blend-saturation\", \"saturation\"],\n [\"mix-blend-color\", \"color\"],\n [\"mix-blend-luminosity\", \"luminosity\"],\n [\"mix-blend-plus-darker\", \"plus-darker\"],\n [\"mix-blend-plus-lighter\", \"plus-lighter\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mix-blend-mode\", value as string]]);\n});\n\n// --- Background Blend Mode ---\n[\n [\"bg-blend-normal\", \"normal\"],\n [\"bg-blend-multiply\", \"multiply\"],\n [\"bg-blend-screen\", \"screen\"],\n [\"bg-blend-overlay\", \"overlay\"],\n [\"bg-blend-darken\", \"darken\"],\n [\"bg-blend-lighten\", \"lighten\"],\n [\"bg-blend-color-dodge\", \"color-dodge\"],\n [\"bg-blend-color-burn\", \"color-burn\"],\n [\"bg-blend-hard-light\", \"hard-light\"],\n [\"bg-blend-soft-light\", \"soft-light\"],\n [\"bg-blend-difference\", \"difference\"],\n [\"bg-blend-exclusion\", \"exclusion\"],\n [\"bg-blend-hue\", \"hue\"],\n [\"bg-blend-saturation\", \"saturation\"],\n [\"bg-blend-color\", \"color\"],\n [\"bg-blend-luminosity\", \"luminosity\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"background-blend-mode\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Clip ---\n[\n [\"mask-clip-border\", \"border-box\"],\n [\"mask-clip-padding\", \"padding-box\"],\n [\"mask-clip-content\", \"content-box\"],\n [\"mask-clip-fill\", \"fill-box\"],\n [\"mask-clip-stroke\", \"stroke-box\"],\n [\"mask-clip-view\", \"view-box\"],\n [\"mask-no-clip\", \"no-clip\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-clip\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Composite ---\n[\n [\"mask-add\", \"add\"],\n [\"mask-subtract\", \"subtract\"],\n [\"mask-intersect\", \"intersect\"],\n [\"mask-exclude\", \"exclude\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-composite\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Mode ---\n[\n [\"mask-alpha\", \"alpha\"],\n [\"mask-luminance\", \"luminance\"],\n [\"mask-match\", \"match-source\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-mode\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Origin ---\n[\n [\"mask-origin-border\", \"border-box\"],\n [\"mask-origin-padding\", \"padding-box\"],\n [\"mask-origin-content\", \"content-box\"],\n [\"mask-origin-fill\", \"fill-box\"],\n [\"mask-origin-stroke\", \"stroke-box\"],\n [\"mask-origin-view\", \"view-box\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-origin\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Position ---\n[\n [\"mask-top-left\", \"top left\"],\n [\"mask-top\", \"top\"],\n [\"mask-top-right\", \"top right\"],\n [\"mask-left\", \"left\"],\n [\"mask-center\", \"center\"],\n [\"mask-right\", \"right\"],\n [\"mask-bottom-left\", \"bottom left\"],\n [\"mask-bottom\", \"bottom\"],\n [\"mask-bottom-right\", \"bottom right\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-position\", value as string]], { category: 'effects' });\n});\nfunctionalUtility({\n name: \"mask-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (token.arbitrary) return [decl(\"mask-position\", value)];\n if (token.customProperty) return [decl(\"mask-position\", `var(${value})`)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"mask-position\", `var(${value})`)],\n description:\n \"mask-position utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mask Repeat ---\n[\n [\"mask-repeat\", \"repeat\"],\n [\"mask-no-repeat\", \"no-repeat\"],\n [\"mask-repeat-x\", \"repeat-x\"],\n [\"mask-repeat-y\", \"repeat-y\"],\n [\"mask-repeat-space\", \"space\"],\n [\"mask-repeat-round\", \"round\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-repeat\", value as string]], { category: 'effects' });\n});\n\n// --- Mask Size ---\n[\n [\"mask-auto\", \"auto\"],\n [\"mask-cover\", \"cover\"],\n [\"mask-contain\", \"contain\"],\n].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-size\", value as string]], { category: 'effects' });\n});\n\n\n// --- Mask Type ---\n[\n [\"mask-type-alpha\", \"alpha\"],\n [\"mask-type-luminance\", \"luminance\"],\n ].forEach(([name, value]) => {\n staticUtility(name as string, [[\"mask-type\", value as string]], { category: 'effects' });\n });\n\n// mask-size-[value] (arbitrary) & mask-size-(--custom-property)\nfunctionalUtility({\n name: \"mask-size\",\n prop: \"mask-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"mask-size utility (static, arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n// --- Mask Image ---\n// Tailwind v4.1.13 registers these mask gradient vars with @property initial values, so a lone\n// mask-linear-from-* composes a valid mask-image without inline var() fallbacks.\nconst maskProperties = () =>\n atRoot([\n property(\"--baro-mask-linear\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-radial\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-conic\", \"linear-gradient(#fff, #fff)\"),\n property(\"--baro-mask-linear-position\", \"0deg\"),\n property(\"--baro-mask-linear-from-position\", \"0%\"),\n property(\"--baro-mask-linear-to-position\", \"100%\"),\n property(\"--baro-mask-linear-from-color\", \"black\"),\n property(\"--baro-mask-linear-to-color\", \"transparent\"),\n ]);\n\nfunctionalUtility({\n name: \"mask-linear-from\",\n handleBareValue: ({ value }) => /^(?:100|[1-9]?\\d)%$/.test(value) ? value : null,\n handle: (value) => [\n decl(\"mask-image\", \"var(--baro-mask-linear), var(--baro-mask-radial), var(--baro-mask-conic)\"),\n decl(\"mask-composite\", \"intersect\"),\n decl(\"--baro-mask-linear-stops\", \"var(--baro-mask-linear-position), var(--baro-mask-linear-from-color) var(--baro-mask-linear-from-position), var(--baro-mask-linear-to-color) var(--baro-mask-linear-to-position)\"),\n decl(\"--baro-mask-linear\", \"linear-gradient(var(--baro-mask-linear-stops))\"),\n decl(\"--baro-mask-linear-from-position\", value),\n maskProperties(),\n ],\n category: \"effects\",\n});\n\nstaticUtility(\"mask-none\", [[\"mask-image\", \"none\"]], { category: \"effects\" });\nfunctionalUtility({\n name: \"mask\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n if (value === \"none\") return [decl(\"mask-image\", \"none\")];\n if (token.arbitrary) return [decl(\"mask-image\", value)];\n if (token.customProperty) return [decl(\"mask-image\", `var(${value})`)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"mask-image\", `var(${value})`)],\n description: \"mask-image utility (arbitrary, custom property supported)\",\n category: \"effects\",\n});\n\n","import { staticUtility, functionalUtility, registerUtility, themeKeyVar } from \"../core/registry\";\nimport { decl, atRule } from \"../core/ast\";\nimport {\n parseNumber,\n parseFraction,\n} from \"../core/utils\";\n\n// --- Layout: Isolation ---\nstaticUtility(\"isolate\", [[\"isolation\", \"isolate\"]], { category: 'layout' });\nstaticUtility(\"isolation-auto\", [[\"isolation\", \"auto\"]], { category: 'layout' });\n\n// --- Layout: Z-Index ---\nstaticUtility(\"z-auto\", [[\"z-index\", \"auto\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"z\",\n prop: \"z-index\",\n themeKey: \"zIndex\",\n supportsNegative: true,\n supportsFraction: true,\n supportsArbitrary: true, // z-[999], z-[calc(var(--index)+1)] 등 지원\n supportsCustomProperty: true, // z-(--my-z) supported\n // but actual theme lookup is handled in ctx.theme\n handleBareValue: ({ value }) => {\n return parseNumber(value); // only allow integers\n },\n description: \"z-index utility\",\n category: \"layout\",\n});\n\n// --- Layout: Aspect Ratio ---\nstaticUtility(\"aspect-square\", [[\"aspect-ratio\", \"1 / 1\"]], { category: 'layout' });\nstaticUtility(\"aspect-video\", [[\"aspect-ratio\", \"var(--aspect-video)\"]], { category: 'layout' });\nstaticUtility(\"aspect-auto\", [[\"aspect-ratio\", \"auto\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"aspect\",\n prop: \"aspect-ratio\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n // #300: aspect-<any theme.aspect key> → var(--aspect-<key>); numbers and fractions pass through as before.\n handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, \"aspect\", value, \"aspect\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n description:\n \"aspect-ratio utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Columns ---\nstaticUtility(\"columns-auto\", [[\"columns\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"columns-3xs\", [[\"columns\", \"var(--container-3xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-2xs\", [[\"columns\", \"var(--container-2xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-xs\", [[\"columns\", \"var(--container-xs)\"]], { category: 'layout' });\nstaticUtility(\"columns-sm\", [[\"columns\", \"var(--container-sm)\"]], { category: 'layout' });\nstaticUtility(\"columns-md\", [[\"columns\", \"var(--container-md)\"]], { category: 'layout' });\nstaticUtility(\"columns-lg\", [[\"columns\", \"var(--container-lg)\"]], { category: 'layout' });\nstaticUtility(\"columns-xl\", [[\"columns\", \"var(--container-xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-2xl\", [[\"columns\", \"var(--container-2xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-3xl\", [[\"columns\", \"var(--container-3xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-4xl\", [[\"columns\", \"var(--container-4xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-5xl\", [[\"columns\", \"var(--container-5xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-6xl\", [[\"columns\", \"var(--container-6xl)\"]], { category: 'layout' });\nstaticUtility(\"columns-7xl\", [[\"columns\", \"var(--container-7xl)\"]], { category: 'layout' });\nfunctionalUtility({\n name: \"columns\",\n prop: \"columns\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value, ctx }) => parseNumber(value) ?? themeKeyVar(ctx, \"container\", value, \"container\"), // #300\n description:\n \"columns utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Break After ---\nstaticUtility(\"break-after-auto\", [[\"break-after\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-after-avoid\", [[\"break-after\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-after-all\", [[\"break-after\", \"all\"]], { category: 'layout' });\nstaticUtility(\"break-after-avoid-page\", [[\"break-after\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-after-page\", [[\"break-after\", \"page\"]], { category: 'layout' });\nstaticUtility(\"break-after-left\", [[\"break-after\", \"left\"]], { category: 'layout' });\nstaticUtility(\"break-after-right\", [[\"break-after\", \"right\"]], { category: 'layout' });\nstaticUtility(\"break-after-column\", [[\"break-after\", \"column\"]], { category: 'layout' });\n\n// --- Layout: Break Before ---\nstaticUtility(\"break-before-auto\", [[\"break-before\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-before-avoid\", [[\"break-before\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-before-all\", [[\"break-before\", \"all\"]], { category: 'layout' });\nstaticUtility(\"break-before-avoid-page\", [[\"break-before\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-before-page\", [[\"break-before\", \"page\"]], { category: 'layout' });\nstaticUtility(\"break-before-left\", [[\"break-before\", \"left\"]], { category: 'layout' });\nstaticUtility(\"break-before-right\", [[\"break-before\", \"right\"]], { category: 'layout' });\nstaticUtility(\"break-before-column\", [[\"break-before\", \"column\"]], { category: 'layout' });\n\n// --- Layout: Break Inside ---\nstaticUtility(\"break-inside-auto\", [[\"break-inside\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid\", [[\"break-inside\", \"avoid\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid-page\", [[\"break-inside\", \"avoid-page\"]], { category: 'layout' });\nstaticUtility(\"break-inside-avoid-column\", [[\"break-inside\", \"avoid-column\"]], { category: 'layout' });\n\n// --- Layout: Box Decoration Break ---\nstaticUtility(\"box-decoration-slice\", [[\"box-decoration-break\", \"slice\"]], { category: 'layout' });\nstaticUtility(\"box-decoration-clone\", [[\"box-decoration-break\", \"clone\"]], { category: 'layout' });\n\n// --- Layout: Box Sizing ---\n staticUtility(\"box-border\", [[\"box-sizing\", \"border-box\"]], { category: 'layout' });\nstaticUtility(\"box-content\", [[\"box-sizing\", \"content-box\"]], { category: 'layout' });\n\n// --- Layout: Display ---\nstaticUtility(\"block\", [[\"display\", \"block\"]], { category: 'layout' });\nstaticUtility(\"inline\", [[\"display\", \"inline\"]], { category: 'layout' });\nstaticUtility(\"inline-block\", [[\"display\", \"inline-block\"]], { category: 'layout' });\nstaticUtility(\"flow-root\", [[\"display\", \"flow-root\"]], { category: 'layout' });\nstaticUtility(\"flex\", [[\"display\", \"flex\"]], { category: 'layout' });\nstaticUtility(\"inline-flex\", [[\"display\", \"inline-flex\"]], { category: 'layout' });\nstaticUtility(\"grid\", [[\"display\", \"grid\"]], { category: 'layout' });\nstaticUtility(\"inline-grid\", [[\"display\", \"inline-grid\"]], { category: 'layout' });\nstaticUtility(\"contents\", [[\"display\", \"contents\"]], { category: 'layout' });\nstaticUtility(\"table\", [[\"display\", \"table\"]], { category: 'layout' });\nstaticUtility(\"inline-table\", [[\"display\", \"inline-table\"]], { category: 'layout' });\nstaticUtility(\"table-caption\", [[\"display\", \"table-caption\"]], { category: 'layout' });\nstaticUtility(\"table-cell\", [[\"display\", \"table-cell\"]], { category: 'layout' });\nstaticUtility(\"table-column\", [[\"display\", \"table-column\"]], { category: 'layout' });\nstaticUtility(\"table-column-group\", [[\"display\", \"table-column-group\"]], { category: 'layout' });\nstaticUtility(\"table-footer-group\", [[\"display\", \"table-footer-group\"]], { category: 'layout' });\nstaticUtility(\"table-header-group\", [[\"display\", \"table-header-group\"]], { category: 'layout' });\nstaticUtility(\"table-row-group\", [[\"display\", \"table-row-group\"]], { category: 'layout' });\nstaticUtility(\"table-row\", [[\"display\", \"table-row\"]], { category: 'layout' });\nstaticUtility(\"list-item\", [[\"display\", \"list-item\"]], { category: 'layout' });\nstaticUtility(\"hidden\", [[\"display\", \"none\"]], { category: 'layout' });\nstaticUtility(\"sr-only\", [\n [\"position\", \"absolute\"],\n [\"width\", \"1px\"],\n [\"height\", \"1px\"],\n [\"padding\", \"0\"],\n [\"margin\", \"-1px\"],\n [\"overflow\", \"hidden\"],\n [\"clip-path\", \"inset(50%)\"],\n [\"white-space\", \"nowrap\"],\n [\"border-width\", \"0\"],\n], { category: 'layout' });\n\nstaticUtility(\"not-sr-only\", [\n [\"position\", \"static\"],\n [\"width\", \"auto\"],\n [\"height\", \"auto\"],\n [\"padding\", \"0\"],\n [\"margin\", \"0\"],\n [\"overflow\", \"visible\"],\n [\"clip-path\", \"none\"],\n [\"white-space\", \"normal\"],\n], { category: 'layout' });\n\n// --- Layout: Container queries (@container, @container/<name>, @container-normal) ---\nstaticUtility(\"@container\", [[\"container-type\", \"inline-size\"]], { category: 'layout' });\nstaticUtility(\"@container-normal\", [[\"container-type\", \"normal\"]], { category: 'layout' });\nstaticUtility(\"@container-size\", [[\"container-type\", \"size\"]], { category: 'layout' }); // #311 (Tailwind 4.3)\n// Named forms: @container/<name>, @container-normal/<name>, @container-size/<name> (#311).\nconst NAMED_CONTAINER = /^@container(-normal|-size)?\\/([a-zA-Z0-9_-]+)$/;\nconst CONTAINER_TYPE: Record<string, string> = { '': 'inline-size', '-normal': 'normal', '-size': 'size' };\nregisterUtility({\n name: \"@container\",\n match: (className: string) => NAMED_CONTAINER.test(className),\n handler: (_value, _ctx, token) => {\n const m = NAMED_CONTAINER.exec(`${token.prefix}${token.value ? `-${token.value}` : \"\"}`);\n return m ? [decl(\"container-type\", CONTAINER_TYPE[m[1] ?? '']), decl(\"container-name\", m[2])] : null;\n },\n category: 'layout',\n});\n\n// --- Layout: Container (Tailwind 4: width 100% + max-width at each breakpoint, ascending) ---\nconst toRem = (v: string): number => {\n const m = /^(-?\\d*\\.?\\d+)(rem|px|em)$/.exec(v.trim());\n if (!m) return Number.NaN;\n return m[2] === 'px' ? Number(m[1]) / 16 : Number(m[1]);\n};\nregisterUtility({\n name: \"container\",\n match: (className: string) => className === \"container\",\n handler: (_value, ctx) => {\n const bps = (ctx.theme('breakpoints') || ctx.config('theme.breakpoints') || {}) as Record<string, unknown>;\n const values = Object.values(bps).filter((v): v is string => typeof v === 'string' && !Number.isNaN(toRem(v)));\n values.sort((a, b) => toRem(a) - toRem(b));\n return [decl(\"width\", \"100%\"), ...values.map((v) => atRule(\"media\", `(width >= ${v})`, [decl(\"max-width\", v)]))];\n },\n category: 'layout',\n});\n\n// --- Layout: Float ---\nstaticUtility(\"float-right\", [[\"float\", \"right\"]], { category: 'layout' });\nstaticUtility(\"float-left\", [[\"float\", \"left\"]], { category: 'layout' });\nstaticUtility(\"float-start\", [[\"float\", \"inline-start\"]], { category: 'layout' });\nstaticUtility(\"float-end\", [[\"float\", \"inline-end\"]], { category: 'layout' });\nstaticUtility(\"float-none\", [[\"float\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Clear ---\nstaticUtility(\"clear-left\", [[\"clear\", \"left\"]], { category: 'layout' });\nstaticUtility(\"clear-right\", [[\"clear\", \"right\"]], { category: 'layout' });\nstaticUtility(\"clear-both\", [[\"clear\", \"both\"]], { category: 'layout' });\nstaticUtility(\"clear-start\", [[\"clear\", \"inline-start\"]], { category: 'layout' });\nstaticUtility(\"clear-end\", [[\"clear\", \"inline-end\"]], { category: 'layout' });\nstaticUtility(\"clear-none\", [[\"clear\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Object Fit ---\nstaticUtility(\"object-contain\", [[\"object-fit\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"object-cover\", [[\"object-fit\", \"cover\"]], { category: 'layout' });\nstaticUtility(\"object-fill\", [[\"object-fit\", \"fill\"]], { category: 'layout' });\nstaticUtility(\"object-none\", [[\"object-fit\", \"none\"]], { category: 'layout' });\nstaticUtility(\"object-scale-down\", [[\"object-fit\", \"scale-down\"]], { category: 'layout' });\n\n// --- Layout: Object Position ---\nstaticUtility(\"object-top-left\", [[\"object-position\", \"top left\"]], { category: 'layout' });\nstaticUtility(\"object-top\", [[\"object-position\", \"top\"]], { category: 'layout' });\nstaticUtility(\"object-top-right\", [[\"object-position\", \"top right\"]], { category: 'layout' });\nstaticUtility(\"object-left\", [[\"object-position\", \"left\"]], { category: 'layout' });\nstaticUtility(\"object-center\", [[\"object-position\", \"center\"]], { category: 'layout' });\nstaticUtility(\"object-right\", [[\"object-position\", \"right\"]], { category: 'layout' });\nstaticUtility(\"object-bottom-left\", [[\"object-position\", \"bottom left\"]], { category: 'layout' });\nstaticUtility(\"object-bottom\", [[\"object-position\", \"bottom\"]], { category: 'layout' });\nstaticUtility(\"object-bottom-right\", [[\"object-position\", \"bottom right\"]], { category: 'layout' });\n\nfunctionalUtility({\n name: \"object\",\n prop: \"object-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description:\n \"object-position utility (arbitrary value, custom property supported)\",\n category: \"layout\",\n});\n\n// --- Layout: Overflow ---\n staticUtility(\"overflow-auto\", [[\"overflow\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-hidden\", [[\"overflow\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-clip\", [[\"overflow\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-visible\", [[\"overflow\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-scroll\", [[\"overflow\", \"scroll\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-auto\", [[\"overflow-x\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-auto\", [[\"overflow-y\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-hidden\", [[\"overflow-x\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-hidden\", [[\"overflow-y\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-clip\", [[\"overflow-x\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-clip\", [[\"overflow-y\", \"clip\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-visible\", [[\"overflow-x\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-visible\", [[\"overflow-y\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"overflow-x-scroll\", [[\"overflow-x\", \"scroll\"]], { category: 'layout' });\nstaticUtility(\"overflow-y-scroll\", [[\"overflow-y\", \"scroll\"]], { category: 'layout' });\n\n// --- Layout: Overscroll Behavior ---\nstaticUtility(\"overscroll-auto\", [[\"overscroll-behavior\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-contain\", [[\"overscroll-behavior\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-none\", [[\"overscroll-behavior\", \"none\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-auto\", [[\"overscroll-behavior-x\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-contain\", [[\"overscroll-behavior-x\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-x-none\", [[\"overscroll-behavior-x\", \"none\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-auto\", [[\"overscroll-behavior-y\", \"auto\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-contain\", [[\"overscroll-behavior-y\", \"contain\"]], { category: 'layout' });\nstaticUtility(\"overscroll-y-none\", [[\"overscroll-behavior-y\", \"none\"]], { category: 'layout' });\n\n// --- Layout: Position ---\nstaticUtility(\"static\", [[\"position\", \"static\"]], { category: 'layout' });\nstaticUtility(\"fixed\", [[\"position\", \"fixed\"]], { category: 'layout' });\nstaticUtility(\"absolute\", [[\"position\", \"absolute\"]], { category: 'layout' });\nstaticUtility(\"relative\", [[\"position\", \"relative\"]], { category: 'layout' });\nstaticUtility(\"sticky\", [[\"position\", \"sticky\"]], { category: 'layout' });\n\n// --- Layout: Inset/Top/Right/Bottom/Left ---\n[\n [\"inset-x\", \"inset-inline\"],\n [\"inset-y\", \"inset-block\"],\n // Tailwind 4.3 logical sides; registered before `inset` so their handler runs first for `inset-s-*` etc.\n [\"inset-s\", \"inset-inline-start\"],\n [\"inset-e\", \"inset-inline-end\"],\n [\"inset-bs\", \"inset-block-start\"],\n [\"inset-be\", \"inset-block-end\"],\n [\"inset\", \"inset\"],\n [\"start\", \"inset-inline-start\"],\n [\"end\", \"inset-inline-end\"],\n [\"top\", \"top\"],\n [\"right\", \"right\"],\n [\"bottom\", \"bottom\"],\n [\"left\", \"left\"],\n].forEach(([name, prop]) => {\n // inset\n staticUtility(`${name}-auto`, [[prop, \"auto\"]], { category: 'layout' });\n staticUtility(`${name}-full`, [[prop, \"100%\"]], { category: 'layout' });\n staticUtility(`-${name}-full`, [[prop, \"-100%\"]], { category: 'layout' });\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'layout' });\n staticUtility(`-${name}-px`, [[prop, \"-1px\"]], { category: 'layout' });\n functionalUtility({\n name: name,\n spacingKeys: true,\n prop: prop,\n supportsNegative: true,\n supportsFraction: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n const frac = parseFraction(value);\n if (frac) return frac;\n return null;\n },\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * -${value})`;\n }\n const frac = parseFraction(value);\n if (frac) return `-${frac}`;\n return null;\n },\n description: `${name} utility (spacing, fraction, px, full, auto, custom property, arbitrary, negative supported)`,\n category: \"layout\",\n });\n});\n\n// --- Layout: Visibility ---\nstaticUtility(\"visible\", [[\"visibility\", \"visible\"]], { category: 'layout' });\nstaticUtility(\"invisible\", [[\"visibility\", \"hidden\"]], { category: 'layout' });\nstaticUtility(\"collapse\", [[\"visibility\", \"collapse\"]], { category: 'layout' });\n\n// --- Layout: Gap ---\nfunctionalUtility({\n name: \"gap-x\",\n spacingKeys: true,\n prop: \"column-gap\",\n supportsArbitrary: true, // gap-x-[10vw]\n supportsCustomProperty: true, // gap-x-(--my-gap-x)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"column-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"column-gap\", `var(${value})`)],\n description: \"gap-x utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap-y\",\n spacingKeys: true,\n prop: \"row-gap\",\n supportsArbitrary: true, // gap-y-[10vw]\n supportsCustomProperty: true, // gap-y-(--my-gap-y)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"row-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"row-gap\", `var(${value})`)],\n description: \"gap-y utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap\",\n spacingKeys: true,\n prop: \"gap\",\n supportsArbitrary: true, // gap-[10vw]\n supportsCustomProperty: true, // gap-(--my-gap)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"gap\", `var(${value})`)],\n description: \"gap utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\n\n// #310: zoom-* (Tailwind 4.3): integer → percent (zoom-50 → 50%), zoom-[1.5], zoom-(--z).\nfunctionalUtility({\n name: \"zoom\",\n prop: \"zoom\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? `${value}%` : null),\n description: \"zoom utility (integer percent, arbitrary, custom property)\",\n category: \"layout\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport {\n parseFractionOrNumber,\n parseNumber,\n parseFraction,\n} from \"../core/utils\";\n\n\n// --- Flexbox & Grid: flex-basis ---\nstaticUtility(\"basis-full\", [[\"flex-basis\", \"100%\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-auto\", [[\"flex-basis\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-3xs\", [[\"flex-basis\", \"var(--container-3xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-2xs\", [[\"flex-basis\", \"var(--container-2xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-xs\", [[\"flex-basis\", \"var(--container-xs)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-sm\", [[\"flex-basis\", \"var(--container-sm)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-md\", [[\"flex-basis\", \"var(--container-md)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-lg\", [[\"flex-basis\", \"var(--container-lg)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-xl\", [[\"flex-basis\", \"var(--container-xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-2xl\", [[\"flex-basis\", \"var(--container-2xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-3xl\", [[\"flex-basis\", \"var(--container-3xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-4xl\", [[\"flex-basis\", \"var(--container-4xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-5xl\", [[\"flex-basis\", \"var(--container-5xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-6xl\", [[\"flex-basis\", \"var(--container-6xl)\"]], { category: 'flex-grid' });\nstaticUtility(\"basis-7xl\", [[\"flex-basis\", \"var(--container-7xl)\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"basis\",\n prop: \"flex-basis\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--container-${value}) * 1px)`;\n }\n const frac = parseFraction(value);\n if (frac) return frac;\n return null;\n },\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--container-${value}) * -1px)`;\n }\n const frac = parseFraction(value);\n if (frac) return `-${frac}`;\n return null;\n },\n description:\n \"flex-basis utility (theme, arbitrary, custom property, fraction supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: flex-direction ---\nstaticUtility(\"flex-row\", [[\"flex-direction\", \"row\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-row-reverse\", [[\"flex-direction\", \"row-reverse\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-col\", [[\"flex-direction\", \"column\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-col-reverse\", [[\"flex-direction\", \"column-reverse\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: flex-wrap ---\nstaticUtility(\"flex-wrap\", [[\"flex-wrap\", \"wrap\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-wrap-reverse\", [[\"flex-wrap\", \"wrap-reverse\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-nowrap\", [[\"flex-wrap\", \"nowrap\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Flex ---\nstaticUtility(\"flex-auto\", [[\"flex\", \"1 1 auto\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-initial\", [[\"flex\", \"0 1 auto\"]], { category: 'flex-grid' });\nstaticUtility(\"flex-none\", [[\"flex\", \"none\"]], { category: 'flex-grid' });\n\n// Registered before `flex` so the legacy aliases win over flex-<n> (first matching registration wins).\n// Legacy alias accepted by Tailwind 4: flex-grow, flex-grow-0, flex-grow-[2]\nstaticUtility(\"flex-grow\", [[\"flex-grow\", \"1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"flex-grow\",\n prop: \"flex-grow\",\n supportsArbitrary: true, // grow-[25vw], grow-[2], grow-[var(--factor)], etc.\n supportsCustomProperty: true, // grow-(--my-grow)\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [decl(\"flex-grow\", value)],\n description: \"flex-grow utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// Legacy alias accepted by Tailwind 4: flex-shrink, flex-shrink-0, flex-shrink-[2]\nstaticUtility(\"flex-shrink\", [[\"flex-shrink\", \"1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"flex-shrink\",\n prop: \"flex-shrink\",\n supportsArbitrary: true, // shrink-[2], shrink-[calc(100vw-var(--sidebar))], etc.\n supportsCustomProperty: true, // shrink-(--my-shrink)\n handleBareValue: ({ value }) => parseNumber(value),\n description: \"flex-shrink utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\nfunctionalUtility({\n name: \"flex\",\n supportsArbitrary: true, // flex-[3_1_auto], flex-[2], flex-[0_0_100%], etc.\n supportsCustomProperty: true, // flex-(--my-flex)\n supportsFraction: true, // flex-1/2 → flex: 50%;\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return value;\n const frac = parseFraction(value);\n if (frac) return `calc(${frac})`;\n return null;\n },\n handle: (value) => [decl(\"flex\", value)],\n description:\n \"flex shorthand utility (number, fraction, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Flex Grow ---\nstaticUtility(\"grow\", [[\"flex-grow\", \"1\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grow\",\n prop: \"flex-grow\",\n supportsArbitrary: true, // grow-[25vw], grow-[2], grow-[var(--factor)], etc.\n supportsCustomProperty: true, // grow-(--my-grow)\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [decl(\"flex-grow\", value)],\n description: \"flex-grow utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Flex Shrink ---\nstaticUtility(\"shrink\", [[\"flex-shrink\", \"1\"]], { category: 'flex-grid' });\nstaticUtility(\"shrink-0\", [[\"flex-shrink\", \"0\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"shrink\",\n prop: \"flex-shrink\",\n supportsArbitrary: true, // shrink-[2], shrink-[calc(100vw-var(--sidebar))], etc.\n supportsCustomProperty: true, // shrink-(--my-shrink)\n handleBareValue: ({ value }) => parseNumber(value),\n description: \"flex-shrink utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Order ---\nstaticUtility(\"order-first\", [[\"order\", \"calc(-infinity)\"]], { category: 'flex-grid' });\nstaticUtility(\"order-last\", [[\"order\", \"calc(infinity)\"]], { category: 'flex-grid' });\nstaticUtility(\"order-none\", [[\"order\", \"0\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"order\",\n prop: \"order\",\n supportsNegative: true, // -order-1 → order: calc(1 * -1)\n supportsArbitrary: true, // order-[min(var(--total-items),10)], etc.\n supportsCustomProperty: true, // order-(--my-order)\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"order utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Template Columns ---\nstaticUtility(\"grid-cols-none\", [[\"grid-template-columns\", \"none\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-cols-subgrid\", [[\"grid-template-columns\", \"subgrid\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grid-cols\",\n prop: \"grid-template-columns\",\n supportsArbitrary: true, // grid-cols-[200px_minmax(900px,_1fr)_100px], etc.\n supportsCustomProperty: true, // grid-cols-(--my-grid-cols)\n handleBareValue: ({ value }) =>\n parseFractionOrNumber(value, { repeat: true }),\n description:\n \"grid-template-columns utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Template Rows ---\nstaticUtility(\"grid-rows-none\", [[\"grid-template-rows\", \"none\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-rows-subgrid\", [[\"grid-template-rows\", \"subgrid\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"grid-rows\",\n prop: \"grid-template-rows\",\n supportsArbitrary: true, // grid-rows-[200px_minmax(900px,_1fr)_100px], etc.\n supportsCustomProperty: true, // grid-rows-(--my-grid-rows)\n handleBareValue: ({ value }) =>\n parseFractionOrNumber(value, { repeat: true }),\n handle: (value) => {\n // grid-rows-[200px_minmax(900px,_1fr)_100px]\n // Just output as-is (spaces instead of underscores)\n if (typeof value === \"string\") {\n return [decl(\"grid-template-rows\", value.replace(/_/g, \" \"))];\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\"grid-template-rows\", `var(${value})`),\n ],\n description:\n \"grid-template-rows utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Row ---\n// row-span utilities\nstaticUtility(\"row-span-full\", [[\"grid-row\", \"1 / -1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-span\",\n prop: \"grid-row\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return `span ${value} / span ${value}`;\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\"grid-row\", `span var(${value}) / span var(${value})`),\n ],\n handle: (value) => {\n if (parseNumber(value))\n return [decl(\"grid-row\", `span ${value} / span ${value}`)];\n // arbitrary value: row-span-[5] → span 5 / span 5\n return null;\n },\n description:\n \"grid-row span utility (number, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-start utilities\nstaticUtility(\"row-start-auto\", [[\"grid-row-start\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-start\",\n prop: \"grid-row-start\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row-start\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row-start\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row-start\", value)];\n return null;\n },\n description:\n \"grid-row-start utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-end utilities\nstaticUtility(\"row-end-auto\", [[\"grid-row-end\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row-end\",\n prop: \"grid-row-end\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row-end\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row-end\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row-end\", value)];\n return null;\n },\n description:\n \"grid-row-end utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n// row-auto, row-<number>, -row-<number>, row-(<custom-property>), row-[value]\nstaticUtility(\"row-auto\", [[\"grid-row\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"row\",\n prop: \"grid-row\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-row\", `var(${value})`)],\n handle: (value) => {\n if (parseNumber(value)) return [decl(\"grid-row\", value)];\n if (typeof value === \"string\") return [decl(\"grid-row\", value)];\n return null;\n },\n description:\n \"grid-row utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Auto Flow ---\n staticUtility(\"grid-flow-row\", [[\"grid-auto-flow\", \"row\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-col\", [[\"grid-auto-flow\", \"column\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-dense\", [[\"grid-auto-flow\", \"dense\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-row-dense\", [[\"grid-auto-flow\", \"row dense\"]], { category: 'flex-grid' });\nstaticUtility(\"grid-flow-col-dense\", [[\"grid-auto-flow\", \"column dense\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Grid Auto Columns ---\nstaticUtility(\"auto-cols-auto\", [[\"grid-auto-columns\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-min\", [[\"grid-auto-columns\", \"min-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-max\", [[\"grid-auto-columns\", \"max-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-cols-fr\", [[\"grid-auto-columns\", \"minmax(0, 1fr)\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"auto-cols\",\n prop: \"grid-auto-columns\",\n supportsArbitrary: true, // auto-cols-[minmax(0,2fr)]\n supportsCustomProperty: true, // auto-cols-(--my-auto-cols)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null), // #310: auto-cols-4\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"grid-auto-columns\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-auto-columns\", `var(${value})`)],\n description:\n \"grid-auto-columns utility (static, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Grid Auto Rows ---\nstaticUtility(\"auto-rows-auto\", [[\"grid-auto-rows\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-min\", [[\"grid-auto-rows\", \"min-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-max\", [[\"grid-auto-rows\", \"max-content\"]], { category: 'flex-grid' });\nstaticUtility(\"auto-rows-fr\", [[\"grid-auto-rows\", \"minmax(0, 1fr)\"]], { category: 'flex-grid' });\n\nfunctionalUtility({\n name: \"auto-rows\",\n prop: \"grid-auto-rows\",\n supportsArbitrary: true, // auto-rows-[minmax(0,2fr)]\n supportsCustomProperty: true, // auto-rows-(--my-auto-rows)\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null), // #310: auto-rows-12\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"grid-auto-rows\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"grid-auto-rows\", `var(${value})`)],\n description:\n \"grid-auto-rows utility (static, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});\n\n// --- Flexbox & Grid: Gap ---\nfunctionalUtility({\n name: \"gap-x\",\n prop: \"column-gap\",\n supportsArbitrary: true, // gap-x-[10vw]\n supportsCustomProperty: true, // gap-x-(--my-gap-x)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"column-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"column-gap\", `var(${value})`)],\n description: \"gap-x utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap-y\",\n prop: \"row-gap\",\n supportsArbitrary: true, // gap-y-[10vw]\n supportsCustomProperty: true, // gap-y-(--my-gap-y)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"row-gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"row-gap\", `var(${value})`)],\n description: \"gap-y utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\nfunctionalUtility({\n name: \"gap\",\n prop: \"gap\",\n supportsArbitrary: true, // gap-[10vw]\n supportsCustomProperty: true, // gap-(--my-gap)\n handleBareValue: ({ value }) => (value === \"px\" ? \"1px\" : parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handle: (value) => {\n if (typeof value === \"string\") return [decl(\"gap\", value)];\n return null;\n },\n handleCustomProperty: (value) => [decl(\"gap\", `var(${value})`)],\n description: \"gap utility (number, arbitrary, custom property supported)\",\n category: \"layout\",\n});\n\n// --- Flexbox & Grid: Justify Content ---\nstaticUtility(\"justify-start\", [[\"justify-content\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-end\", [[\"justify-content\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-end-safe\", [[\"justify-content\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-center\", [[\"justify-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-center-safe\", [[\"justify-content\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-between\", [[\"justify-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-around\", [[\"justify-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-evenly\", [[\"justify-content\", \"space-evenly\"]], { category: 'flex-grid' });\n staticUtility(\"justify-stretch\", [[\"justify-content\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-baseline\", [[\"justify-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-normal\", [[\"justify-content\", \"normal\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Justify Items ---\nstaticUtility(\"justify-items-start\", [[\"justify-items\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-end\", [[\"justify-items\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-end-safe\", [[\"justify-items\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-center\", [[\"justify-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-center-safe\", [[\"justify-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-stretch\", [[\"justify-items\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-items-normal\", [[\"justify-items\", \"normal\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Justify Self ---\nstaticUtility(\"justify-self-auto\", [[\"justify-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-start\", [[\"justify-self\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-center\", [[\"justify-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-center-safe\", [[\"justify-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-end\", [[\"justify-self\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-end-safe\", [[\"justify-self\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"justify-self-stretch\", [[\"justify-self\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Content ---\n staticUtility(\"content-normal\", [[\"align-content\", \"normal\"]], { category: 'flex-grid' });\nstaticUtility(\"content-center\", [[\"align-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"content-start\", [[\"align-content\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"content-end\", [[\"align-content\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"content-between\", [[\"align-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"content-around\", [[\"align-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"content-evenly\", [[\"align-content\", \"space-evenly\"]], { category: 'flex-grid' });\nstaticUtility(\"content-baseline\", [[\"align-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"content-stretch\", [[\"align-content\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Items ---\nstaticUtility(\"items-start\", [[\"align-items\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"items-end\", [[\"align-items\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"items-end-safe\", [[\"align-items\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"items-center\", [[\"align-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"items-center-safe\", [[\"align-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"items-baseline\", [[\"align-items\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"items-baseline-last\", [[\"align-items\", \"last baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"items-stretch\", [[\"align-items\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Align Self ---\nstaticUtility(\"self-auto\", [[\"align-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"self-start\", [[\"align-self\", \"flex-start\"]], { category: 'flex-grid' });\nstaticUtility(\"self-end\", [[\"align-self\", \"flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"self-end-safe\", [[\"align-self\", \"safe flex-end\"]], { category: 'flex-grid' });\nstaticUtility(\"self-center\", [[\"align-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"self-center-safe\", [[\"align-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"self-stretch\", [[\"align-self\", \"stretch\"]], { category: 'flex-grid' });\nstaticUtility(\"self-baseline\", [[\"align-self\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"self-baseline-last\", [[\"align-self\", \"last baseline\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Place Content ---\nstaticUtility(\"place-content-center\", [[\"place-content\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-center-safe\", [[\"place-content\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-start\", [[\"place-content\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-end\", [[\"place-content\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-end-safe\", [[\"place-content\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-between\", [[\"place-content\", \"space-between\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-around\", [[\"place-content\", \"space-around\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-evenly\", [[\"place-content\", \"space-evenly\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-baseline\", [[\"place-content\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"place-content-stretch\", [[\"place-content\", \"stretch\"]], { category: 'flex-grid' } );\n\n// --- Flexbox & Grid: Place Items ---\nstaticUtility(\"place-items-start\", [[\"place-items\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-end\", [[\"place-items\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-end-safe\", [[\"place-items\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-center\", [[\"place-items\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-center-safe\", [[\"place-items\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-baseline\", [[\"place-items\", \"baseline\"]], { category: 'flex-grid' });\nstaticUtility(\"place-items-stretch\", [[\"place-items\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Place Self ---\nstaticUtility(\"place-self-auto\", [[\"place-self\", \"auto\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-start\", [[\"place-self\", \"start\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-end\", [[\"place-self\", \"end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-end-safe\", [[\"place-self\", \"safe end\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-center\", [[\"place-self\", \"center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-center-safe\", [[\"place-self\", \"safe center\"]], { category: 'flex-grid' });\nstaticUtility(\"place-self-stretch\", [[\"place-self\", \"stretch\"]], { category: 'flex-grid' });\n\n// --- Flexbox & Grid: Grid Column ---\n// col-span utilities\nstaticUtility(\"col-span-full\", [[\"grid-column\", \"1 / -1\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-span\",\n prop: \"grid-column\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) return `span ${value} / span ${value}`;\n return null;\n },\n handleCustomProperty: (value, _ctx, _token) => {\n return [decl(\"grid-column\", `span var(${value}) / span var(${value})`)];\n },\n handle: (value, _ctx, _token) => {\n if (parseNumber(value))\n return [decl(\"grid-column\", `span ${value} / span ${value}`)];\n return null;\n },\n description:\n \"grid-column span utility (number, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-start utilities\nstaticUtility(\"col-start-auto\", [[\"grid-column-start\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-start\",\n prop: \"grid-column-start\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column-start utility (number, negative, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-end utilities\nstaticUtility(\"col-end-auto\", [[\"grid-column-end\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col-end\",\n prop: \"grid-column-end\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column-end utility (number, negative, arbitrary, custom property supported)\",\n category: \"grid\",\n});\n\n// col-auto, col-<number>, -col-<number>, col-(<custom-property>), col-[value]\nstaticUtility(\"col-auto\", [[\"grid-column\", \"auto\"]], { category: 'flex-grid' });\nfunctionalUtility({\n name: \"col\",\n prop: \"grid-column\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handleNegativeBareValue: ({ value }) => {\n if (parseNumber(value)) return `calc(${value} * -1)`;\n return null;\n },\n description:\n \"grid-column utility (number, negative, arbitrary, custom property supported)\",\n category: \"flex-grid\",\n});","import { parseNumber } from \"../core/utils\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { atRoot, decl, property, rule } from \"../core/ast\";\n\n// Padding utilities (p-*, px-*, py-*, ps-*, pe-*, pt-*, pr-*, pb-*, pl-*)\n[\n [\"px\", \"padding-inline\"],\n [\"py\", \"padding-block\"],\n [\"ps\", \"padding-inline-start\"],\n [\"pe\", \"padding-inline-end\"],\n [\"pbs\", \"padding-block-start\"],\n [\"pbe\", \"padding-block-end\"],\n [\"pt\", \"padding-top\"],\n [\"pr\", \"padding-right\"],\n [\"pb\", \"padding-bottom\"],\n [\"pl\", \"padding-left\"],\n [\"p\", \"padding\"],\n].forEach(([name, prop]) => {\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'spacing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n description: `${name} utility (number, arbitrary, custom property supported)`,\n category: \"spacing\",\n });\n});\n\n// Margin utilities (m-*, mx-*, my-*, ms-*, me-*, mt-*, mr-*, mb-*, ml-*)\n[\n [\"mx\", \"margin-inline\"],\n [\"my\", \"margin-block\"],\n [\"ms\", \"margin-inline-start\"],\n [\"me\", \"margin-inline-end\"],\n [\"mbs\", \"margin-block-start\"],\n [\"mbe\", \"margin-block-end\"],\n [\"mt\", \"margin-top\"],\n [\"mr\", \"margin-right\"],\n [\"mb\", \"margin-bottom\"],\n [\"ml\", \"margin-left\"],\n [\"m\", \"margin\"],\n].forEach(([name, prop]) => {\n staticUtility(`${name}-auto`, [[prop, \"auto\"]], { category: 'spacing' });\n staticUtility(`${name}-px`, [[prop, \"1px\"]], { category: 'spacing' });\n staticUtility(`-${name}-px`, [[prop, \"-1px\"]], { category: 'spacing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n description: `${name} margin utility (number, negative, arbitrary, custom property, auto, px supported)`,\n category: \"spacing\",\n });\n});\n\n// --- Spacing: space-x, space-y, space-x-reverse, space-y-reverse ---\n// Tailwind 4 form: margin on the end of every non-last child\n// (`:where(& > :not(:last-child))`), not the v3 `> :not([hidden]) ~ :not([hidden])`.\nconst SPACE_SELECTOR = \":where(& > :not(:last-child))\";\n\n([\"x\", \"y\"] as const).forEach((axis) => {\n const name = `space-${axis}`;\n const rev = `--baro-space-${axis}-reverse`;\n const [start, end] =\n axis === \"x\"\n ? [\"margin-inline-start\", \"margin-inline-end\"]\n : [\"margin-block-start\", \"margin-block-end\"];\n const reverseProperty = () => atRoot([property(rev, \"0\")]);\n const spaceRule = (v: string) =>\n rule(SPACE_SELECTOR, [\n decl(rev, \"0\"),\n decl(start, `calc(${v} * var(${rev}))`),\n decl(end, `calc(${v} * calc(1 - var(${rev})))`),\n ]);\n const body = (v: string) => [reverseProperty(), spaceRule(v)];\n\n staticUtility(`${name}-px`, [reverseProperty, () => spaceRule(\"1px\")], { category: \"spacing\" });\n staticUtility(`-${name}-px`, [reverseProperty, () => spaceRule(\"-1px\")], { category: \"spacing\" });\n staticUtility(`${name}-reverse`, [\n reverseProperty,\n () => rule(SPACE_SELECTOR, [decl(rev, \"1\")]),\n ], { category: \"spacing\" });\n\n functionalUtility({\n spacingKeys: true,\n name,\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n handle: (value, _ctx, token) => {\n let v = String(value);\n if (/^-?\\d+(\\.\\d+)?$/.test(v)) {\n v = `calc(var(--spacing) * ${token.negative ? \"-\" : \"\"}${v})`;\n }\n return body(v);\n },\n handleCustomProperty: (value) => body(`var(${value})`),\n description: `${name} utility (number, negative, px, arbitrary, custom property, reverse supported)`,\n category: \"spacing\",\n });\n});\n","import { staticUtility, functionalUtility, themeKeyVar } from \"../core/registry\";\nimport { decl } from \"../core/ast\";\nimport {\n parseFractionOrNumber,\n parseNumber,\n} from \"../core/utils\";\n\n// Import layout utilities\nimport \"./layout\";\nimport \"./flexbox-grid\";\nimport \"./spacing\";\n\n\n// --- Sizing: width (w-*) and size (size-*) ---\n// width documentation\n\n// w-* static values\n[\n ['w-auto', 'auto'],\n ['w-px', '1px'],\n ['w-full', '100%'],\n ['w-screen', '100vw'],\n ['w-dvw', '100dvw'],\n ['w-dvh', '100dvh'],\n ['w-lvw', '100lvw'],\n ['w-lvh', '100lvh'],\n ['w-svw', '100svw'],\n ['w-svh', '100svh'],\n ['w-min', 'min-content'],\n ['w-max', 'max-content'],\n ['w-fit', 'fit-content'],\n ['w-3xs', 'var(--container-3xs)'],\n ['w-2xs', 'var(--container-2xs)'],\n ['w-xs', 'var(--container-xs)'],\n ['w-sm', 'var(--container-sm)'],\n ['w-md', 'var(--container-md)'],\n ['w-lg', 'var(--container-lg)'],\n ['w-xl', 'var(--container-xl)'],\n ['w-2xl', 'var(--container-2xl)'],\n ['w-3xl', 'var(--container-3xl)'],\n ['w-4xl', 'var(--container-4xl)'],\n ['w-5xl', 'var(--container-5xl)'],\n ['w-6xl', 'var(--container-6xl)'],\n ['w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['width', value]]);\n});\n\n// w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'w',\n prop: 'width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n \n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'width utility (spacing, fraction, arbitrary, custom property, container scale, static supported)',\n category: 'sizing',\n});\n\n// size-* static values\n[\n ['size-auto', ['auto', 'auto']],\n ['size-px', ['1px', '1px']],\n ['size-full', ['100%', '100%']],\n ['size-dvw', ['100dvw', '100dvw']],\n ['size-dvh', ['100dvh', '100dvh']],\n ['size-lvw', ['100lvw', '100lvw']],\n ['size-lvh', ['100lvh', '100lvh']],\n ['size-svw', ['100svw', '100svw']],\n ['size-svh', ['100svh', '100svh']],\n ['size-min', ['min-content', 'min-content']],\n ['size-max', ['max-content', 'max-content']],\n ['size-fit', ['fit-content', 'fit-content']],\n].forEach(([name, [w, h]]) => {\n staticUtility(name as string, [['width', w], ['height', h]]);\n});\n\n// size-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'size',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n handle: (value) => {\n // arbitrary, custom property, etc.\n return [\n decl('width', value),\n decl('height', value),\n ];\n },\n handleCustomProperty: (value) => [\n decl('width', `var(${value})`),\n decl('height', `var(${value})`),\n ],\n description: 'size utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: height (h-*) ---\n// height documentation\n\n// h-* static values\n[\n ['h-auto', 'auto'],\n ['h-px', '1px'],\n ['h-full', '100%'],\n ['h-screen', '100vh'],\n ['h-dvh', '100dvh'],\n ['h-lvh', '100lvh'],\n ['h-svh', '100svh'],\n ['h-min', 'min-content'],\n ['h-max', 'max-content'],\n ['h-fit', 'fit-content'],\n].forEach(([name, value]) => {\n staticUtility(name, [['height', value]]);\n});\n\n// h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'h',\n prop: 'height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: min-height (min-h-*) ---\n// min-height documentation\n\n// min-h-* static values\n[\n ['min-h-0', '0px'],\n ['min-h-px', '1px'],\n ['min-h-full', '100%'],\n ['min-h-screen', '100vh'],\n ['min-h-dvh', '100dvh'],\n ['min-h-lvh', '100lvh'],\n ['min-h-svh', '100svh'],\n ['min-h-min', 'min-content'],\n ['min-h-max', 'max-content'],\n ['min-h-fit', 'fit-content'],\n].forEach(([name, value]) => {\n staticUtility(name, [['min-height', value]], { category: 'sizing' });\n});\n\n// min-h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'min-h',\n prop: 'min-height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'min-height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: max-height (max-h-*) ---\n// max-height documentation\n\n// max-h-* static values\n[\n ['max-h-px', '1px'],\n ['max-h-full', '100%'],\n ['max-h-screen', '100vh'],\n ['max-h-dvh', '100dvh'],\n ['max-h-lvh', '100lvh'],\n ['max-h-svh', '100svh'],\n ['max-h-min', 'min-content'],\n ['max-h-max', 'max-content'],\n ['max-h-fit', 'fit-content'],\n ['max-h-none', 'none'],\n].forEach(([name, value]) => {\n staticUtility(name, [['max-height', value]], { category: 'sizing' });\n});\n\n// max-h-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'max-h',\n prop: 'max-height',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'max-height utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: min-width (min-w-*) ---\n// min-width documentation\n\n// min-w-* static values\n[\n ['min-w-auto', 'auto'],\n ['min-w-px', '1px'],\n ['min-w-full', '100%'],\n ['min-w-screen', '100vw'],\n ['min-w-dvw', '100dvw'],\n ['min-w-dvh', '100dvh'],\n ['min-w-lvw', '100lvw'],\n ['min-w-lvh', '100lvh'],\n ['min-w-svw', '100svw'],\n ['min-w-svh', '100svh'],\n ['min-w-min', 'min-content'],\n ['min-w-max', 'max-content'],\n ['min-w-fit', 'fit-content'],\n ['min-w-3xs', 'var(--container-3xs)'],\n ['min-w-2xs', 'var(--container-2xs)'],\n ['min-w-xs', 'var(--container-xs)'],\n ['min-w-sm', 'var(--container-sm)'],\n ['min-w-md', 'var(--container-md)'],\n ['min-w-lg', 'var(--container-lg)'],\n ['min-w-xl', 'var(--container-xl)'],\n ['min-w-2xl', 'var(--container-2xl)'],\n ['min-w-3xl', 'var(--container-3xl)'],\n ['min-w-4xl', 'var(--container-4xl)'],\n ['min-w-5xl', 'var(--container-5xl)'],\n ['min-w-6xl', 'var(--container-6xl)'],\n ['min-w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['min-width', value]], { category: 'sizing' });\n});\n\n// min-w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'min-w',\n prop: 'min-width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return null;\n },\n description: 'min-width utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n\n// --- Sizing: max-width (max-w-*) ---\n// max-width documentation\n\n// max-w-* static values\n[\n ['max-w-none', 'none'],\n ['max-w-min', 'min-content'],\n ['max-w-max', 'max-content'],\n ['max-w-fit', 'fit-content'],\n ['max-w-xs', 'var(--container-xs)'],\n ['max-w-sm', 'var(--container-sm)'],\n ['max-w-md', 'var(--container-md)'],\n ['max-w-lg', 'var(--container-lg)'],\n ['max-w-xl', 'var(--container-xl)'],\n ['max-w-2xl', 'var(--container-2xl)'],\n ['max-w-3xl', 'var(--container-3xl)'],\n ['max-w-4xl', 'var(--container-4xl)'],\n ['max-w-5xl', 'var(--container-5xl)'],\n ['max-w-6xl', 'var(--container-6xl)'],\n ['max-w-7xl', 'var(--container-7xl)'],\n].forEach(([name, value]) => {\n staticUtility(name, [['max-width', value]], { category: 'sizing' });\n});\n\n// max-w-* functional: spacing scale, fraction, arbitrary, custom property\nfunctionalUtility({\n spacingKeys: true,\n name: 'max-w',\n prop: 'max-width',\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value, ctx }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n return themeKeyVar(ctx, 'container', value, 'container'); // #300: max-w-<any theme.container key>\n },\n description: 'max-width utility (spacing, fraction, arbitrary, custom property, static supported)',\n category: 'sizing',\n});\n\n// --- Sizing: logical inline-size / block-size (Tailwind 4.3) ---\n// inline-* / block-* and their min-/max- forms mirror the width / height scales. Bare `inline` / `block` (and\n// inline-block/flex/grid/table) stay display utilities: static names win over the functional sizing lookup,\n// matching Tailwind 4.3.3.\n{\n const containers = ['3xs', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl'].map(\n (k) => [k, `var(--container-${k})`],\n );\n const common = [['0', '0px'], ['px', '1px'], ['full', '100%'], ['min', 'min-content'], ['max', 'max-content'], ['fit', 'fit-content']];\n const inlineVp = [['screen', '100vw'], ['dvw', '100dvw'], ['lvw', '100lvw'], ['svw', '100svw']];\n const blockVp = [['screen', '100vh'], ['dvh', '100dvh'], ['lvh', '100lvh'], ['svh', '100svh'], ['lh', '1lh']];\n const families: [string, string, string[][]][] = [\n ['inline', 'inline-size', [...common, ['auto', 'auto'], ...inlineVp, ...containers]],\n ['min-inline', 'min-inline-size', [...common, ['auto', 'auto'], ...inlineVp, ...containers]],\n ['max-inline', 'max-inline-size', [...common, ['none', 'none'], ...inlineVp, ...containers]],\n ['block', 'block-size', [...common, ['auto', 'auto'], ...blockVp]],\n ['min-block', 'min-block-size', [...common, ['auto', 'auto'], ...blockVp]],\n ['max-block', 'max-block-size', [...common, ['none', 'none'], ...blockVp]],\n ];\n for (const [name, prop, statics] of families) {\n for (const [key, value] of statics) staticUtility(`${name}-${key}`, [[prop, value]], { category: 'sizing' });\n functionalUtility({\n spacingKeys: true,\n name,\n prop,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsFraction: true,\n handleBareValue: ({ value, token, ctx }) => {\n if (token.negative) return null; // Tailwind 4.3.3 has no negative inline/block sizes\n if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;\n if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;\n // #300: the inline families also take any theme.container key, like their built-in container names.\n return name.includes('inline') ? themeKeyVar(ctx, 'container', value, 'container') : null;\n },\n description: `${prop} utility (spacing, fraction, arbitrary, custom property, keywords)`,\n category: 'sizing',\n });\n }\n}","import { staticUtility, functionalUtility, registerUtility, themeKeyVar, themeKeyValue } from \"../core/registry\";\nimport { fontSizeLineHeight } from \"../core/cssVars\";\nimport { atRoot, decl, property, rule } from \"../core/ast\";\n\n// Tailwind v4: leading-* sets --tw-leading (registered, non-inheriting) and text-<size> reads\n// var(--tw-leading, <size line-height>), so leading-* beats any text-* regardless of rule order (#254).\nconst leadingProperty = () => atRoot([property(\"--baro-leading\")]);\nimport { themeColorDecls,\n parseColor,\n parseNumber,\n} from \"../core/utils\";\n\n// --- Typography: Font Family ---\nstaticUtility(\"font-sans\", [[\"font-family\", \"var(--font-sans)\"]], { category: 'typography' });\nstaticUtility(\"font-serif\", [[\"font-family\", \"var(--font-serif)\"]], { category: 'typography' });\nstaticUtility(\"font-mono\", [[\"font-family\", \"var(--font-mono)\"]], { category: 'typography' });\n\n// --- Typography: Font Size ---\nstaticUtility(\"text-xs\", [[\"font-size\", \"var(--text-xs)\"], [\"line-height\", \"var(--baro-leading, var(--text-xs--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-sm\", [[\"font-size\", \"var(--text-sm)\"], [\"line-height\", \"var(--baro-leading, var(--text-sm--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-base\", [[\"font-size\", \"var(--text-base)\"], [\"line-height\", \"var(--baro-leading, var(--text-base--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-lg\", [[\"font-size\", \"var(--text-lg)\"], [\"line-height\", \"var(--baro-leading, var(--text-lg--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-xl\", [[\"font-size\", \"var(--text-xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-2xl\", [[\"font-size\", \"var(--text-2xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-2xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-3xl\", [[\"font-size\", \"var(--text-3xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-3xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-4xl\", [[\"font-size\", \"var(--text-4xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-4xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-5xl\", [[\"font-size\", \"var(--text-5xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-5xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-6xl\", [[\"font-size\", \"var(--text-6xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-6xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-7xl\", [[\"font-size\", \"var(--text-7xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-7xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-8xl\", [[\"font-size\", \"var(--text-8xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-8xl--line-height))\"]], { category: 'typography' });\nstaticUtility(\"text-9xl\", [[\"font-size\", \"var(--text-9xl)\"], [\"line-height\", \"var(--baro-leading, var(--text-9xl--line-height))\"]], { category: 'typography' });\n\n\n// --- Typography: Font Weight ---\n// #300: Tailwind 4.3.3 resolves --font-<key> before --font-weight-<key>, so a theme.fontFamily key named like a\n// weight (`fontFamily.bold`) turns `font-bold` into that family, as `@theme { --font-bold: ... }` does.\nfunction fontWeightUtility(name: string) {\n registerUtility({\n name: `font-${name}`,\n match: (className: string) => className === `font-${name}`,\n handler: (_value, ctx) => {\n const family = themeKeyVar(ctx, \"fontFamily\", name, \"font\");\n return family ? [decl(\"font-family\", family)] : [decl(\"font-weight\", `var(--font-weight-${name})`)];\n },\n category: \"typography\",\n });\n}\nfontWeightUtility(\"thin\");\nfontWeightUtility(\"extralight\");\nfontWeightUtility(\"light\");\nfontWeightUtility(\"normal\");\nfontWeightUtility(\"medium\");\nfontWeightUtility(\"semibold\");\nfontWeightUtility(\"bold\");\nfontWeightUtility(\"extrabold\");\nfontWeightUtility(\"black\");\n\nfunctionalUtility({\n name: \"font\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: font-<any theme.fontFamily key> → var(--font-<key>), else font-<any theme.fontWeight key> →\n // var(--font-weight-<key>) (family first, as Tailwind resolves --font before --font-weight).\n handleBareValue: ({ value, ctx }) =>\n themeKeyVar(ctx, \"fontFamily\", value, \"font\") ?? themeKeyVar(ctx, \"fontWeight\", value, \"font-weight\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, _ctx, token) => {\n // font-features-*/font-stretch-* belong to their own registrations (#309).\n if (token.prefix !== \"font\") return null;\n if (!token.arbitrary && value.startsWith(\"var(--font-weight-\")) return [decl(\"font-weight\", value)];\n if (parseNumber(value)) {\n return [decl(\"font-weight\", value)];\n }\n return [decl(\"font-family\", value)];\n },\n handleCustomProperty: (value, _ctx, token) => {\n if (token.prefix !== \"font\") return null;\n if (value.startsWith(\"font-name:\")) {\n return [decl(\"font-family\", `var(${value.replace(\"font-name:\", \"\")})`)];\n }\n return [decl(\"font-weight\", `var(${value})`)];\n },\n description: \"font-weight utility (theme, number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Font Style ---\nstaticUtility(\"italic\", [[\"font-style\", \"italic\"]], { category: 'typography' });\nstaticUtility(\"not-italic\", [[\"font-style\", \"normal\"]], { category: 'typography' });\n\n// --- Typography: Letter Spacing ---\nstaticUtility(\"tracking-tighter\", [[\"letter-spacing\", \"var(--letter-spacing-tighter)\"]], { category: 'typography' });\nstaticUtility(\"tracking-tight\", [[\"letter-spacing\", \"var(--letter-spacing-tight)\"]], { category: 'typography' });\nstaticUtility(\"tracking-normal\", [[\"letter-spacing\", \"var(--letter-spacing-normal)\"]], { category: 'typography' });\nstaticUtility(\"tracking-wide\", [[\"letter-spacing\", \"var(--letter-spacing-wide)\"]], { category: 'typography' });\nstaticUtility(\"tracking-wider\", [[\"letter-spacing\", \"var(--letter-spacing-wider)\"]], { category: 'typography' });\nstaticUtility(\"tracking-widest\", [[\"letter-spacing\", \"var(--letter-spacing-widest)\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"tracking\",\n prop: \"letter-spacing\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: tracking-<any theme.letterSpacing key> → var(--letter-spacing-<key>), the form of the built-in names.\n handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, \"letterSpacing\", value, \"letter-spacing\") ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n description: \"letter-spacing utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Line Height ---\nstaticUtility(\"leading-none\", [[\"--baro-leading\", \"var(--leading-none, 1)\"], [\"line-height\", \"var(--leading-none, 1)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-tight\", [[\"--baro-leading\", \"var(--leading-tight, 1.25)\"], [\"line-height\", \"var(--leading-tight, 1.25)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-snug\", [[\"--baro-leading\", \"var(--leading-snug, 1.375)\"], [\"line-height\", \"var(--leading-snug, 1.375)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-normal\", [[\"--baro-leading\", \"var(--leading-normal, 1.5)\"], [\"line-height\", \"var(--leading-normal, 1.5)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-relaxed\", [[\"--baro-leading\", \"var(--leading-relaxed, 1.625)\"], [\"line-height\", \"var(--leading-relaxed, 1.625)\"], leadingProperty()], { category: 'typography' });\nstaticUtility(\"leading-loose\", [[\"--baro-leading\", \"var(--leading-loose, 2)\"], [\"line-height\", \"var(--leading-loose, 2)\"], leadingProperty()], { category: 'typography' });\n\nfunctionalUtility({\n name: \"leading\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n // #300: leading-<any theme.lineHeight key> → var(--leading-<key>, <value>) plus --baro-leading, like the built-in\n // names (no `prop`, so the theme path goes through handle and keeps --baro-leading).\n handleBareValue: ({ value, ctx }) => {\n const v = themeKeyValue(ctx, \"lineHeight\", value);\n if (v != null) return `var(--leading-${value}, ${v})`;\n const numbered = ctx.theme(\"lineHeight\", value); // numeric theme keys (leading-7 → 1.75rem) stay literal\n return typeof numbered === \"string\" ? numbered : parseNumber(value);\n },\n handle: (value) => [decl(\"--baro-leading\", value), decl(\"line-height\", value), leadingProperty()],\n handleCustomProperty: (value) => [decl(\"--baro-leading\", `var(${value})`), decl(\"line-height\", `var(${value})`), leadingProperty()],\n description: \"line-height utility (theme, number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Align ---\nstaticUtility(\"text-left\", [[\"text-align\", \"left\"]], { category: 'typography' });\nstaticUtility(\"text-center\", [[\"text-align\", \"center\"]], { category: 'typography' });\nstaticUtility(\"text-right\", [[\"text-align\", \"right\"]], { category: 'typography' });\nstaticUtility(\"text-justify\", [[\"text-align\", \"justify\"]], { category: 'typography' });\nstaticUtility(\"text-start\", [[\"text-align\", \"start\"]], { category: 'typography' });\nstaticUtility(\"text-end\", [[\"text-align\", \"end\"]], { category: 'typography' });\n\nconst FONT_SIZE_HINTS = new Set([\"length\", \"size\", \"percentage\", \"absolute-size\", \"relative-size\"]);\nconst FONT_SIZE_KEYWORDS = /^(xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large|larger|smaller)$/;\nconst LENGTH_RE = /^-?(\\d+\\.?\\d*|\\.\\d+)(px|r?em|r?lh|r?cap|r?ch|r?ex|r?ic|%|vh|vw|vmin|vmax|[sdl]v[hwib]|v[ib]|cq[whib]|cqmin|cqmax|pt|pc|in|cm|mm|q)$/i;\n/** Tailwind's `text-[…]` inference: an explicit type hint wins; else lengths / size keywords / math → font-size, else colour. */\nfunction textArbitraryKind(raw: string): { fontSize: boolean; value: string } {\n const hint = /^([a-z-]+):(.+)$/.exec(raw);\n if (hint && (hint[1] === \"color\" || FONT_SIZE_HINTS.has(hint[1]))) {\n return { fontSize: hint[1] !== \"color\", value: hint[2] };\n }\n const fontSize = raw === \"0\" || LENGTH_RE.test(raw) || FONT_SIZE_KEYWORDS.test(raw) || /^(calc|min|max|clamp)\\(/.test(raw);\n return { fontSize, value: raw };\n}\n\n// --- Typography: Text Color ---\nstaticUtility(\"text-inherit\", [[\"color\", \"inherit\"]], { category: 'typography' });\nstaticUtility(\"text-current\", [[\"color\", \"currentColor\"]], { category: 'typography' });\nstaticUtility(\"text-transparent\", [[\"color\", \"transparent\"]], { category: 'typography' });\n\n// --- Typography: Text Overflow ---\nstaticUtility(\"truncate\", [[\"overflow\", \"hidden\"], [\"text-overflow\", \"ellipsis\"], [\"white-space\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"text-ellipsis\", [[\"text-overflow\", \"ellipsis\"]], { category: 'typography' });\nstaticUtility(\"text-clip\", [[\"text-overflow\", \"clip\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"text\", \n themeKey: \"colors\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n // #300: text-<any theme.fontSize key> (text-hero) → var(--text-hero), when no colour matched.\n handleBareValue: ({ value, ctx, extra }) => (extra?.opacity ? null : themeKeyVar(ctx, \"fontSize\", value, \"text\")) ?? (/^(\\d|\\.\\d)/.test(value) ? value : null),\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) return themeColorDecls(\"color\", value, extra);\n const sizeKey = !token.arbitrary && !token.customProperty ? /^var\\(--text-([\\w-]+)\\)$/.exec(value)?.[1] : undefined;\n if (sizeKey) {\n const lineHeight = fontSizeLineHeight(ctx.theme(\"fontSize\", sizeKey));\n return lineHeight\n ? [decl(\"font-size\", value), decl(\"line-height\", `var(--baro-leading, var(--text-${sizeKey}--line-height))`)]\n : [decl(\"font-size\", value)];\n }\n\n const kind = textArbitraryKind(value);\n return [decl(kind.fontSize ? \"font-size\" : \"color\", kind.value)];\n },\n // Tailwind 4: text-(--x) is a colour; text-(length:--x) is a font-size.\n handleCustomProperty: (value) => {\n const kind = textArbitraryKind(value);\n return [decl(kind.fontSize ? \"font-size\" : \"color\", `var(${kind.value})`)];\n },\n description: \"text color utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n\nfunctionalUtility({\n name: \"text\",\n themeKey: \"fontSize\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token) => {\n // Check if it's a theme value first\n const themeValue = ctx.theme(\"fontSize\", value) as string | [string, string];\n if (themeValue) {\n if (Array.isArray(themeValue)) {\n // [fontSize, lineHeight] format\n return [\n decl(\"font-size\", themeValue[0]),\n decl(\"line-height\", `var(--baro-leading, ${themeValue[1]})`)\n ];\n } else {\n return [decl(\"font-size\", themeValue as string)];\n }\n }\n\n // Handle arbitrary values\n if (token.arbitrary) {\n return [decl(\"font-size\", value)];\n }\n\n return null;\n },\n handleCustomProperty: (value) => [decl(\"font-size\", `var(${value})`)],\n description: \"font-size utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Transform ---\nstaticUtility(\"uppercase\", [[\"text-transform\", \"uppercase\"]], { category: 'typography' });\nstaticUtility(\"lowercase\", [[\"text-transform\", \"lowercase\"]], { category: 'typography' });\nstaticUtility(\"capitalize\", [[\"text-transform\", \"capitalize\"]], { category: 'typography' });\nstaticUtility(\"normal-case\", [[\"text-transform\", \"none\"]], { category: 'typography' });\n\n// --- Typography: Text Decoration ---\nstaticUtility(\"underline\", [[\"text-decoration-line\", \"underline\"]], { category: 'typography' });\nstaticUtility(\"overline\", [[\"text-decoration-line\", \"overline\"]], { category: 'typography' });\nstaticUtility(\"line-through\", [[\"text-decoration-line\", \"line-through\"]], { category: 'typography' });\nstaticUtility(\"no-underline\", [[\"text-decoration-line\", \"none\"]], { category: 'typography' });\n\n\n\n// --- Typography: Whitespace ---\nstaticUtility(\"whitespace-normal\", [[\"white-space\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"whitespace-nowrap\", [[\"white-space\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre\", [[\"white-space\", \"pre\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre-line\", [[\"white-space\", \"pre-line\"]], { category: 'typography' });\nstaticUtility(\"whitespace-pre-wrap\", [[\"white-space\", \"pre-wrap\"]], { category: 'typography' });\nstaticUtility(\"whitespace-break-spaces\", [[\"white-space\", \"break-spaces\"]], { category: 'typography' });\n\n// --- Typography: Word Break ---\nstaticUtility(\"break-normal\", [[\"overflow-wrap\", \"normal\"], [\"word-break\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"break-words\", [[\"overflow-wrap\", \"break-word\"]], { category: 'typography' });\nstaticUtility(\"break-all\", [[\"word-break\", \"break-all\"]], { category: 'typography' });\nstaticUtility(\"break-keep\", [[\"word-break\", \"keep-all\"]], { category: 'typography' });\n\n// --- Typography: Font Smoothing ---\nstaticUtility(\"antialiased\", [[\"-webkit-font-smoothing\", \"antialiased\"], [\"-moz-osx-font-smoothing\", \"grayscale\"]], { category: 'typography' });\nstaticUtility(\"subpixel-antialiased\", [[\"-webkit-font-smoothing\", \"auto\"], [\"-moz-osx-font-smoothing\", \"auto\"]], { category: 'typography' });\n\n// --- Typography: Font Stretch ---\nstaticUtility(\"font-stretch-normal\", [[\"font-stretch\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-ultra-condensed\", [[\"font-stretch\", \"ultra-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-extra-condensed\", [[\"font-stretch\", \"extra-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-condensed\", [[\"font-stretch\", \"condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-semi-condensed\", [[\"font-stretch\", \"semi-condensed\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-semi-expanded\", [[\"font-stretch\", \"semi-expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-expanded\", [[\"font-stretch\", \"expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-extra-expanded\", [[\"font-stretch\", \"extra-expanded\"]], { category: 'typography' });\nstaticUtility(\"font-stretch-ultra-expanded\", [[\"font-stretch\", \"ultra-expanded\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"font-stretch\",\n prop: \"font-stretch\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"font-stretch utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Font Variant Numeric ---\nstaticUtility(\"normal-nums\", [[\"font-variant-numeric\", \"normal\"]], { category: 'typography' });\nstaticUtility(\"ordinal\", [[\"font-variant-numeric\", \"ordinal\"]], { category: 'typography' });\nstaticUtility(\"slashed-zero\", [[\"font-variant-numeric\", \"slashed-zero\"]], { category: 'typography' });\nstaticUtility(\"lining-nums\", [[\"font-variant-numeric\", \"lining-nums\"]], { category: 'typography' });\nstaticUtility(\"oldstyle-nums\", [[\"font-variant-numeric\", \"oldstyle-nums\"]], { category: 'typography' });\nstaticUtility(\"proportional-nums\", [[\"font-variant-numeric\", \"proportional-nums\"]], { category: 'typography' });\nstaticUtility(\"tabular-nums\", [[\"font-variant-numeric\", \"tabular-nums\"]], { category: 'typography' });\nstaticUtility(\"diagonal-fractions\", [[\"font-variant-numeric\", \"diagonal-fractions\"]], { category: 'typography' });\nstaticUtility(\"stacked-fractions\", [[\"font-variant-numeric\", \"stacked-fractions\"]], { category: 'typography' });\n\n// --- Typography: Line Clamp ---\nstaticUtility(\"line-clamp-none\", [[\"-webkit-line-clamp\", \"none\"]], { category: 'typography' });\nfunctionalUtility({\n name: \"line-clamp\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => parseNumber(value),\n handle: (value) => [\n decl(\"overflow\", \"hidden\"),\n decl(\"display\", \"-webkit-box\"),\n decl(\"-webkit-box-orient\", \"vertical\"),\n decl(\"-webkit-line-clamp\", value)\n ],\n handleCustomProperty: (value) => [\n decl(\"overflow\", \"hidden\"),\n decl(\"display\", \"-webkit-box\"),\n decl(\"-webkit-box-orient\", \"vertical\"),\n decl(\"-webkit-line-clamp\", `var(${value})`)\n ],\n description: \"line-clamp utility (number, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: List Style Type ---\nstaticUtility(\"list-none\", [[\"list-style-type\", \"none\"]], { category: 'typography' });\nstaticUtility(\"list-disc\", [[\"list-style-type\", \"disc\"]], { category: 'typography' });\nstaticUtility(\"list-decimal\", [[\"list-style-type\", \"decimal\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"list\",\n prop: \"list-style-type\",\n themeKey: \"listStyleType\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"list-style-type utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: List Style Position ---\nstaticUtility(\"list-inside\", [[\"list-style-position\", \"inside\"]], { category: 'typography' });\nstaticUtility(\"list-outside\", [[\"list-style-position\", \"outside\"]], { category: 'typography' });\n\n// --- Typography: List Style Image ---\nstaticUtility(\"list-image-none\", [[\"list-style-image\", \"none\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"list-image\",\n prop: \"list-style-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"list-style-image\", `url(${value})`)],\n handleCustomProperty: (value) => [decl(\"list-style-image\", `var(${value})`)],\n description: \"list-style-image utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Decoration Color ---\nfunctionalUtility({\n name: \"decoration\",\n themeKeys: [\"textDecorationThickness\", \"colors\"], // #338: a key in both is the thickness, as in Tailwind\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.themeNamespace === \"textDecorationThickness\") return [decl(\"text-decoration-thickness\", value)];\n if (extra?.realThemeValue) return themeColorDecls(\"text-decoration-color\", value, extra);\n return [decl(\"text-decoration-color\", value)];\n },\n handleCustomProperty: (value) => [decl(\"text-decoration-color\", `var(${value})`)],\n description: \"text-decoration-color utility (theme, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Decoration Style ---\n staticUtility(\"decoration-solid\", [[\"text-decoration-style\", \"solid\"]], { category: 'typography' });\nstaticUtility(\"decoration-double\", [[\"text-decoration-style\", \"double\"]], { category: 'typography' });\nstaticUtility(\"decoration-dotted\", [[\"text-decoration-style\", \"dotted\"]], { category: 'typography' });\nstaticUtility(\"decoration-dashed\", [[\"text-decoration-style\", \"dashed\"]], { category: 'typography' });\nstaticUtility(\"decoration-wavy\", [[\"text-decoration-style\", \"wavy\"]], { category: 'typography' });\n\n// --- Typography: Text Decoration Thickness ---\nstaticUtility(\"decoration-auto\", [[\"text-decoration-thickness\", \"auto\"]], { category: 'typography' });\nstaticUtility(\"decoration-from-font\", [[\"text-decoration-thickness\", \"from-font\"]], { category: 'typography' });\nstaticUtility(\"decoration-0\", [[\"text-decoration-thickness\", \"0px\"]], { category: 'typography' });\nstaticUtility(\"decoration-1\", [[\"text-decoration-thickness\", \"1px\"]], { category: 'typography' });\nstaticUtility(\"decoration-2\", [[\"text-decoration-thickness\", \"2px\"]], { category: 'typography' });\nstaticUtility(\"decoration-4\", [[\"text-decoration-thickness\", \"4px\"]], { category: 'typography' });\nstaticUtility(\"decoration-8\", [[\"text-decoration-thickness\", \"8px\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"decoration\",\n prop: \"text-decoration-thickness\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `${value}px` : null),\n description: \"text-decoration-thickness utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Underline Offset ---\nstaticUtility(\"underline-offset-auto\", [[\"text-underline-offset\", \"auto\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-0\", [[\"text-underline-offset\", \"0px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-1\", [[\"text-underline-offset\", \"1px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-2\", [[\"text-underline-offset\", \"2px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-4\", [[\"text-underline-offset\", \"4px\"]], { category: 'typography' });\nstaticUtility(\"underline-offset-8\", [[\"text-underline-offset\", \"8px\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"underline-offset\",\n prop: \"text-underline-offset\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `${value}px` : null),\n description: \"text-underline-offset utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Text Wrap ---\nstaticUtility(\"text-wrap\", [[\"text-wrap\", \"wrap\"]], { category: 'typography' });\nstaticUtility(\"text-nowrap\", [[\"text-wrap\", \"nowrap\"]], { category: 'typography' });\nstaticUtility(\"text-balance\", [[\"text-wrap\", \"balance\"]], { category: 'typography' });\nstaticUtility(\"text-pretty\", [[\"text-wrap\", \"pretty\"]], { category: 'typography' });\n\n// --- Typography: Text Indent ---\nfunctionalUtility({\n name: \"indent\",\n prop: \"text-indent\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * ${value})` : null),\n handleNegativeBareValue: ({ value }) => (parseNumber(value) ? `calc(var(--spacing) * -${value})` : null),\n description: \"text-indent utility (spacing, negative, arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Vertical Align ---\nstaticUtility(\"align-baseline\", [[\"vertical-align\", \"baseline\"]], { category: 'typography' });\nstaticUtility(\"align-top\", [[\"vertical-align\", \"top\"]], { category: 'typography' });\nstaticUtility(\"align-middle\", [[\"vertical-align\", \"middle\"]], { category: 'typography' });\nstaticUtility(\"align-bottom\", [[\"vertical-align\", \"bottom\"]], { category: 'typography' });\nstaticUtility(\"align-text-top\", [[\"vertical-align\", \"text-top\"]], { category: 'typography' });\nstaticUtility(\"align-text-bottom\", [[\"vertical-align\", \"text-bottom\"]], { category: 'typography' });\nstaticUtility(\"align-sub\", [[\"vertical-align\", \"sub\"]], { category: 'typography' });\nstaticUtility(\"align-super\", [[\"vertical-align\", \"super\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"align\",\n prop: \"vertical-align\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"vertical-align utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Typography: Hyphens ---\nstaticUtility(\"hyphens-none\", [[\"hyphens\", \"none\"]], { category: 'typography' });\nstaticUtility(\"hyphens-manual\", [[\"hyphens\", \"manual\"]], { category: 'typography' });\nstaticUtility(\"hyphens-auto\", [[\"hyphens\", \"auto\"]], { category: 'typography' });\n\n// --- Typography: Content ---\nstaticUtility(\"content-none\", [[\"--baro-content\", \"none\"], [\"content\", \"none\"]], { category: 'typography' });\n\nfunctionalUtility({\n name: \"content\",\n prop: \"content\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"--baro-content\", value), decl(\"content\", \"var(--baro-content)\")],\n handleCustomProperty: (value) => [decl(\"--baro-content\", `var(${value})`), decl(\"content\", \"var(--baro-content)\")],\n description: \"content utility (arbitrary, custom property supported)\",\n category: \"typography\",\n});\n\n// --- Placeholder Color --- (Tailwind 4: `.placeholder-red-500::placeholder { color: … }`)\nconst placeholderColor = (value: string) => [rule(\"&::placeholder\", [decl(\"color\", value)])];\nstaticUtility(\"placeholder-inherit\", placeholderColor(\"inherit\"), { category: 'typography' });\nstaticUtility(\"placeholder-current\", placeholderColor(\"currentcolor\"), { category: 'typography' });\nstaticUtility(\"placeholder-transparent\", placeholderColor(\"transparent\"), { category: 'typography' });\nfunctionalUtility({\n name: \"placeholder\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _ctx, _token, extra) => {\n if (extra?.realThemeValue) return [rule(\"&::placeholder\", themeColorDecls(\"color\", value, extra))];\n if (parseColor(value)) return placeholderColor(value);\n return null;\n },\n handleCustomProperty: (value) => placeholderColor(`var(${value})`),\n description: \"placeholder color utility (theme, alpha, arbitrary, custom property)\",\n});\n\n// --- Typography: Font Feature Settings (#309, Tailwind 4.3) ---\n// Tailwind 4.3 has no named values: font-features-[...] and font-features-(--x) only.\nfunctionalUtility({\n name: \"font-features\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _ctx, token) => (token.arbitrary ? [decl(\"font-feature-settings\", value)] : null),\n handleCustomProperty: (value) => [decl(\"font-feature-settings\", `var(${value.replace(/^[a-z-]+:(?=--)/, \"\")})`)],\n description: \"font-feature-settings utility (arbitrary, custom property)\",\n category: \"typography\",\n});\n\n// #310: tab-* (Tailwind 4.3 tab-size): tab-4, tab-[8], tab-(--t).\nfunctionalUtility({\n name: \"tab\",\n prop: \"tab-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? value : null),\n description: \"tab-size utility (integer, arbitrary, custom property)\",\n category: \"typography\",\n});\n","import { staticUtility, functionalUtility } from \"../core/registry\";\nimport { AstNode, atRoot, atRule, decl, property } from \"../core/ast\";\nimport { parseColor, parseLength, parseNumber, themeColorDecls } from \"../core/utils\";\n\nconst gradientStopProperties = () => {\n return atRoot([\n property('--baro-gradient-position'),\n property('--baro-gradient-from', '#0000', '<color>'),\n property('--baro-gradient-via', '#0000', '<color>'),\n property('--baro-gradient-to', '#0000', '<color>'),\n property('--baro-gradient-stops'),\n property('--baro-gradient-via-stops'),\n property('--baro-gradient-from-position', '0%', '<length-percentage>'),\n property('--baro-gradient-via-position', '50%', '<length-percentage>'),\n property('--baro-gradient-to-position', '100%', '<length-percentage>'),\n ], \"background\")\n}\n\n\n// --- Background Attachment ---\nstaticUtility(\"bg-fixed\", [[\"background-attachment\", \"fixed\"]], { category: 'background' });\nstaticUtility(\"bg-local\", [[\"background-attachment\", \"local\"]], { category: 'background' });\nstaticUtility(\"bg-scroll\", [[\"background-attachment\", \"scroll\"]], { category: 'background' });\n\n// --- Background Clip ---\nstaticUtility(\"bg-clip-border\", [[\"background-clip\", \"border-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-padding\", [[\"background-clip\", \"padding-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-content\", [[\"background-clip\", \"content-box\"]], { category: 'background' });\nstaticUtility(\"bg-clip-text\", [[\"background-clip\", \"text\"]], { category: 'background' });\n\n// --- Background Color ---\nstaticUtility(\"bg-inherit\", [[\"background-color\", \"inherit\"]], { category: 'background' });\nstaticUtility(\"bg-current\", [[\"background-color\", \"currentColor\"]], { category: 'background' });\nstaticUtility(\"bg-transparent\", [[\"background-color\", \"transparent\"]], { category: 'background' });\n\n// --- Background Image ---\nstaticUtility(\"bg-none\", [[\"background-image\", \"none\"]], { category: 'background' });\n\n// --- Background Origin ---\nstaticUtility(\"bg-origin-border\", [[\"background-origin\", \"border-box\"]], { category: 'background' });\nstaticUtility(\"bg-origin-padding\", [[\"background-origin\", \"padding-box\"]], { category: 'background' });\nstaticUtility(\"bg-origin-content\", [[\"background-origin\", \"content-box\"]], { category: 'background' });\n\n// --- Background Position ---\n[\n [\"bg-bottom\", \"bottom\"],\n [\"bg-center\", \"center\"],\n [\"bg-left\", \"left\"],\n [\"bg-left-bottom\", \"left bottom\"],\n [\"bg-left-top\", \"left top\"],\n [\"bg-right\", \"right\"],\n [\"bg-right-bottom\", \"right bottom\"],\n [\"bg-right-top\", \"right top\"],\n [\"bg-top\", \"top\"],\n].forEach(([name, value]) => {\n staticUtility(name, [[\"background-position\", value]], { category: 'background' });\n});\n\n/**\n * background-position utility (arbitrary, custom property supported)\n *\n * bg-position-[length] → background-position: [length]\n * bg-position-[length] → background-position: [length]\n */\nfunctionalUtility({\n name: \"bg-position\",\n prop: \"background-position\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"background-position utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Repeat ---\nstaticUtility(\"bg-repeat\", [[\"background-repeat\", \"repeat\"]], { category: 'background' });\nstaticUtility(\"bg-no-repeat\", [[\"background-repeat\", \"no-repeat\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-x\", [[\"background-repeat\", \"repeat-x\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-y\", [[\"background-repeat\", \"repeat-y\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-round\", [[\"background-repeat\", \"round\"]], { category: 'background' });\nstaticUtility(\"bg-repeat-space\", [[\"background-repeat\", \"space\"]], { category: 'background' });\n\n// --- Background Size ---\nstaticUtility(\"bg-auto\", [[\"background-size\", \"auto\"]], { category: 'background' });\nstaticUtility(\"bg-cover\", [[\"background-size\", \"cover\"]], { category: 'background' });\nstaticUtility(\"bg-contain\", [[\"background-size\", \"contain\"]], { category: 'background' });\n\nfunctionalUtility({\n name: \"bg-size\",\n prop: \"background-size\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n description: \"background-size utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Gradients: Linear ---\nconst positionValue = (position: string) => [\n decl(\"--baro-gradient-position\", position),\n atRule(\"supports\", \"(background-image: linear-gradient(in lab, red, red))\", [\n decl(\"--baro-gradient-position\", `${position} in oklab`),\n ]),\n decl(\"background-image\", \"linear-gradient(var(--baro-gradient-stops))\"),\n];\n// Tailwind 4 emits the legacy bg-gradient-to-* with the interpolation space baked in, no @supports.\nconst legacyPositionValue = (position: string) => [\n decl(\"--baro-gradient-position\", `${position} in oklab`),\n decl(\"background-image\", \"linear-gradient(var(--baro-gradient-stops))\"),\n];\n\n[\n [\"bg-linear-to-t\", positionValue(\"to top\")],\n [\"bg-linear-to-tr\", positionValue(\"to top right\")],\n [\"bg-linear-to-r\", positionValue(\"to right\")],\n [\"bg-linear-to-br\", positionValue(\"to bottom right\")],\n [\"bg-linear-to-b\", positionValue(\"to bottom\")],\n [\"bg-linear-to-bl\", positionValue(\"to bottom left\")],\n [\"bg-linear-to-l\", positionValue(\"to left\")],\n [\"bg-linear-to-tl\", positionValue(\"to top left\")],\n\n // fallback , legacy CSS compatibility\n [\"bg-gradient-to-t\", legacyPositionValue(\"to top\")],\n [\"bg-gradient-to-tr\", legacyPositionValue(\"to top right\")],\n [\"bg-gradient-to-r\", legacyPositionValue(\"to right\")],\n [\"bg-gradient-to-br\", legacyPositionValue(\"to bottom right\")],\n [\"bg-gradient-to-b\", legacyPositionValue(\"to bottom\")],\n [\"bg-gradient-to-bl\", legacyPositionValue(\"to bottom left\")],\n [\"bg-gradient-to-l\", legacyPositionValue(\"to left\")],\n [\"bg-gradient-to-tl\", legacyPositionValue(\"to top left\")],\n].forEach(([name, value]) => {\n staticUtility(name as string, value as AstNode[], { category: 'background', priority: 1000 });\n});\n// bg-linear-<angle> (e.g., bg-linear-45)\nfunctionalUtility({\n name: \"bg-linear\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, context, token) => {\n if (parseNumber(value)) {\n // bg-linear-45 → --baro-gradient-position: 45deg (in oklab when supported)\n return positionValue(`${value}deg`);\n }\n if (token.arbitrary) {\n // bg-linear-[25deg,red_5%,yellow_60%,lime_90%,teal]\n return [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, ${value}))`\n ),\n ];\n }\n if (token.customProperty) {\n // bg-linear-(--my-gradient)\n return [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, var(${value})))`\n ),\n ];\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(\n \"background-image\",\n `linear-gradient(var(--baro-gradient-stops, var(${value})))`\n ),\n ],\n description:\n \"linear-gradient background-image utility (angle, arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Background Gradients: Radial / Conic ---\n// Tailwind 4 shape: the utility sets --baro-gradient-position (the stops composite starts with it,\n// and it is registered without an initial value) and the image is just <fn>(var(--baro-gradient-stops)).\nconst gradientImage = (fn: string, position: string, fallback?: string): AstNode[] => [\n decl(\"--baro-gradient-position\", position),\n decl(\"background-image\", `${fn}(var(--baro-gradient-stops${fallback ? `,${fallback}` : \"\"}))`),\n];\nstaticUtility(\"bg-radial\", gradientImage(\"radial-gradient\", \"in oklab\"), { category: 'background' });\nfunctionalUtility({\n name: \"bg-radial\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _context, token) => {\n // bg-radial-[at_50%_75%]\n if (token.arbitrary) return gradientImage(\"radial-gradient\", value, value);\n if (token.customProperty) return gradientImage(\"radial-gradient\", `var(${value})`, `var(${value})`);\n return null;\n },\n handleCustomProperty: (value) => gradientImage(\"radial-gradient\", `var(${value})`, `var(${value})`),\n description:\n \"radial-gradient background-image utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n\nstaticUtility(\"bg-conic\", gradientImage(\"conic-gradient\", \"in oklab\"), { category: 'background' });\nfunctionalUtility({\n name: \"bg-conic\",\n prop: \"background-image\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, _context, token) => {\n // bg-conic-180 → --baro-gradient-position: from 180deg in oklab\n if (!token.arbitrary && !token.customProperty && parseNumber(value)) {\n return gradientImage(\"conic-gradient\", `from ${value}deg in oklab`);\n }\n // bg-conic-[from_45deg]\n if (token.arbitrary) return gradientImage(\"conic-gradient\", value, value);\n if (token.customProperty) return gradientImage(\"conic-gradient\", `var(${value})`, `var(${value})`);\n return null;\n },\n handleCustomProperty: (value) => gradientImage(\"conic-gradient\", `var(${value})`, `var(${value})`),\n description:\n \"conic-gradient background-image utility (angle, arbitrary, custom property supported)\",\n category: \"background\",\n});\n\n// --- Gradient Stops ---\n\n\n\n// from-*, via-*, to-* (color, percentage, custom property, arbitrary), Tailwind 4 stop composition\nconst G = \"--baro-gradient\";\nconst stopsDecls = (stop: string, color: string | AstNode[]): AstNode[] => {\n const colorDecls = typeof color === \"string\" ? [decl(`${G}-${stop}`, color)] : color;\n if (stop === \"via\") {\n return [\n gradientStopProperties(),\n ...colorDecls,\n decl(`${G}-via-stops`, `var(${G}-position), var(${G}-from) var(${G}-from-position), var(${G}-via) var(${G}-via-position), var(${G}-to) var(${G}-to-position)`),\n decl(`${G}-stops`, `var(${G}-via-stops)`),\n ];\n }\n return [\n gradientStopProperties(),\n ...colorDecls,\n decl(`${G}-stops`, `var(${G}-via-stops, var(${G}-position), var(${G}-from) var(${G}-from-position), var(${G}-to) var(${G}-to-position))`),\n ];\n};\n[\"from\", \"via\", \"to\"].forEach((stop) => {\n functionalUtility({\n name: stop,\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _context, _token, extra) => {\n if (extra?.realThemeValue) {\n return stopsDecls(stop, themeColorDecls(`${G}-${stop}`, value, extra));\n }\n // from-10% → --baro-gradient-from-position: 10%\n if (parseLength(value)) {\n return [gradientStopProperties(), decl(`${G}-${stop}-position`, value)];\n }\n if (parseNumber(value)) {\n return [gradientStopProperties(), decl(`${G}-${stop}-position`, `${value}%`)];\n }\n if (parseColor(value)) {\n return stopsDecls(stop, value);\n }\n return null;\n },\n handleCustomProperty: (value) => [\n decl(`--baro-gradient-${stop}`, `var(${value})`),\n ],\n description: `${stop} gradient stop utility (color, percent, custom property, arbitrary supported)`,\n category: \"background\",\n });\n // position variant: from-10%, via-30%, to-90%\n functionalUtility({\n name: `${stop}-position`,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(`--baro-gradient-${stop}-position`, value)],\n handleCustomProperty: (value) => [\n decl(`--baro-gradient-${stop}-position`, `var(${value})`),\n ],\n description: `${stop}-position gradient stop position utility (percent, custom property, arbitrary supported)`,\n category: \"background\",\n });\n});\n\n/**\n * background-size utility (arbitrary, custom property supported)\n * bg-[length] → background-size: [length]\n * bg-[length] → background-size: [length]\n * bg-[color] → background-color: [color]\n * bg-[url] → background-image: [url]\n * bg-[radial-gradient()] → background-image: radial-gradient(var(--baro-gradient-stops))\n * bg-red-500 → background-color: var(--color-red-500)\n */\nfunctionalUtility({\n name: \"bg\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, context, token, extra) => {\n if (value.startsWith(\"url(\")) {\n return [decl(\"background-image\", value)];\n }\n\n // if (value.startsWith(\"radial-gradient(\")) {\n // return [decl(\"background-image\", value)];\n // }\n\n if (value.startsWith(\"length:\")) {\n return [decl(\"background-size\", value.replace(\"length:\", \"\"))];\n }\n\n if (extra?.realThemeValue) return themeColorDecls(\"background-color\", value, extra);\n\n if (parseColor(value)) {\n const parsedColor = parseColor(value);\n\n if (value.startsWith(\"color:\")) {\n return [decl(\"background-color\", parsedColor || value)];\n }\n\n return [decl(\"background-color\", value)];\n }\n\n if (parseLength(value)) {\n return [decl(\"background-size\", value)];\n }\n\n return null;\n },\n handleCustomProperty: (value) =>\n value.startsWith(\"length:\")\n ? [decl(\"background-size\", `var(${value.slice(7)})`)]\n : [decl(\"background-color\", `var(${value})`)],\n description: \"background-size utility (arbitrary, custom property supported)\",\n category: \"background\",\n});\n","import { staticUtility, functionalUtility, registerUtility, themeKeyVar, themeKeyValue } from \"../core/registry\";\nimport { atRoot, atRule, decl, property, rule } from \"../core/ast\";\nimport { parseNumber, parseLength, parseColor, themeColorDecls } from \"../core/utils\";\n\n// --- Border Radius ---\n// border-radius documentation\n\n// Static border radius utilities\nstaticUtility(\"rounded-none\", [[\"border-radius\", \"0px\"]], { category: 'borders' });\nstaticUtility(\"rounded-sm\", [[\"border-radius\", \"var(--radius-sm)\"]], { category: 'borders' });\nstaticUtility(\"rounded\", [[\"border-radius\", \"0.25rem\"]], { category: 'borders' });\nstaticUtility(\"rounded-md\", [[\"border-radius\", \"var(--radius-md)\"]], { category: 'borders' });\nstaticUtility(\"rounded-lg\", [[\"border-radius\", \"var(--radius-lg)\"]], { category: 'borders' });\nstaticUtility(\"rounded-xl\", [[\"border-radius\", \"var(--radius-xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-2xl\", [[\"border-radius\", \"var(--radius-2xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-3xl\", [[\"border-radius\", \"var(--radius-3xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-4xl\", [[\"border-radius\", \"var(--radius-4xl)\"]], { category: 'borders' });\nstaticUtility(\"rounded-xs\", [[\"border-radius\", \"var(--radius-xs)\"]], { category: 'borders' });\n// #300: a theme.borderRadius.full other than the default wins over the literal, like Tailwind 4.3.3 where\n// `@theme { --radius-full: ... }` makes rounded-full (and rounded-t-full ...) read var(--radius-full).\n// #336: Tailwind 4.3.3 emits `calc(infinity * 1px)` for rounded-full (was 9999px).\nconst FULL = \"calc(infinity * 1px)\";\nfunction roundedFull(name: string, props: string[]) {\n registerUtility({\n name,\n match: (className: string) => className === name,\n handler: (_value, ctx) => {\n const own = themeKeyValue(ctx, \"borderRadius\", \"full\");\n const value = own != null && own !== \"9999px\" && own !== FULL ? \"var(--radius-full)\" : FULL;\n return props.map((prop) => decl(prop, value));\n },\n category: \"borders\",\n });\n}\nroundedFull(\"rounded-full\", [\"border-radius\"]);\n\n\n// Individual corner radius utilities\n[\n [\"rounded-t\", [\"border-top-left-radius\", \"border-top-right-radius\"]],\n [\"rounded-r\", [\"border-top-right-radius\", \"border-bottom-right-radius\"]],\n [\"rounded-b\", [\"border-bottom-right-radius\", \"border-bottom-left-radius\"]],\n [\"rounded-l\", [\"border-top-left-radius\", \"border-bottom-left-radius\"]],\n [\"rounded-tl\", [\"border-top-left-radius\"]],\n [\"rounded-tr\", [\"border-top-right-radius\"]],\n [\"rounded-br\", [\"border-bottom-right-radius\"]],\n [\"rounded-bl\", [\"border-bottom-left-radius\"]],\n // #321 logical corners (Tailwind 4.3): none -> 0, full -> calc(infinity * 1px) like Tailwind.\n [\"rounded-s\", [\"border-start-start-radius\", \"border-end-start-radius\"]],\n [\"rounded-e\", [\"border-start-end-radius\", \"border-end-end-radius\"]],\n [\"rounded-ss\", [\"border-start-start-radius\"]],\n [\"rounded-se\", [\"border-start-end-radius\"]],\n [\"rounded-es\", [\"border-end-start-radius\"]],\n [\"rounded-ee\", [\"border-end-end-radius\"]],\n].forEach(([name, props]) => {\n const propList = props as string[];\n const logical = propList[0].startsWith(\"border-start\") || propList[0].startsWith(\"border-end\");\n // Static utilities\n staticUtility(`${name}-none`, propList.map(prop => [prop, logical ? \"0\" : \"0px\"]), { category: 'borders' });\n staticUtility(`${name}-sm`, propList.map(prop => [prop, \"var(--radius-sm)\"]), { category: 'borders' });\n staticUtility(`${name}`, propList.map(prop => [prop, \"0.25rem\"]), { category: 'borders' });\n staticUtility(`${name}-md`, propList.map(prop => [prop, \"var(--radius-md)\"]), { category: 'borders' });\n staticUtility(`${name}-lg`, propList.map(prop => [prop, \"var(--radius-lg)\"]), { category: 'borders' });\n staticUtility(`${name}-xl`, propList.map(prop => [prop, \"var(--radius-xl)\"]), { category: 'borders' });\n staticUtility(`${name}-2xl`, propList.map(prop => [prop, \"var(--radius-2xl)\"]), { category: 'borders' });\n staticUtility(`${name}-3xl`, propList.map(prop => [prop, \"var(--radius-3xl)\"]), { category: 'borders' });\n staticUtility(`${name}-4xl`, propList.map(prop => [prop, \"var(--radius-4xl)\"]), { category: 'borders' });\n staticUtility(`${name}-xs`, propList.map(prop => [prop, \"var(--radius-xs)\"]), { category: 'borders' });\n // #336 every *-full → calc(infinity * 1px) like Tailwind 4.3.3; #300 a custom `full` key wins either way.\n roundedFull(`${name}-full`, propList);\n\n // Functional utility\n functionalUtility({\n name: name as string,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value, ctx }) => {\n // Tailwind 4.3 has no bare-number logical radius (rounded-s-2 emits nothing).\n if (!logical && parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n return themeKeyVar(ctx, \"borderRadius\", value, \"radius\"); // #300: rounded-t-card\n },\n handle: (value) => propList.map(prop => decl(prop, value)),\n description: `${name} utility (spacing, arbitrary, custom property support)`,\n category: \"borders\",\n });\n});\n\n\n// Functional border radius utility\nfunctionalUtility({\n name: \"rounded\",\n // Only the `rounded` prefix itself: a class the logical rounded-s/e/... utility rejects (rounded-s-2) must not fall\n // through to border-radius (#321).\n handle: (value, _ctx, token) => (token.prefix === \"rounded\" ? [decl(\"border-radius\", value)] : null),\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value, ctx }) => {\n if (parseNumber(value)) {\n return `calc(var(--spacing) * ${value})`;\n }\n return themeKeyVar(ctx, \"borderRadius\", value, \"radius\"); // #300: rounded-card → var(--radius-card)\n },\n description: \"border-radius utility (spacing, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Border Width ---\n// border-width documentation\n\n// Like Tailwind v4, every border-width utility also sets border-style through a registered var whose initial value is\n// solid, so a bare border/border-t renders without relying on a preflight reset, and border-dashed/dotted/none (which\n// set the var) still win whatever the rule order.\nconst borderStyleProperty = () => atRoot([property(\"--baro-border-style\", \"solid\")]);\nconst withBorderStyle = (props: string[], width: string) => [\n borderStyleProperty(),\n ...props.map((prop) => decl(prop.replace(\"width\", \"style\"), \"var(--baro-border-style)\")),\n ...props.map((prop) => decl(prop, width)),\n];\n\n// Static border width utilities\n[[\"border-0\", \"0px\"], [\"border-2\", \"2px\"], [\"border-4\", \"4px\"], [\"border-8\", \"8px\"], [\"border\", \"1px\"]].forEach(([name, width]) => {\n staticUtility(name, [borderStyleProperty, [\"border-style\", \"var(--baro-border-style)\"], [\"border-width\", width]], { category: 'borders' });\n});\n\n\n\n// Individual side border width utilities\n[\n [\"border-x\", [\"border-left-width\", \"border-right-width\"]],\n [\"border-y\", [\"border-top-width\", \"border-bottom-width\"]],\n [\"border-bs\", [\"border-block-start-width\"]],\n [\"border-be\", [\"border-block-end-width\"]],\n [\"border-s\", [\"border-inline-start-width\"]], // #311 (Tailwind 4.3)\n [\"border-e\", [\"border-inline-end-width\"]],\n [\"border-t\", [\"border-top-width\"]],\n [\"border-r\", [\"border-right-width\"]],\n [\"border-b\", [\"border-bottom-width\"]],\n [\"border-l\", [\"border-left-width\"]],\n].forEach(([name, props]) => {\n const propList = props as string[];\n // Static utilities\n const styled = (width: string) => [\n borderStyleProperty,\n ...propList.map((prop) => [prop.replace(\"width\", \"style\"), \"var(--baro-border-style)\"] as [string, string]),\n ...propList.map((prop) => [prop, width] as [string, string]),\n ];\n staticUtility(`${name}-0`, styled(\"0px\"));\n staticUtility(`${name}-2`, styled(\"2px\"));\n staticUtility(`${name}-4`, styled(\"4px\"));\n staticUtility(`${name}-8`, styled(\"8px\"));\n staticUtility(`${name}`, styled(\"1px\"));\n\n // Functional utility\n functionalUtility({\n name: name as string,\n themeKeys: [\"colors\", \"borderWidth\"], // #338: a key in both is a colour, as in Tailwind\n supportsOpacity: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n handle: (value, ctx, token, extra) => {\n if (extra?.themeNamespace === \"borderWidth\") return withBorderStyle(propList, value);\n if (extra?.realThemeValue) return propList.flatMap(prop => themeColorDecls(prop.replace(\"width\", \"color\"), value, extra));\n if (parseColor(value)) {\n return propList.map(prop => decl(prop.replace(\"width\", \"color\"), value));\n }\n if (token.arbitrary) {\n return withBorderStyle(propList, value);\n }\n return null;\n },\n handleCustomProperty: (value) => {\n\n if (value.startsWith(\"length:\")) {\n return withBorderStyle(propList, `var(${value.replace(\"length:\", \"\")})`);\n }\n\n return propList.map(prop => decl(prop.replace(\"width\", \"color\"), `var(${value})`));\n },\n description: `${name} utility (number, arbitrary, custom property support)`,\n category: \"borders\",\n });\n});\n\n// --- Border Color ---\n// border-color documentation\n\n// Static border color utilities\nstaticUtility(\"border-inherit\", [[\"border-color\", \"inherit\"]], { category: 'borders' });\nstaticUtility(\"border-current\", [[\"border-color\", \"currentColor\"]], { category: 'borders' });\nstaticUtility(\"border-transparent\", [[\"border-color\", \"transparent\"]], { category: 'borders' });\n\n// --- Border Style ---\n// border-style documentation\n\n// Static border style utilities\nstaticUtility(\"border-solid\", [[\"--baro-border-style\", \"solid\"], [\"border-style\", \"solid\"]], { category: 'borders' });\nstaticUtility(\"border-dashed\", [[\"--baro-border-style\", \"dashed\"], [\"border-style\", \"dashed\"]], { category: 'borders' });\nstaticUtility(\"border-dotted\", [[\"--baro-border-style\", \"dotted\"], [\"border-style\", \"dotted\"]], { category: 'borders' });\nstaticUtility(\"border-double\", [[\"--baro-border-style\", \"double\"], [\"border-style\", \"double\"]], { category: 'borders' });\nstaticUtility(\"border-hidden\", [[\"--baro-border-style\", \"hidden\"], [\"border-style\", \"hidden\"]], { category: 'borders' });\nstaticUtility(\"border-none\", [[\"--baro-border-style\", \"none\"], [\"border-style\", \"none\"]], { category: 'borders' });\n\n// --- Divide Width --- (Tailwind 4: `:where(& > :not(:last-child))`, style from the registered border-style var)\nconst divideSides = { x: [\"border-inline-start\", \"border-inline-end\", \"border-inline-style\"], y: [\"border-top\", \"border-bottom\", \"border-bottom-style\", \"border-top-style\"] };\nObject.entries(divideSides).forEach(([axis, [start, end, ...styles]]) => {\n const rev = `--baro-divide-${axis}-reverse`;\n const divide = (width: string) => [\n borderStyleProperty(),\n rule(\":where(& > :not(:last-child))\", [\n decl(rev, \"0\"),\n ...styles.map((s) => decl(s, \"var(--baro-border-style)\")),\n decl(`${start}-width`, `calc(${width} * var(${rev}))`),\n decl(`${end}-width`, `calc(${width} * calc(1 - var(${rev})))`),\n ]),\n ];\n staticUtility(`divide-${axis}`, divide(\"1px\"), { category: 'borders' });\n staticUtility(`divide-${axis}-reverse`, [rule(\":where(& > :not(:last-child))\", [decl(rev, \"1\")])], { category: 'borders' });\n functionalUtility({\n name: `divide-${axis}`,\n themeKeys: [\"divideWidth\", \"borderWidth\"], // #338, as Tailwind's --divide-width then --border-width\n supportsArbitrary: true,\n handleBareValue: ({ value }) => (/^\\d+$/.test(value) ? `${value}px` : null),\n handle: (value) => divide(value),\n description: `divide-${axis} width utility`,\n category: \"borders\",\n });\n});\n\n\n// Functional border width utility\nfunctionalUtility({\n name: \"border\",\n themeKeys: [\"colors\", \"borderWidth\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n\n if (extra?.themeNamespace === \"borderWidth\") return withBorderStyle([\"border-width\"], value);\n if (extra?.realThemeValue) return themeColorDecls(\"border-color\", value, extra);\n\n if (token.arbitrary) {\n if (parseLength(value)) {\n return withBorderStyle([\"border-width\"], value);\n }\n return [decl(\"border-color\", value)];\n }\n\n if (parseNumber(value)) {\n return withBorderStyle([\"border-width\"], `${value}px`);\n }\n if (parseColor(value)) {\n return [decl(\"border-color\", value)];\n }\n return null;\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"length:\")) {\n return withBorderStyle([\"border-width\"], `var(${value.replace(\"length:\", \"\")})`);\n }\n return [decl(\"border-color\", `var(${value})`)];\n },\n description: \"border-width utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Outline Width ---\n// outline-width documentation\n\n// Like border (and Tailwind v4), outline width utilities set outline-style through a registered var whose initial value\n// is solid, so outline-2/focus-visible:outline-1 render; outline-dashed/none/hidden set the var and win in either order.\nconst outlineStyleProperty = () => atRoot([property(\"--baro-outline-style\", \"solid\")]);\nconst withOutlineStyle = (width: string) => [\n outlineStyleProperty(),\n decl(\"outline-style\", \"var(--baro-outline-style)\"),\n decl(\"outline-width\", width),\n];\n\n// Static outline width utilities\n[[\"outline-0\", \"0px\"], [\"outline-1\", \"1px\"], [\"outline-2\", \"2px\"], [\"outline-4\", \"4px\"], [\"outline-8\", \"8px\"]].forEach(([name, width]) => {\n staticUtility(name, [outlineStyleProperty, [\"outline-style\", \"var(--baro-outline-style)\"], [\"outline-width\", width]], { category: 'borders' });\n});\n\n// --- Outline Color ---\n// outline-color documentation\n\n// Static outline color utilities\nstaticUtility(\"outline-inherit\", [[\"outline-color\", \"inherit\"]], { category: 'borders' });\nstaticUtility(\"outline-current\", [[\"outline-color\", \"currentColor\"]], { category: 'borders' });\nstaticUtility(\"outline-transparent\", [[\"outline-color\", \"transparent\"]], { category: 'borders' });\n\n\n// --- Outline Style ---\n// outline-style documentation\n\n// Static outline style utilities\n// Tailwind v4: outline-none removes the outline; outline-hidden (v3's outline-none) hides it but keeps a transparent\n// outline in forced-colors mode for accessibility.\nstaticUtility(\"outline-none\", [[\"--baro-outline-style\", \"none\"], [\"outline-style\", \"none\"]], { category: 'borders' });\nstaticUtility(\"outline-hidden\", [\n [\"--baro-outline-style\", \"none\"],\n [\"outline-style\", \"none\"],\n atRule(\"media\", \"(forced-colors: active)\", [decl(\"outline\", \"2px solid transparent\"), decl(\"outline-offset\", \"2px\")]),\n], { category: 'borders' });\nstaticUtility(\"outline\", [outlineStyleProperty, [\"outline-style\", \"var(--baro-outline-style)\"], [\"outline-width\", \"1px\"]], { category: 'borders' });\n[\"solid\", \"dashed\", \"dotted\", \"double\"].forEach((style) => {\n staticUtility(`outline-${style}`, [[\"--baro-outline-style\", style], [\"outline-style\", style]], { category: 'borders' });\n});\n\n// --- Outline Offset ---\n// outline-offset documentation\n\n// Static outline offset utilities\nstaticUtility(\"outline-offset-0\", [[\"outline-offset\", \"0px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-1\", [[\"outline-offset\", \"1px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-2\", [[\"outline-offset\", \"2px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-4\", [[\"outline-offset\", \"4px\"]], { category: 'borders' });\nstaticUtility(\"outline-offset-8\", [[\"outline-offset\", \"8px\"]], { category: 'borders' });\n\n// Functional outline offset utility\nfunctionalUtility({\n name: \"outline-offset\",\n prop: \"outline-offset\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n description: \"outline-offset utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n\n// Functional outline color utility\nfunctionalUtility({\n name: \"outline\",\n themeKeys: [\"colors\", \"outlineWidth\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, ctx, token, extra) => {\n\n if (extra?.themeNamespace === \"outlineWidth\") return withOutlineStyle(value);\n if (extra?.realThemeValue) return themeColorDecls(\"outline-color\", value, extra);\n\n if (parseColor(value)) {\n return [decl(\"outline-color\", value)];\n }\n\n if (parseNumber(value)) {\n return withOutlineStyle(`${value}px`);\n }\n\n // Handle arbitrary values\n if (token.arbitrary) {\n\n if (parseLength(value)) {\n return withOutlineStyle(value);\n }\n\n return [decl(\"outline-color\", value)];\n }\n\n\n\n return null;\n },\n handleCustomProperty: (value) => {\n\n if (value.startsWith(\"color:\")) {\n return [decl(\"outline-color\", value.replace(\"color:\", \"\"))];\n }\n\n if (value.startsWith(\"length:\")) {\n return withOutlineStyle(`var(${value.replace(\"length:\", \"\")})`);\n }\n\n return [decl(\"outline-color\", `var(${value})`)];\n },\n description: \"outline-color utility (theme colors, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n\n// Functional outline width utility\nfunctionalUtility({\n name: \"outline\",\n prop: \"outline-width\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handleBareValue: ({ value }) => {\n if (parseNumber(value)) {\n return `${value}px`;\n }\n return null;\n },\n description: \"outline-width utility (number, arbitrary, custom property support)\",\n category: \"borders\",\n});\n\n// --- Divide Color --- (Tailwind 4: `:where(& > :not(:last-child)) { border-color: … }`, same selector as divide-x/y)\nconst divideColor = (value: string) => [rule(\":where(& > :not(:last-child))\", [decl(\"border-color\", value)])];\nstaticUtility(\"divide-inherit\", divideColor(\"inherit\"), { category: 'borders' });\nstaticUtility(\"divide-current\", divideColor(\"currentColor\"), { category: 'borders' });\nstaticUtility(\"divide-transparent\", divideColor(\"transparent\"), { category: 'borders' });\nfunctionalUtility({\n name: \"divide\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsOpacity: true,\n handle: (value, _ctx, _token, extra) => {\n // Theme colours go through the shared helper (var(--color-*) and Tailwind's /alpha form, #228).\n if (extra?.realThemeValue) {\n return [rule(\":where(& > :not(:last-child))\", themeColorDecls(\"border-color\", value, extra))];\n }\n // Arbitrary values only when they are colours: divide-[3px] is not a divide colour (Tailwind emits nothing).\n if (parseColor(value)) return divideColor(value);\n return null;\n },\n handleCustomProperty: (value) => divideColor(`var(${value})`),\n description: \"divide-color utility (theme, alpha, arbitrary, custom property)\",\n category: \"borders\",\n});\n","// --- Transform Utilities ---\nimport { atRoot, decl, property } from \"../core/ast\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { parseFractionOrNumber, parseNumber } from \"../core/utils\";\n\n// Like Tailwind v4, the per-axis rotate/scale/translate utilities set only their own --baro-* var and a shared composite\n// declaration reads all axes: rotate/skew with empty fallbacks, scale/translate through @property-registered defaults.\n// A lone rotate-x-*/scale-y-*/translate-x-* therefore never references an undefined var, and axes combine.\nconst ROTATE_SKEW =\n \"var(--baro-rotate-x,) var(--baro-rotate-y,) var(--baro-rotate-z,) var(--baro-skew-x,) var(--baro-skew-y,)\";\nconst rotateAxis = (axis: string, fn: string) => [decl(`--baro-rotate-${axis}`, fn), decl(\"transform\", ROTATE_SKEW)];\nconst skewAxis = (axis: string, fn: string) => [decl(`--baro-skew-${axis}`, fn), decl(\"transform\", ROTATE_SKEW)];\n\nconst scaleProperties = () =>\n atRoot([\n property(\"--baro-scale-x\", \"1\"),\n property(\"--baro-scale-y\", \"1\"),\n property(\"--baro-scale-z\", \"1\"),\n ]);\nconst scaleAxis = (axis: string, v: string) => [\n scaleProperties(),\n decl(`--baro-scale-${axis}`, v),\n decl(\"scale\", axis === \"z\" ? \"var(--baro-scale-x) var(--baro-scale-y) var(--baro-scale-z)\" : \"var(--baro-scale-x) var(--baro-scale-y)\"),\n];\n\n// --- Transform ---\n// transform-none: disables all transforms\nstaticUtility(\"transform-none\", [[\"transform\", \"none\"]], {\n category: \"transform\",\n});\n\n// transform-gpu: enables GPU acceleration for transforms\n// Output: transform: translateZ(0) <ROTATE_SKEW>\nstaticUtility(\n \"transform-gpu\",\n [\n [\n \"transform\",\n `translateZ(0) ${ROTATE_SKEW}`,\n ],\n ],\n { category: \"transform\" }\n);\n\n// transform-cpu: disables GPU acceleration, uses only CPU transforms\n// Output: transform: <ROTATE_SKEW>\nstaticUtility(\"transform-cpu\", [\n [\n \"transform\",\n ROTATE_SKEW,\n ],\n]);\n\n// --- Transform Style ---\n// transform-style documentation\n\n// transform-3d: transform-style: preserve-3d;\nstaticUtility(\"transform-3d\", [[\"transform-style\", \"preserve-3d\"]], {\n category: \"transform\",\n});\n// transform-flat: transform-style: flat;\nstaticUtility(\"transform-flat\", [[\"transform-style\", \"flat\"]], {\n category: \"transform\",\n});\n\n// transform-(<custom-property>): sets transform to a CSS custom property value\n// Example: transform-(--my-transform) → transform: var(--my-transform);\nfunctionalUtility({\n name: \"transform\",\n prop: \"transform\",\n supportsCustomProperty: true,\n handleCustomProperty: (value) => [decl(\"transform\", `var(${value})`)],\n description:\n \"transform utility for custom property (transform-(--my-transform))\",\n category: \"transform\",\n});\n\n// transform-[<value>]: sets transform to an arbitrary value\n// Example: transform-[matrix(1,2,3,4,5,6)] → transform: matrix(1,2,3,4,5,6);\nfunctionalUtility({\n name: \"transform\",\n prop: \"transform\",\n supportsArbitrary: true,\n handle: (value) => [decl(\"transform\", value)],\n description: \"transform utility for arbitrary value (transform-[...])\",\n category: \"transform\",\n});\n\n// --- Backface Visibility ---\n// backface-visibility documentation\nstaticUtility(\"backface-hidden\", [[\"backface-visibility\", \"hidden\"]], {\n category: \"transform\",\n});\nstaticUtility(\"backface-visible\", [[\"backface-visibility\", \"visible\"]], {\n category: \"transform\",\n});\n\n// --- Perspective ---\n// perspective documentation\nstaticUtility(\n \"perspective-dramatic\",\n [[\"perspective\", \"var(--perspective-dramatic)\"]],\n { category: \"transform\" }\n); // 100px\nstaticUtility(\n \"perspective-near\",\n [[\"perspective\", \"var(--perspective-near)\"]],\n { category: \"transform\" }\n); // 300px\nstaticUtility(\n \"perspective-normal\",\n [[\"perspective\", \"var(--perspective-normal)\"]],\n { category: \"transform\" }\n); // 500px\nstaticUtility(\n \"perspective-midrange\",\n [[\"perspective\", \"var(--perspective-midrange)\"]],\n { category: \"transform\" }\n); // 800px\nstaticUtility(\n \"perspective-distant\",\n [[\"perspective\", \"var(--perspective-distant)\"]],\n { category: \"transform\" }\n); // 1200px\nstaticUtility(\"perspective-none\", [[\"perspective\", \"none\"]], {\n category: \"transform\",\n});\n\n// --- Perspective Origin ---\n// perspective-origin documentation\nstaticUtility(\"perspective-origin-center\", [[\"perspective-origin\", \"center\"]], {\n category: \"transform\",\n});\nstaticUtility(\"perspective-origin-top\", [[\"perspective-origin\", \"top\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-top-right\",\n [[\"perspective-origin\", \"top right\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-right\", [[\"perspective-origin\", \"right\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-bottom-right\",\n [[\"perspective-origin\", \"bottom right\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-bottom\", [[\"perspective-origin\", \"bottom\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-bottom-left\",\n [[\"perspective-origin\", \"bottom left\"]],\n { category: \"transform\" }\n);\nstaticUtility(\"perspective-origin-left\", [[\"perspective-origin\", \"left\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"perspective-origin-top-left\",\n [[\"perspective-origin\", \"top left\"]],\n { category: \"transform\" }\n);\n\nfunctionalUtility({\n name: \"perspective-origin\",\n prop: \"perspective-origin\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => [decl(\"perspective-origin\", value)],\n handleCustomProperty: (value) => [\n decl(\"perspective-origin\", `var(${value})`),\n ],\n description:\n \"perspective-origin utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// perspective-(<custom-property>) → perspective: var(--custom-property)\nfunctionalUtility({\n name: \"perspective\",\n prop: \"perspective\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value) => {\n // perspective-[750px] → perspective: 750px\n return [decl(\"perspective\", value)];\n },\n handleCustomProperty: (value) => [decl(\"perspective\", `var(${value})`)],\n description:\n \"perspective utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Rotate ---\n// rotate documentation\n\n// rotate-none\nstaticUtility(\"rotate-none\", [[\"rotate\", \"none\"]], { category: \"transform\" });\n\n// rotate-x-<number>, -rotate-x-<number>, rotate-x-(<custom-property>), rotate-x-[<value>]\nfunctionalUtility({\n name: \"rotate-x\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-x-45 → --baro-rotate-x: rotateX(45deg); transform: ROTATE_SKEW\n // -rotate-x-45 → --baro-rotate-x: rotateX(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"x\", `rotateX(${sign}${deg})`);\n }\n // rotate-x-[3.142rad] → --baro-rotate-x: rotateX(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"x\", `rotateX(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"x\", `rotateX(var(${value}))`),\n description: \"rotate-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-y-<number>, -rotate-y-<number>, rotate-y-(<custom-property>), rotate-y-[<value>]\nfunctionalUtility({\n name: \"rotate-y\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-y-45 → --baro-rotate-y: rotateY(45deg); transform: ROTATE_SKEW\n // -rotate-y-45 → --baro-rotate-y: rotateY(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"y\", `rotateY(${sign}${deg})`);\n }\n // rotate-y-[3.142rad] → --baro-rotate-y: rotateY(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"y\", `rotateY(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"y\", `rotateY(var(${value}))`),\n description: \"rotate-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-z-<number>, -rotate-z-<number>, rotate-z-(<custom-property>), rotate-z-[<value>]\nfunctionalUtility({\n name: \"rotate-z\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-z-45 → --baro-rotate-z: rotateZ(45deg); transform: ROTATE_SKEW\n // -rotate-z-45 → --baro-rotate-z: rotateZ(-45deg); transform: ROTATE_SKEW\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return rotateAxis(\"z\", `rotateZ(${sign}${deg})`);\n }\n // rotate-z-[3.142rad] → --baro-rotate-z: rotateZ(3.142rad); transform: ROTATE_SKEW\n return rotateAxis(\"z\", `rotateZ(${value})`);\n },\n handleCustomProperty: (value) => rotateAxis(\"z\", `rotateZ(var(${value}))`),\n description: \"rotate-z utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// rotate-<number>, -rotate-<number>, rotate-(<custom-property>), rotate-[<value>]\nfunctionalUtility({\n name: \"rotate\",\n prop: \"rotate\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // rotate-45 → rotate: 45deg\n // -rotate-45 → rotate: calc(45deg * -1)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n if (negative || String(value).startsWith(\"-\")) {\n return [decl(\"rotate\", `calc(${deg} * -1)`)];\n }\n\n return [decl(\"rotate\", deg)];\n }\n // rotate-[3.142rad] → rotate: 3.142rad\n return [decl(\"rotate\", value)];\n },\n handleCustomProperty: (value) => [decl(\"rotate\", `var(${value})`)],\n description: \"rotate utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Scale ---\n// scale documentation\n\n// scale-none\nstaticUtility(\"scale-none\", [[\"scale\", \"none\"]], { category: \"transform\" });\n// scale-3d\nstaticUtility(\n \"scale-3d\",\n [scaleProperties, [\"scale\", \"var(--baro-scale-x) var(--baro-scale-y) var(--baro-scale-z)\"]],\n { category: \"transform\" }\n);\n\n// scale-x-<number>, -scale-x-<number>, scale-x-(<custom-property>), scale-x-[<value>]\nfunctionalUtility({\n name: \"scale-x\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"x\", value);\n }\n\n // scale-x-75 → --baro-scale-x: 75%; scale reads all axes\n // -scale-x-75 → --baro-scale-x: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"x\", `calc(${pct} * ${sign}1)`);\n }\n // scale-x-[1.7] → --baro-scale-x: 1.7; scale reads all axes\n return scaleAxis(\"x\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"x\", `var(${value})`),\n description: \"scale-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-y-<number>, -scale-y-<number>, scale-y-(<custom-property>), scale-y-[<value>]\nfunctionalUtility({\n name: \"scale-y\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"y\", value);\n }\n\n // scale-y-75 → --baro-scale-y: 75%; scale reads all axes\n // -scale-y-75 → --baro-scale-y: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"y\", `calc(${pct} * ${sign}1)`);\n }\n // scale-y-[1.7] → --baro-scale-y: 1.7; scale reads all axes\n return scaleAxis(\"y\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"y\", `var(${value})`),\n description: \"scale-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-z-<number>, -scale-z-<number>, scale-z-(<custom-property>), scale-z-[<value>]\nfunctionalUtility({\n name: \"scale-z\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return scaleAxis(\"z\", value);\n }\n\n // scale-z-75 → --baro-scale-z: 75%; scale reads all axes\n // -scale-z-75 → --baro-scale-z: calc(75% * -1); scale reads all axes\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return scaleAxis(\"z\", `calc(${pct} * ${sign}1)`);\n }\n // scale-z-[1.7] → --baro-scale-z: 1.7; scale reads all axes\n return scaleAxis(\"z\", value);\n },\n handleCustomProperty: (value) => scaleAxis(\"z\", `var(${value})`),\n description: \"scale-z utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// scale-<number>, -scale-<number>, scale-(<custom-property>), scale-[<value>]\nfunctionalUtility({\n name: \"scale\",\n prop: \"scale\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative, arbitrary }) => {\n if (arbitrary) {\n return [decl(\"scale\", `${value}`)];\n }\n\n // scale-75 → scale: 75% 75%\n // -scale-75 → scale: calc(75% * -1) calc(75% * -1)\n if (parseNumber(value) || negative) {\n const pct = `${Math.abs(Number(value))}%`;\n if (negative || String(value).startsWith(\"-\")) {\n return [decl(\"scale\", `calc(${pct} * -1) calc(${pct} * -1)`)];\n }\n return [decl(\"scale\", `${pct} ${pct}`)];\n }\n // scale-[1.7] → scale: 1.7\n return [decl(\"scale\", value)];\n },\n handleCustomProperty: (value) => [\n decl(\"scale\", `var(${value}) var(${value})`),\n ],\n description: \"scale utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Skew ---\n// skew documentation\n\n// skew-x-<number>, -skew-x-<number>, skew-x-(<custom-property>), skew-x-[<value>]\nfunctionalUtility({\n name: \"skew-x\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-x-4 → transform: skewX(4deg)\n // -skew-x-4 → transform: skewX(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return skewAxis(\"x\", `skewX(${sign}${deg})`);\n }\n // skew-x-[3.142rad] → transform: skewX(3.142rad)\n return skewAxis(\"x\", `skewX(${value})`);\n },\n handleCustomProperty: (value) => skewAxis(\"x\", `skewX(var(${value}))`),\n description: \"skew-x utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// skew-y-<number>, -skew-y-<number>, skew-y-(<custom-property>), skew-y-[<value>]\nfunctionalUtility({\n name: \"skew-y\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-y-4 → transform: skewY(4deg)\n // -skew-y-4 → transform: skewY(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return skewAxis(\"y\", `skewY(${sign}${deg})`);\n }\n // skew-y-[3.142rad] → transform: skewY(3.142rad)\n return skewAxis(\"y\", `skewY(${value})`);\n },\n handleCustomProperty: (value) => skewAxis(\"y\", `skewY(var(${value}))`),\n description: \"skew-y utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// skew-<number>, -skew-<number>, skew-(<custom-property>), skew-[<value>]\nfunctionalUtility({\n name: \"skew\",\n prop: \"transform\",\n supportsArbitrary: true,\n supportsCustomProperty: true,\n supportsNegative: true,\n handle: (value, ctx, { negative }) => {\n // skew-4 → transform: skewX(4deg) skewY(4deg)\n // -skew-4 → transform: skewX(-4deg) skewY(-4deg)\n if (parseNumber(value) || negative) {\n const deg = `${Math.abs(Number(value))}deg`;\n const sign = negative || String(value).startsWith(\"-\") ? \"-\" : \"\";\n return [decl(\"--baro-skew-x\", `skewX(${sign}${deg})`), decl(\"--baro-skew-y\", `skewY(${sign}${deg})`), decl(\"transform\", ROTATE_SKEW)];\n }\n // skew-[3.142rad] → transform: skewX(3.142rad) skewY(3.142rad)\n return [decl(\"--baro-skew-x\", `skewX(${value})`), decl(\"--baro-skew-y\", `skewY(${value})`), decl(\"transform\", ROTATE_SKEW)];\n },\n handleCustomProperty: (value) => [\n decl(\"--baro-skew-x\", `skewX(var(${value}))`),\n decl(\"--baro-skew-y\", `skewY(var(${value}))`),\n decl(\"transform\", ROTATE_SKEW),\n ],\n description: \"skew utility (named, arbitrary, custom property supported)\",\n category: \"transform\",\n});\n\n// --- Transform Origin ---\n// transform-origin documentation\n\n// origin-center: transform-origin: center;\nstaticUtility(\"origin-center\", [[\"transform-origin\", \"center\"]], {\n category: \"transform\",\n});\n// origin-top: transform-origin: top;\nstaticUtility(\"origin-top\", [[\"transform-origin\", \"top\"]], {\n category: \"transform\",\n});\n// origin-top-right: transform-origin: top right;\nstaticUtility(\"origin-top-right\", [[\"transform-origin\", \"top right\"]], {\n category: \"transform\",\n});\n// origin-right: transform-origin: right;\nstaticUtility(\"origin-right\", [[\"transform-origin\", \"right\"]], {\n category: \"transform\",\n});\n// origin-bottom-right: transform-origin: bottom right;\nstaticUtility(\"origin-bottom-right\", [[\"transform-origin\", \"bottom right\"]], {\n category: \"transform\",\n});\n// origin-bottom: transform-origin: bottom;\nstaticUtility(\"origin-bottom\", [[\"transform-origin\", \"bottom\"]], {\n category: \"transform\",\n});\n// origin-bottom-left: transform-origin: bottom left;\nstaticUtility(\"origin-bottom-left\", [[\"transform-origin\", \"bottom left\"]], {\n category: \"transform\",\n});\n// origin-left: transform-origin: left;\nstaticUtility(\"origin-left\", [[\"transform-origin\", \"left\"]], {\n category: \"transform\",\n});\n// origin-top-left: transform-origin: top left;\nstaticUtility(\"origin-top-left\", [[\"transform-origin\", \"top left\"]], {\n category: \"transform\",\n});\n\n// origin-(<custom-property>): transform-origin: var(--custom-property);\nfunctionalUtility({\n name: \"origin\",\n prop: \"transform-origin\",\n supportsCustomProperty: true,\n supportsArbitrary: true,\n description:\n \"transform-origin utility for custom property (origin-(--my-transform-origin))\",\n category: \"transform\",\n});\n\n// --- Translate ---\n// translate documentation\n\nconst translateProperties = () =>\n atRoot([\n property(\"--baro-translate-x\", \"0\"),\n property(\"--baro-translate-y\", \"0\"),\n property(\"--baro-translate-z\", \"0\"),\n ]);\n\nconst translateAxis = (axis: string, v: string) => [\n translateProperties(),\n decl(`--baro-translate-${axis}`, v),\n decl(\n \"translate\",\n axis === \"z\"\n ? \"var(--baro-translate-x) var(--baro-translate-y) var(--baro-translate-z)\"\n : \"var(--baro-translate-x) var(--baro-translate-y)\"\n ),\n];\nconst staticTranslateAxis = (axis: string, v: string) => [\n translateProperties,\n [`--baro-translate-${axis}`, v] as [string, string],\n [\n \"translate\",\n axis === \"z\"\n ? \"var(--baro-translate-x) var(--baro-translate-y) var(--baro-translate-z)\"\n : \"var(--baro-translate-x) var(--baro-translate-y)\",\n ] as [string, string],\n];\n\n// --- Static translate utilities ---\n// translate-none: disables all translation\nstaticUtility(\"translate-none\", [[\"translate\", \"none\"]], {\n category: \"transform\",\n});\n\n// translate-px, -translate-px, translate-full, -translate-full\nstaticUtility(\"translate-px\", [[\"translate\", \"1px 1px\"]], {\n category: \"transform\",\n});\nstaticUtility(\"-translate-px\", [[\"translate\", \"-1px -1px\"]], {\n category: \"transform\",\n});\nstaticUtility(\n \"translate-full\",\n [\n translateProperties,\n [\"--baro-translate-x\", \"100%\"],\n [\"--baro-translate-y\", \"100%\"],\n [\"translate\", \"var(--baro-translate-x) var(--baro-translate-y)\"],\n ],\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-full\",\n [\n translateProperties,\n [\"--baro-translate-x\", \"-100%\"],\n [\"--baro-translate-y\", \"-100%\"],\n [\"translate\", \"var(--baro-translate-x) var(--baro-translate-y)\"],\n ],\n { category: \"transform\" }\n);\n\n// translate-x-px, -translate-x-px, translate-x-full, -translate-x-full\nstaticUtility(\n \"translate-x-px\",\n staticTranslateAxis(\"x\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-x-px\",\n staticTranslateAxis(\"x\", \"-1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"translate-x-full\",\n staticTranslateAxis(\"x\", \"100%\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-x-full\",\n staticTranslateAxis(\"x\", \"-100%\"),\n { category: \"transform\" }\n);\n\n// translate-y-px, -translate-y-px, translate-y-full, -translate-y-full\nstaticUtility(\n \"translate-y-px\",\n staticTranslateAxis(\"y\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-y-px\",\n staticTranslateAxis(\"y\", \"-1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"translate-y-full\",\n staticTranslateAxis(\"y\", \"100%\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-y-full\",\n staticTranslateAxis(\"y\", \"-100%\"),\n { category: \"transform\" }\n);\n\n// translate-z-px, -translate-z-px\nstaticUtility(\n \"translate-z-px\",\n staticTranslateAxis(\"z\", \"1px\"),\n { category: \"transform\" }\n);\nstaticUtility(\n \"-translate-z-px\",\n staticTranslateAxis(\"z\", \"-1px\"),\n { category: \"transform\" }\n);\n\n// --- Functional translate utilities ---\n\n// translate-x-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-x\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"x\", v);\n }\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"x\", v);\n }\n return translateAxis(\"x\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"x\", `var(${value})`),\n description:\n \"translate-x utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-y-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-y\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"y\", v);\n }\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"y\", v);\n }\n return translateAxis(\"y\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"y\", `var(${value})`),\n description:\n \"translate-y utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-z-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate-z\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return translateAxis(\"z\", v);\n }\n\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return translateAxis(\"z\", v);\n }\n\n return translateAxis(\"z\", value);\n },\n handleCustomProperty: (value) => translateAxis(\"z\", `var(${value})`),\n description:\n \"translate-z utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n\n// translate-<number|fraction|arbitrary|custom>, negative supported\nfunctionalUtility({\n name: \"translate\",\n prop: \"translate\",\n supportsNegative: true,\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, { negative }) => {\n // Fraction\n if (value.includes(\"/\") && parseFractionOrNumber(value)) {\n const v = `calc(${value} * 100%)`;\n return [decl(\"translate\", `${v} ${v}`)];\n }\n // Number (spacing scale)\n if (parseNumber(value) || negative) {\n const v = `calc(var(--spacing) * ${value})`;\n return [decl(\"translate\", `${v} ${v}`)];\n }\n // Arbitrary value\n return [decl(\"translate\", `${value} ${value}`)];\n },\n handleCustomProperty: (value) => [\n decl(\"translate\", `var(${value}) var(${value})`),\n ],\n description:\n \"translate utility (spacing, fraction, arbitrary, custom property, negative)\",\n category: \"transform\",\n});\n","import { decl } from \"../core/ast\";\nimport { staticUtility, functionalUtility } from \"../core/registry\";\nimport { parseNumber } from \"../core/utils\";\n\n// --- Fill Utilities ---\n// fill documentation\n\n// Static fill values\nstaticUtility(\"fill-inherit\", [[\"fill\", \"inherit\"]], { category: 'svg' });\nstaticUtility(\"fill-current\", [[\"fill\", \"currentColor\"]], { category: 'svg' });\nstaticUtility(\"fill-transparent\", [[\"fill\", \"transparent\"]], { category: 'svg' });\nstaticUtility(\"fill-black\", [[\"fill\", \"#000\"]], { category: 'svg' });\nstaticUtility(\"fill-white\", [[\"fill\", \"#fff\"]], { category: 'svg' });\n\n// Functional: theme color, arbitrary, custom property\nfunctionalUtility({\n name: \"fill\",\n themeKeys: [\"colors\"],\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n if (extra?.realThemeValue) {\n return [decl(\"fill\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"fill\", value)];\n },\n description: \"fill utility (static, theme, arbitrary, custom property supported)\",\n category: \"svg\",\n});\n\n// --- Stroke Utilities ---\n// stroke documentation\nstaticUtility(\"stroke-inherit\", [[\"stroke\", \"inherit\"]], { category: 'svg' });\nstaticUtility(\"stroke-current\", [[\"stroke\", \"currentColor\"]], { category: 'svg' });\nstaticUtility(\"stroke-transparent\", [[\"stroke\", \"transparent\"]], { category: 'svg' });\nstaticUtility(\"stroke-black\", [[\"stroke\", \"#000\"]], { category: 'svg' });\nstaticUtility(\"stroke-white\", [[\"stroke\", \"#fff\"]], { category: 'svg' });\n\nfunctionalUtility({\n name: \"stroke\",\n themeKeys: [\"colors\", \"strokeWidth\"], // #338: a key in both is a colour, as in Tailwind\n supportsArbitrary: true,\n supportsCustomProperty: true,\n handle: (value, ctx, token, extra) => {\n\n if (parseNumber(value) || extra?.themeNamespace === \"strokeWidth\") {\n return [decl(\"stroke-width\", value)];\n }\n\n if (extra?.realThemeValue) {\n return [decl(\"stroke\", `var(--color-${extra.realThemeValue})`)];\n }\n return [decl(\"stroke\", value)];\n },\n handleCustomProperty: (value) => {\n if (value.startsWith(\"length:\")) {\n const cp = value.replace(\"length:\", \"\");\n return [decl(\"stroke-width\", `var(${cp})`)];\n }\n return [decl(\"stroke\", `var(${value})`)];\n },\n description: \"stroke utility (static, theme, arbitrary, custom property supported)\",\n category: \"svg\",\n});\n\n","import { staticUtility } from \"../core/registry\";\n\n// --- Forced Color Adjust Utilities ---\n// forced-color-adjust documentation\nstaticUtility(\"forced-color-adjust-auto\", [[\"forced-color-adjust\", \"auto\"]], { category: 'accessibility' });\nstaticUtility(\"forced-color-adjust-none\", [[\"forced-color-adjust\", \"none\"]], { category: 'accessibility' }); ","import { staticModifier } from \"../../core/registry\";\nimport { atRule } from '../../core/ast';\n\n// --- Basic pseudo-class variants ---\nstaticModifier('hover', ['&:hover'], {\n order: 50,\n source: 'pseudo',\n wrap: () => [atRule('media', '(hover: hover)', [])],\n});\nstaticModifier('focus', ['&:focus'], { order: 50, source: 'pseudo' });\nstaticModifier('active', ['&:active'], { order: 50, source: 'pseudo' });\nstaticModifier('visited', ['&:visited'], { order: 50, source: 'pseudo' });\nstaticModifier('focus-visible', ['&:focus-visible'], { order: 50, source: 'pseudo' });\nstaticModifier('focus-within', ['&:focus-within'], { order: 50, source: 'pseudo' });\n","import { staticModifier } from \"../../core/registry\";\n\n// --- Form state variants ---\nstaticModifier('disabled', ['&:disabled'], { source: 'pseudo' });\nstaticModifier('checked', ['&:checked'], { source: 'pseudo' });\nstaticModifier('required', ['&:required'], { source: 'pseudo' });\nstaticModifier('invalid', ['&:invalid'], { source: 'pseudo' });\nstaticModifier('enabled', ['&:enabled'], { source: 'pseudo' });\nstaticModifier('indeterminate', ['&:indeterminate'], { source: 'pseudo' });\nstaticModifier('default', ['&:default'], { source: 'pseudo' });\nstaticModifier('optional', ['&:optional'], { source: 'pseudo' });\nstaticModifier('valid', ['&:valid'], { source: 'pseudo' });\nstaticModifier('user-valid', ['&:user-valid'], { source: 'pseudo' });\nstaticModifier('user-invalid', ['&:user-invalid'], { source: 'pseudo' });\nstaticModifier('in-range', ['&:in-range'], { source: 'pseudo' });\nstaticModifier('out-of-range', ['&:out-of-range'], { source: 'pseudo' });\nstaticModifier('placeholder-shown', ['&:placeholder-shown'], { source: 'pseudo' });\nstaticModifier('autofill', ['&:autofill'], { source: 'pseudo' });\nstaticModifier('read-only', ['&:read-only'], { source: 'pseudo' }); ","import { staticModifier } from \"../../core/registry\";\n\n// --- Structural selector variants ---\nstaticModifier('first', ['&:first-child'], { source: 'pseudo' });\nstaticModifier('last', ['&:last-child'], { source: 'pseudo' });\nstaticModifier('only', ['&:only-child'], { source: 'pseudo' });\nstaticModifier('odd', ['&:nth-child(odd)'], { source: 'pseudo' });\nstaticModifier('even', ['&:nth-child(even)'], { source: 'pseudo' });\nstaticModifier('first-of-type', ['&:first-of-type'], { source: 'pseudo' });\nstaticModifier('last-of-type', ['&:last-of-type'], { source: 'pseudo' });\nstaticModifier('only-of-type', ['&:only-of-type'], { source: 'pseudo' });\nstaticModifier('empty', ['&:empty'], { source: 'pseudo' }); ","import { staticModifier } from \"../../core/registry\";\nimport { AstNode, atRule } from \"../../core/ast\";\n\n// --- Media feature variants ---\nstaticModifier('prefers-contrast-more', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-contrast: more)', [], 'media')],\n source: 'media'\n});\nstaticModifier('prefers-contrast-less', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-contrast: less)', [], 'media')],\n source: 'media'\n});\nstaticModifier('forced-colors', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(forced-colors: active)', [], 'media')],\n source: 'media'\n});\nstaticModifier('pointer-coarse', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(pointer: coarse)', [], 'media')],\n source: 'media'\n});\nstaticModifier('pointer-fine', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(pointer: fine)', [], 'media')],\n source: 'media'\n});\nstaticModifier('any-pointer-coarse', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(any-pointer: coarse)', [], 'media')],\n source: 'media'\n});\nstaticModifier('any-pointer-fine', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(any-pointer: fine)', [], 'media')],\n source: 'media'\n});\n\n// Motion variants\nstaticModifier('motion-safe', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-reduced-motion: no-preference)', [], 'media')],\n source: 'media'\n});\nstaticModifier('motion-reduce', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(prefers-reduced-motion: reduce)', [], 'media')],\n source: 'media'\n});\n\n// Print and orientation variants\nstaticModifier('print', ['&'], {\n order: 5,\n wrap: () => [atRule('media', 'print', [], 'media')],\n source: 'media'\n});\nstaticModifier('portrait', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(orientation: portrait)', [], 'media')],\n source: 'media'\n});\nstaticModifier('landscape', ['&'], {\n order: 5,\n wrap: () => [atRule('media', '(orientation: landscape)', [], 'media')],\n source: 'media'\n}); ","import { staticModifier } from \"../../core/registry\";\n \n// --- Attribute selector variants ---\nstaticModifier('rtl', ['&[dir=rtl]'], { order: 20, source: 'attribute' });\nstaticModifier('ltr', ['&[dir=ltr]'], { order: 20, source: 'attribute' });\nstaticModifier('inert', ['&[inert]'], { order: 40, source: 'attribute' });\nstaticModifier('open', ['&:is([open], :popover-open, :open)'], { order: 40, source: 'attribute' }); ","import { staticModifier } from \"../../core/registry\";\nimport { AstNode, atRule, atRoot, decl, property } from \"../../core/ast\";\n\n// Import separated variant modules\nimport \"./pseudo-classes\";\nimport \"./form-states\";\nimport \"./structural-selectors\";\nimport \"./media-features\";\nimport \"./attribute-selectors\";\n\n// --- Pseudo-elements (cross-browser) ---\n// Like Tailwind, before:/after: create the pseudo-element: `content` defaults to\n// var(--baro-content) (initial \"\"), which content-* utilities set.\n// A content-* utility already sets `content`, so the default is skipped then\n// (Tailwind prepends it and lets the utility override it: same result).\nconst withPseudoContent = (ast: AstNode[]): AstNode[] => [\n atRoot([property(\"--baro-content\", '\"\"')]),\n ...ast,\n ...(ast.some((n) => n.type === \"decl\" && n.prop === \"content\") ? [] : [decl(\"content\", \"var(--baro-content)\")]),\n];\nstaticModifier('before', ['&::before'], { source: 'pseudo', astHandler: withPseudoContent });\nstaticModifier('after', ['&::after'], { source: 'pseudo', astHandler: withPseudoContent });\n// #335: the selectors Tailwind 4.3.3 emits. Each vendor pseudo-element is its own rule in a browser that\n// does not know it, and the legacy ones (::-moz-selection, :-ms-input-placeholder, ...) are no longer needed.\nstaticModifier('placeholder', ['&::placeholder'], { source: 'pseudo' });\nstaticModifier('selection', ['& *::selection', '&::selection'], { source: 'pseudo' });\nstaticModifier('file', ['&::file-selector-button'], { source: 'pseudo' });\nstaticModifier('marker', [\n '& *::marker',\n '&::marker',\n '& *::-webkit-details-marker',\n '&::-webkit-details-marker',\n], { source: 'pseudo' });\nstaticModifier('details-content', ['&::details-content'], { source: 'pseudo' });\nstaticModifier('first-line', ['&::first-line'], { source: 'pseudo' });\nstaticModifier('first-letter', ['&::first-letter'], { source: 'pseudo' });\nstaticModifier('backdrop', ['&::backdrop'], { source: 'pseudo' });\n\n// --- starting: variant (maps to @starting-style) ---\nstaticModifier('starting', ['&'], {\n wrap: () => [atRule('starting-style', '', [], 'starting')],\n source: 'starting'\n}); ","import { AstNode } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { getModifier } from \"../../core/registry\";\n\n/**\n * Create container query parameters\n */\nexport function createContainerParams(type: 'min' | 'max', value: string, name?: string, negate = false): string {\n const condition = type === 'min' ? 'width >=' : 'width <';\n const query = `${negate ? 'not ' : ''}(${condition} ${value})`;\n return name ? `${name} ${query}` : query;\n}\n\n/**\n * Create media query parameters\n */\nexport function createMediaParams(type: 'min' | 'max', value: string): string {\n return type === 'min' ? `(min-width: ${value})` : `(width < ${value})`;\n}\n\n/**\n * Get size value from theme\n */\nexport function getThemeSize(ctx: Context, key: string): string | undefined {\n return ctx.theme('container.' + key) as string || ctx.theme('breakpoint.' + key) as string;\n}\n\n/**\n * Create container query AST\n */\nexport function createContainerRule(params: string, ast: AstNode | AstNode[]): AstNode {\n return {\n type: 'at-rule',\n name: 'container',\n params,\n nodes: Array.isArray(ast) ? ast : [ast],\n source: 'container'\n };\n}\n\n/**\n * Create media query AST\n */\nexport function createMediaRule(params: string, ast: AstNode | AstNode[]): AstNode {\n return {\n type: 'at-rule',\n name: 'media',\n params,\n nodes: Array.isArray(ast) ? ast : [ast],\n };\n}\n\n// Default breakpoint values (fallback)\nexport function getDefaultBreakpoint(breakpoint: string): string {\n const defaults: Record<string, string> = {\n 'sm': '(min-width: 640px)',\n 'md': '(min-width: 768px)', \n 'lg': '(min-width: 1024px)',\n 'xl': '(min-width: 1280px)',\n '2xl': '(min-width: 1536px)'\n };\n return defaults[breakpoint] || `(min-width: ${breakpoint})`;\n}\n\n/**\n * Arbitrary selector value as Tailwind reads it: `_` is a space, `\\_` a literal underscore.\n */\nexport function decodeArbitrarySelector(value: string): string {\n return value.replace(/\\\\_|_/g, (m) => (m === '_' ? ' ' : '_'));\n}\n\n/**\n * `data-[state=open]` / `aria-[expanded=true]` / `data-avatar` → `[data-state=\"open\"]`, as Tailwind emits it.\n * Returns undefined for anything else.\n */\nexport function attributeVariantSelector(variant: string): string | undefined {\n const bracket = /^(data|aria)-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(variant);\n if (bracket) {\n const [, kind, key, raw] = bracket;\n if (raw === undefined) return `[${kind}-${key}]`;\n const value = /^([\"']).*\\1$/.test(raw) ? raw : `\"${decodeArbitrarySelector(raw)}\"`;\n return `[${kind}-${key}=${value}]`;\n }\n const bare = /^data-([a-zA-Z0-9_-]+)$/.exec(variant);\n if (bare) return `[data-${bare[1]}]`;\n // #352: bare `aria-<state>` is `[aria-<state>=\"true\"]`\n const aria = /^aria-([a-zA-Z0-9_-]+)$/.exec(variant);\n return aria ? `[aria-${aria[1]}=\"true\"]` : undefined;\n}\n\n/**\n * The argument of a `:has()`/`:not()` built from an arbitrary value: a selector list is wrapped as `*:is(…)`\n * (Tailwind's form); a relative selector (`>svg`) or a single selector is kept.\n */\nexport function functionalArgument(value: string): string {\n const v = decodeArbitrarySelector(value);\n return /^[>+~]/.test(v.trim()) || !hasTopLevelComma(v) ? v : `*:is(${v})`;\n}\n\nfunction hasTopLevelComma(value: string): boolean {\n let depth = 0;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (c === '\\\\') i++;\n else if (c === '(' || c === '[') depth++;\n else if (c === ')' || c === ']') depth--;\n else if (c === ',' && depth === 0) return true;\n }\n return false;\n}\n/**\n * #335: the pseudo-class selector (`:hover`, `:first-child`, `:nth-child(odd)`) of a registered static\n * variant, for compounding in not-/group-/peer-/has- forms, or null when the variant is unknown or is not a\n * single pseudo-class (pseudo-elements, at-rules, multi-selector variants). Tailwind 4.3.3 emits nothing\n * for a compound variant whose inner variant it cannot compound (`not-foo`, `group-before`, `peer-has-foo`).\n */\nexport function pseudoClassOf(name: string, ctx: Context): string | null {\n const plugin = getModifier(ctx).find((p) => p.name === name && p.match(name, ctx));\n if (!plugin?.modifySelector) return null;\n const r = plugin.modifySelector({ selector: '&', fullClassName: '', mod: { type: name }, context: ctx });\n const list = Array.isArray(r) ? r : r && typeof r === 'object' ? [r] : typeof r === 'string' ? [{ selector: r }] : [];\n if (list.length !== 1) return null;\n const m = /^&(:(?!:)[a-zA-Z-]+(?:\\(.*\\))?)$/.exec(list[0].selector);\n return m ? m[1] : null;\n}\n\n/**\n * #352: the selector `not-<v>` / `group-not-<v>` negates: an attribute variant (`data-*`, `aria-*`), a\n * pseudo-class (#335), or a wrap-free `has-*` variant (`has-[…]`, `has-aria-*`), as Tailwind 4.3.3 compounds\n * them. Null when `<v>` is unknown or is not a single compound on `&`.\n */\nexport function negatableSelectorOf(name: string, ctx: Context): string | null {\n const attr = attributeVariantSelector(name);\n if (attr) return attr;\n const pc = pseudoClassOf(name, ctx);\n if (pc || !name.startsWith('has-')) return pc;\n const plugin = getModifier(ctx).find((p) => p.match(name, ctx));\n if (!plugin?.modifySelector || plugin.wrap || plugin.astHandler) return null;\n const r = plugin.modifySelector({ selector: '&', fullClassName: '', mod: { type: name }, context: ctx });\n const list = Array.isArray(r) ? r : r && typeof r === 'object' ? [r] : typeof r === 'string' ? [{ selector: r }] : [];\n if (list.length !== 1) return null;\n const m = /^&(:has\\(.+\\))$/.exec(list[0].selector);\n return m && !m[1].includes('&') ? m[1] : null;\n}\n\n/**\n * #352: `not-<v>` for a wrap-only at-rule variant (`md`, `max-md`, `min-[…]`, `print`, `motion-safe`,\n * `supports-[…]`, `dark` in media mode): the same at-rule with its condition negated (`@media not (…)`,\n * `@supports not (…)`), as Tailwind 4.3.3 emits it. Null for anything else, and for a prelude that is a list\n * or already combines conditions, where a leading `not` would not negate the whole query.\n */\nexport function negatedAtRuleOf(name: string, ctx: Context): AstNode | null {\n if (name.startsWith('not-')) return null;\n const plugin = getModifier(ctx).find((p) => p.match(name, ctx));\n if (!plugin?.wrap || plugin.astHandler) return null;\n if (plugin.modifySelector) {\n const r = plugin.modifySelector({ selector: '&', fullClassName: '', mod: { type: name }, context: ctx });\n const sel = typeof r === 'string' ? r : Array.isArray(r) ? (r.length === 1 ? r[0].selector : null) : r?.selector;\n if (sel !== '&') return null;\n }\n const items = plugin.wrap({ type: name }, ctx);\n if (items.length !== 1) return null;\n const node = items[0];\n if (node.type !== 'at-rule' || (node.name !== 'media' && node.name !== 'supports') || node.nodes?.length) return null;\n const params = (node.params ?? '').trim();\n if (!params || /^not\\b|,|\\s(and|or)\\s/i.test(params)) return null;\n return { ...node, params: `not ${params}`, nodes: [] };\n}\n","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\nimport { getDefaultBreakpoint } from \"./utils\";\n\n// responsive (media queries) - dynamic breakpoint support\nfunctionalModifier(\n (mod: string, context: Context) => {\n // 1. Check breakpoints defined in config (matches actual implementation)\n const breakpoints = context.theme('breakpoints') || context.config('theme.breakpoints') || {};\n const breakpointKeys = Object.keys(breakpoints);\n \n // 2. Check basic breakpoints (all breakpoints defined in config)\n if (breakpointKeys.includes(mod)) {\n return true;\n }\n \n // 3. Check max-width breakpoint (max-{breakpoint})\n if (mod.startsWith('max-')) {\n const baseBreakpoint = mod.replace('max-', '');\n // 3-1. When it is a defined breakpoint\n if (breakpointKeys.includes(baseBreakpoint)) {\n return true;\n }\n // 3-2. When it is an arbitrary max-width (max-[960px])\n if (/^\\[.*\\]$/.test(baseBreakpoint)) {\n return true;\n }\n }\n \n // 4. Check arbitrary min-width (min-[600px])\n if (/^min-\\[.*\\]$/.test(mod)) {\n return true; // arbitrary values are always valid\n }\n \n // 5. Check arbitrary max-width (max-[960px])\n if (/^max-\\[.*\\]$/.test(mod)) {\n return true; // arbitrary values are always valid\n }\n \n return false;\n },\n undefined,\n (mod: ParsedModifier, context: Context) => {\n const breakpoint = mod.type;\n \n // 1. Handle breakpoints defined in config (v4.1 standard)\n const breakpoints = context.theme('breakpoints') || context.config('theme.breakpoints') || {};\n \n // 2. Handle basic breakpoints (all breakpoints defined in config)\n if (Object.keys(breakpoints).includes(breakpoint)) {\n let mediaQuery: string = context.theme(`breakpoints.${breakpoint}`) as string || \n getDefaultBreakpoint(breakpoint);\n // If only a number (px/em/rem etc.) is provided, wrap with (min-width: ...)\n if (/^\\d*\\.?\\d+(px|em|rem)?$/.test(mediaQuery)) {\n mediaQuery = `(min-width: ${mediaQuery})`;\n }\n return [atRule('media', mediaQuery, [], 'responsive')];\n }\n \n // 3. Handle max-width breakpoint (max-{breakpoint})\n if (breakpoint.startsWith('max-')) {\n const baseBreakpoint = breakpoint.replace('max-', '');\n \n // 3-1. When it is a defined breakpoint (max-sm, max-md, etc.)\n if (Object.keys(breakpoints).includes(baseBreakpoint)) {\n let mediaQuery = context.theme(`breakpoints.${baseBreakpoint}`) as string || \n getDefaultBreakpoint(baseBreakpoint);\n \n // Convert min-width to max-width\n if (mediaQuery.includes('min-width:')) {\n const value = mediaQuery.match(/min-width:\\s*([^)]+)/)?.[1];\n if (value) {\n mediaQuery = `(width < ${value})`;\n }\n } else if (mediaQuery.includes('width >=')) {\n const value = mediaQuery.match(/width >=\\s*([^)]+)/)?.[1];\n if (value) {\n mediaQuery = `(width < ${value})`;\n }\n } else if (/^\\d*\\.?\\d+(px|em|rem)?$/.test(mediaQuery)) {\n // A bare theme value (`48rem`), as `md` wraps it with (min-width: …)\n mediaQuery = `(width < ${mediaQuery})`;\n }\n \n return [atRule('media', mediaQuery, [], 'responsive')];\n }\n \n // 3-2. When it is an arbitrary max-width (max-[960px])\n if (/^\\[(.*)\\]$/.test(baseBreakpoint)) {\n const value = baseBreakpoint.match(/^\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width < ${value})`, [], 'responsive')];\n }\n }\n }\n \n // 4. Handle arbitrary min-width (min-[600px])\n if (/^min-\\[(.*)\\]$/.test(breakpoint)) {\n const value = breakpoint.match(/^min-\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width >= ${value})`, [], 'responsive')];\n }\n }\n \n // 5. Handle arbitrary max-width (max-[960px])\n if (/^max-\\[(.*)\\]$/.test(breakpoint)) {\n const value = breakpoint.match(/^max-\\[(.*)\\]$/)?.[1];\n if (value) {\n return [atRule('media', `(width < ${value})`, [], 'responsive')];\n }\n }\n return [];\n }\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { AstNode, atRule, rule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\n\n// Dark variant plugin\nconst getDarkSelectors = (ctx: Context) => {\n const mode = ctx.config(\"darkMode\") || \"media\";\n const custom = ctx.config(\"darkModeSelector\");\n const selectors: { type: \"media\" | \"selector\"; value: string }[] = [];\n\n if (mode === \"media\") {\n selectors.push({ type: \"media\", value: \"(prefers-color-scheme: dark)\" });\n if (custom) {\n const joined = Array.isArray(custom) ? custom.join(\", \") : custom;\n selectors.push({ type: \"selector\", value: joined as string });\n }\n return selectors;\n }\n if (mode === \"class\") {\n if (custom) {\n const joined = Array.isArray(custom) ? custom.join(\", \") : custom;\n selectors.push({ type: \"selector\", value: joined as string });\n return selectors;\n }\n selectors.push({ type: \"selector\", value: \".dark\" });\n return selectors;\n }\n selectors.push({ type: \"selector\", value: \".dark\" });\n return selectors;\n};\n\nfunctionalModifier(\n (mod: string) => mod === \"dark\",\n undefined, // modifySelector is not used\n (_mod: ParsedModifier, ctx: Context) => {\n const selectors = getDarkSelectors(ctx);\n \n const result: AstNode[] = [];\n\n selectors.forEach((sel) => {\n if (sel.type === \"media\") {\n const atRuleNode = atRule(\"media\", sel.value, [], 'dark');\n result.push(atRuleNode);\n } else {\n const ruleNode = rule(sel.value, [], 'dark');\n result.push(ruleNode);\n }\n });\n\n return result;\n }\n); \n","import { functionalModifier } from \"../../core/registry\";\nimport { AstNode, atRule } from \"../../core/ast\";\nimport { Context } from \"../../core/context\";\nimport { ParsedModifier } from \"../../core/parser\";\nimport { createContainerRule, createContainerParams } from \"./utils\";\n\n// --- @container query variants ---\n\n// @container/<name> is a utility (container-type + container-name, presets/layout.ts), not a variant: a bare\n// `@container <name> { }` has no condition and is invalid CSS.\n\n// 3. [not-]@<size>, @min-<size>, @max-<size>, each with an optional /<name>. <size> is a --container-* theme key\n// (3xs…7xl) or an arbitrary [value]; unknown theme keys emit nothing (Tailwind 4 behaviour).\nconst SIZE_VARIANT = /^(not-)?@(?:(min|max)-)?(\\[[^\\]]+\\]|[a-zA-Z0-9.]+)(?:\\/([a-zA-Z0-9_-]+))?$/;\nfunctionalModifier(\n (mod: string) => SIZE_VARIANT.test(mod) && !/^(?:not-)?@container(?:\\/|$)/.test(mod),\n undefined,\n (mod: ParsedModifier, context: Context) => {\n const m = SIZE_VARIANT.exec(mod.type);\n if (!m) return [];\n const [, not, type, size, name] = m;\n const value = size.startsWith('[')\n ? size.slice(1, -1).replace(/_/g, ' ')\n : (context.theme('container.' + size) as string | undefined);\n if (!value) return [];\n // #311: not-@<size> negates the condition (Tailwind 4.3.3: `@container [name] not (width >= …)`).\n return [createContainerRule(createContainerParams(type === 'max' ? 'max' : 'min', value, name, !!not), [])];\n }\n);\n","import { functionalModifier, getModifier, type ModifierRegistration } from \"../../core/registry\";\nimport type { Context } from \"../../core/context\";\nimport type { ParsedModifier } from \"../../core/parser\";\nimport { attributeVariantSelector, decodeArbitrarySelector, functionalArgument } from \"./utils\";\n\n/** A bracketed selector that opens with an at-rule is not a selector: the variant does not match. */\nexport const startsAtRule = (bracket: string) => /^[\\s_]*@/.test(bracket);\n\n// has-[]: functionalModifier\nfunctionalModifier(\n (mod: string) => /^has-\\[.*\\]$/.test(mod) && !startsAtRule(mod.slice(5)),\n ({ selector, mod }) => {\n const m = /^has-\\[(.+)\\]$/.exec(mod.type);\n\n return m ? {\n selector: `&:has(${functionalArgument(m[1])})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined,\n);\n\n// has-data-[slot=x] / has-aria-[…]: `&:has(*[data-slot=\"x\"])`, as Tailwind emits it\nfunctionalModifier(\n (mod: string) => /^has-(data|aria)-/.test(mod) && !!attributeVariantSelector(mod.slice(4)),\n ({ mod }) => ({\n selector: `&:has(*${attributeVariantSelector(mod.type.slice(4))})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n }),\n undefined,\n);\n\n/**\n * `has-<v>` / `in-<v>` for a simple variant `<v>` whose selector is `&<compound>` (hover, focus, checked, first,\n * open, data-*, aria-*, …): `&:has(*<compound>)` / `:where(*<compound>) &`, as Tailwind 4.1.13 emits them; `<v>`'s\n * wrap (hover's `@media (hover: hover)`) is kept. `in-[sel]` → `:where(*:is(sel)) &`.\n * Tokens reach here only after the #220 variant-scope guard in the parser / jsonToAst.\n */\ntype HasIn = { kind: string; compound: string; inner?: ModifierRegistration };\n\nfunction innerCompound(variant: string, ctx: Context): Omit<HasIn, 'kind'> | undefined {\n const attr = attributeVariantSelector(variant);\n if (attr) return { compound: attr };\n if (/^(has|in|not|group|peer)-|[^a-z0-9-]/.test(variant)) return undefined;\n const inner = getModifier(ctx).find((m) => m.match(variant, ctx));\n if (!inner?.modifySelector || inner.astHandler) return undefined;\n const out = inner.modifySelector({ selector: '&', fullClassName: '', mod: { type: variant } as ParsedModifier, context: ctx });\n if (out == null) return undefined;\n const list = typeof out === 'string' ? [{ selector: out }] : Array.isArray(out) ? out : [out];\n if (list.length !== 1) return undefined;\n const sel = list[0].selector;\n // one compound on `&` only: no combinator, no top-level list, no second `&`\n if (!/^&[:[]/.test(sel) || sel.slice(1).includes('&') || /[\\s,>+~]/.test(sel.replace(/\\([^()]*\\)/g, ''))) return undefined;\n return { compound: sel.slice(1), inner };\n}\n\nfunction resolveHasIn(mod: string, ctx: Context): HasIn | undefined {\n const m = /^(has|in)-(.+)$/.exec(mod);\n if (!m) return undefined;\n const [, kind, v] = m;\n if (kind === 'in' && /^\\[.+\\]$/.test(v)) {\n if (startsAtRule(v.slice(1))) return undefined;\n const sel = decodeArbitrarySelector(v.slice(1, -1));\n return { kind, compound: sel.startsWith('&') ? sel.slice(1) : `:is(${sel})` };\n }\n if (kind === 'has' && (v.startsWith('[') || /^(data|aria)-/.test(v))) return undefined; // handled above\n const r = innerCompound(v, ctx);\n return r && { kind, ...r };\n}\n\nconst hasInSelector: ModifierRegistration['modifySelector'] = ({ selector, mod, context }) => {\n const r = resolveHasIn(mod.type, context);\n if (!r) return { selector };\n return {\n selector: r.kind === 'has' ? `&:has(*${r.compound})` : `:where(*${r.compound}) &`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n};\n\n// Two registrations: the engine applies any `wrap` it finds, so only inner variants that wrap get one.\nfunctionalModifier(\n (mod: string, ctx: Context) => !!resolveHasIn(mod, ctx)?.inner?.wrap,\n hasInSelector,\n (mod, context) => resolveHasIn(mod.type, context)!.inner!.wrap!({ ...mod, type: mod.type.replace(/^(has|in)-/, '') }, context),\n);\nfunctionalModifier(\n (mod: string, ctx: Context) => { const r = resolveHasIn(mod, ctx); return !!r && !r.inner?.wrap; },\n hasInSelector,\n);\n\n/**\n * `group-has-<v>` / `peer-has-<v>` (optionally `/name`): `&:is(:where(.group):has(*<compound>) *)` /\n * `&:is(:where(.peer):has(*<compound>) ~ *)`, as Tailwind 4.1.13 emits them; `[sel]` → `*:is(sel)` (a relative\n * selector is kept), and `<v>`'s wrap (hover's `@media (hover: hover)`) is kept. Registered before the generic\n * group-/peer- handlers so it matches first; tokens reach here only after the #220 variant-scope guard.\n */\ntype GroupHas = { kind: 'group' | 'peer'; base: string; arg: string; inner?: ModifierRegistration; v: string };\n\nfunction resolveGroupHas(mod: string, ctx: Context): GroupHas | undefined {\n const m = /^(group|peer)-has-(.+?)(?:\\/([a-zA-Z0-9_-]+))?$/.exec(mod);\n if (!m) return undefined;\n const kind = m[1] as 'group' | 'peer';\n const v = m[2];\n const base = m[3] ? `.${kind}\\\\/${m[3]}` : `.${kind}`;\n if (/^\\[.+\\]$/.test(v)) {\n if (startsAtRule(v.slice(1))) return undefined;\n const sel = decodeArbitrarySelector(v.slice(1, -1));\n return { kind, base, v, arg: /^[>+~]/.test(sel.trim()) ? sel : `*:is(${sel})` };\n }\n const r = innerCompound(v, ctx);\n return r && { kind, base, v, arg: `*${r.compound}`, inner: r.inner };\n}\n\nconst groupHasSelector: ModifierRegistration['modifySelector'] = ({ selector, mod, context }) => {\n const r = resolveGroupHas(mod.type, context);\n if (!r) return { selector };\n const tail = r.kind === 'group' ? ' *' : ' ~ *';\n return { selector: `&:is(:where(${r.base}):has(${r.arg})${tail})`, wrappingType: 'rule', source: r.kind };\n};\n\nfunctionalModifier(\n (mod: string, ctx: Context) => !!resolveGroupHas(mod, ctx)?.inner?.wrap,\n groupHasSelector,\n (mod, context) => {\n const r = resolveGroupHas(mod.type, context)!;\n return r.inner!.wrap!({ ...mod, type: r.v }, context);\n },\n);\nfunctionalModifier(\n (mod: string, ctx: Context) => { const r = resolveGroupHas(mod, ctx); return !!r && !r.inner?.wrap; },\n groupHasSelector,\n);\n","import { functionalModifier } from \"../../core/registry\";\nimport { functionalArgument, negatableSelectorOf, negatedAtRuleOf } from \"./utils\";\n\n// #352: not-<at-rule variant> (not-md, not-max-md, not-min-[…], not-print, not-motion-safe, not-supports-[…]):\n// the at-rule with its condition negated. Registered before the selector negation below.\nfunctionalModifier(\n (mod: string, context) => /^not-(?!@)/.test(mod) && !!negatedAtRuleOf(mod.slice(4), context),\n () => '&',\n (mod, context) => {\n const node = negatedAtRuleOf(mod.type.slice(4), context);\n return node ? [node] : [];\n }\n);\n\n// not-[]: functionalModifier for arbitrary negation\nfunctionalModifier(\n (mod: string) => /^not-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^not-\\[(.+)\\]$/.exec(mod.type);\n if (m) {\n\n if (!/^[a-zA-Z0-9_-]+(=.+)?$/.test(m[1])) {\n return {\n selector: `&:not(${functionalArgument(m[1])})`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n\n return {\n selector: `&:not([${m[1]}])`,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n \n return {\n selector,\n source: 'attribute'\n };\n }\n);\n\n// not-: functionalModifier for pseudo-class negation. not-@… is container-query negation (container-queries.ts);\n// anything it does not accept (e.g. not-@container) emits nothing, like Tailwind 4.3.3 (#311).\nfunctionalModifier(\n (mod: string) => /^not-/.test(mod) && !mod.startsWith('not-@'),\n ({ selector, mod, context }) => {\n const m = /^not-(.+)$/.exec(mod.type);\n const inner = m ? negatableSelectorOf(m[1], context) : null;\n if (m && !inner) return null; // #335: unknown inner variant emits nothing\n return {\n selector: inner ? `&:not(${inner})` : selector,\n flatten: false,\n wrappingType: 'rule',\n source: 'attribute'\n };\n }\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Universal selector variants ( 4.x style, supports chaining/:is wrapping) ---\nfunctionalModifier(\n (mod) => mod === '*',\n () => {\n // Tailwind: `:is(.cls > *)` — the direct children, not the element itself.\n return { selector: ':is(& > *)', wrappingType: 'rule', source: 'universal' };\n },\n undefined,\n);\n\nfunctionalModifier(\n (mod) => mod === '**',\n () => ({ selector: ':is(& *)', wrappingType: 'rule', source: 'universal' }),\n undefined,\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { decodeArbitrarySelector } from \"./utils\";\n\n// Master CSS-style arbitrary variant ([...]) support (order: 999, always last)\nfunctionalModifier(\n (mod: string) => /^\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^\\[(.+)\\]$/.exec(mod.type);\n if (!m) return { selector };\n // `_` is a space (`[&_svg]` → `& svg`), as in Tailwind\n const inner = decodeArbitrarySelector(m[1]).trim();\n // For attribute selectors (attr=val) or simple attributes ([open]), wrap with brackets\n if (/^[a-zA-Z0-9_-]+(=.+)?$/.test(inner)) {\n return { selector: `&[${inner}]`, wrappingType: 'rule', source: 'attribute' };\n }\n\n if (inner.startsWith('&')) {\n return { selector: `${inner}`, wrappingType: 'rule', source: 'pseudo' };\n }\n\n // No `&`: Tailwind matches the element itself (`[:root]` → `&:is(:root)`).\n return { selector: `&:is(${inner})`, wrappingType: 'rule', source: 'base' };\n },\n undefined\n); ","import { functionalArgument, negatableSelectorOf } from \"./utils\";\nimport { functionalModifier } from \"../../core/registry\";\n\n// --- Standard aria and not- variants ---\nfunctionalModifier(\n (mod: string) => /^aria-/.test(mod),\n ({ selector, mod }) => {\n // aria-[expanded=true] → &[aria-expanded=\"true\"] { ... }\n const bracket = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(mod.type);\n if (bracket) {\n const key = bracket[1];\n const value = bracket[2] ?? 'true';\n return {\n selector: `&[aria-${key}=\"${value}\"]`,\n source: 'aria'\n };\n }\n // aria-pressed → &[aria-pressed=\"true\"] { ... }\n const m2 = /^aria-([a-zA-Z0-9_]+)$/.exec(mod.type);\n if (m2) {\n const key = m2[1];\n return {\n selector: `&[aria-${key}=\"true\"]`,\n source: 'aria'\n };\n }\n return {\n selector,\n source: 'aria'\n };\n },\n undefined\n);\n\nfunctionalModifier(\n (mod: string) => mod.startsWith('not-') && !mod.startsWith('not-@'), // not-@… is container negation (#311)\n ({ selector, mod, context }) => {\n const pseudo = mod.type.replace('not-', '');\n if (pseudo.startsWith('[')) {\n const inner = pseudo.slice(1, -1);\n // Attribute pattern: identifier(=value)? (e.g., open, dir=rtl, aria-pressed=true)\n if (/^[a-zA-Z0-9_-]+(=.+)?$/.test(inner)) {\n return {\n selector: `&:not([${inner}])`,\n source: 'attribute'\n };\n } else {\n // Otherwise, treat as a selector\n return {\n selector: `&:not(${functionalArgument(inner)})`,\n source: 'attribute'\n };\n }\n } else {\n // not-hover → :not(:hover); not-first → :not(:first-child); unknown → nothing (#335)\n const inner = negatableSelectorOf(pseudo, context);\n if (!inner) return null;\n return {\n selector: `&:not(${inner})`,\n source: 'attribute'\n };\n }\n },\n undefined\n);\n\n// --- Standard data- variants (similar to aria-) ---\nfunctionalModifier(\n (mod: string) => /^data-/.test(mod),\n ({ selector, mod }) => {\n \n // data-[state=open] → [data-state=\"open\"] & { ... }\n const bracket = /^data-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(mod.type);\n if (bracket) {\n const key = bracket[1];\n const value = bracket[2] ?? 'true';\n return {\n selector: `&[data-${key}=\"${value}\"]`,\n source: 'data'\n };\n }\n // data-avatar → [data-avatar] & { ... }\n const m2 = /^data-([a-zA-Z0-9_]+)$/.exec(mod.type);\n if (m2) {\n const key = m2[1];\n return {\n selector: `&[data-${key}]`,\n source: 'data'\n };\n }\n return {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Nth-child, nth-last-child, nth-of-type, nth-last-of-type (숫자/패턴 기반) ---\nfunctionalModifier(\n (mod: string) => /^nth-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-child(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-last-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-last-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-last-child(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-of-type-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-of-type-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-of-type(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^nth-last-of-type-(\\d+)$/.test(mod),\n ({ selector, mod }) => {\n const n = mod.type.match(/^nth-last-of-type-(\\d+)$/)?.[1];\n return n ? {\n selector: `&:nth-last-of-type(${n})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\n\n// --- Functional selector variants ---\nfunctionalModifier(\n (mod: string) => /^is-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^is-\\[(.+)\\]$/.exec(mod.type);\n return m ? {\n selector: `&:is(${m[1]})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n);\nfunctionalModifier(\n (mod: string) => /^where-\\[.*\\]$/.test(mod),\n ({ selector, mod }) => {\n const m = /^where-\\[(.+)\\]$/.exec(mod.type);\n return m ? {\n selector: `&:where(${m[1]})`,\n source: 'attribute'\n } : {\n selector,\n source: 'attribute'\n };\n },\n undefined\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\n\n// --- At-rule variants ---\n\n// supports-[]: functionalModifier\nfunctionalModifier(\n (mod: string) => /^supports-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^supports-\\[(.+)\\]$/.exec(mod.type);\n if (m) {\n return [atRule('supports', `(${m[1]})`, [], 'supports')];\n }\n return [];\n }\n);\n\n// --- layer-[]: @layer 쿼리 variant ---\nfunctionalModifier(\n (mod: string) => /^layer-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^layer-\\[(.+)\\]$/.exec(mod.type);\n return m ? [atRule('layer', m[1], [])] : [];\n }\n);\n\n// --- scope-[]: @scope 쿼리 variant ---\nfunctionalModifier(\n (mod: string) => /^scope-\\[.*\\]$/.test(mod),\n undefined,\n (mod) => {\n const m = /^scope-\\[(.+)\\]$/.exec(mod.type);\n return m ? [atRule('scope', m[1], [])] : [];\n }\n); ","import { functionalModifier } from \"../../core/registry\";\nimport { atRule } from \"../../core/ast\";\nimport { attributeVariantSelector, decodeArbitrarySelector, functionalArgument, negatableSelectorOf, pseudoClassOf } from \"./utils\";\nimport type { Context } from \"../../core/context\";\nimport { startsAtRule } from \"./has-variants\";\n\n// `group-has-[@…]` / `peer-has-[@…]`: an at-rule is not a selector, the variant does not match (as has-[…]).\nconst atRuleHas = (mod: string) => /^(group|peer)-has-\\[/.test(mod) && startsAtRule(mod.slice(mod.indexOf(\"[\") + 1));\n\n// `group-x/name` → ['x', '.group\\/name']; the name is a plain identifier, as Tailwind requires.\nfunction splitGroupName(kind: 'group' | 'peer', variant: string): [string, string] {\n const named = /^(.+)\\/([a-zA-Z0-9_-]+)$/.exec(variant);\n return named ? [named[1], `.${kind}\\\\/${named[2]}`] : [variant, `.${kind}`];\n}\n\n// group-hover / peer-hover (optionally named): like `hover:`, only where hover is real (`@media (hover: hover)`).\n// Registered before the generic group-/peer- handlers so it matches first.\nfunctionalModifier(\n (mod: string) => /^(group|peer)-hover(\\/[a-zA-Z0-9_-]+)?$/.test(mod),\n ({ mod }) => {\n const kind = mod.type.startsWith('group') ? 'group' : 'peer';\n const [, base] = splitGroupName(kind, mod.type.slice(kind.length + 1));\n const tail = kind === 'group' ? ' *' : ' ~ *';\n return { selector: `&:is(:where(${base}):hover${tail})`, wrappingType: 'rule', source: kind };\n },\n () => [atRule('media', '(hover: hover)', [])],\n);\n\n// `group-not-[x]` / `peer-not-[x]` → `:not(*:is(x))`; `group-not-focus` → `:not(:focus)`.\nfunction negated(value: string, ctx: Context): string | null {\n const v = value.slice(4);\n if (v.startsWith('[') && v.endsWith(']')) return `:not(*:is(${decodeArbitrarySelector(v.slice(1, -1))}))`;\n const inner = negatableSelectorOf(v, ctx);\n return inner ? `:not(${inner})` : null;\n}\n\n// --- group/peer/parent/child extensions (examples: group-focus, peer-active, etc.) ---\nfunctionalModifier(\n (mod: string) => /^group-(.+)$/.test(mod) && !atRuleHas(mod),\n ({ selector, mod, context }) => {\n const raw = /^group-(.+)$/.exec(mod.type);\n const [variant, base] = splitGroupName('group', raw?.[1] ?? '');\n const m = raw ? [raw[0], variant] as const : null;\n const g = `:where(${base})`;\n\n // group-data-[state=open] / group-aria-[…] → `:where(.group)[data-state=\"open\"] *`\n const attr = m ? attributeVariantSelector(m[1]) : undefined;\n if (attr) return { selector: `&:is(${g}${attr} *)`, wrappingType: 'rule', source: 'group' };\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n const value = m?.[1].slice(1, -1).replace(/_/g, '');\n return {\n selector: `&:is(${g}:is(${value}) *)`,\n wrappingType: 'rule',\n source: 'group'\n };\n }\n\n if (m?.[1]?.startsWith('not-')) {\n const neg = negated(m[1], context);\n return neg ? { selector: `&:is(${g}${neg} *)`, wrappingType: 'rule', source: 'group' } : null;\n }\n\n if (m?.[1]?.startsWith('has-')) {\n const pattern = /^has-\\[([a-zA-Z0-9_-]+)\\]$/.exec(m?.[1]);\n if (pattern) {\n const value = pattern[1];\n return {\n selector: `&:is(${g}:has(:is(${value})) *)`,\n source: 'group'\n };\n }\n return {\n selector: `&:is(${g}:has(${functionalArgument(m[1].slice(5, -1))}) *)`,\n source: 'group'\n };\n }\n\n if (m?.[1]?.startsWith('aria-')) {\n const pattern = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(m?.[1]);\n if (pattern) {\n const value = pattern[1];\n if (pattern[2]) {\n return {\n selector: `&:is(${g}[aria-${value}=\"${pattern[2]}\"] *)`,\n source: 'group'\n };\n } else {\n return {\n selector: `&:is(${g}[aria-${value}] *)`,\n source: 'group'\n };\n }\n }\n }\n\n const pc = m ? pseudoClassOf(m[1], context) : null;\n if (m && !pc) return null; // #335: unknown inner variant emits nothing\n return m ? {\n selector: `&:is(${g}${pc} *)`,\n wrappingType: 'rule',\n source: 'group'\n } : {\n selector,\n source: 'group'\n };\n },\n undefined,\n);\n\nfunctionalModifier(\n (mod: string) => /^peer-(.+)$/.test(mod) && !atRuleHas(mod),\n ({ selector, mod, context }) => {\n const raw = /^peer-(.+)$/.exec(mod.type);\n const [variant, base] = splitGroupName('peer', raw?.[1] ?? '');\n const m = raw ? [raw[0], variant] as const : null;\n const g = `:where(${base})`;\n\n // peer-data-[state=open] / peer-aria-[…] → `:where(.peer)[data-state=\"open\"] ~ *`\n const attr = m ? attributeVariantSelector(m[1]) : undefined;\n if (attr) return { selector: `&:is(${g}${attr} ~ *)`, wrappingType: 'rule', source: 'peer' };\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n const value = m?.[1].slice(1, -1).replace(/_/g, '');\n return {\n selector: `&:is(${g}:is(${value})~*)`,\n wrappingType: 'rule',\n source: 'peer'\n };\n }\n\n const value = m?.[1];\n\n // has-xxxx, not-xxxx, aria-xxxx\n\n if (value?.startsWith('has-[') && value.endsWith(']')) {\n return { selector: `&:is(${g}:has(${functionalArgument(value.slice(5, -1))}) ~ *)`, source: 'peer' };\n }\n\n if (value?.startsWith('has-')) {\n const pc = pseudoClassOf(value.slice(4), context);\n if (!pc) return null;\n return {\n selector: `&:is(${g}:has(${pc})~*)`,\n source: 'peer'\n };\n }\n\n if (value?.startsWith('not-')) {\n const neg = negated(value, context);\n if (!neg) return null;\n return {\n selector: `&:is(${g}${neg} ~ *)`,\n source: 'peer'\n };\n }\n \n if (value?.startsWith('aria-')) {\n\n let pattern = /^aria-([a-zA-Z0-9_]+)$/.exec(value);\n if (pattern) {\n const key = pattern[1];\n return {\n selector: `&:is(${g}[aria-${key}]~*)`,\n source: 'peer'\n };\n }\n\n pattern = /^aria-\\[([a-zA-Z0-9_-]+)(?:=([^\\]]+))?\\]$/.exec(value);\n if (pattern) {\n const key = pattern[1];\n const value = pattern[2];\n\n if (pattern[2]) {\n return {\n selector: `&:is(${g}[aria-${key}=\"${value}\"]~*)`,\n source: 'peer'\n };\n } else {\n return {\n selector: `&:is(${g}[aria-${key}]~*)`,\n source: 'peer'\n };\n }\n }\n }\n\n const pc = m ? pseudoClassOf(value!, context) : null;\n if (m && !pc) return null; // #335: unknown inner variant emits nothing\n return m ? {\n selector: `&:is(${g}${pc}~*)`,\n source: 'peer'\n } : {\n selector,\n source: 'peer'\n };\n },\n undefined,\n);\n\n// --- parent/child extensions (not in the actual spec, but extensibility example) ---\nfunctionalModifier(\n (mod: string) => /^parent-(.+)$/.test(mod),\n ({ selector, mod }) => {\n const m = /^parent-(.+)$/.exec(mod.type);\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n return {\n selector: `.parent\\\\:\\\\[${m[1].slice(1, -1)}\\\\] &`,\n wrappingType: 'rule',\n source: 'parent'\n };\n }\n\n return m ? {\n selector: `.parent:${m[1]} &`,\n source: 'parent'\n } : {\n selector,\n source: 'parent'\n };\n },\n undefined,\n);\nfunctionalModifier(\n (mod: string) => /^child-(.+)$/.test(mod),\n ({ selector, mod }) => {\n const m = /^child-(.+)$/.exec(mod.type);\n\n if (m?.[1].startsWith('[') && m?.[1].endsWith(']')) {\n return {\n selector: `& > .child\\\\:\\\\[${m[1].slice(1, -1)}\\\\]`,\n wrappingType: 'rule',\n source: 'child'\n };\n }\n return m ? {\n selector: `& > .child:${m[1]}`,\n source: 'child'\n } : {\n selector,\n source: 'child'\n };\n },\n undefined,\n); ","/**\n * Tailwind-compatible cascade order for runtime-inserted rules (#254); shared by @barocss/server (#267).\n *\n * The runtime discovers classes in DOM order, so without sorting `lg:px-8`\n * seen before `sm:px-6` would land earlier and lose at >= 1024px. Each rule\n * gets a sort key derived from its leading `@media` / `@container` preludes:\n *\n * 0 base, negated media (`not-md:` → `@media not (…)`, as Tailwind 4.3.3 orders them, #352),\n * state media (hover), motion/contrast, unknown\n * 1 max-* breakpoints (larger width first)\n * 2 min-* breakpoints (smaller width first)\n * 3 @max-* container queries (larger width first)\n * 4 @min-* container queries (smaller width first)\n * 5 orientation, dark (prefers-color-scheme), print, forced-colors\n *\n * Nested at-rules (e.g. `sm:dark:`) contribute one key pair per level, so\n * `sm:` < `sm:dark:` < `md:`. Equal keys keep discovery order.\n */\nexport type RuleKey = number[];\n\nconst LEADING_AT = /^\\s*@(media|container)\\s+([^{]*)\\{/;\nconst LATE_MEDIA = /prefers-color-scheme|\\bprint\\b|forced-colors|orientation/;\nconst MIN_W = /(?:min-width\\s*:\\s*|width\\s*>=?\\s*)([\\d.]+)(px|rem|em)?/;\nconst MAX_W = /(?:max-width\\s*:\\s*|width\\s*<=?\\s*)([\\d.]+)(px|rem|em)?/;\n\nfunction toPx(n: string, unit?: string): number {\n const v = parseFloat(n);\n return unit === \"rem\" || unit === \"em\" ? v * 16 : v;\n}\n\nfunction preludeKey(kind: string, prelude: string): [number, number] {\n const container = kind === \"container\";\n if (!container && /^\\s*not\\b/i.test(prelude)) return [0, 0];\n const min = MIN_W.exec(prelude);\n if (min) return [container ? 4 : 2, toPx(min[1], min[2])];\n const max = MAX_W.exec(prelude);\n if (max) return [container ? 3 : 1, -toPx(max[1], max[2])];\n if (!container && LATE_MEDIA.test(prelude)) return [5, 0];\n return [0, 0];\n}\n\nexport function ruleSortKey(rule: string): RuleKey {\n const key: number[] = [];\n let rest = rule;\n let m: RegExpExecArray | null;\n while ((m = LEADING_AT.exec(rest))) {\n const [g, v] = preludeKey(m[1], m[2]);\n key.push(g, v);\n rest = rest.slice(m[0].length);\n }\n return key;\n}\n\nexport function compareKeys(a: RuleKey, b: RuleKey): number {\n const n = Math.min(a.length, b.length);\n for (let i = 0; i < n; i++) {\n if (a[i] !== b[i]) return a[i] - b[i];\n }\n return a.length - b.length;\n}\n\n/** Index after the last key <= `key` (stable upper bound) in sorted `keys`. */\nexport function upperBound(keys: RuleKey[], key: RuleKey): number {\n let lo = 0;\n let hi = keys.length;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (compareKeys(keys[mid], key) <= 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n}\n","/**\n * StylePartitionManager\n *\n * StylePartitionManager is a singleton class that manages the partition of styles into different parts.\n * It is used to manage the partition of styles into different parts.\n *\n */\n\nimport { GenerateCssRulesResult } from \"@barocss/kit\";\nimport { parseClassName, isDebug } from \"@barocss/kit\";\nimport { compareKeys, ruleSortKey, upperBound, type RuleKey } from \"./rule-order\";\n\nexport interface StylePartition {\n id: string;\n styles: string[];\n styleElement: HTMLStyleElement;\n /** Sort keys parallel to `styles` / the sheet's cssRules (#254). */\n keys?: RuleKey[];\n}\n\nexport class StylePartitionManager {\n /**\n * Insert `rule` at its Tailwind variant position within `partition` (#254):\n * one insertRule at a binary-searched index, no sheet rewrite.\n */\n private insertSorted(partition: StylePartition, rule: string, key: RuleKey) {\n const keys = (partition.keys ??= []);\n const index = upperBound(keys, key);\n const sheet = partition.styleElement.sheet;\n if (sheet && sheet.cssRules.length === keys.length) {\n sheet.insertRule(this.escapeCssRule(rule), index);\n partition.styles.splice(index, 0, rule);\n } else {\n // No CSSOM (detached) or sheet not solely ours: rebuild text in order.\n partition.styles.splice(index, 0, rule);\n partition.styleElement.textContent = partition.styles.join(\"\\n\") + \"\\n\";\n }\n keys.splice(index, 0, key);\n }\n\n private partitions: StylePartition[] = [];\n private categoryPartitions: Map<string, StylePartition> = new Map();\n private partitionCounter = 0;\n private maxRulesPerPartition = 50;\n private insertionPoint: HTMLElement;\n private classToPartitionMap = new Map<string, number>();\n private classToCategoryPartitionMap = new Map<string, string>();\n private styleIdPrefix = \"barocss-style-partition-\";\n private getCategory: (cls: string) => string | undefined;\n /** #347: CSP nonce set on every `<style>` this manager creates (empty = none). */\n private nonce: string;\n\n constructor(\n insertionPoint: HTMLElement,\n maxRulesPerPartition: number = 50,\n styleIdPrefix: string = \"barocss-style-partition-\",\n getCategory: (cls: string) => string | undefined = cls => parseClassName(cls).utility?.category,\n nonce: string = \"\"\n ) {\n this.nonce = nonce;\n this.insertionPoint = insertionPoint;\n this.maxRulesPerPartition = maxRulesPerPartition;\n this.styleIdPrefix = styleIdPrefix;\n this.getCategory = getCategory;\n\n this.initializeDefaultPartition();\n }\n\n /** A new `<style>`, carrying the #347 CSP nonce when one is configured. */\n private createStyleElement(): HTMLStyleElement {\n const el = document.createElement(\"style\");\n if (this.nonce) el.setAttribute(\"nonce\", this.nonce);\n return el;\n }\n\n private initializeDefaultPartition() {\n this.createNewPartition();\n }\n\n private createNewCategoryPartition(category: string, atDocumentStart = false) {\n const newPartition: StylePartition = {\n id: this.styleIdPrefix + `-${category}`,\n styles: [],\n styleElement: this.createStyleElement(),\n };\n\n // set id\n newPartition.styleElement.id = newPartition.id;\n newPartition.styleElement.setAttribute(\"data-barocss\", \"partition\");\n newPartition.styleElement.setAttribute(\"data-category\", category);\n\n // set insertion point\n const head = this.insertionPoint.ownerDocument?.head;\n if (atDocumentStart && head) {\n // Layered base styles (preflight) must be the first stylesheet so their\n // cascade layer is declared before any app layer (e.g. Tailwind `base`).\n head.insertBefore(newPartition.styleElement, head.firstChild);\n } else {\n this.insertionPoint.appendChild(newPartition.styleElement);\n }\n\n this.categoryPartitions.set(category, newPartition);\n\n return newPartition;\n }\n\n private createNewPartition() {\n const newPartition: StylePartition = {\n id: this.styleIdPrefix + `-${this.partitionCounter++}`,\n styles: [],\n styleElement: this.createStyleElement(),\n };\n this.partitions.push(newPartition);\n\n // set id\n newPartition.styleElement.id = newPartition.id;\n newPartition.styleElement.setAttribute(\"data-barocss\", \"partition\");\n newPartition.styleElement.setAttribute(\n \"data-partition-index\",\n this.partitionCounter.toString()\n );\n\n // set insertion point\n this.insertionPoint.appendChild(newPartition.styleElement);\n\n return newPartition;\n }\n\n hasRule(rule: string) {\n return this.classToPartitionMap.has(rule);\n }\n\n hasCategoryRule(rule: string, category: string) {\n return this.classToCategoryPartitionMap.get(rule) === category;\n }\n\n setRuleCache(rule: string, partitionIndex: number) {\n this.classToPartitionMap.set(rule, partitionIndex);\n }\n\n setCategoryRuleCache(rule: string, category: string) {\n this.classToCategoryPartitionMap.set(rule, category);\n }\n\n get currentPartition() {\n return this.partitions[this.partitions.length - 1];\n }\n\n getCategoryPartition(category: string) {\n return this.categoryPartitions.get(category);\n }\n\n hasDetachedPartitions(): boolean {\n return [...this.partitions, ...this.categoryPartitions.values()]\n .some(partition => !partition.styleElement.isConnected);\n }\n\n /**\n * Escape CSS rule text\n * - Properly escape special characters\n * - Prevent CSS syntax errors\n */\n private escapeCssRule(rule: string): string {\n // Basic CSS string normalization\n const escaped = rule.replace(/\\\\\\//g, '\\\\/');\n\n return escaped;\n }\n\n addRule(rule: string) {\n if (this.hasRule(rule)) {\n return false;\n }\n\n const key = ruleSortKey(rule);\n // Earliest partition holding a rule that must come after this one; the\n // chunks are consecutive <style> elements, so this keeps global order.\n let partitionIndex = this.partitions.findIndex(p => {\n const keys = p.keys;\n return !!keys && keys.length > 0 && compareKeys(keys[keys.length - 1], key) > 0;\n });\n if (partitionIndex === -1) {\n if (this.currentPartition.styles.length >= this.maxRulesPerPartition) {\n this.createNewPartition();\n }\n partitionIndex = this.partitions.length - 1;\n }\n const partition = this.partitions[partitionIndex];\n\n try {\n this.insertSorted(partition, rule, key);\n this.setRuleCache(rule, partitionIndex);\n return true;\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule: ${rule}`,\n error\n );\n return false;\n }\n }\n\n addCategoryRule(rule: string, category: string) {\n if (this.hasCategoryRule(rule, category)) {\n return false;\n }\n\n let categoryPartition = this.getCategoryPartition(category);\n if (!categoryPartition) {\n categoryPartition = this.createNewCategoryPartition(category);\n }\n\n try {\n this.insertSorted(categoryPartition, rule, ruleSortKey(rule));\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule in category: ${category} ${rule}`,\n error\n );\n return false;\n }\n\n this.setCategoryRuleCache(rule, category);\n\n return true;\n }\n \n addRootRules(rules: string[]) {\n let categoryPartition = this.getCategoryPartition(\"root\");\n if (!categoryPartition) {\n categoryPartition = this.createNewCategoryPartition(\"root\");\n } \n\n try {\n\n const sheet = categoryPartition.styleElement.sheet;\n\n for (const rule of rules) {\n if (sheet) {\n sheet.insertRule(this.escapeCssRule(rule), sheet.cssRules.length);\n } else {\n categoryPartition.styleElement.textContent += rule + \"\\n\";\n }\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(\n `[StylePartitionManager] Failed to insert rule in category: root ${rules.join(\"\\n\")}`,\n error\n );\n return { success: 0, failed: rules.length };\n }\n\n return { success: rules.length, failed: 0 };\n }\n\n addRules(rules: GenerateCssRulesResult[]) {\n let success = 0;\n let failed = 0;\n\n for (const rule of rules) {\n const category = this.getCategory(rule.cls);\n\n if (category) {\n for (const css of rule.cssList) {\n this.addCategoryRule(css, category);\n }\n } else {\n for (const css of rule.cssList) {\n if (this.addRule(css)) {\n success++;\n } else {\n failed++;\n }\n }\n }\n }\n\n return { success, failed };\n }\n\n /**\n * Remove one generated rule (#269 GC). Keeps `styles`, the #254 `keys` and the\n * sheet's cssRules parallel: one deleteRule at the rule's index, or a text\n * rebuild when the sheet isn't solely ours / has no CSSOM. Returns whether\n * the rule was found.\n */\n removeRule(rule: string, category?: string): boolean {\n let partition: StylePartition | undefined;\n if (category) {\n if (this.classToCategoryPartitionMap.get(rule) !== category) return false;\n partition = this.categoryPartitions.get(category);\n } else {\n const partitionIndex = this.classToPartitionMap.get(rule);\n partition = partitionIndex === undefined ? undefined : this.partitions[partitionIndex];\n }\n if (!partition) return false;\n const index = partition.styles.indexOf(rule);\n if (index === -1) return false;\n const sheet = partition.styleElement.sheet;\n const inSync = !!sheet && sheet.cssRules.length === partition.styles.length;\n partition.styles.splice(index, 1);\n partition.keys?.splice(index, 1);\n if (inSync && sheet) {\n sheet.deleteRule(index);\n } else {\n partition.styleElement.textContent = partition.styles.length ? partition.styles.join(\"\\n\") + \"\\n\" : \"\";\n }\n if (category) this.classToCategoryPartitionMap.delete(rule);\n else this.classToPartitionMap.delete(rule);\n return true;\n }\n\n /** Number of generated (non-root, non-preflight) rules currently held. */\n get ruleCount(): number {\n return this.classToPartitionMap.size + this.classToCategoryPartitionMap.size;\n }\n\n /**\n * 특정 규칙이 어느 파티션에 있는지 찾기\n */\n findRulePartition(rule: string): StylePartition | null {\n const partitionIndex = this.classToPartitionMap.get(rule);\n if (partitionIndex !== undefined && this.partitions[partitionIndex]) {\n return this.partitions[partitionIndex];\n }\n\n const categoryPartition = this.classToCategoryPartitionMap.get(rule);\n if (categoryPartition !== undefined) {\n return this.categoryPartitions.get(categoryPartition) || null;\n }\n\n return null;\n }\n\n\n updateRuleContent(category: string, ruleContent: string, atDocumentStart = false) {\n const partition = this.getCategoryPartition(category);\n if (partition) {\n partition.styleElement.textContent = ruleContent;\n } else {\n const newPartition = this.createNewCategoryPartition(category, atDocumentStart);\n // eslint-disable-next-line no-console\n if (isDebug()) console.log(`[StylePartitionManager] Created new partition for category: ${category}`);\n newPartition.styleElement.textContent = ruleContent;\n }\n }\n\n /**\n * 모든 파티션 정리\n */\n cleanup(): void {\n // DOM에서 모든 스타일 엘리먼트 제거\n this.partitions.forEach((partition) => {\n if (partition.styleElement.parentNode) {\n partition.styleElement.parentNode.removeChild(partition.styleElement);\n }\n });\n\n this.categoryPartitions.forEach((partition) => {\n if (partition.styleElement.parentNode) {\n partition.styleElement.parentNode.removeChild(partition.styleElement);\n }\n });\n\n // 상태 초기화\n this.partitions = [];\n this.categoryPartitions.clear();\n this.partitionCounter = 0;\n this.classToPartitionMap.clear();\n this.classToCategoryPartitionMap.clear();\n }\n}\n","// #335: class lists split on ASCII whitespace only, as HTML classList and Tailwind's candidate scanner do;\n// a non-ASCII space (U+00A0, U+3000, ...) is part of a token, which then matches no utility.\nconst CLASS_SEPARATOR = /[ \\t\\n\\f\\r]+/;\n\nexport function normalizeClassName(className: any): string {\n if (!className) return '';\n \n if (typeof className === 'object' && typeof className.baseVal === 'string') {\n return className.baseVal;\n }\n \n return className.toString();\n }\n \nexport function normalizeClassNameList(className: any): string[] {\n if (!className) return [];\n return normalizeClassName(className).split(CLASS_SEPARATOR).filter(Boolean);\n}\n","import { IncrementalParser, parseClassName } from \"@barocss/kit\";\nimport { BrowserRuntime } from \"./browser-runtime\";\nimport { normalizeClassNameList } from \"./utils\";\nimport type { ClassGc } from \"./class-gc\";\n\n/**\n * Change detection system for DOM mutations\n * \n * ⚠️ BROWSER-ONLY: This class is designed for browser environments only.\n * It uses MutationObserver and DOM APIs that are not available in Node.js.\n * \n * This class monitors DOM changes and automatically processes new CSS classes\n * that are added to elements. It uses MutationObserver to detect:\n * - Class attribute changes on existing elements\n * - New elements being added to the DOM\n * - Changes in child elements\n * \n * For server-side usage, use IncrementalParser directly with processClassesSync()\n * or processClasses() methods.\n */\nexport class ChangeDetector {\n /** MutationObserver instance for DOM change detection */\n private observer: MutationObserver | null = null;\n \n /** Reference to IncrementalParser for class processing */\n private incrementalParser: IncrementalParser;\n \n /** Reference to BrowserRuntime for CSS injection (optional) */\n private BrowserRuntime?: BrowserRuntime;\n private getCategory: (cls: string) => string | undefined;\n \n /**\n * Create a new ChangeDetector instance\n * \n * @param incrementalParser - IncrementalParser instance for class processing\n * @param BrowserRuntime - Optional BrowserRuntime instance for CSS injection\n */\n constructor(incrementalParser: IncrementalParser, BrowserRuntime?: BrowserRuntime, getCategory: (cls: string) => string | undefined = cls => parseClassName(cls).utility?.category) {\n this.incrementalParser = incrementalParser;\n this.BrowserRuntime = BrowserRuntime;\n this.getCategory = getCategory;\n }\n\n /** #269: refcount/GC tracker, when the runtime has GC enabled. */\n private gc: ClassGc | null = null;\n\n setGc(gc: ClassGc | null): void {\n this.gc = gc;\n }\n\n setParser(parser: IncrementalParser): void {\n this.incrementalParser = parser;\n }\n \n /**\n * Starts observing DOM changes for new CSS classes\n * \n * This method sets up a MutationObserver that monitors:\n * - Attribute changes (specifically class attribute modifications)\n * - Child list changes (new elements being added)\n * - Subtree changes (changes in descendant elements)\n * \n * The observer automatically processes any new classes it discovers\n * by adding them to the IncrementalParser's pending queue.\n * \n * @param root - The root element to observe (defaults to document.body)\n * @param options - Configuration options including initial scan and onReady callback\n * @returns The MutationObserver instance for external control\n */\n observe(root: HTMLElement | ShadowRoot = document.body, options?: { scan?: boolean; onReady?: () => void }): MutationObserver {\n if (typeof window === 'undefined') {\n // Return dummy observer for Node.js environment\n return new MutationObserver(() => {});\n }\n \n if (this.observer) {\n this.observer.disconnect();\n }\n \n this.gc?.setRoot(root);\n\n this.observer = new MutationObserver((mutations) => {\n const newClasses = new Set<string>();\n const gc = this.gc;\n\n mutations.forEach(mutation => {\n if (gc) {\n if (mutation.type === 'attributes') {\n gc.reconcile(mutation.target as Element);\n } else if (mutation.type === 'childList') {\n mutation.removedNodes.forEach(node => gc.reconcileTree(node));\n mutation.addedNodes.forEach(node => gc.reconcileTree(node));\n }\n }\n // Handle attribute changes (class modifications)\n if (mutation.type === 'attributes' && mutation.attributeName === 'class' && root.contains(mutation.target)) {\n const target = mutation.target as HTMLElement;\n if (target.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(target.className);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n newClasses.add(cls);\n }\n });\n }\n }\n \n // Handle new nodes\n if (mutation.type === 'childList') {\n mutation.addedNodes.forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE && root.contains(node)) {\n const element = node as Element;\n this.processElement(element, newClasses);\n // Process child elements\n element.querySelectorAll('[class]').forEach(el => {\n this.processElement(el, newClasses);\n });\n }\n });\n }\n });\n \n // Process new classes in batch\n if (newClasses.size > 0) {\n const classesArray = Array.from(newClasses);\n \n // Process classes directly and update BrowserRuntime cache\n const results = this.incrementalParser.processClasses(classesArray);\n // If BrowserRuntime is available, apply results via public API\n this.BrowserRuntime?.applyParseResults(results);\n } else {\n this.BrowserRuntime?.applyParseResults([]);\n }\n gc?.afterBatch();\n });\n \n this.observer.observe(root, {\n attributes: true,\n subtree: true,\n attributeFilter: ['class'],\n childList: true\n });\n \n // Handle scan option - process existing classes\n if (options?.scan) {\n this.scanExistingClasses(root, options);\n }\n \n return this.observer;\n }\n \n /**\n * Scan existing classes in the DOM and process them\n */\n private scanExistingClasses(root: HTMLElement | ShadowRoot, options?: { onReady?: () => void }): void {\n const existingClasses = new Set<string>();\n \n // Include root itself\n const rootClass = (root as HTMLElement).className;\n if (rootClass) {\n const classes = normalizeClassNameList(rootClass);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n existingClasses.add(cls);\n }\n });\n }\n \n // Scan all child elements\n const elementsWithClass = root.querySelectorAll('[class]') as unknown as HTMLElement[];\n // console.log('[BrowserRuntime] scanExistingClasses', elementsWithClass);\n for (const el of elementsWithClass) {\n if (el.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(el.className);\n // console.log('[BrowserRuntime] scanExistingClasses', classes);\n \n for (const cls of classes) {\n if (!this.incrementalParser.isProcessed(cls)) {\n existingClasses.add(cls);\n }\n };\n }\n }\n \n // console.log('[BrowserRuntime] scanExistingClasses', existingClasses);\n \n if (existingClasses.size > 0) {\n // Process classes using IncrementalParser\n const classes = Array.from(existingClasses);\n const results = this.incrementalParser.processClasses(classes);\n \n const layoutResults = results.filter(result => this.getCategory(result.cls) === 'layout');\n const nonLayoutResults = results.filter(result => this.getCategory(result.cls) !== 'layout');\n \n \n // Apply layout results\n this.BrowserRuntime?.applyParseResults(layoutResults);\n options?.onReady?.();\n \n // Apply non-layout results\n this.BrowserRuntime?.applyParseResults(nonLayoutResults);\n } else {\n options?.onReady?.();\n }\n }\n \n /**\n * Processes an individual element and extracts new classes\n * \n * This method is called for each element discovered during DOM mutations.\n * It:\n * - Extracts all class names from the element's className\n * - Filters out already processed classes\n * - Adds new classes to the collection for batch processing\n * \n * @param element - The HTML element to process\n * @param newClasses - Set to collect newly discovered class names\n */\n private processElement(element: Element, newClasses: Set<string>): void {\n if (element.className) {\n // SVG className is SVGAnimatedString; convert to string with toString()\n // HTMLElement className is string; use as-is\n const classes = normalizeClassNameList(element.className);\n classes.forEach(cls => {\n if (!this.incrementalParser.isProcessed(cls)) {\n newClasses.add(cls);\n }\n });\n }\n \n }\n \n /**\n * Stops observing DOM changes and cleans up resources\n * \n * This method disconnects the MutationObserver and clears the\n * observer reference to prevent memory leaks and allow the\n * ChangeDetector to be properly garbage collected.\n */\n disconnect(): void {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n }\n }\n","/** #210 internal helpers (not re-exported from index.ts). */\n/** Unescape a CSS identifier (`\\:` -> `:`, `\\31 ` -> `1`). */\nexport function unescapeCssIdent(s: string): string {\n return s.replace(/\\\\([0-9a-fA-F]{1,6})\\s?|\\\\(.)/g, (_m, hex, ch) => (hex ? String.fromCodePoint(parseInt(hex, 16)) : ch));\n}\n\n// `:where(.divide-y > ...)` / `:is(.x ...)` count too: Tailwind 4 and BaroCSS emit divide/space rules that way (#268).\nconst LEADING_CLASS = /^\\s*(?::(?:where|is)\\(\\s*)?\\.((?:\\\\[0-9a-fA-F]{1,6}\\s?|\\\\.|[\\w-]|[^\\x00-\\x7F])+)/;\n\nexport function splitTopLevel(sel: string): string[] {\n const parts: string[] = []; let depth = 0, start = 0;\n for (let i = 0; i < sel.length; i++) {\n const c = sel[i];\n if (c === '\\\\') i++;\n else if (c === '(' || c === '[') depth++;\n else if (c === ')' || c === ']') depth--;\n else if (c === ',' && depth === 0) { parts.push(sel.slice(start, i)); start = i + 1; }\n }\n parts.push(sel.slice(start));\n return parts;\n}\n\n/** #274: `@keyframes` names defined in the given rules (walks grouping rules). */\nexport function collectKeyframeNames(rules: CSSRuleList | CSSRule[], out: Set<string> = new Set()): Set<string> {\n for (const rule of Array.from(rules)) {\n if ((rule as CSSKeyframesRule).type === 7 && typeof (rule as CSSKeyframesRule).name === 'string') {\n out.add((rule as CSSKeyframesRule).name);\n continue;\n }\n const inner = (rule as CSSGroupingRule).cssRules;\n if (inner && inner.length) collectKeyframeNames(inner, out);\n }\n return out;\n}\n\n/** Classes that lead a selector in the given rules (walks grouping rules such as @layer/@media/@supports). */\nexport function collectLeadingClasses(rules: CSSRuleList | CSSRule[], out: Set<string> = new Set()): Set<string> {\n for (const rule of Array.from(rules)) {\n const selectorText = (rule as CSSStyleRule).selectorText;\n if (typeof selectorText === 'string') {\n for (const part of splitTopLevel(selectorText)) {\n const m = LEADING_CLASS.exec(part);\n if (m) out.add(unescapeCssIdent(m[1]));\n }\n }\n const inner = (rule as CSSGroupingRule).cssRules;\n if (inner && inner.length) collectLeadingClasses(inner, out);\n }\n return out;\n}\n","import { normalizeClassNameList } from \"./utils\";\n\n/**\n * #269: per-class refcount over the observed root, plus a delayed sweep that\n * reclaims classes no live element carries any more.\n *\n * Counting is reconciliation, not delta arithmetic: for every element a\n * mutation batch touches (attribute target, added subtree, removed subtree) we\n * compare the classes we last counted for it with what it carries *now*\n * (nothing if it is no longer inside the root). That makes the count\n * independent of record order, so remove-then-re-add in one batch, moves\n * between parents and edits made while detached all settle to the true state.\n * An element we miss can only leak a count (rule kept), never drop one.\n *\n * Before a class is reclaimed the sweep re-checks the live DOM\n * (`getElementsByClassName`), so even a miscount cannot unstyle a live element.\n */\nexport interface ClassGcHost {\n /** Delete the rules of these classes. */\n reclaim(classes: string[]): void;\n /** Whether a class must never be reclaimed (pinned, found in a pre-existing sheet, ...). */\n isPermanent(cls: string): boolean;\n /** Number of generated rules/classes currently cached (for the LRU cap). */\n cachedCount(): number;\n}\n\nexport class ClassGc {\n private counts = new Map<string, number>();\n private counted = new WeakMap<Element, string[]>();\n /** class -> time its count reached 0 (insertion order = oldest first). */\n private candidates = new Map<string, number>();\n private timer: ReturnType<typeof setTimeout> | null = null;\n private root: Element | ShadowRoot | null = null;\n\n constructor(\n private host: ClassGcHost,\n private graceMs: number,\n private maxRules: number,\n private now: () => number = () => Date.now(),\n ) {}\n\n /** Start counting for a new root: count every element currently inside it. */\n setRoot(root: Element | ShadowRoot): void {\n this.counts.clear();\n this.counted = new WeakMap();\n this.candidates.clear();\n this.cancel();\n this.root = root;\n if (root.nodeType === 1) this.reconcileTree(root);\n else root.querySelectorAll('[class]').forEach(child => this.reconcile(child));\n }\n\n count(cls: string): number {\n return this.counts.get(cls) ?? 0;\n }\n\n /** Re-count `el` and (optionally) all its descendants from their current state. */\n reconcileTree(node: Node): void {\n if (node.nodeType !== 1) return;\n const el = node as Element;\n this.reconcile(el);\n el.querySelectorAll('[class]').forEach(child => this.reconcile(child));\n }\n\n reconcile(el: Element): void {\n const root = this.root;\n const live = !!root && root.contains(el);\n const next = live ? Array.from(new Set(normalizeClassNameList(el.getAttribute('class')))) : [];\n const prev = this.counted.get(el);\n if (!prev && next.length === 0) return;\n const prevSet = new Set(prev ?? []);\n const nextSet = new Set(next);\n for (const cls of nextSet) {\n if (prevSet.has(cls)) continue;\n const c = (this.counts.get(cls) ?? 0) + 1;\n this.counts.set(cls, c);\n this.candidates.delete(cls);\n }\n for (const cls of prevSet) {\n if (nextSet.has(cls)) continue;\n const c = (this.counts.get(cls) ?? 0) - 1;\n if (c > 0) {\n this.counts.set(cls, c);\n } else {\n this.counts.delete(cls);\n this.candidates.delete(cls); // re-insert so order stays oldest-first\n this.candidates.set(cls, this.now());\n }\n }\n if (next.length) this.counted.set(el, next);\n else this.counted.delete(el);\n }\n\n /** Call after a mutation batch has been counted and its classes inserted. */\n afterBatch(): void {\n if (this.candidates.size === 0) return;\n if (this.host.cachedCount() > this.maxRules) {\n this.schedule(0);\n } else {\n this.schedule(this.graceMs);\n }\n }\n\n private schedule(delay: number): void {\n if (this.timer !== null) {\n if (delay > 0) return;\n clearTimeout(this.timer);\n }\n this.timer = setTimeout(() => {\n this.timer = null;\n this.sweep();\n }, delay);\n }\n\n /** Reclaim candidates whose grace period elapsed (plus LRU overflow). Public for tests. */\n sweep(): void {\n const now = this.now();\n const overflow = Math.max(0, this.host.cachedCount() - this.maxRules);\n const doomed: string[] = [];\n let evicted = 0;\n for (const [cls, since] of this.candidates) {\n const expired = now - since >= this.graceMs;\n if (!expired && evicted >= overflow) continue;\n this.candidates.delete(cls);\n if (this.count(cls) > 0 || this.inDom(cls) || this.host.isPermanent(cls)) continue;\n doomed.push(cls);\n if (!expired) evicted++;\n }\n if (doomed.length) this.host.reclaim(doomed);\n if (this.candidates.size) this.schedule(this.graceMs);\n }\n\n private inDom(cls: string): boolean {\n const root = this.root;\n if (!root) return false;\n // #327: a shadow root: only its own tree can use its rules.\n if (root.nodeType !== 1) return Array.from(root.querySelectorAll('[class]')).some(el => el.classList.contains(cls));\n // Document-wide: an element outside the observed root (portal, <html class>) may share the class.\n const doc = root.ownerDocument ?? document;\n return (root as Element).classList.contains(cls)\n || doc.documentElement.classList.contains(cls)\n || doc.getElementsByClassName(cls).length > 0;\n }\n\n cancel(): void {\n if (this.timer !== null) clearTimeout(this.timer);\n this.timer = null;\n }\n\n stats() {\n return { trackedClasses: this.counts.size, candidates: this.candidates.size };\n }\n}\n","import { IncrementalParser, createContext, parseClassName, isDebug } from \"@barocss/kit\";\nimport type { Config, Context, GenerateCssRulesResult } from \"@barocss/kit\";\nimport { ruleSortKey, upperBound, type RuleKey } from \"./rule-order\";\n\n/**\n * #327: Shadow DOM support. Every `BrowserRuntime({ root: shadowRoot })` with the same config shares one\n * {@link SharedRootSheet}: one generation per class, one constructable rules sheet (plus one prologue sheet with the\n * scoped preflight and theme variables) adopted by every root. Without constructable sheets, each root gets two\n * `<style>` elements that mirror the same rule list.\n */\n\n/**\n * #327: rewrite preflight for a shadow root. `html`/`:root` selectors become `:host`; `body` rules are removed and\n * their declarations (minus the page-level `min-height`/`scroll-behavior`) are re-emitted last on `:host`, so the\n * widget's top element gets the same inherited typography a page body would (body came after html in the document).\n */\nexport function scopePreflightForShadowRoot(css: string): string {\n const bodyDecls: string[] = [];\n let out = css.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n out = out.replace(/(?<=^|[{};])(\\s*)([^{};@\\s][^{};]*?)\\{([^{}]*)\\}/g, (_m, ws: string, prelude: string, block: string) => {\n const sels = prelude.split(',').map(s => s.trim()).filter(Boolean);\n if (sels.includes('body')) {\n for (const decl of block.split(';').map(d => d.trim()).filter(Boolean)) {\n if (!/^(min-height|scroll-behavior)\\s*:/.test(decl)) bodyDecls.push(decl);\n }\n }\n const mapped = Array.from(new Set(sels.filter(s => s !== 'body').map(s => (s === 'html' || s === ':root' ? ':host' : s))));\n if (mapped.length === 0) return '';\n return `${ws}${mapped.join(', ')} {${block}}`;\n });\n if (bodyDecls.length) out += `\\n@layer base {\\n:host {\\n ${bodyDecls.join(';\\n ')};\\n}\\n}\\n`;\n return out;\n}\n\nfunction stableKey(config: Config): string {\n return JSON.stringify(config, (_k, v) => (typeof v === 'function' ? `fn:${String(v)}` : v instanceof RegExp ? `re:${v}` : v)) ?? '';\n}\n\n/** A cheap string hash (FNV-1a), for readable registry keys. */\nfunction hash(text: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < text.length; i++) { h ^= text.charCodeAt(i); h = Math.imul(h, 0x01000193); }\n return (h >>> 0).toString(36);\n}\n\n/** Whether constructable sheets can be adopted by a shadow root (#327) or, with `'document'`, by the document (#347). */\nexport function canConstruct(target: 'shadow' | 'document' = 'shadow'): boolean {\n try {\n const proto = target === 'document'\n ? (typeof Document !== 'undefined' ? Document.prototype : undefined)\n : (typeof ShadowRoot !== 'undefined' ? ShadowRoot.prototype : undefined);\n return !!proto && 'adoptedStyleSheets' in proto\n && typeof CSSStyleSheet === 'function' && typeof new CSSStyleSheet().replaceSync === 'function';\n } catch { return false; }\n}\n\nconst escapeCssRule = (rule: string) => rule.replace(/\\\\\\//g, '\\\\/');\n\ninterface Segment { rules: string[]; keys: RuleKey[] }\ntype SheetRoot = ShadowRoot | Document;\ninterface Attached { root: SheetRoot; styles?: [HTMLStyleElement, HTMLStyleElement] }\n\nexport class SharedRootSheet {\n /** Readable label (hash of the config); not used for identity. */\n readonly key: string;\n /** The full config key the registry uses. */\n readonly fullKey: string;\n readonly context: Context;\n readonly results = new Map<string, GenerateCssRulesResult>();\n /** Number of classes actually generated (not served from `results`). */\n generations = 0;\n readonly constructable: boolean;\n private prologueSheet: CSSStyleSheet | null = null;\n private rulesSheet: CSSStyleSheet | null = null;\n private prologue = { preflight: '', vars: '' };\n /** Ordered: root (@property/@keyframes), uncategorised, then categories by first use (like the document partitions). */\n private segments = new Map<string, Segment>([['root', { rules: [], keys: [] }], ['', { rules: [], keys: [] }]]);\n /** rule text -> number of roots that use it. */\n private refs = new Map<string, number>();\n private attached: Attached[] = [];\n\n constructor(key: string, config: Config, fullKey: string = key, opts: { context?: Context; target?: 'shadow' | 'document' } = {}) {\n this.key = key;\n this.fullKey = fullKey;\n this.context = opts.context ?? createContext(config);\n this.constructable = canConstruct(opts.target ?? 'shadow');\n if (this.constructable) {\n this.prologueSheet = new CSSStyleSheet();\n this.rulesSheet = new CSSStyleSheet();\n }\n }\n\n get rootCount(): number { return this.attached.length; }\n get ruleCount(): number { return this.refs.size; }\n\n /** Adopt the sheets into `root`; without constructable sheets a shadow root gets two `<style>`s (carrying `nonce`, #347). */\n attach(root: SheetRoot, nonce = ''): void {\n if (this.attached.some(a => a.root === root)) return;\n if (this.prologueSheet && this.rulesSheet) {\n const own = [this.prologueSheet, this.rulesSheet];\n root.adoptedStyleSheets = [...root.adoptedStyleSheets.filter(s => !own.includes(s)), ...own];\n this.attached.push({ root });\n return;\n }\n if (root.nodeType !== 11) throw new Error('[BrowserRuntime] constructable sheets are not supported for the document');\n const doc = (root as ShadowRoot).ownerDocument ?? document;\n const pro = doc.createElement('style'), rules = doc.createElement('style');\n if (nonce) { pro.setAttribute('nonce', nonce); rules.setAttribute('nonce', nonce); }\n pro.setAttribute('data-barocss', 'root-prologue');\n rules.setAttribute('data-barocss', 'root');\n pro.textContent = this.prologueText();\n rules.textContent = this.allRules().join('\\n');\n root.insertBefore(rules, root.firstChild);\n root.insertBefore(pro, rules);\n this.attached.push({ root, styles: [pro, rules] });\n }\n\n detach(root: SheetRoot): void {\n const i = this.attached.findIndex(a => a.root === root);\n if (i === -1) return;\n const [a] = this.attached.splice(i, 1);\n if (a.styles) a.styles.forEach(s => s.remove());\n else if (root.adoptedStyleSheets) root.adoptedStyleSheets = root.adoptedStyleSheets.filter(s => s !== this.prologueSheet && s !== this.rulesSheet);\n }\n\n setPrologue(part: 'preflight' | 'vars', css: string): void {\n if (this.prologue[part] === css) return;\n this.prologue[part] = css;\n const text = this.prologueText();\n if (this.prologueSheet) this.prologueSheet.replaceSync(text);\n for (const a of this.attached) if (a.styles) a.styles[0].textContent = text;\n }\n\n private prologueText(): string {\n return [this.prologue.preflight, this.prologue.vars].filter(Boolean).join('\\n');\n }\n\n private allRules(): string[] {\n return Array.from(this.segments.values()).flatMap(s => s.rules);\n }\n\n private offset(segment: Segment): number {\n let n = 0;\n for (const s of this.segments.values()) { if (s === segment) return n; n += s.rules.length; }\n return n;\n }\n\n /** Take a reference on `rule`; inserts it (sorted, #254) when this is the first root to use it. */\n retain(rule: string, segmentName: string): boolean {\n const count = this.refs.get(rule);\n if (count !== undefined) { this.refs.set(rule, count + 1); return true; }\n let seg = this.segments.get(segmentName);\n if (!seg) { seg = { rules: [], keys: [] }; this.segments.set(segmentName, seg); }\n const isRoot = segmentName === 'root';\n const key = ruleSortKey(rule);\n const local = isRoot ? seg.rules.length : upperBound(seg.keys, key);\n const index = this.offset(seg) + local;\n try {\n this.insertAt(rule, index);\n } catch (error) {\n // eslint-disable-next-line no-console\n if (isDebug()) console.warn(`[BrowserRuntime] Failed to insert rule into shadow root sheet: ${rule}`, error);\n return false;\n }\n seg.rules.splice(local, 0, rule);\n seg.keys.splice(local, 0, key);\n this.refs.set(rule, 1);\n return true;\n }\n\n /** Drop a reference on `rule`; deletes it only when no root uses it any more (#269 across roots). */\n release(rule: string): void {\n const count = this.refs.get(rule);\n if (count === undefined) return;\n if (count > 1) { this.refs.set(rule, count - 1); return; }\n this.refs.delete(rule);\n for (const seg of this.segments.values()) {\n const local = seg.rules.indexOf(rule);\n if (local === -1) continue;\n const index = this.offset(seg) + local;\n seg.rules.splice(local, 1);\n seg.keys.splice(local, 1);\n this.deleteAt(index);\n return;\n }\n }\n\n private insertAt(rule: string, index: number): void {\n const css = escapeCssRule(rule);\n if (this.rulesSheet) { this.rulesSheet.insertRule(css, index); return; }\n const total = this.allRules().length;\n for (const a of this.attached) {\n const el = a.styles![1], sheet = el.sheet;\n if (sheet && sheet.cssRules.length === total) sheet.insertRule(css, index);\n else { const list = this.allRules(); list.splice(index, 0, rule); el.textContent = list.join('\\n'); }\n }\n }\n\n private deleteAt(index: number): void {\n if (this.rulesSheet) { this.rulesSheet.deleteRule(index); return; }\n const total = this.allRules().length; // already spliced\n for (const a of this.attached) {\n const el = a.styles![1], sheet = el.sheet;\n if (sheet && sheet.cssRules.length === total + 1) sheet.deleteRule(index);\n else el.textContent = this.allRules().join('\\n');\n }\n }\n\n /** The CSS text all roots currently share (prologue then rules). */\n cssText(): string {\n return [this.prologueText(), ...this.allRules()].join('\\n');\n }\n}\n\nconst registry = new Map<string, SharedRootSheet>();\n\n/** #327: the shared sheet for `config` (keyed by a config hash, so equal configs and prefixes share). */\nexport function acquireSharedRootSheet(config: Config, label: (text: string) => string = hash): SharedRootSheet {\n // Keyed by the full config text (a hash alone could collide and let one tenant's config style another's widget).\n const full = stableKey(config);\n let entry = registry.get(full);\n if (!entry) { entry = new SharedRootSheet(label(full), config, full); registry.set(full, entry); }\n return entry;\n}\n\nexport function releaseIfUnused(entry: SharedRootSheet): void {\n if (entry.rootCount === 0 && registry.get(entry.fullKey) === entry) registry.delete(entry.fullKey);\n}\n\n/** #327: diagnostics for the shared shadow-root sheets (one per distinct config). */\nexport function getSharedRootSheetStats(): Array<{ key: string; roots: number; rules: number; generations: number; constructable: boolean }> {\n return Array.from(registry.values(), e => ({ key: e.key, roots: e.rootCount, rules: e.ruleCount, generations: e.generations, constructable: e.constructable }));\n}\n\n/** An IncrementalParser whose generated results are shared by every root on the same {@link SharedRootSheet}. */\nexport class SharedIncrementalParser extends IncrementalParser {\n constructor(readonly shared: SharedRootSheet) { super(shared.context); }\n processClass(className: string): GenerateCssRulesResult | null {\n if (this.isProcessed(className)) return null;\n const cached = this.shared.results.get(className);\n if (cached) { this.markProcessed(className); return cached; }\n const result = super.processClass(className);\n if (result) { this.shared.results.set(className, result); this.shared.generations++; }\n return result;\n }\n}\n\n/**\n * The per-root view of a shared sheet, with the subset of the StylePartitionManager API BrowserRuntime uses.\n * It holds one reference per rule this root uses.\n */\nexport class ShadowRootStyles {\n private owned = new Set<string>();\n private scopePreflight: boolean;\n constructor(\n readonly shared: SharedRootSheet,\n private root: SheetRoot,\n private getCategory: (cls: string) => string | undefined = cls => parseClassName(cls).utility?.category,\n opts: { nonce?: string } = {},\n ) {\n // #347: in the document mode (constructable) the preflight stays as written (html/:root/body).\n this.scopePreflight = root.nodeType === 11;\n shared.attach(root, opts.nonce);\n }\n\n hasDetachedPartitions(): boolean { return false; }\n\n updateRuleContent(category: string, ruleContent: string): void {\n if (category === 'preflight') this.shared.setPrologue('preflight', this.scopePreflight ? scopePreflightForShadowRoot(ruleContent) : ruleContent);\n else if (category === 'css-vars') this.shared.setPrologue('vars', ruleContent);\n }\n\n private take(rule: string, segment: string): boolean {\n if (this.owned.has(rule)) return false;\n if (!this.shared.retain(rule, segment)) return false;\n this.owned.add(rule);\n return true;\n }\n\n addRule(rule: string): boolean { return this.take(rule, ''); }\n addCategoryRule(rule: string, category: string): boolean { return this.take(rule, `c:${category}`); }\n\n addRootRules(rules: string[]) {\n let success = 0;\n for (const rule of rules) if (this.take(rule, 'root')) success++;\n return { success, failed: rules.length - success };\n }\n\n addRules(rules: GenerateCssRulesResult[]) {\n let success = 0, failed = 0;\n for (const result of rules) {\n const category = this.getCategory(result.cls);\n for (const css of result.cssList) {\n if (category ? this.addCategoryRule(css, category) : this.addRule(css)) success++; else failed++;\n }\n }\n return { success, failed };\n }\n\n removeRule(rule: string, _category?: string): boolean {\n if (!this.owned.delete(rule)) return false;\n this.shared.release(rule);\n return true;\n }\n\n get ruleCount(): number { return this.owned.size; }\n\n /** Release every rule this root holds and stop adopting the shared sheet. */\n cleanup(): void {\n this.owned.forEach(rule => this.shared.release(rule));\n this.owned.clear();\n this.shared.detach(this.root);\n releaseIfUnused(this.shared);\n }\n}\n","import { GenerateCssRulesResult } from '@barocss/kit';\nimport { createContext, clearAstCache, IncrementalParser, parseClassName, isDebug } from '@barocss/kit';\nimport type { Config, Context } from '@barocss/kit';\nimport { StylePartitionManager } from './style-partition-manager';\nimport { ChangeDetector } from './change-detector';\nimport { collectKeyframeNames, collectLeadingClasses } from './existing-classes';\nimport { ClassGc } from './class-gc';\nimport { normalizeClassNameList } from './utils';\nimport { acquireSharedRootSheet, canConstruct, ShadowRootStyles, SharedIncrementalParser, SharedRootSheet } from './shadow-root-sheet';\n\nexport interface BrowserRuntimeOptions {\n config?: Config; // full config object\n styleId?: string;\n insertionPoint?: 'head' | 'body' | HTMLElement;\n maxRulesPerPartition?: number;\n /**\n * #210: skip classes the page's existing (non-BaroCSS, same-origin) stylesheets already define,\n * so a built app plus the runtime injects only what the build is missing. Opt-in. A class counts\n * as covered only when a rule's selector starts with it (e.g. `.p-4`, `.md\\:p-4` inside @media,\n * `.hover\\:x:hover`), so a class seen only as a descendant (`.group:hover .x`) is not skipped.\n * The index is rebuilt when `document.styleSheets.length` changes. A page class that leads a selector\n * with the same name is treated as covered, and rules added later to an already-indexed sheet aren't seen.\n */\n skipExisting?: boolean;\n /**\n * #269: reclaim the rules of classes that no element inside the observed root carries any more.\n * On by default; it only acts on classes seen through `observe()`. A class is deleted only after\n * its refcount has stayed 0 for `gcGraceMs` and a live-DOM re-check finds no element with it.\n * Never reclaimed: classes passed to `addClass()`, classes any pre-existing (non-BaroCSS) sheet\n * defines (build output, server sheet), root/@property/preflight rules. `false` disables it.\n */\n gc?: boolean;\n /** #269: how long a class must stay unused before its rules are deleted (default 3000 ms). */\n gcGraceMs?: number;\n /**\n * #269: soft cap on cached classes. When exceeded, unused (refcount 0) classes are evicted\n * oldest-first without waiting for the grace period; classes in use are never evicted. Default: no cap.\n */\n maxRules?: number;\n /**\n * #327: a ShadowRoot to style instead of the document. The runtime observes that root (with an initial scan)\n * and places all of its CSS in it: utilities, theme variables, @property, @keyframes and a preflight rewritten\n * for the root (`html`/`:root` -> `:host`, `body` declarations re-emitted on `:host`). Nothing goes to\n * `document.head`. Runtimes with the same config share one constructable sheet adopted by every root\n * (`adoptedStyleSheets`); without constructable sheets each root gets `<style>` elements instead.\n * `insertionPoint`, `styleId` and `maxRulesPerPartition` are ignored in this mode, and server sheets (#268)\n * are not adopted. `document` (or omitting it) keeps the document mode.\n */\n root?: ShadowRoot | Document;\n /**\n * #347: a CSP nonce set on every `<style>` element the runtime creates (preflight, theme variables, rule\n * partitions, and the shadow-root fallback `<style>`s), so the runtime works under\n * `style-src 'nonce-…'` without `'unsafe-inline'`. Rules are then added through CSSOM (`insertRule`),\n * which CSP does not govern. Default: none.\n */\n nonce?: string;\n /**\n * #347: document mode only. Put all CSS in constructable sheets adopted by the document\n * (`document.adoptedStyleSheets`) instead of `<style>` elements; CSP `style-src` does not apply to them,\n * so no nonce is needed. The adopted sheets come after every document sheet in cascade order (preflight stays\n * in `@layer base`). Where `document.adoptedStyleSheets` is unsupported it falls back to `<style>` elements\n * (with `nonce` when set). `insertionPoint`, `styleId` and `maxRulesPerPartition` are ignored when adopted.\n * Default: false.\n */\n constructable?: boolean;\n}\n\n/** #268: marks a server-rendered sheet (`@barocss/server` `ssrStyleTag()`); the runtime adopts its class rules. */\nexport const SSR_STYLE_SELECTOR = 'style[data-barocss-ssr]';\n\n/** Tailwind 4 layer order, declared by BaroCSS's first <style> in <head>. */\nexport const LAYER_ORDER = \"@layer theme, base, components, utilities;\";\n\nexport class BrowserRuntime {\n private cache: Map<string, GenerateCssRulesResult> = new Map(); // class name -> generated CSS mapping\n private rootCache: Set<string> = new Set(); // class name -> generated CSS mapping\n private context: Context;\n private options: Required<Omit<BrowserRuntimeOptions, 'root'>>;\n /** #327: the shadow root this runtime styles, or null in document mode. */\n private shadowRoot: ShadowRoot | null = null;\n private isDestroyed = false;\n private existing: Set<string> | null = null;\n /** #274: @keyframes names the page's own sheets define (filled with `existing`). */\n private existingKeyframes = new Set<string>();\n private existingSheetCount = -1;\n /** #269: classes requested explicitly through addClass(); never reclaimed. */\n private pinned = new Set<string>();\n private gc: ClassGc | null = null;\n private reclaimedCount = 0;\n /** #268: class rules adopted from `<style data-barocss-ssr>`, in sheet order, and the classes they lead. */\n private ssrRules: Array<{ css: string; cls: string }> = [];\n private ssrClasses = new Set<string>();\n private observedOnce = false;\n\n private incrementalParser: IncrementalParser;\n private changeDetector: ChangeDetector;\n private stylePartitionManager: StylePartitionManager | ShadowRootStyles;\n\n private getCategory = (cls: string) => parseClassName(cls, this.context).utility?.category;\n\n constructor(options: BrowserRuntimeOptions = {}) {\n // Default config - createContext handles defaultTheme automatically\n const defaultConfig: Config = {};\n\n this.options = {\n config: options.config || defaultConfig,\n styleId: options.styleId || 'barocss-runtime',\n insertionPoint: options.insertionPoint || 'head',\n maxRulesPerPartition: options.maxRulesPerPartition || 50,\n skipExisting: options.skipExisting ?? false,\n gc: options.gc ?? true,\n gcGraceMs: options.gcGraceMs ?? 3000,\n maxRules: options.maxRules ?? Infinity,\n nonce: options.nonce ?? '',\n constructable: options.constructable ?? false,\n };\n\n const root = options.root;\n if (root && root.nodeType === 11) this.shadowRoot = root as ShadowRoot;\n\n // Pass full config to createContext (defaultTheme auto-included)\n if (this.shadowRoot) {\n const shared = acquireSharedRootSheet(this.options.config);\n this.context = shared.context;\n this.incrementalParser = new SharedIncrementalParser(shared);\n } else {\n this.context = createContext(this.options.config);\n this.incrementalParser = new IncrementalParser(this.context);\n }\n this.changeDetector = new ChangeDetector(this.incrementalParser, this, this.getCategory);\n\n this.stylePartitionManager = this.createStyles();\n\n if (this.options.gc) {\n this.gc = new ClassGc({\n reclaim: classes => this.reclaim(classes),\n isPermanent: cls => this.isPermanent(cls),\n cachedCount: () => this.cache.size,\n }, this.options.gcGraceMs, this.options.maxRules);\n this.changeDetector.setGc(this.gc);\n }\n\n this.init();\n if (this.shadowRoot) this.observe(this.shadowRoot, { scan: true });\n }\n\n /** Document partitions, or (#327) this root's view of the shared shadow-root sheet. */\n private createStyles(): StylePartitionManager | ShadowRootStyles {\n if (this.shadowRoot) {\n const parser = this.incrementalParser as SharedIncrementalParser;\n let shared = parser.shared;\n // A reset after the last root released the entry: re-acquire (same key -> same or a fresh entry).\n const current = acquireSharedRootSheet(this.options.config);\n if (current !== shared) {\n shared = current;\n this.context = shared.context;\n this.incrementalParser = new SharedIncrementalParser(shared);\n this.changeDetector?.setParser(this.incrementalParser);\n }\n return new ShadowRootStyles(shared, this.shadowRoot, this.getCategory, { nonce: this.options.nonce });\n }\n if (this.options.constructable && typeof document !== 'undefined' && canConstruct('document')) {\n // #347: a private (not shared) #327 sheet pair, adopted by the document; reuses this runtime's context.\n const sheet = new SharedRootSheet('document', this.options.config, 'document', { context: this.context, target: 'document' });\n return new ShadowRootStyles(sheet, document, this.getCategory);\n }\n return new StylePartitionManager(this.getInsertionPoint(), this.options.maxRulesPerPartition, `${this.options.styleId}-partition`, this.getCategory, this.options.nonce);\n }\n\n // Debugging and logging helpers\n \n /**\n * Add debug logs (by level)\n */\n private debugLog(level: 'info' | 'warn' | 'error' | 'debug', message: string, data?: unknown): void {\n // Silent unless the kit debug flag is on (`debug: true` in config, or setDebug(true)).\n if (!isDebug()) return;\n // console-ok: gated by the isDebug() early return above\n // eslint-disable-next-line no-console\n const consoleMethod = console[level] || console.log;\n consoleMethod(`[BrowserRuntime:${level.toUpperCase()}] ${message}`, data || '');\n }\n\n private init() {\n this.debugLog('debug', 'init');\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.adoptSsrSheets();\n }\n\n /**\n * #268: adopt the class rules of server-rendered `<style data-barocss-ssr>` sheets in <head>, at startup\n * (constructor and the first observe()). Each rule moves\n * (same task, so no paint in between) into the partition its class would get if generated here, at\n * its #254 sorted position, so a later client `sm:` rule lands before a server `lg:` rule. Its classes\n * are never regenerated and never reclaimed. `:root`, `@property` and `@keyframes` stay in the sheet.\n */\n private adoptSsrSheets(): void {\n if (typeof document === 'undefined' || this.shadowRoot) return;\n const adopted: Array<{ css: string; cls: string }> = [];\n // Only sheets in <head> at startup (constructor / observe()): a marked <style> injected later or into\n // <body> (model or user HTML) must not suppress generation or GC for its classes (#268 review).\n if (!document.head) return;\n for (const el of Array.from(document.head.querySelectorAll<HTMLStyleElement>(`${SSR_STYLE_SELECTOR}:not([data-barocss-adopted])`))) {\n const sheet = el.sheet;\n if (!sheet) continue;\n el.setAttribute('data-barocss-adopted', '');\n const moved: Array<{ css: string; cls: string }> = [];\n for (let i = sheet.cssRules.length - 1; i >= 0; i--) {\n const rule = sheet.cssRules[i];\n const classes = collectLeadingClasses([rule]);\n if (classes.size === 0) continue;\n classes.forEach(cls => this.ssrClasses.add(cls));\n moved.unshift({ css: rule.cssText, cls: classes.values().next().value! });\n sheet.deleteRule(i);\n }\n adopted.push(...moved);\n }\n if (adopted.length === 0) return;\n this.ssrRules.push(...adopted);\n this.insertSsrRules(adopted);\n }\n\n private insertSsrRules(rules: Array<{ css: string; cls: string }>): void {\n for (const { css, cls } of rules) {\n const category = this.getCategory(cls);\n if (category) this.stylePartitionManager.addCategoryRule(css, category);\n else this.stylePartitionManager.addRule(css);\n }\n }\n\n private injectPreflightCSS() {\n // Kit documents `preflight: true` (full) as the default; only an explicit\n // `false` disables it.\n const level = this.options.config.preflight ?? true;\n if (level) {\n const preflightCSS = this.context.getPreflightCSS(level);\n // #208: preflight joins the `base` layer from the first <style> in\n // <head>, which also fixes the layer order. Unlayered author CSS and\n // BaroCSS utilities (unlayered) beat it, and an app's own\n // `@layer base` rules come later within `base`, so they win too.\n this.stylePartitionManager.updateRuleContent(\n \"preflight\",\n `${LAYER_ORDER}\\n@layer base {\\n${preflightCSS}\\n}`,\n true,\n );\n }\n }\n\n private ensureCssVars() {\n if (this.isDestroyed) return;\n\n const cssVars = this.context.themeToCssVars ? this.context.themeToCssVars() : ':root { /* CSS Variables will be generated here */ }';\n this.stylePartitionManager.updateRuleContent(\"css-vars\", cssVars);\n }\n\n private getInsertionPoint(): HTMLElement {\n if (typeof this.options.insertionPoint !== 'string') {\n return this.options.insertionPoint;\n }\n switch (this.options.insertionPoint) {\n case 'body':\n return document.body || document.head;\n case 'head':\n default:\n return document.head;\n }\n }\n\n /**\n * Dynamically add one or more class names and generate/insert CSS\n */\n addClass(classes: string | string[]): void {\n if (this.isDestroyed) return;\n \n const classList = this.normalizeClasses(classes).filter(Boolean);\n classList.forEach(cls => this.pinned.add(cls));\n \n this.processClasses(classList);\n }\n\n /**\n * Process classes\n */\n private processClasses(classList: string[]): void { \n // Use incremental parsing by default (always enabled)\n \n this.processClassesIncremental(classList);\n }\n\n /**\n * Process classes using incremental parsing\n */\n private processClassesIncremental(classList: string[]): void {\n const isBrowser = typeof window !== 'undefined';\n \n // Process classes immediately for testing environment\n const results = this.incrementalParser.processClasses(classList);\n \n this.debugLog('debug', 'results', { results, classList });\n // Apply results and inject CSS\n this.applyParseResults(results, { isBrowser });\n }\n\n /**\n * Public method to apply parser results, update internal caches, and inject CSS\n */\n public applyParseResults(results: Array<GenerateCssRulesResult>, _opts?: { isBrowser?: boolean }): void {\n if (this.isDestroyed) return;\n if (!this.shadowRoot && this.getInsertionPoint().isConnected && this.stylePartitionManager.hasDetachedPartitions()) {\n const existingResults = Array.from(this.cache.values());\n this.reset();\n results = [...existingResults, ...results];\n results.forEach(result => this.incrementalParser.markProcessed(result.cls));\n }\n if (this.ssrClasses.size > 0) results = results.filter(result => !this.ssrClasses.has(result.cls));\n if (this.options.skipExisting && results.length > 0 && typeof document !== 'undefined') {\n const existing = this.getExistingClasses();\n results = results.filter(result => !existing.has(result.cls));\n }\n if (results.length === 0) return;\n const cssRules: GenerateCssRulesResult[] = [];\n const rootCssRules: string[] = [];\n // #274: companion mode leaves a @keyframes the page's own sheets define to them.\n const pageKeyframes = this.options.skipExisting && typeof document !== 'undefined'\n ? (this.getExistingClasses(), this.existingKeyframes) : null;\n\n for (const result of results) {\n if (result.css && Array.isArray(result.cssList)) {\n cssRules.push(result);\n this.cache.set(result.cls, result);\n }\n\n if (result.rootCss && Array.isArray(result.rootCssList)) {\n for (const rootCss of result.rootCssList) {\n if (pageKeyframes?.size) {\n const kf = /^\\s*@keyframes\\s+([^\\s{]+)/.exec(rootCss)?.[1];\n if (kf && pageKeyframes.has(kf)) continue;\n }\n if (!this.rootCache.has(rootCss)) {\n this.rootCache.add(rootCss);\n rootCssRules.push(rootCss);\n }\n }\n }\n }\n\n if (rootCssRules.length > 0) {\n this.stylePartitionManager.addRootRules(rootCssRules.filter(Boolean));\n }\n\n if (cssRules.length > 0) {\n this.stylePartitionManager.addRules(cssRules);\n }\n\n this.debugLog('info', `Applied ${results.length} parser results`, {\n cssRuleCount: cssRules.length,\n rootCssCount: rootCssRules.length,\n });\n }\n\n /** #269: a class that must never be reclaimed. */\n private isPermanent(cls: string): boolean {\n if (this.pinned.has(cls) || this.ssrClasses.has(cls)) return true;\n // #327: document sheets cannot style a shadow root, so they never make its classes permanent.\n if (this.shadowRoot) return false;\n if (typeof document === 'undefined') return true;\n return this.getExistingClasses().has(cls);\n }\n\n /**\n * #269: delete the generated rules of classes no live element uses. Root/@property/@keyframes rules stay\n * (they are shared and harmless); a rule text another cached class still emits is kept.\n */\n private reclaim(classes: string[]): void {\n if (this.isDestroyed) return;\n const victims = classes.filter(cls => this.cache.has(cls));\n if (victims.length === 0) return;\n const results = victims.map(cls => this.cache.get(cls)!);\n victims.forEach(cls => {\n this.cache.delete(cls);\n this.incrementalParser.unmarkProcessed(cls);\n });\n const stillUsed = new Set<string>();\n for (const result of this.cache.values()) result.cssList.forEach(css => stillUsed.add(css));\n for (const result of results) {\n const category = this.getCategory(result.cls);\n for (const css of result.cssList) {\n if (!stillUsed.has(css)) this.stylePartitionManager.removeRule(css, category);\n }\n }\n this.reclaimedCount += victims.length;\n }\n\n /** Class names defined by the page's own stylesheets (BaroCSS's sheets and cross-origin sheets excluded). */\n getExistingClasses(): Set<string> {\n // Our own <style> elements, matched by sheet identity too (jsdom leaves ownerNode unset).\n const own = new Set(Array.from(document.querySelectorAll<HTMLStyleElement>('style[data-barocss]'), s => s.sheet));\n const sheets = Array.from(document.styleSheets).filter(sheet => {\n if (own.has(sheet)) return false;\n const owner = sheet.ownerNode as Element | null;\n return !(owner && typeof owner.hasAttribute === 'function'\n && (owner.hasAttribute('data-barocss') || (owner.id || '').startsWith(this.options.styleId)));\n });\n if (this.existing && sheets.length === this.existingSheetCount) return this.existing;\n const out = new Set<string>();\n const keyframes = new Set<string>();\n for (const sheet of sheets) {\n let rules: CSSRuleList;\n try { rules = sheet.cssRules; } catch { continue; } // cross-origin\n collectLeadingClasses(rules, out);\n collectKeyframeNames(rules, keyframes);\n }\n this.existingKeyframes = keyframes;\n this.existing = out;\n this.existingSheetCount = sheets.length;\n return out;\n }\n\n /**\n * MutationObserver instance method to automatically call addClass when class attributes change in DOM\n */\n observe(root: HTMLElement | ShadowRoot = this.shadowRoot ?? document.body, options?: { scan?: boolean; onReady?: () => void }): MutationObserver {\n if (!this.observedOnce) { this.observedOnce = true; this.adoptSsrSheets(); }\n return this.changeDetector.observe(root, options);\n }\n\n private normalizeClasses(classes: string | string[]): string[] {\n return (Array.isArray(classes) ? classes : [classes]).flatMap(normalizeClassNameList);\n }\n\n has(cls: string): boolean {\n const result = this.cache.has(cls);\n return result;\n }\n\n getCss(cls: string): string | undefined {\n const css = this.cache.get(cls)?.cssList.join('\\n');\n return css;\n }\n\n getAllCss(): string {\n const all = [...this.rootCache, ...Array.from(this.cache.values()).flatMap(result => result.cssList)].join('\\n');\n return all;\n }\n\n getClasses(): string[] {\n const keys = Array.from(this.cache.keys());\n return keys;\n }\n\n /**\n * Get comprehensive cache statistics\n */\n getCacheStats() {\n const incremental = this.incrementalParser.getStats();\n return {\n runtime: {\n cachedClasses: this.cache.size,\n rootCacheSize: this.rootCache.size,\n ruleCount: this.stylePartitionManager.ruleCount,\n reclaimedClasses: this.reclaimedCount,\n gc: this.gc?.stats() ?? null,\n },\n ast: incremental.cacheStats.ast,\n incremental,\n };\n }\n\n /**\n * Clear all caches (useful for debugging or memory management)\n */\n clearCaches(): void {\n if (this.isDestroyed) return;\n this.cache.clear();\n this.rootCache.clear();\n clearAstCache(this.context);\n this.incrementalParser.clearProcessed();\n this.stylePartitionManager.cleanup();\n this.stylePartitionManager = this.createStyles();\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.insertSsrRules(this.ssrRules);\n }\n\n\n reset(): void {\n if (this.isDestroyed) return;\n this.cache.clear();\n this.rootCache.clear();\n this.incrementalParser.clearProcessed();\n this.stylePartitionManager.cleanup();\n this.stylePartitionManager = this.createStyles();\n this.injectPreflightCSS();\n this.ensureCssVars();\n this.insertSsrRules(this.ssrRules);\n }\n\n updateConfig(newConfig: Config): void {\n if (this.isDestroyed) return;\n const existingClasses = Array.from(this.cache.keys());\n this.options.config = newConfig;\n if (this.shadowRoot) {\n // #327: move this root to the shared sheet of the new config.\n this.stylePartitionManager.cleanup();\n const shared = acquireSharedRootSheet(newConfig);\n this.context = shared.context;\n this.incrementalParser = new SharedIncrementalParser(shared);\n } else {\n this.context = createContext(newConfig);\n this.incrementalParser = new IncrementalParser(this.context);\n }\n this.changeDetector.setParser(this.incrementalParser);\n this.reset();\n if (existingClasses.length > 0) {\n this.addClass(existingClasses);\n }\n }\n\n removeClass(classes: string | string[]): void {\n if (this.isDestroyed) return;\n const classList = new Set(this.normalizeClasses(classes));\n const retainedResults = Array.from(this.cache.values()).filter(result => !classList.has(result.cls));\n if (retainedResults.length === this.cache.size) return;\n\n this.reset();\n retainedResults.forEach(result => this.incrementalParser.markProcessed(result.cls));\n this.applyParseResults(retainedResults);\n }\n\n destroy(): void {\n if (this.isDestroyed) return;\n this.changeDetector.disconnect();\n this.gc?.cancel();\n this.stylePartitionManager.cleanup();\n\n this.cache.clear();\n this.rootCache.clear();\n this.isDestroyed = true;\n\n }\n\n getStats() {\n const stats = {\n cachedClasses: this.cache.size,\n styleElementId: this.options.styleId,\n isDestroyed: this.isDestroyed,\n config: this.options.config,\n cacheStats: this.getCacheStats(),\n /** #327: the shared shadow-root sheet this runtime uses (null in document mode). */\n /** #347: whether the document-mode CSS lives in adopted constructable sheets. */\n adopted: !this.shadowRoot && this.stylePartitionManager instanceof ShadowRootStyles,\n sharedSheet: this.shadowRoot && this.stylePartitionManager instanceof ShadowRootStyles\n ? { roots: this.stylePartitionManager.shared.rootCount, rules: this.stylePartitionManager.shared.ruleCount, generations: this.stylePartitionManager.shared.generations, constructable: this.stylePartitionManager.shared.constructable }\n : null,\n };\n return stats;\n }\n}\n","import { BrowserRuntime, BrowserRuntimeOptions } from \"./browser-runtime\";\n\nlet runtime: BrowserRuntime | null = null;\nlet runtimeConfig: BrowserRuntimeOptions['config'];\nlet runtimeNonce = '';\nlet runtimeConstructable = false;\nlet mismatchWarned = false;\n\n/**\n * Returns the shared runtime, creating it on first use. If a live runtime\n * already exists and `options.config` is a different config object, it is\n * applied via `updateConfig` (which replaces the whole config), so an early\n * `getRuntime()` never makes a later `baroStart({ config })` lose its config.\n */\nexport function getRuntime(options: BrowserRuntimeOptions = {}) {\n if (!runtime || runtime.getStats().isDestroyed) {\n runtime = new BrowserRuntime(options);\n runtimeConfig = options.config;\n runtimeNonce = options.nonce ?? '';\n runtimeConstructable = options.constructable ?? false;\n mismatchWarned = false;\n } else if (options.config && options.config !== runtimeConfig) {\n runtime.updateConfig(options.config);\n runtimeConfig = options.config;\n }\n if (!mismatchWarned) {\n const badNonce = options.nonce !== undefined && options.nonce !== runtimeNonce;\n const badConstructable = options.constructable !== undefined && options.constructable !== runtimeConstructable;\n if (badNonce || badConstructable) {\n mismatchWarned = true;\n const what = [badNonce && `nonce (runtime has ${runtimeNonce ? 'a different nonce' : 'none'})`, badConstructable && `constructable (runtime has ${runtimeConstructable})`].filter(Boolean).join(' and ');\n // console-ok: one-time real-misuse warning; the requested option is ignored, so strict-CSP styles may be blocked\n console.warn(`[BaroCSS] runtime already created with a different ${what}; the new value is ignored. Pass nonce/constructable on the first getRuntime/baroStart call.`);\n }\n }\n return runtime;\n}\n\ntype BaroBootOptions = BrowserRuntimeOptions & { loadingClassName?: string };\n\n/**\n * Starts BaroCSS on the document (the shared runtime). #327: with `root: shadowRoot` it instead returns a new\n * runtime that observes and styles only that shadow root (runtimes with the same config share one sheet).\n */\nexport function baroBoot(options: BaroBootOptions & { root: ShadowRoot }): BrowserRuntime;\nexport function baroBoot(options?: BaroBootOptions): void;\nexport function baroBoot({ loadingClassName = 'baro-boot', ...options }: BaroBootOptions = {}): BrowserRuntime | void {\n if (options.root && options.root.nodeType === 11) return new BrowserRuntime(options);\n if (!document.body) {\n document.addEventListener('DOMContentLoaded', () => baroBoot({ loadingClassName, ...options }), { once: true });\n return;\n }\n const startClassName = `${loadingClassName}-doing`;\n const endClassName = `${loadingClassName}-done`;\n try { \n\n document.body.classList.add(startClassName);\n\n const runtime = getRuntime(options);\n runtime.observe(document.body, { scan: true, onReady: () => {\n document.body.classList.remove(startClassName);\n document.body.classList.add(endClassName);\n }});\n } catch (error) {\n document.body?.classList.remove(startClassName);\n // console-ok: one-shot boot failure; otherwise the page stays unstyled with no signal\n // eslint-disable-next-line no-console\n console.error('BaroCSS boot failed:', error);\n }\n}\n\nexport const baroStart = baroBoot;\n","import type { BrowserRuntime } from './browser-runtime';\nimport { normalizeClassNameList } from './utils';\n\n/** Collect literal className tokens from a json-render Spec's flat elements map. */\nexport function collectJsonRenderClassNames(spec: unknown): string[] {\n if (!spec || typeof spec !== 'object' || Array.isArray(spec)) return [];\n const elements = (spec as { elements?: unknown }).elements;\n if (!elements || typeof elements !== 'object' || Array.isArray(elements)) return [];\n\n const classes = new Set<string>();\n for (const key of Object.keys(elements)) {\n const element = (elements as Record<string, unknown>)[key];\n if (!element || typeof element !== 'object' || Array.isArray(element)) continue;\n const props = (element as { props?: unknown }).props;\n if (!props || typeof props !== 'object' || Array.isArray(props)) continue;\n const className = (props as { className?: unknown }).className;\n if (typeof className !== 'string') continue;\n for (const cls of normalizeClassNameList(className)) {\n if (cls) classes.add(cls);\n }\n }\n return Array.from(classes);\n}\n\n/** Submit literal classes synchronously before UI mount; the caller validates class support. */\nexport function preloadJsonRenderClasses(spec: unknown, runtime: Pick<BrowserRuntime, 'addClass'>): void {\n const classes = collectJsonRenderClassNames(spec);\n if (classes.length > 0) runtime.addClass(classes);\n}\n","/**\n * shadcn/ui theme preset for the BaroCSS browser runtime.\n *\n * Use it next to a Tailwind-4 shadcn build so runtime-generated classes\n * (`bg-primary`, `bg-primary/90`, `rounded-lg`, ...) resolve to the app's theme:\n *\n * baroStart({ config: { theme: { extend: shadcnTheme } } });\n *\n * It references the RAW `:root` variables shadcn defines (`--primary`, `--radius`),\n * not `--color-*`: `@theme inline` does not emit `--color-*` / `--radius-*` to the page.\n * Custom tokens must be added by extending the colors yourself.\n */\nconst SHADCN_COLOR_NAMES = [\n 'background', 'foreground',\n 'card', 'card-foreground', 'popover', 'popover-foreground',\n 'primary', 'primary-foreground', 'secondary', 'secondary-foreground',\n 'muted', 'muted-foreground', 'accent', 'accent-foreground',\n 'destructive', 'border', 'input', 'ring',\n 'chart-1', 'chart-2', 'chart-3', 'chart-4', 'chart-5',\n 'sidebar', 'sidebar-foreground', 'sidebar-primary', 'sidebar-primary-foreground',\n 'sidebar-accent', 'sidebar-accent-foreground', 'sidebar-border', 'sidebar-ring',\n] as const;\n\nexport const shadcnTheme = {\n colors: Object.fromEntries(SHADCN_COLOR_NAMES.map((n) => [n, `var(--${n})`])) as Record<string, string>,\n borderRadius: {\n sm: 'calc(var(--radius) - 4px)',\n md: 'calc(var(--radius) - 2px)',\n lg: 'var(--radius)',\n xl: 'calc(var(--radius) + 4px)',\n } as Record<string, string>,\n};\n"],"mappings":"AAqBA,SAAgBK,EACdC,EACAC,EACAC,GAEA,MAAO,CAAEC,KAAM,OAAQH,OAAMC,QAAOC,SACtC,CACA,SAAgBE,EAAOC,EAAkBH,GACvC,MAAO,CACLC,KAAM,UACNE,QACAH,SAEJ,CAEA,SAAgBI,EACdC,EACAC,EACAH,EACAH,GAEA,MAAO,CAAEC,KAAM,UAAWI,OAAMC,SAAQH,QAAOH,SACjD,CAIA,SAAgBO,EAAKC,EAAkBL,EAAkBH,GACvD,MAAO,CAAEC,KAAM,OAAQO,WAAUL,QAAOH,SAC1C,CAQA,SAAgBS,EAASJ,EAAcK,EAAuBC,EAAiBX,GAC7E,MAAMG,EAAmB,CACvBN,EAAK,SAAU,IAAIc,GAAU,OAAQX,GACrCH,EAAK,WAAY,QAASG,IAO5B,OAJIU,GACFP,EAAMS,KAAKf,EAAK,gBAAiBa,EAAcV,IAG1CI,EAAO,WAAYC,EAAMF,EAAOH,EACzC,CC/DA,IAAIa,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