LazyBoy2/web/src/grok/runtime-theme-token-install...

33 lines
72 KiB
TypeScript
Raw Normal View History

2026-09-14 09:08:20 +00:00
/** Exact immutable runtime theme-token generator and installer.
* Source: index-UbX-y3il.js SHA-256 ef4e9831b65d39633f09c9ad0c083b98b7ebf52e3bb558182aee5bde31f876fa.
* Palette 129583-129644; Bzn/_zn 132849-132920; Urn 46941-47033; tables 8230.
* CORE_CSS is the exact light/dark output of the shipped Urn closure; bzn and
* Ezn remain generators over the complete palette/mapping data below. */
export type RuntimeThemeMode = "light" | "dark";
export interface ThemeStyleElement { id: string; textContent: string | null }
export interface ThemeDocument { documentElement: { dataset: Record<string,string|undefined>; style: { colorScheme: string } }; head: { appendChild(node: ThemeStyleElement): void; removeChild(node: ThemeStyleElement): void }; createElement(tagName: "style"): ThemeStyleElement; getElementById(id: string): ThemeStyleElement | null }
export interface RuntimeThemeInstallHandle { update(mode: RuntimeThemeMode): void; dispose(): void }
export const RUNTIME_THEME_STYLE_ID = "sand-cursor-theme" as const;
export const RUNTIME_THEME_CLASS: Readonly<Record<RuntimeThemeMode,string>> = { light: "cursor-light", dark: "cursor-dark" };
export const IMMUTABLE_THEME_SNAPSHOT_HASHES = {"light":"9e56e8bba144ea6ec97ef4ddf1d3dadbdd9d4741fb173f7431210c2c41ddd569","dark":"df27d452a59e967cf6edce997871098f22435e168aa0c7ecb76d22c07fa24881"};
export const IMMUTABLE_RENDERER_ASSET_SHA256 = "ef4e9831b65d39633f09c9ad0c083b98b7ebf52e3bb558182aee5bde31f876fa" as const;
export const IMMUTABLE_THEME_PALETTE_COUNT = 130 as const;
type ModeValue = string | Readonly<Record<RuntimeThemeMode,string>>;
interface RuntimePaletteEntry { readonly cssVar: string; readonly light: string; readonly dark: string }
const RUNTIME_PALETTE: readonly RuntimePaletteEntry[] = [{"cssVar":"--sand-bg-base","light":"#fcfcfc","dark":"#070707"},{"cssVar":"--sand-bg-subtle","light":"#f7f7f7","dark":"#111111"},{"cssVar":"--sand-bg-elevated","light":"#fcfcfc","dark":"#181818"},{"cssVar":"--sand-bg-fade-base","light":"#fcfcfc00","dark":"#07070700"},{"cssVar":"--sand-bg-fade-subtle","light":"#f7f7f700","dark":"#11111100"},{"cssVar":"--sand-bg-scrim","light":"#14141480","dark":"#141414b2"},{"cssVar":"--sand-bg-scrim-heavy","light":"#141414e5","dark":"#141414f2"},{"cssVar":"--sand-text-primary","light":"#141414","dark":"#fcfcfc"},{"cssVar":"--sand-text-secondary","light":"#14141499","dark":"#fcfcfc99"},{"cssVar":"--sand-text-tertiary","light":"#14141466","dark":"#fcfcfc66"},{"cssVar":"--sand-text-disabled","light":"#1414144d","dark":"#fcfcfc4d"},{"cssVar":"--sand-text-on-primary","light":"#fcfcfc","dark":"#141414"},{"cssVar":"--sand-text-on-color","light":"#fcfcfc","dark":"#fcfcfc"},{"cssVar":"--sand-text-neutral","light":"#3d3d3d","dark":"#b7b7b7"},{"cssVar":"--sand-text-neutral-disabled","light":"#77777721","dark":"#77777733"},{"cssVar":"--sand-text-accent","light":"#0c64c1","dark":"#459ffe"},{"cssVar":"--sand-text-accent-disabled","light":"#1084fe2b","dark":"#1084fe52"},{"cssVar":"--sand-text-success","light":"#009957","dark":"#38d591"},{"cssVar":"--sand-text-success-disabled","light":"#00c97221","dark":"#00c97233"},{"cssVar":"--sand-text-warning","light":"#c27400","dark":"#ffaf38"},{"cssVar":"--sand-text-warning-disabled","light":"#ff980021","dark":"#ff980033"},{"cssVar":"--sand-text-danger","light":"#c21d2e","dark":"#ff5667"},{"cssVar":"--sand-text-danger-disabled","light":"#ff263c2b","dark":"#ff263c52"},{"cssVar":"--sand-text-supplementary1","light":"#c24e00","dark":"#ff8838"},{"cssVar":"--sand-text-supplementary1-disabled","light":"#ff670021","dark":"#ff670033"},{"cssVar":"--sand-text-supplementary2","light":"#734f2e","dark":"#ae8968"},{"cssVar":"--sand-text-supplementary2-disabled","light":"#97683d21","dark":"#97683d33"},{"cssVar":"--sand-text-supplementary3","light":"#008f7e","dark":"#38cbba"},{"cssVar":"--sand-text-supplementary3-disabled","light":"#00bca621","dark":"#00bca633"},{"cssVar":"--sand-text-supplementary4","light":"#6e44c1","dark":"#a97efe"},{"cssVar":"--sand-text-supplementary4-disabled","light":"#9159fe21","dark":"#9159fe33"},{"cssVar":"--sand-text-supplementary5","light":"#c22476","dark":"#ff5eb1"},{"cssVar":"--sand-text-supplementary5-disabled","light":"#ff309b21","dark":"#ff309b33"},{"cssVar":"--sand-text-shimmer-base","light":"#14141466","dark":"#fcfcfc66"},{"cssVar":"--sand-text-shimmer-highlight","light":"#141414","dark":"#fcfcfc"},{"cssVar":"--sand-border-subtle","light":"#1414140d","dark":"#fcfcfc0d"},{"cssVar":"--sand-border-weak","light":"#1414141a","dark":"#fcfcfc1a"},{"cssVar":"--sand-border-default","light":"#14141426","dark":"#fcfcfc26"},{"cssVar":"--sand-border-strong","light":"#1414144d","dark":"#fcfcfc4d"},{"cssVar":"--sand-border-focus","light":"#14141466","dark":"#fcfcfc66"},{"cssVar":"--sand-border-accent","light":"#459ffe","dark":"#0c64c1"},{"cssVar":"--sand-border-accent-subtle","light":"#1084fe2b","dark":"#1084fe52"},{"cssVar":"--sand-border-success","light":"#38d591","dark":"#009957"},{"cssVar":"--sand-border-success-subtle","light":"#00c9722b","dark":"#00c97252"},{"cssVar":"--sand-border-warning","light":"#ffaf38","dark":"#c27400"},{"cssVar":"--sand-border-warning-subtle","light":"#ff98002b","dark":"#ff980052"},{"cssVar":"--sand-border-danger","light":"#ff5667","dark":"#c21d2e"},{"cssVar":"--sand-border-danger-subtle","light":"#ff263c2b","dark":"#ff263c52"},{"cssVar":"--sand-border-supplementary5-subtle","light":"#ff309b2b","dark":"#ff309b52"},{"cssVar":"--sand-border-cutout-on-base","light":"#fcfcfc","dark":"#141414"},{"cssVar":"--sand-border-cutout-on-subtle","light":"#f7f7f7","dark":"#111111"},{"cssVar":"--sand-border-cutout-on-elevated","light":"#fcfcfc","dark":"#181818"},{"cssVar":"--sand-fill-primary","light":"#070707","dark":"#fafafa"},{"cssVar":"--sand-fill-primary-hover","light":"#2f2f2f","dar
const SAND_DATA: Readonly<Record<RuntimeThemeMode,Readonly<Record<string,string>>>> = {"light":{"--sand-data-gray-1":"#b7b7b7","--sand-data-gray-2":"#959595","--sand-data-gray-3":"#777777","--sand-data-gray-4":"#5a5a5a","--sand-data-gray-5":"#3d3d3d","--sand-data-blue-1":"#80befe","--sand-data-blue-2":"#459ffe","--sand-data-blue-3":"#1084fe","--sand-data-blue-4":"#0c64c1","--sand-data-blue-5":"#084382","--sand-data-red-1":"#ff8c98","--sand-data-red-2":"#ff5667","--sand-data-red-3":"#ff263c","--sand-data-red-4":"#c21d2e","--sand-data-red-5":"#82131f","--sand-data-orange-1":"#ffae78","--sand-data-orange-2":"#ff8838","--sand-data-orange-3":"#ff6700","--sand-data-orange-4":"#c24e00","--sand-data-orange-5":"#823500","--sand-data-yellow-1":"#ffc878","--sand-data-yellow-2":"#ffaf38","--sand-data-yellow-3":"#ff9800","--sand-data-yellow-4":"#c27400","--sand-data-yellow-5":"#824e00","--sand-data-green-1":"#78e2b4","--sand-data-green-2":"#38d591","--sand-data-green-3":"#00c972","--sand-data-green-4":"#009957","--sand-data-green-5":"#00673a","--sand-data-cyan-1":"#78dbd0","--sand-data-cyan-2":"#38cbba","--sand-data-cyan-3":"#00bca6","--sand-data-cyan-4":"#008f7e","--sand-data-cyan-5":"#006055","--sand-data-purple-1":"#c5a7fe","--sand-data-purple-2":"#a97efe","--sand-data-purple-3":"#9159fe","--sand-data-purple-4":"#6e44c1","--sand-data-purple-5":"#4a2d82","--sand-data-magenta-1":"#ff91ca","--sand-data-magenta-2":"#ff5eb1","--sand-data-magenta-3":"#ff309b","--sand-data-magenta-4":"#c22476","--sand-data-magenta-5":"#82184f","--sand-data-brown-1":"#c8af98","--sand-data-brown-2":"#ae8968","--sand-data-brown-3":"#97683d","--sand-data-brown-4":"#734f2e","--sand-data-brown-5":"#4d351f","--sand-gradient-bg1-fade":"linear-gradient(to bottom, var(--sand-bg-base), var(--sand-bg-fade-base))","--sand-gradient-bg2-fade":"linear-gradient(to bottom, var(--sand-bg-subtle), var(--sand-bg-fade-subtle))","--sand-gradient-text-shimmer":"linear-gradient(90deg, var(--sand-text-shimmer-base) 0%, var(--sand-text-shimmer-base) 25%, var(--sand-text-shimmer-highlight) 60%, var(--sand-text-shimmer-base) 75%, var(--sand-text-shimmer-base) 100%)","--sand-blur-background":"24px"},"dark":{"--sand-data-gray-1":"#3d3d3d","--sand-data-gray-2":"#5a5a5a","--sand-data-gray-3":"#777777","--sand-data-gray-4":"#959595","--sand-data-gray-5":"#b7b7b7","--sand-data-blue-1":"#084382","--sand-data-blue-2":"#0c64c1","--sand-data-blue-3":"#1084fe","--sand-data-blue-4":"#459ffe","--sand-data-blue-5":"#80befe","--sand-data-red-1":"#82131f","--sand-data-red-2":"#c21d2e","--sand-data-red-3":"#ff263c","--sand-data-red-4":"#ff5667","--sand-data-red-5":"#ff8c98","--sand-data-orange-1":"#823500","--sand-data-orange-2":"#c24e00","--sand-data-orange-3":"#ff6700","--sand-data-orange-4":"#ff8838","--sand-data-orange-5":"#ffae78","--sand-data-yellow-1":"#824e00","--sand-data-yellow-2":"#c27400","--sand-data-yellow-3":"#ff9800","--sand-data-yellow-4":"#ffaf38","--sand-data-yellow-5":"#ffc878","--sand-data-green-1":"#00673a","--sand-data-green-2":"#009957","--sand-data-green-3":"#00c972","--sand-data-green-4":"#38d591","--sand-data-green-5":"#78e2b4","--sand-data-cyan-1":"#006055","--sand-data-cyan-2":"#008f7e","--sand-data-cyan-3":"#00bca6","--sand-data-cyan-4":"#38cbba","--sand-data-cyan-5":"#78dbd0","--sand-data-purple-1":"#4a2d82","--sand-data-purple-2":"#6e44c1","--sand-data-purple-3":"#9159fe","--sand-data-purple-4":"#a97efe","--sand-data-purple-5":"#c5a7fe","--sand-data-magenta-1":"#82184f","--sand-data-magenta-2":"#c22476","--sand-data-magenta-3":"#ff309b","--sand-data-magenta-4":"#ff5eb1","--sand-data-magenta-5":"#ff91ca","--sand-data-brown-1":"#4d351f","--sand-data-brown-2":"#734f2e","--sand-data-brown-3":"#97683d","--sand-data-brown-4":"#ae8968","--sand-data-brown-5":"#c8af98","--sand-gradient-bg1-fade":"linear-gradient(to bottom, var(--sand-bg-base), var(--sand-bg-fade-base))","--sand-gradient-bg2-fade":"linear-gradient(to bottom, var(--sand-bg-subtle), var(--sand-bg-fade-subtle))","--sand-gradient-text-shimmer":"linear-gradient(90deg, var(--sand-text-shimmer-base) 0%, var(--sand-te
export const IMMUTABLE_SZN_PALETTE_MAPPING: Readonly<Record<string,ModeValue>> = {"--cursor-text-primary":"var(--sand-text-primary)","--cursor-text-secondary":"var(--sand-text-secondary)","--cursor-text-tertiary":"var(--sand-text-tertiary)","--cursor-text-quaternary":{"light":"#1414144d","dark":"#fcfcfc4d"},"--cursor-text-invert":"var(--sand-text-on-color)","--cursor-text-accent":"var(--sand-text-accent)","--cursor-text-link":"var(--sand-text-accent)","--cursor-foreground":"var(--sand-fill-bubble-user)","--cursor-icon-primary":"var(--sand-text-primary)","--cursor-icon-secondary":"var(--sand-text-secondary)","--cursor-icon-tertiary":"var(--sand-text-tertiary)","--cursor-icon-quaternary":{"light":"#1414144d","dark":"#fcfcfc4d"},"--cursor-icon-accent-primary":"var(--sand-text-accent)","--cursor-bg-editor":"var(--sand-bg-base)","--cursor-bg-chrome":"var(--sand-bg-subtle)","--cursor-bg-elevated":"var(--sand-bg-elevated)","--cursor-bg-input":"var(--sand-fill-elevated)","--cursor-bg-card":"var(--sand-fill-secondary)","--cursor-bg-quaternary":"var(--sand-fill-secondary)","--cursor-bg-quinary":"var(--sand-fill-secondary-disabled)","--cursor-bg-tertiary":"var(--sand-fill-ghost-hover)","--cursor-bg-secondary":"var(--sand-fill-ghost-selected)","--cursor-bg-active":"var(--sand-fill-ghost-selected)","--cursor-bg-hover":"var(--sand-fill-ghost-hover)","--cursor-bg-selected":"var(--sand-fill-ghost-selected)","--cursor-bg-focused":"var(--sand-fill-ghost-selected)","--cursor-bg-primary":"var(--sand-fill-ghost-selected)","--cursor-bg-accent":"var(--sand-fill-accent)","--cursor-bg-accent-hover":"var(--sand-fill-accent-hover)","--cursor-bg-accent-secondary":"var(--sand-fill-accent-subtle)","--cursor-bg-accent-tertiary":"var(--sand-fill-accent-subtle)","--cursor-bg-accent-quaternary":"var(--sand-fill-accent-subtle)","--cursor-accent-color":"var(--sand-fill-accent)","--cursor-stroke-primary":{"light":"#14141433","dark":"#fcfcfc33"},"--cursor-stroke-secondary":"var(--sand-border-default)","--cursor-stroke-tertiary":{"light":"#1414141a","dark":"#fcfcfc1a"},"--cursor-stroke-quaternary":{"light":"#1414140d","dark":"#fcfcfc0d"},"--cursor-stroke-focused":"var(--sand-border-focus)","--cursor-stroke-accent":"var(--sand-fill-accent)","--cursor-stroke-red":"var(--sand-fill-danger)","--cursor-stroke-cyan-primary":{"light":"#008f7e","dark":"#38cbba"},"--cursor-border-color":"var(--sand-border-default)","--cursor-text-git-added-primary":"var(--sand-text-success)","--cursor-text-git-removed-primary":"var(--sand-text-danger)","--cursor-box-shadow-sm":"0 1px 3px 0 var(--sand-shadow-control)","--cursor-box-shadow-md":"0 10px 20px -3px var(--sand-shadow-popover-ambient), 0 4px 6px -4px var(--sand-shadow-popover-key), 0 0 0 1px var(--sand-shadow-ring)","--cursor-box-shadow-lg":"0 22px 70px 4px var(--sand-shadow-window-ambient), 0 0 0 0.5px var(--sand-shadow-window-edge)","--cursor-shadow-md":"0 10px 20px -3px var(--sand-shadow-popover-ambient), 0 4px 6px -4px var(--sand-shadow-popover-key), 0 0 0 1px var(--sand-shadow-ring)","--cursor-shadow-primary":"#1414144d","--sand-agent-selected-fill":"var(--sand-fill-ghost-selected)","--sand-floating-control-surface":"var(--sand-fill-elevated)","--ui-tooltip-border-width":"0.5px","--ui-tooltip-border-radius":"6px","--ui-tooltip-box-shadow":"0 4px 12px -1px var(--sand-shadow-inline-ambient), 0 2px 4px -2px var(--sand-shadow-inline-key), 0 0 0 1px var(--sand-shadow-ring)","--ui-tooltip-font-size":"12px","--ui-tooltip-line-height":"16px","--ui-tooltip-letter-spacing":"0","--ui-tooltip-padding-y":"4px","--ui-tooltip-padding-x":"6px"};
const NZN_TOKENS: Readonly<Record<string,ModeValue>> = {"--cursor-text-red-primary":{"light":"#c21d2e","dark":"#ff5667"},"--cursor-icon-red-primary":{"light":"#c21d2e","dark":"#ff5667"},"--cursor-bg-red-primary":{"light":"#ff263c","dark":"#ff263c"},"--cursor-bg-red-secondary":{"light":"#ff263c17","dark":"#ff263c2c"},"--cursor-text-orange-primary":{"light":"#c24e00","dark":"#ff8838"},"--cursor-icon-orange-primary":{"light":"#c24e00","dark":"#ff8838"},"--cursor-bg-orange-primary":{"light":"#ff6700","dark":"#ff6700"},"--cursor-bg-orange-secondary":{"light":"#ff670017","dark":"#ff67002c"},"--cursor-text-yellow-primary":{"light":"#c27400","dark":"#ffaf38"},"--cursor-icon-yellow-primary":{"light":"#c27400","dark":"#ffaf38"},"--cursor-bg-yellow-primary":{"light":"#ff9800","dark":"#ff9800"},"--cursor-bg-yellow-secondary":{"light":"#ff980017","dark":"#ff98002c"},"--cursor-text-green-primary":{"light":"#009957","dark":"#38d591"},"--cursor-icon-green-primary":{"light":"#009957","dark":"#38d591"},"--cursor-bg-green-primary":{"light":"#00c972","dark":"#00c972"},"--cursor-bg-green-secondary":{"light":"#00c97217","dark":"#00c9722c"},"--cursor-text-cyan-primary":{"light":"#008f7e","dark":"#38cbba"},"--cursor-icon-cyan-primary":{"light":"#008f7e","dark":"#38cbba"},"--cursor-bg-cyan-primary":{"light":"#00bca6","dark":"#00bca6"},"--cursor-bg-cyan-secondary":{"light":"#00bca617","dark":"#00bca62c"},"--cursor-text-blue-primary":{"light":"#0c64c1","dark":"#459ffe"},"--cursor-icon-blue-primary":{"light":"#0c64c1","dark":"#459ffe"},"--cursor-bg-blue-primary":{"light":"#1084fe","dark":"#1084fe"},"--cursor-bg-blue-secondary":{"light":"#1084fe17","dark":"#1084fe2c"},"--cursor-text-magenta-primary":{"light":"#c22476","dark":"#ff5eb1"},"--cursor-icon-magenta-primary":{"light":"#c22476","dark":"#ff5eb1"},"--cursor-bg-magenta-primary":{"light":"#ff309b","dark":"#ff309b"},"--cursor-bg-magenta-secondary":{"light":"#ff309b17","dark":"#ff309b2c"},"--cursor-text-purple-primary":{"light":"#6e44c1","dark":"#a97efe"},"--cursor-icon-purple-primary":{"light":"#6e44c1","dark":"#a97efe"},"--cursor-bg-purple-primary":{"light":"#9159fe","dark":"#9159fe"},"--cursor-bg-purple-secondary":{"light":"#9159fe17","dark":"#9159fe2c"}};
function rootBlock(d: readonly string[]): string { return ':root {\n' + d.join('\n') + '\n}'; }
export function bzn(mode: RuntimeThemeMode): string { const d=RUNTIME_PALETTE.map(e=>" "+e.cssVar+": "+e[mode]+";"); for(const [n,v] of Object.entries(SAND_DATA[mode])) if(!n.startsWith("--sand-gradient-")&&n!=="--sand-blur-background") d.push(" "+n+": "+v+";"); d.push(" --sand-gradient-bg1-fade: linear-gradient(to bottom, var(--sand-bg-base), var(--sand-bg-fade-base));"," --sand-gradient-bg2-fade: linear-gradient(to bottom, var(--sand-bg-subtle), var(--sand-bg-fade-subtle));"," --sand-gradient-text-shimmer: linear-gradient(90deg, var(--sand-text-shimmer-base) 0%, var(--sand-text-shimmer-base) 25%, var(--sand-text-shimmer-highlight) 60%, var(--sand-text-shimmer-base) 75%, var(--sand-text-shimmer-base) 100%);"," --sand-blur-background: 24px;"); return rootBlock(d); }
function resolveModeValue(v: ModeValue,m: RuntimeThemeMode): string { return typeof v === "string" ? v : v[m]; }
export function Ezn(mode: RuntimeThemeMode): string { const d:string[]=[]; for(const [n,v] of Object.entries({...NZN_TOKENS,...IMMUTABLE_SZN_PALETTE_MAPPING})) d.push(" "+n+": "+resolveModeValue(v,mode)+";"); return rootBlock(d); }
const CORE_CSS: Readonly<Record<RuntimeThemeMode,string>> = {"light":":root {\n --cursor-accent: #1084fe;\n --cursor-action-label: #fcfcfc;\n --cursor-added: #00c972;\n --cursor-base: #141414;\n --cursor-blue: #1084fe;\n --cursor-brand: #f54e00;\n --cursor-chrome: #f7f7f7;\n --cursor-cyan: #00bca6;\n --cursor-danger: #c21d2e;\n --cursor-diff-added-line-background: #00c97217;\n --cursor-diff-added-text-background: #00c97210;\n --cursor-diff-removed-line-background: #ff263c17;\n --cursor-diff-removed-text-background: #ff263c10;\n --cursor-editor: #fcfcfc;\n --cursor-focus: #459ffe;\n --cursor-green: #00c972;\n --cursor-magenta: #ff309b;\n --cursor-modified: #ff9800;\n --cursor-orange: #ff6700;\n --cursor-purple: #9159fe;\n --cursor-red: #ff263c;\n --cursor-removed: #c21d2e;\n --cursor-sidebar: #f7f7f7;\n --cursor-success: #00c972;\n --cursor-terminal-ansi-black: #141414;\n --cursor-terminal-ansi-blue: #0c64c1;\n --cursor-terminal-ansi-bright-black: #141414bd;\n --cursor-terminal-ansi-bright-blue: #1084fe;\n --cursor-terminal-ansi-bright-cyan: #00bca6;\n --cursor-terminal-ansi-bright-green: #00c972;\n --cursor-terminal-ansi-bright-magenta: #ff309b;\n --cursor-terminal-ansi-bright-red: #ff263c;\n --cursor-terminal-ansi-bright-white: #ffffff;\n --cursor-terminal-ansi-bright-yellow: #ff9800;\n --cursor-terminal-ansi-cyan: #008f7e;\n --cursor-terminal-ansi-green: #009957;\n --cursor-terminal-ansi-magenta: #c22476;\n --cursor-terminal-ansi-red: #c21d2e;\n --cursor-terminal-ansi-white: #fcfcfc;\n --cursor-terminal-ansi-yellow: #c27400;\n --cursor-untracked: #008f7e;\n --cursor-warn: #ff9800;\n --cursor-yellow: #ff9800;\n}\n:root {\n\t--cursor-foreground: var(--cursor-base);\n\t--cursor-text-primary: var(--cursor-base);\n\t--cursor-text-secondary: color-mix(in srgb, var(--cursor-base) 74%, transparent);\n\t--cursor-text-tertiary: color-mix(in srgb, var(--cursor-base) 60%, transparent);\n\t--cursor-text-quaternary: color-mix(in srgb, var(--cursor-base) 36%, transparent);\n\t--cursor-text-invert: var(--cursor-editor);\n\t--cursor-text-active: var(--cursor-text-primary);\n\t--cursor-text-focused: var(--cursor-text-primary);\n\t--cursor-text-git-added-primary: var(--cursor-added);\n\t--cursor-text-git-added-secondary: color-mix(in srgb, var(--cursor-added) 78%, transparent);\n\t--cursor-text-git-added-tertiary: color-mix(in srgb, var(--cursor-added) 64%, transparent);\n\t--cursor-text-git-added-quaternary: color-mix(in srgb, var(--cursor-added) 40%, transparent);\n\t--cursor-text-git-modified-primary: var(--cursor-modified);\n\t--cursor-text-git-modified-secondary: color-mix(in srgb, var(--cursor-modified) 78%, transparent);\n\t--cursor-text-git-modified-tertiary: color-mix(in srgb, var(--cursor-modified) 64%, transparent);\n\t--cursor-text-git-modified-quaternary: color-mix(in srgb, var(--cursor-modified) 40%, transparent);\n\t--cursor-text-git-removed-primary: var(--cursor-removed);\n\t--cursor-text-git-removed-secondary: color-mix(in srgb, var(--cursor-removed) 78%, transparent);\n\t--cursor-text-git-removed-tertiary: color-mix(in srgb, var(--cursor-removed) 64%, transparent);\n\t--cursor-text-git-removed-quaternary: color-mix(in srgb, var(--cursor-removed) 40%, transparent);\n\t--cursor-text-git-untracked-primary: var(--cursor-untracked);\n\t--cursor-text-git-untracked-secondary: color-mix(in srgb, var(--cursor-untracked) 78%, transparent);\n\t--cursor-text-git-untracked-tertiary: color-mix(in srgb, var(--cursor-untracked) 64%, transparent);\n\t--cursor-text-git-untracked-quaternary: color-mix(in srgb, var(--cursor-untracked) 40%, transparent);\n\t--cursor-text-red-primary: var(--cursor-red);\n\t--cursor-text-red-secondary: color-mix(in srgb, var(--cursor-red) 78%, transparent);\n\t--cursor-text-yellow-primary: var(--cursor-yellow);\n\t--cursor-text-yellow-secondary: color-mix(in srgb, var(--cursor-yellow) 78%, transparent);\n\t--cursor-text-green-primary: var(--cursor-green);\n\t--cursor-text-green-secondary: color-mix(in srgb, var(--cursor-green) 78%, transparent);\n\t--cursor-text-mag
export const RADIUS_CSS = ":root {\n --cursor-radius-base: 8px;\n --cursor-radius-lg: 10px;\n --cursor-radius-xl: 14px;\n --cursor-radius-2xl: 16px;\n --cursor-radius-3xl: 18px;\n}" as const;
export function _zn(mode: RuntimeThemeMode): string { return [CORE_CSS[mode],RADIUS_CSS,bzn(mode),Ezn(mode)].join("\n"); }
export const buildRuntimeThemeCss = _zn;
function ambientDocument(): ThemeDocument|undefined { return typeof document === "undefined" ? undefined : document as unknown as ThemeDocument; }
function requireDocument(d: ThemeDocument|undefined): ThemeDocument { if(d===undefined) throw Error("Runtime theme installation requires a document"); if(d.documentElement===undefined||d.head===undefined||typeof d.createElement!=="function"||typeof d.getElementById!=="function"||typeof d.head.appendChild!=="function") throw Error("Runtime theme installation received an incomplete document"); return d; }
export function Bzn(mode: RuntimeThemeMode, documentLike?: ThemeDocument): void { const d=requireDocument(documentLike??ambientDocument()); d.documentElement.dataset.theme=RUNTIME_THEME_CLASS[mode]; d.documentElement.style.colorScheme=mode; let s=d.getElementById(RUNTIME_THEME_STYLE_ID); if(s===null){s=d.createElement("style");s.id=RUNTIME_THEME_STYLE_ID;} s.textContent=_zn(mode); d.head.appendChild(s); }
export function createRuntimeThemeInstaller(documentLike: ThemeDocument, initialMode?: RuntimeThemeMode): RuntimeThemeInstallHandle { const d=requireDocument(documentLike); let owned:ThemeStyleElement|null=null, disposed=false; const update=(mode:RuntimeThemeMode)=>{if(disposed)return;const before=d.getElementById(RUNTIME_THEME_STYLE_ID);Bzn(mode,d);if(before===null)owned=d.getElementById(RUNTIME_THEME_STYLE_ID);};const dispose=()=>{if(disposed)return;disposed=true;if(owned!==null&&d.getElementById(RUNTIME_THEME_STYLE_ID)===owned)d.head.removeChild(owned);owned=null;};const h={update,dispose};if(initialMode!==undefined)update(initialMode);return h; }