export const themeCookie = "hpc-theme"; export const themeStorageKey = "hpc.theme.preference"; export const themePreferences = ["light","dark","system"] as const; export type ThemePreference = typeof themePreferences[number]; export type ResolvedTheme = "light"|"dark"; export function isThemePreference(v:unknown): v is ThemePreference { return typeof v === "string" && (themePreferences as readonly string[]).includes(v); } export function resolveTheme(preference:ThemePreference, systemDark:boolean):ResolvedTheme { return preference === "system" ? (systemDark ? "dark" : "light") : preference; } export const themeCookieAttributes = { path:"/", sameSite:"lax" as const, maxAgeSeconds:31536000, secureInProduction:true };