{"version":3,"file":"helper-DIqIjHVw.cjs","names":["MEDIA_SCHEME_THEME","defaultColorSchemes","defaultMetaColorSchemeValue","defaultThemes","defaultMetaColorSchemeValue"],"sources":["../src/themes/utils/internal.ts","../src/themes/internals/initial-script-theme.ts","../src/themes/internals/helper.ts"],"sourcesContent":["import {\n  isArray,\n  isNonEmptyString,\n  isString,\n  isServer,\n  isBoolean\n} from \"@rzl-zone/utils-js/predicates\";\n\nimport type { Attribute, RzlThemeProviderProps, ThemeCtx } from \"../types\";\nimport {\n  defaultColorSchemes,\n  defaultMetaColorSchemeValue,\n  MEDIA_SCHEME_THEME\n} from \"../configs\";\n\n/** @internal */\nexport const saveToLS = (storageKey: string, value?: string): void => {\n  if (isServer()) return undefined;\n  // Save to storage\n  if (isNonEmptyString(storageKey) && isNonEmptyString(value)) {\n    try {\n      localStorage.setItem(storageKey, value);\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    } catch (e) {\n      // Unsupported\n    }\n  }\n};\n\n/** @internal */\nexport const getTheme = (\n  key: string,\n  validTheme: ThemeCtx[\"themes\"],\n  fallback?: ThemeCtx[\"theme\"]\n): ThemeCtx[\"theme\"] => {\n  if (isServer()) return undefined;\n\n  let theme: ThemeCtx[\"theme\"] | undefined;\n  try {\n    const stored = localStorage.getItem(key);\n    theme = stored && validTheme.includes(stored) ? stored : fallback;\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  } catch (e) {\n    // Unsupported\n  }\n\n  return theme ?? fallback;\n};\n\n/** @internal */\nexport const disableAnimation = (nonce?: string): VoidFunction | undefined => {\n  if (isServer()) return undefined;\n\n  const css = document.createElement(\"style\");\n  if (isNonEmptyString(nonce)) css.setAttribute(\"nonce\", nonce);\n  css.appendChild(\n    document.createTextNode(\n      \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\"\n    )\n  );\n  document.head.appendChild(css);\n\n  return () => {\n    // Force restyle\n    (() => window.getComputedStyle(document.body))();\n\n    // Wait for next tick before removing\n    setTimeout(() => {\n      document.head.removeChild(css);\n    }, 1);\n  };\n};\n\n/** @internal */\nexport const getSystemTheme = (mql?: MediaQueryList | MediaQueryListEvent) => {\n  if (!mql) mql = window?.matchMedia(MEDIA_SCHEME_THEME);\n  return mql?.matches ? \"dark\" : \"light\";\n};\n\n/** @internal */\nexport const updateMetaThemeColor = ({\n  theme,\n  enableMetaColorScheme,\n  metaColorSchemeValue\n}: {\n  theme: string | undefined;\n  enableMetaColorScheme: boolean | undefined;\n  metaColorSchemeValue: {\n    light: string;\n    dark: string;\n  };\n}): void => {\n  if (\n    !isServer() &&\n    isString(theme) &&\n    isBoolean(enableMetaColorScheme) &&\n    enableMetaColorScheme === true\n  ) {\n    document\n      // eslint-disable-next-line quotes\n      .querySelectorAll('meta[name=\"theme-color\"][data-rzl-theme]')\n      .forEach((el) => el.remove());\n\n    if (theme === \"dark\") {\n      const meta = document.createElement(\"meta\");\n      meta.name = \"theme-color\";\n      meta.content = metaColorSchemeValue.dark;\n      meta.setAttribute(\"data-rzl-theme\", \"dark\");\n      document.head.appendChild(meta);\n    } else if (theme === \"light\") {\n      const meta = document.createElement(\"meta\");\n      meta.name = \"theme-color\";\n      meta.content = metaColorSchemeValue.light;\n      meta.setAttribute(\"data-rzl-theme\", \"light\");\n      document.head.appendChild(meta);\n    } else {\n      const meta1 = document.createElement(\"meta\");\n      meta1.name = \"theme-color\";\n      meta1.content = metaColorSchemeValue.dark;\n      meta1.media = \"(prefers-color-scheme: dark)\";\n      meta1.setAttribute(\"data-rzl-theme\", \"dark\");\n      document.head.appendChild(meta1);\n\n      const meta2 = document.createElement(\"meta\");\n      meta2.name = \"theme-color\";\n      meta2.content = metaColorSchemeValue.light;\n      meta2.media = \"(prefers-color-scheme: light)\";\n      meta2.setAttribute(\"data-rzl-theme\", \"light\");\n      document.head.appendChild(meta2);\n    }\n  }\n};\n\n/** @internal */\ntype NonUndefRzlThemeProviderProps = Required<RzlThemeProviderProps>;\n\n/** @internal */\nexport const handlingApplyTheme = ({\n  attribute,\n  attributes,\n  theme,\n  defaultTheme,\n  enableColorScheme,\n  name,\n  resolved\n}: {\n  name: string | undefined;\n  resolved: string;\n  theme: string | undefined;\n  defaultTheme: string;\n  attributes: string[];\n  attribute: NonUndefRzlThemeProviderProps[\"attribute\"];\n  enableColorScheme: NonUndefRzlThemeProviderProps[\"enableColorScheme\"];\n}): void => {\n  if (isServer()) return undefined;\n\n  const docEl = document.documentElement;\n  const bodyEl = document.body;\n\n  const handleAttribute = (attr: Attribute) => {\n    if (attr === \"class\") {\n      if (attributes.length > 0) docEl.classList.remove(...attributes);\n      if (name) docEl.classList.add(name);\n    } else if (attr.startsWith(\"data-\")) {\n      if (name) {\n        docEl.setAttribute(attr, name);\n      } else {\n        docEl.removeAttribute(attr);\n      }\n    }\n  };\n\n  if (isArray(attribute)) {\n    attribute.forEach(handleAttribute);\n  } else {\n    handleAttribute(attribute);\n  }\n\n  if (enableColorScheme !== false) {\n    const fallback = defaultColorSchemes.includes(defaultTheme)\n      ? defaultTheme\n      : null;\n    let colorScheme = defaultColorSchemes.includes(resolved)\n      ? resolved\n      : fallback;\n    if (colorScheme) {\n      const defaultValidColorScheme = [\"light\", \"dark\", \"system\"];\n\n      if (colorScheme === \"system\") colorScheme = getSystemTheme();\n\n      if (enableColorScheme === \"body\") {\n        if (theme && defaultValidColorScheme.includes(theme)) {\n          bodyEl.style.colorScheme = colorScheme;\n        } else {\n          bodyEl.style.removeProperty(\"color-scheme\");\n\n          if (bodyEl.getAttribute(\"style\")?.trim() === \"\") {\n            bodyEl.removeAttribute(\"style\");\n          }\n        }\n      } else if (enableColorScheme === \"html\") {\n        if (theme && defaultValidColorScheme.includes(theme)) {\n          docEl.style.colorScheme = colorScheme;\n        } else {\n          docEl.style.removeProperty(\"color-scheme\");\n\n          if (docEl.getAttribute(\"style\")?.trim() === \"\") {\n            docEl.removeAttribute(\"style\");\n          }\n        }\n      }\n    }\n  }\n};\n\n/** @internal */\nexport function normalizeThemes<T extends unknown[]>(\n  themes: T,\n  enableSystem: boolean\n): T {\n  const cleaned = themes.filter((t) => t !== \"system\");\n\n  const set = new Set(cleaned);\n\n  if (enableSystem) set.add(\"system\");\n  else set.delete(\"system\");\n\n  return Array.from(set) as T;\n}\n\n/** @internal */\nexport const setMetaColorSchemeValue = (\n  metaColorSchemeValue?: RzlThemeProviderProps[\"metaColorSchemeValue\"]\n) => {\n  return {\n    ...defaultMetaColorSchemeValue,\n    ...metaColorSchemeValue\n  };\n};\n","/** @internal */\nexport const initialScriptTheme = (\n  storageKey: string,\n  attribute: string | string[],\n  defaultTheme: string,\n  forcedTheme: string | null | undefined,\n  themes: string[],\n  value: { [x: string]: string },\n  enableSystem: boolean | undefined,\n  metaColorSchemeValue: {\n    light: string;\n    dark: string;\n  },\n  enableColorScheme?: \"html\" | \"body\" | false | undefined,\n  enableMetaColorScheme?: boolean | undefined\n) => {\n  const docEl = document.documentElement;\n  const bodyEl = document.body;\n\n  const updateDOM = (theme: string) => {\n    const attributes = Array.isArray(attribute) ? attribute : [attribute];\n\n    attributes.forEach((attr) => {\n      const isClass = attr === \"class\";\n      const classes =\n        isClass && value ? themes.map((t) => value[t] || t) : themes;\n      if (isClass) {\n        if (classes.length > 0) docEl.classList.remove(...classes);\n        docEl.classList.add(value && value[theme] ? value[theme] : theme);\n      } else {\n        docEl.setAttribute(attr, theme);\n      }\n    });\n\n    setColorScheme(theme, enableColorScheme);\n    updateMetaThemeColor({\n      theme,\n      enableMetaColorScheme,\n      metaColorSchemeValue\n    });\n  };\n\n  const updateMetaThemeColor = ({\n    theme,\n    enableMetaColorScheme,\n    metaColorSchemeValue\n  }: {\n    theme: string | undefined;\n    enableMetaColorScheme: boolean | undefined;\n    metaColorSchemeValue: {\n      light: string;\n      dark: string;\n    };\n  }) => {\n    if (typeof document !== \"undefined\" && enableMetaColorScheme === true) {\n      document\n        // eslint-disable-next-line quotes\n        .querySelectorAll('meta[name=\"theme-color\"][data-rzl-theme]')\n        .forEach((el) => el.remove());\n\n      if (theme === \"dark\" && metaColorSchemeValue.dark) {\n        const meta = document.createElement(\"meta\");\n        meta.name = \"theme-color\";\n        meta.content = metaColorSchemeValue.dark;\n        meta.setAttribute(\"data-rzl-theme\", \"dark\");\n        document.head.appendChild(meta);\n      } else if (theme === \"light\" && metaColorSchemeValue.light) {\n        const meta = document.createElement(\"meta\");\n        meta.name = \"theme-color\";\n        meta.content = metaColorSchemeValue.light;\n        meta.setAttribute(\"data-rzl-theme\", \"light\");\n        document.head.appendChild(meta);\n      } else {\n        if (metaColorSchemeValue.dark) {\n          const meta1 = document.createElement(\"meta\");\n          meta1.name = \"theme-color\";\n          meta1.content = metaColorSchemeValue.dark;\n          meta1.media = \"(prefers-color-scheme: dark)\";\n          meta1.setAttribute(\"data-rzl-theme\", \"dark\");\n          document.head.appendChild(meta1);\n        }\n\n        if (metaColorSchemeValue.light) {\n          const meta2 = document.createElement(\"meta\");\n          meta2.name = \"theme-color\";\n          meta2.content = metaColorSchemeValue.light;\n          meta2.media = \"(prefers-color-scheme: light)\";\n          meta2.setAttribute(\"data-rzl-theme\", \"light\");\n          document.head.appendChild(meta2);\n        }\n      }\n    }\n  };\n\n  const setColorScheme = (\n    theme: string,\n    enableColorScheme?: \"html\" | \"body\" | false | undefined\n  ) => {\n    if (enableColorScheme !== false) {\n      const defaultColorSchemes = [\"light\", \"dark\"];\n\n      const fallback = defaultColorSchemes.includes(defaultTheme)\n        ? defaultTheme\n        : null;\n      let colorScheme = defaultColorSchemes.includes(theme) ? theme : fallback;\n      if (colorScheme) {\n        const defaultValidColorScheme = [\"light\", \"dark\", \"system\"];\n        if (colorScheme === \"system\") colorScheme = getSystemTheme();\n\n        if (enableColorScheme === \"body\") {\n          if (theme && defaultValidColorScheme.includes(theme)) {\n            bodyEl.style.colorScheme = colorScheme;\n          } else {\n            bodyEl.style.removeProperty(\"color-scheme\");\n\n            if (bodyEl.getAttribute(\"style\")?.trim() === \"\") {\n              bodyEl.removeAttribute(\"style\");\n            }\n          }\n        } else if (enableColorScheme === \"html\") {\n          if (theme && defaultValidColorScheme.includes(theme)) {\n            docEl.style.colorScheme = colorScheme;\n          } else {\n            docEl.style.removeProperty(\"color-scheme\");\n\n            if (docEl.getAttribute(\"style\")?.trim() === \"\") {\n              docEl.removeAttribute(\"style\");\n            }\n          }\n        }\n      }\n    }\n  };\n\n  const getSystemTheme = () => {\n    return window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n      ? \"dark\"\n      : \"light\";\n  };\n\n  if (typeof forcedTheme === \"string\" && storageKey.trim().length) {\n    updateDOM(forcedTheme);\n  } else {\n    try {\n      const storedTheme =\n        typeof storageKey === \"string\" && storageKey.trim().length\n          ? localStorage.getItem(storageKey)\n          : null;\n      const themeName =\n        storedTheme && themes.includes(storedTheme)\n          ? storedTheme\n          : defaultTheme;\n      const isSystem = enableSystem && themeName === \"system\";\n      const theme = isSystem ? getSystemTheme() : themeName;\n      updateDOM(theme);\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    } catch (e) {\n      // mean is not support, so const skip.\n    }\n  }\n};\n","import {\n  assertIsBoolean,\n  assertIsPlainObject,\n  assertIsString\n} from \"@rzl-zone/utils-js/assertions\";\nimport {\n  getPreciseType,\n  isArray,\n  isBoolean,\n  isNil,\n  isNonEmptyString,\n  isString,\n  isUndefined\n} from \"@rzl-zone/utils-js/predicates\";\nimport { safeStableStringify } from \"@rzl-zone/utils-js/conversions\";\n\nimport { type RzlThemeProviderProps } from \"..\";\nimport { setMetaColorSchemeValue } from \"../utils/internal\";\nimport { defaultMetaColorSchemeValue, defaultThemes } from \"../configs\";\n\nimport type { Attribute } from \"../types\";\n\n/** @internal */\nexport function minifyInnerHTMLScriptInternalOnly<T>(script: T): string {\n  if (isNil(script)) return \"\";\n\n  return (\n    String(script)\n      .replace(/\\/\\/.*(?=[\\n\\r])/g, \"\") // Remove single-line comments\n      .replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\") // Remove multi-line comments\n      .replace(/(?<=\\S)[ \\t]{2,}(?=\\S)/g, \" \") // Remove extra spaces/tabs between words\n      // eslint-disable-next-line no-useless-escape\n      .replace(/\\s*([\\(\\)\\{\\};,?:=<>!&|+\\-*\\/])\\s*/g, \"$1\") // Remove spaces before & after operators and punctuation\n      .replace(/\\[\\s*([^\\]]*?)\\s*\\]/g, \"[$1]\") // Remove spaces inside arrays without touching strings inside\n      .replace(/\\s*(=>|===|!==|==|!=|>=|<=|\\+|-|\\*|\\/|&&|\\|\\|)\\s*/g, \"$1\") // Remove spaces around operators\n      .replace(\n        /\\b(return|if|else|for|while|do|try|catch|finally|switch|case|default|break|continue|throw|typeof|instanceof|in|void|yield|async|await|new|delete|import|export|class|extends|static|get|set)\\s+/g,\n        \"$1 \"\n      ) // Ensure one space after important keywords\n      .replace(/\\b(var|let|const|function)\\s+/g, \"$1 \") // Ensure one space after variable & function declarations\n      .replace(/\\b(\\d+)\\s+([a-zA-Z_$])/g, \"$1$2\") // Remove space between number and letter (e.g., 100 px -> 100px)\n      .replace(/([a-zA-Z_$])\\s*\\(\\s*/g, \"$1(\") // Remove spaces before/after opening parentheses in function calls\n      .replace(/\\)\\s*\\{\\s*/g, \"){\") // Remove spaces before/after `{` following `)`\n      .replace(/;}/g, \"}\") // Remove `;` before `}`\n      .replace(/([{[])\\s*,/g, \"$1\") // Remove commas right after { or [\n      .replace(/,(\\s*[}\\]])/g, \"$1\") // Remove commas before } or ]\n      .replace(/([\"'`])\\s*\\+\\s*([\"'`])/g, \"$1$2\") // Remove unnecessary `+` in string concatenation\n      .replace(/\\bconsole\\.log\\s*\\(.*?\\);?/g, \"\") // Remove all console.log()\n      .replace(/\\bconsole\\.info\\s*\\(.*?\\);?/g, \"\") // Remove all console.info()\n      .replace(/\\bconsole\\.warn\\s*\\(.*?\\);?/g, \"\") // Remove all console.warn()\n      .replace(/\\bconsole\\.error\\s*\\(.*?\\);?/g, \"\") // Remove all console.error()\n      .replace(/\\bconsole\\.debug\\s*\\(.*?\\);?/g, \"\") // Remove all console.debug()\n      .replace(/\\bconsole\\.trace\\s*\\(.*?\\);?/g, \"\") // Remove all console.trace()\n      .replace(/\\bconsole\\.assert\\s*\\(.*?\\);?/g, \"\") // Remove all console.assert()\n      .replace(/\\bconsole\\.time\\s*\\(.*?\\);?/g, \"\") // Remove all console.time()\n      .replace(/\\bconsole\\.timeEnd\\s*\\(.*?\\);?/g, \"\") // Remove all console.timeEnd()\n      .replace(/\\bconsole\\.timeLog\\s*\\(.*?\\);?/g, \"\") // Remove all console.timeLog()\n      .replace(/\\bconsole\\.count\\s*\\(.*?\\);?/g, \"\") // Remove all console.count()\n      .replace(/\\bconsole\\.countReset\\s*\\(.*?\\);?/g, \"\") // Remove all console.countReset()\n      .replace(/\\s{2,}/g, \" \") // Remove remaining excessive spaces\n      .trim()\n  );\n}\n\n/** @internal */\nexport const validateAttributeProps = (\n  attr: Attribute | Attribute[]\n): void | never => {\n  if (!isNonEmptyString(attr)) {\n    throw new TypeError(\n      `Props \\`attribute\\` must be of type \\`string\\` or \\`undefined\\` and value can't be empty-string, but received: \\`${getPreciseType(\n        attr\n      )}\\`.`\n    );\n  }\n  if (attr !== \"class\" && !attr.startsWith(\"data-\")) {\n    throw new TypeError(\n      `Props \\`attribute\\` must be \\`\"class\"\\` or start with \\`\"data-\"\\`, but received value: \\`${safeStableStringify(\n        attr,\n        { keepUndefined: true }\n      )}\\`.`\n    );\n  }\n};\n\n/** @internal */\nexport const validateProps = <EnablingSystem extends boolean = true>(\n  props: RzlThemeProviderProps<EnablingSystem> & { dir: \"app\" | \"pages\" }\n) => {\n  const {\n    forcedTheme,\n    disableTransitionOnChange = true,\n    enableSystem = true,\n    enableColorScheme = \"html\",\n    enableMetaColorScheme = true,\n    storageKey = \"rzl-theme\",\n    defaultTheme: _defaultTheme,\n    attribute = \"data-theme\",\n    value,\n    children,\n    nonce,\n    scriptProps,\n    themes = defaultThemes\n  } = props;\n\n  let { metaColorSchemeValue = defaultMetaColorSchemeValue } = props;\n\n  const providerName =\n    props.dir === \"app\" ? \"RzlThemeAppProvider\" : \"RzlThemePagesProvider\";\n\n  if (!isUndefined(nonce)) {\n    assertIsString(nonce, {\n      message({ currentType, validType }) {\n        return `Props \\`nonce\\` at '${providerName}', must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n      }\n    });\n  }\n\n  if (!isUndefined(value)) {\n    assertIsPlainObject(value, {\n      message({ currentType, validType }) {\n        return `Props \\`value\\` must be a \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n      }\n    });\n\n    for (const [themeName, themeValue] of Object.entries(value)) {\n      if (!isNonEmptyString(themeName)) {\n        throw new TypeError(\n          `Props \\`value\\` at '${providerName}', the key name theme \"${themeName}\" must be of type a \\`string\\` and \\`non-empty string\\`, but received: \\`${getPreciseType(\n            themeName\n          )}\\`, with current value: \\`${safeStableStringify(themeName, {\n            keepUndefined: true\n          })}\\`.`\n        );\n      }\n      if (!isNonEmptyString(themeValue)) {\n        throw new TypeError(\n          `Props \\`value\\` at '${providerName}', the value for theme key \"${themeName}\" must be of type a \\`string\\` and \\`non-empty string\\`, but received: \\`${getPreciseType(\n            themeValue\n          )}\\`, with current value: \\`${safeStableStringify(themeValue, {\n            keepUndefined: true\n          })}\\`.`\n        );\n      }\n    }\n  }\n\n  if (!isUndefined(attribute)) {\n    if (isArray(attribute)) {\n      attribute.forEach(validateAttributeProps);\n    } else {\n      validateAttributeProps(attribute);\n    }\n  }\n\n  if (!isUndefined(_defaultTheme) && !isNonEmptyString(_defaultTheme)) {\n    throw new TypeError(\n      `Props \\`defaultTheme\\` at '${providerName}', must be of type a \\`string\\` and \\`non-empty string\\`, but received: \\`${getPreciseType(\n        _defaultTheme\n      )}\\`.`\n    );\n  }\n  if (!isUndefined(storageKey) && !isNonEmptyString(storageKey)) {\n    throw new TypeError(\n      `Props \\`storageKey\\` at '${providerName}', must be of type \\`string\\` and value cant be \\`empty-string\\`, but received: \\`${getPreciseType(\n        storageKey\n      )}\\`.`\n    );\n  }\n\n  if (\n    (isBoolean(enableColorScheme) && enableColorScheme !== false) ||\n    (isString(enableColorScheme) &&\n      ![\"html\", \"body\"].includes(enableColorScheme))\n  ) {\n    throw new TypeError(\n      `Props \\`enableColorScheme\\` at '${providerName}', must be of type \\`string\\`, \\`boolean\\` and if value is a string must one of (\"body\" or \"html\") if \\`boolean\\` valid value only \\`false\\`, but received: \\`${getPreciseType(\n        enableColorScheme\n      )}\\`, with current value: \\`${safeStableStringify(enableColorScheme, {\n        keepUndefined: true\n      })}\\`.`\n    );\n  }\n\n  if (!isUndefined(forcedTheme) && !isString(forcedTheme)) {\n    throw new TypeError(\n      `Props \\`forcedTheme\\` at '${providerName}', must be of type \\`string\\`, but received: \\`${getPreciseType(\n        forcedTheme\n      )}\\`.`\n    );\n  }\n\n  if (!isUndefined(metaColorSchemeValue)) {\n    assertIsPlainObject(metaColorSchemeValue, {\n      message({ currentType, validType }) {\n        return `Props \\`metaColorSchemeValue\\` at '${providerName}', must be a \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n      }\n    });\n\n    metaColorSchemeValue = setMetaColorSchemeValue(metaColorSchemeValue);\n\n    if (!isNonEmptyString(metaColorSchemeValue.light)) {\n      throw new TypeError(\n        `Props \\`metaColorSchemeValue.light\\` at '${providerName}', must be of type \\`string\\`, but received: \\`${getPreciseType(\n          metaColorSchemeValue.light\n        )}\\`.`\n      );\n    }\n\n    if (!isNonEmptyString(metaColorSchemeValue.dark)) {\n      throw new TypeError(\n        `Props \\`metaColorSchemeValue.dark\\` at '${providerName}', must be of type \\`string\\`, but received: \\`${getPreciseType(\n          metaColorSchemeValue.dark\n        )}\\`.`\n      );\n    }\n  }\n\n  assertIsBoolean(enableSystem, {\n    message({ currentType, validType }) {\n      return `Props \\`enableSystem\\` at '${providerName}', must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n    }\n  });\n  assertIsBoolean(enableMetaColorScheme, {\n    message({ currentType, validType }) {\n      return `Props \\`enableMetaColorScheme\\` at '${providerName}', must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n    }\n  });\n  assertIsBoolean(disableTransitionOnChange, {\n    message({ currentType, validType }) {\n      return `Props \\`disableTransitionOnChange\\` at '${providerName}', must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`;\n    }\n  });\n\n  return {\n    forcedTheme,\n    disableTransitionOnChange,\n    enableSystem,\n    enableColorScheme,\n    enableMetaColorScheme,\n    storageKey,\n    defaultTheme: _defaultTheme,\n    attribute,\n    value,\n    children,\n    nonce,\n    scriptProps,\n    metaColorSchemeValue,\n    themes\n  };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAa,YAAY,YAAoB,UAAyB;CACpE,gDAAa,GAAG,OAAO;CAEvB,wDAAqB,UAAU,yDAAsB,KAAK,GACxD,IAAI;EACF,aAAa,QAAQ,YAAY,KAAK;CAExC,SAAS,GAAG,CAEZ;AAEJ;;AAGA,MAAa,YACX,KACA,YACA,aACsB;CACtB,gDAAa,GAAG,OAAO;CAEvB,IAAI;CACJ,IAAI;EACF,MAAM,SAAS,aAAa,QAAQ,GAAG;EACvC,QAAQ,UAAU,WAAW,SAAS,MAAM,IAAI,SAAS;CAE3D,SAAS,GAAG,CAEZ;CAEA,OAAO,SAAS;AAClB;;AAGA,MAAa,oBAAoB,UAA6C;CAC5E,gDAAa,GAAG,OAAO;CAEvB,MAAM,MAAM,SAAS,cAAc,OAAO;CAC1C,wDAAqB,KAAK,GAAG,IAAI,aAAa,SAAS,KAAK;CAC5D,IAAI,YACF,SAAS,eACP,6KACF,CACF;CACA,SAAS,KAAK,YAAY,GAAG;CAE7B,aAAa;EAEX,OAAO,OAAO,iBAAiB,SAAS,IAAI,EAAC,CAAE;EAG/C,iBAAiB;GACf,SAAS,KAAK,YAAY,GAAG;EAC/B,GAAG,CAAC;CACN;AACF;;AAGA,MAAa,kBAAkB,QAA+C;CAC5E,IAAI,CAAC,KAAK,MAAM,QAAQ,WAAWA,iCAAk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