import { a as n } from "./chunk-SFKZAUPW.js";
import { Type as e } from "@sinclair/typebox";
import "../../../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/index.js";
import { colorPalette as c } from "../../../style-system/dist/colors.js";
import r from "../../../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/src/chroma.js";
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
var y = [{ value: "system-ui", label: "System UI" }, { value: "transitional", label: "Transitional" }, { value: "old-style", label: "Old style" }, { value: "humanist", label: "Humanist" }, { value: "geometric-humanist", label: "Geometric humanist" }, { value: "classical-humanist", label: "Classical humanist" }, { value: "neo-grotesque", label: "Neo-grotesque" }, { value: "monospace-slab-serif", label: "Monospace slab serif" }, { value: "monospace-code", label: "Monospace code" }, { value: "industrial", label: "Industrial" }, { value: "rounded-sans", label: "Rounded sans" }, { value: "slab-serif", label: "Slab serif" }, { value: "antique", label: "Antique" }, { value: "didone", label: "Didone" }, { value: "handwritten", label: "Handwritten" }], l = e.Object({ type: n(["stack", "theme", "google"], { title: "Type of font", description: "The type of font. Can be a font stack, a theme font or a Google font" }), family: e.String({ title: "Family", description: "The font family (eg. the name of the font)" }) }, { title: "Headings font", description: "Used for titles and headings", additionalProperties: !1 }), s = e.Object({ type: n(["stack", "theme", "google"], { title: "Type of font", description: "The type of font. Can be a font stack, a theme font or a Google font" }), family: e.String({ title: "Family", description: "The font family (eg. the name of the font)" }) }, { title: "Body font", description: "Used for paragraphs and body text", additionalProperties: !1 }), h = e.Object({ id: e.String({ title: "ID", description: "The unique identifier of the theme" }), name: e.String({ title: "Name", description: "The name of the theme" }), description: e.String({ title: "Description", description: "The description of the theme" }), tags: e.Array(e.String({ title: "Tag" }), { title: "Tags", description: "The tags of the theme" }), browserColorScheme: e.String({ title: "Browser scheme", description: "Color of browser-provided UI. Either 'light' or 'dark'" }), colors: e.Object({ primary: e.String({ title: "Primary", description: "The brand's primary color." }), secondary: e.String({ title: "Secondary", description: "The brand's second most used color" }), accent: e.String({ title: "Accent", description: "The brand's least used color" }), neutral: e.String({ title: "Neutral", description: "The base neutral color" }), base100: e.String({ title: "Base", description: "Base surface color of page, used for blank backgrounds. Should be white or near-white for light color-schemes, and black or near-black for dark color-schemes." }), base200: e.String({ title: "Base 2", description: "Should be darker than base 1 but still light for light color-schemes, and lighter but still dark for dark color-schemes." }), base300: e.String({ title: "Base 3", description: "3rd base color, should be darker than base 2 for light color-schemes, and lighter than base 2 for dark color-schemes." }) }, { title: "Theme base colors", description: "The base colors of the theme. Each theme must declare all these colors", "ai:instructions": "You can use CSS notations like rgb #hex, hsl() oklab() or any tailwind color like slate-500 or red-200", additionalProperties: !1 }), typography: e.Object({ base: e.Number({ title: "Base font size", description: "The base font size in pixels. It is safe to keep it as is" }), heading: l, body: s, alternatives: e.Array(e.Object({ body: s, heading: l }, { additionalProperties: !1 }), { title: "Alternative fonts", description: "Alternative fonts that can be suggested to the user. Takes the same shape" }) }, { additionalProperties: !1 }) }, { additionalProperties: !1 });
e.Array(h);
function v(t) {
  return { ...t, colors: Object.entries(t.colors).reduce((a, [i, o]) => {
    let d = f(o);
    return { ...a, [i]: d };
  }, {}) };
}
function f(t) {
  if (r.valid(t)) return t;
  if (/ok(lch|lab)\(([^)]+)\)/.test(t)) {
    let a = t.replace(/,/g, " ");
    if (r.valid(a)) return a;
  }
  if (/^([a-z]+)-([0-9]+)$/.test(t)) {
    let [a, i] = t.split("-"), o = c[a]?.[i];
    if (o) return o;
  }
  return t;
}
export {
  y as a,
  h as b,
  v as f
};
//# sourceMappingURL=chunk-HHO3ONTQ.js.map
