{"version":3,"file":"index.mjs","names":["flattened: Plugin[]","patterns: RegexPatterns","context: ParseContext","results: T[]"],"sources":["../src/utils/cache.ts","../src/utils/escape.ts","../src/utils/createMatcher.ts","../src/utils/pluginUtils.ts","../src/index.ts"],"sourcesContent":["export class LRUCache<K, V> {\n  private cache: Map<K, V>\n  private maxSize: number\n\n  constructor(maxSize: number = 1000) {\n    this.cache = new Map()\n    this.maxSize = maxSize\n  }\n\n  get(key: K): V | undefined {\n    if (!this.cache.has(key)) return undefined\n\n    const value = this.cache.get(key)!\n    this.cache.delete(key)\n    this.cache.set(key, value)\n    return value\n  }\n\n  set(key: K, value: V): void {\n    if (this.cache.has(key)) {\n      this.cache.delete(key)\n    } else if (this.cache.size >= this.maxSize) {\n      const firstKey = this.cache.keys().next().value\n      this.cache.delete(firstKey as any)\n    }\n    this.cache.set(key, value)\n  }\n\n  clear(): void {\n    this.cache.clear()\n  }\n\n  get size(): number {\n    return this.cache.size\n  }\n}\n","export const escapeRegex = (str: string): string => str.replace(/[.*+?^${}()|[\\]\\\\/-]/g, '\\\\$&')\n","export const DEFAULT_GLOBAL_PATTERN = '[\\\\w.-]+'\n\ntype Param = string | (string | string[])[]\n\nexport function createMatcher(variant?: Param, utility?: Param, value?: Param) {\n  const normalize = (input?: Param) => {\n    const flat = Array.isArray(input) ? input.flat(Infinity) : [input]\n    return flat.filter(Boolean).join('|') || DEFAULT_GLOBAL_PATTERN\n  }\n\n  return new RegExp(\n    `^(?:(?<variant>${normalize(variant)}):)?(?<utility>${normalize(\n      utility\n    )})(?:-(?<value>${normalize(value)}?))?$`\n  )\n}\n","import { Plugin, PluginFactory, PluginLike } from '../types'\n\nexport function flattenPlugins(plugins: (Plugin | PluginFactory | PluginLike)[]): Plugin[] {\n  const flattened: Plugin[] = []\n\n  for (const plugin of plugins) {\n    if (typeof plugin === 'function') {\n      const result = plugin()\n      if (Array.isArray(result)) {\n        flattened.push(...result)\n      } else {\n        flattened.push(result)\n      }\n    } else if (Array.isArray(plugin)) {\n      flattened.push(...plugin)\n    } else {\n      flattened.push(plugin as Plugin)\n    }\n  }\n\n  return flattened\n}\n\nexport function createPluginError(pluginName: string, hooksName: string, err: any): void {\n  console.error(`Plugin \"${hooksName}\" ${pluginName} failed:`, err)\n}\n\nexport const isValidResult = (result: any) => typeof result !== 'undefined'\n","import type {\n  Config,\n  Plugin,\n  Variants,\n  Utilities,\n  PluginLike,\n  ParseContext,\n  PluginFactory,\n  RegexPatterns,\n  BaseProcessResult,\n  CSSPropertyOrVariable,\n  DefaultProcessUtilityResult\n} from './types'\nimport {\n  LRUCache,\n  escapeRegex,\n  createMatcher,\n  isValidResult,\n  flattenPlugins,\n  createPluginError,\n  DEFAULT_GLOBAL_PATTERN\n} from './utils'\n\nexport class TenoxUI<\n  TUtilities extends { [type: string]: any } = Utilities<CSSPropertyOrVariable>,\n  TVariants extends { [variant: string]: any } = Variants,\n  TProcessResult extends BaseProcessResult<any> = BaseProcessResult<string>,\n  TProcessUtilitiesResult extends BaseProcessResult<any> = BaseProcessResult<string>\n> {\n  private utilities: TUtilities\n  private variants: TVariants\n  private plugins: Plugin[]\n  public matcher: ParseContext | null\n\n  private _matcherCache: ParseContext | null = null\n  private _parseCache: LRUCache<string, any>\n  private _valueCache: LRUCache<string, string | null>\n  private _variantCache: LRUCache<string, string | null>\n  private _utilityCache: LRUCache<string, any>\n  private _cnCache: LRUCache<string, any>\n\n  private _hooks: Map<string, Plugin[]>\n\n  constructor({\n    variants,\n    utilities,\n    plugins = [],\n    cacheSize = 1000\n  }: Config<TUtilities, TVariants, TProcessResult, TProcessUtilitiesResult> = {}) {\n    this.utilities = (utilities || {}) as TUtilities\n    this.variants = (variants || {}) as TVariants\n    this.plugins = flattenPlugins(plugins as (Plugin | PluginFactory | PluginLike)[]).sort(\n      (a, b) => (b.priority || 0) - (a.priority || 0)\n    )\n    this.matcher = null\n\n    this._parseCache = new LRUCache(cacheSize)\n    this._valueCache = new LRUCache(cacheSize)\n    this._variantCache = new LRUCache(cacheSize)\n    this._utilityCache = new LRUCache(cacheSize * 2)\n    this._cnCache = new LRUCache(cacheSize * 2)\n    this._hooks = new Map()\n\n    this._initializePlugins()\n    this._initializeMatcher()\n  }\n\n  private sanitizePlugin(name: Exclude<keyof Plugin, 'name' | 'priority'>): Plugin[] {\n    if (!this._hooks.has(name)) {\n      const filtered = this.plugins\n        .filter((p) => p[name])\n        .sort((a, b) => (b.priority || 0) - (a.priority || 0))\n      this._hooks.set(name, filtered)\n    }\n    return this._hooks.get(name)!\n  }\n\n  public use(...plugin: (Plugin | PluginFactory | PluginLike)[]): this {\n    const newPlugins = flattenPlugins(plugin)\n    this.plugins.push(...newPlugins)\n    this.plugins.sort((a, b) => (b.priority || 0) - (a.priority || 0))\n    this._matcherCache = null\n    this._hooks.clear()\n    this.clearCache()\n    this._initializePlugins()\n    this._initializeMatcher()\n    return this\n  }\n\n  private processPlugin(hook: Exclude<keyof Plugin, 'name' | 'priority'>, ...context: any[]): any {\n    for (const plugin of this.sanitizePlugin(hook)) {\n      if (plugin[hook]) {\n        try {\n          const hookFn = plugin[hook] as (...args: any[]) => any\n          const result = hookFn(...context)\n          if (typeof result !== 'undefined') return result\n        } catch (err) {\n          createPluginError(hook, plugin.name, err)\n        }\n      }\n    }\n  }\n\n  private _initializePlugins() {\n    this.processPlugin('init', {\n      getUtilities: () => this.utilities,\n      getVariants: () => this.variants,\n      process: {\n        value: (value: string) => this.processValue(value),\n        variant: (variant: string) => this.processVariant(variant),\n        utility: (ctx: any) => this.processUtility(ctx),\n        className: (cn: string) => this.processClassName(cn),\n        classNames: (cns: string | string[]) => this.process(cns)\n      },\n      parser: (className: string) => this.parse(className),\n      regexp: () => this.regexp(),\n      addUtility<K extends keyof TUtilities>(name: K, value: TUtilities[K]) {\n        this.addUtility(name, value)\n      },\n      addVariant<K extends keyof TVariants>(name: K, value: TVariants[K]) {\n        this.addVariant(name, value)\n      },\n      addUtilities(utilities: Partial<TUtilities>) {\n        this.addUtilities(utilities)\n      },\n      addVariants(variants: Partial<TVariants>) {\n        this.addVariants(variants)\n      },\n      invalidateCache: () => this.invalidateCache()\n    })\n  }\n\n  private _initializeMatcher() {\n    this.matcher = this.regexp()\n  }\n\n  public addUtility<K extends keyof TUtilities>(name: K, value: TUtilities[K]): this {\n    this.utilities = { ...this.utilities, [name]: value }\n    this.invalidateCache()\n    return this\n  }\n\n  public addVariant<K extends keyof TVariants>(name: K, value: TVariants[K]): this {\n    this.variants = { ...this.variants, [name]: value }\n    this.invalidateCache()\n    return this\n  }\n\n  public addUtilities(utilities: Partial<TUtilities>): this {\n    this.utilities = { ...this.utilities, ...utilities }\n    this.invalidateCache()\n    return this\n  }\n\n  public addVariants(variants: Partial<TVariants>): this {\n    this.variants = { ...this.variants, ...variants }\n    this.invalidateCache()\n    return this\n  }\n\n  public removeUtility(name: string): this {\n    const { [name]: removed, ...rest } = this.utilities\n    this.utilities = rest as TUtilities\n    this.invalidateCache()\n    return this\n  }\n\n  public removeVariant(name: string): this {\n    const { [name]: removed, ...rest } = this.variants\n    this.variants = rest as TVariants\n    this.invalidateCache()\n    return this\n  }\n\n  public invalidateCache(): void {\n    this._matcherCache = null\n    this._hooks.clear()\n    this.clearCache()\n    this._initializeMatcher()\n  }\n\n  public clearCache(): void {\n    this._parseCache.clear()\n    this._valueCache.clear()\n    this._variantCache.clear()\n    this._utilityCache.clear()\n    this._cnCache.clear()\n  }\n\n  public getCacheStats() {\n    return {\n      parse: this._parseCache.size,\n      processValue: this._valueCache.size,\n      processVariant: this._variantCache.size,\n      processUtility: this._utilityCache.size,\n      processClassName: this._cnCache.size\n    }\n  }\n\n  public regexp() {\n    if (this._matcherCache) return this._matcherCache\n\n    const sanitize = (obj: Record<string, any> = {}) => Object.keys(obj).map(escapeRegex).join('|')\n\n    let patterns: RegexPatterns = {\n      variant: sanitize(this.variants) || DEFAULT_GLOBAL_PATTERN,\n      utility: sanitize(this.utilities) || DEFAULT_GLOBAL_PATTERN,\n      value: DEFAULT_GLOBAL_PATTERN\n    }\n    let regexp = createMatcher(patterns.variant, patterns.utility, patterns.value)\n\n    for (const plugin of this.sanitizePlugin('regexp')) {\n      if (plugin.regexp) {\n        try {\n          const context: ParseContext = { patterns, regexp }\n\n          const result = plugin.regexp(context)\n\n          if (result) {\n            if (result.patterns) {\n              patterns = { ...patterns, ...result.patterns }\n            }\n\n            if (result.regexp) {\n              const regexResult = result.regexp\n              regexp = typeof regexResult === 'string' ? new RegExp(regexResult) : regexResult\n            } else {\n              regexp = createMatcher(patterns.variant, patterns.utility, patterns.value)\n            }\n          }\n        } catch (err) {\n          createPluginError('regexp', plugin.name, err)\n        }\n      }\n    }\n\n    this._matcherCache = { patterns, regexp }\n    return this._matcherCache\n  }\n\n  public parse(className: string): (undefined | string)[] | any | null {\n    if (!className || typeof className !== 'string') return null\n\n    const cached = this._parseCache.get(className)\n    if (cached) return cached\n\n    let { patterns, regexp } = this.regexp()\n\n    const pluginResult = this.processPlugin('parse', className, { patterns, regexp })\n    const result = isValidResult(pluginResult) ? pluginResult : className.match(regexp)\n    this._parseCache.set(className, result)\n    return result\n  }\n\n  public processAny(member: 'value' | 'variant', value: string): string | null {\n    if (!['value', 'variant'].includes(member) || !value) return null\n\n    const cacheStorage = member === 'value' ? this._valueCache : this._variantCache\n\n    const cached = cacheStorage.get(value)\n    if (cached) return cached\n\n    const pluginResult = this.processPlugin(member, value)\n    const variantOrValue = member === 'variant' ? this.variants[value] || null : value\n\n    const result = isValidResult(pluginResult) ? pluginResult : variantOrValue\n    cacheStorage.set(value, result)\n    return result\n  }\n\n  public processValue = (value: string): string | null => this.processAny('value', value)\n\n  public processVariant = (variant: string): string | null => this.processAny('variant', variant)\n\n  public processUtility<T = BaseProcessResult>({\n    variant = null,\n    utility = '',\n    value = '',\n    className = ''\n  }: {\n    variant?: string | null\n    utility?: string\n    value?: string\n    className?: string\n  } = {}): T | (BaseProcessResult & DefaultProcessUtilityResult) | unknown {\n    const cacheKey = `${variant || ''}:${utility}:${value}:${className}`\n\n    const cached = this._utilityCache.get(cacheKey)\n    if (cached) return cached\n\n    const mainContext = {\n      className,\n      utility: this.utilities[utility],\n      value: this.processValue(value),\n      variant: variant ? this.processVariant(variant) : null,\n      match: this.parse(className)\n    }\n\n    const context = this.processPlugin('beforeUtility', mainContext) || mainContext\n\n    const pluginResult = this.processPlugin('utility', context)\n\n    const beforeResult = isValidResult(pluginResult) ? pluginResult : context\n\n    const afterUtilityResult = this.processPlugin('afterUtility', beforeResult)\n\n    const result = (\n      isValidResult(afterUtilityResult) ? afterUtilityResult : beforeResult\n    ) satisfies BaseProcessResult & DefaultProcessUtilityResult\n\n    this._utilityCache.set(cacheKey, result)\n    return result\n  }\n\n  public processClassName<T>(className: string): T | null {\n    if (!className || typeof className !== 'string') return null\n\n    const cached = this._cnCache.get(className)\n    if (cached) return cached\n\n    const pluginResult = this.processPlugin('process', className)\n\n    if (isValidResult(pluginResult)) {\n      this._cnCache.set(className, pluginResult)\n      return pluginResult as T\n    }\n\n    const parsed = this.parse(className)\n    if (!parsed) {\n      this._cnCache.set(className, null)\n      return null\n    }\n\n    const [, variant, utility, value] = parsed\n    const processed = this.processUtility({ variant, utility, value, className })\n\n    this._cnCache.set(className, processed)\n    return processed ? (processed as T) : null\n  }\n\n  public process<T = unknown>(classNames: string | string[]): T[] | T | null {\n    const classList = Array.isArray(classNames) ? classNames : classNames.split(/\\s+/)\n    if (classList.length === 0) return []\n\n    const results: T[] = []\n    for (let i = 0; i < classList.length; i++) {\n      const result = this.processClassName<T>(classList[i])\n      if (result) results.push(result)\n    }\n\n    return (this.processPlugin('done', results) || results) as T\n  }\n}\n\nexport * from './types'\nexport default TenoxUI\n"],"mappings":";AAAA,IAAa,EAAb,KAA4B,CAI1B,YAAY,EAAkB,IAAM,CAClC,KAAK,MAAQ,IAAI,IACjB,KAAK,QAAU,EAGjB,IAAI,EAAuB,CACzB,GAAI,CAAC,KAAK,MAAM,IAAI,EAAI,CAAE,OAE1B,IAAM,EAAQ,KAAK,MAAM,IAA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