import aura from "./aura.json" with { type: "json" }
import ayu from "./ayu.json" with { type: "json" }
import catppuccin from "./catppuccin.json" with { type: "json" }
import catppuccinFrappe from "./catppuccin-frappe.json" with { type: "json" }
import catppuccinMacchiato from "./catppuccin-macchiato.json" with { type: "json" }
import cobalt2 from "./cobalt2.json" with { type: "json" }
import cursor from "./cursor.json" with { type: "json" }
import dracula from "./dracula.json" with { type: "json" }
import everforest from "./everforest.json" with { type: "json" }
import flexoki from "./flexoki.json" with { type: "json" }
import github from "./github.json" with { type: "json" }
import gruvbox from "./gruvbox.json" with { type: "json" }
import kanagawa from "./kanagawa.json" with { type: "json" }
import saeeol from "./saeeol.json" with { type: "json" }
import material from "./material.json" with { type: "json" }
import matrix from "./matrix.json" with { type: "json" }
import mercury from "./mercury.json" with { type: "json" }
import monokai from "./monokai.json" with { type: "json" }
import nightowl from "./nightowl.json" with { type: "json" }
import nord from "./nord.json" with { type: "json" }
import osakaJade from "./osaka-jade.json" with { type: "json" }
import onedark from "./one-dark.json" with { type: "json" }
import orng from "./orng.json" with { type: "json" }
import lucentOrng from "./lucent-orng.json" with { type: "json" }
import palenight from "./palenight.json" with { type: "json" }
import rosepine from "./rosepine.json" with { type: "json" }
import solarized from "./solarized.json" with { type: "json" }
import synthwave84 from "./synthwave84.json" with { type: "json" }
import tokyonight from "./tokyonight.json" with { type: "json" }
import vercel from "./vercel.json" with { type: "json" }
import vesper from "./vesper.json" with { type: "json" }
import zenburn from "./zenburn.json" with { type: "json" }
import carbonfox from "./carbonfox.json" with { type: "json" }
import colorblind from "./colorblind.json" with { type: "json" }
import type { ThemeJson } from "./theme-types"

export const DEFAULT_THEMES: Record<string, ThemeJson> = {
  aura,
  ayu,
  catppuccin,
  ["catppuccin-frappe"]: catppuccinFrappe,
  ["catppuccin-macchiato"]: catppuccinMacchiato,
  cobalt2,
  cursor,
  dracula,
  everforest,
  flexoki,
  github,
  gruvbox,
  kanagawa,
  saeeol,
  material,
  matrix,
  mercury,
  monokai,
  nightowl,
  nord,
  ["one-dark"]: onedark,
  ["osaka-jade"]: osakaJade,
  orng,
  ["lucent-orng"]: lucentOrng,
  palenight,
  rosepine,
  solarized,
  synthwave84,
  tokyonight,
  vesper,
  vercel,
  zenburn,
  carbonfox,
  colorblind,
}

export function isValidTheme(t: unknown): t is ThemeJson {
  if (t == null || typeof t !== "object" || !("theme" in t)) return false
  const theme = (t as Record<string, unknown>).theme
  if (theme == null || typeof theme !== "object") return false
  return "background" in theme && "text" in theme && "primary" in theme
}
