import { O as e } from "./chunk-LSPN22SI.D75E3zS-.js";
import { b as t } from "./colors.B0ZQIUWB.js";
import { b as n } from "./chroma-js.Dcir27CH.js";
import { Type as r } from "@sinclair/typebox";
var i = [
	{
		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"
	}
], a = r.Object({
	type: e([
		"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: r.String({
		title: "Family",
		description: "The font family (eg. the name of the font)"
	})
}, {
	title: "Headings font",
	description: "Used for titles and headings",
	additionalProperties: !1
}), o = r.Object({
	type: e([
		"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: r.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
}), s = r.Object({
	id: r.String({
		title: "ID",
		description: "The unique identifier of the theme"
	}),
	name: r.String({
		title: "Name",
		description: "The name of the theme"
	}),
	description: r.String({
		title: "Description",
		description: "The description of the theme"
	}),
	tags: r.Array(r.String({ title: "Tag" }), {
		title: "Tags",
		description: "The tags of the theme"
	}),
	browserColorScheme: r.String({
		title: "Browser scheme",
		description: "Color of browser-provided UI. Either 'light' or 'dark'"
	}),
	colors: r.Object({
		primary: r.String({
			title: "Primary",
			description: "The brand's primary color."
		}),
		secondary: r.String({
			title: "Secondary",
			description: "The brand's second most used color"
		}),
		accent: r.String({
			title: "Accent",
			description: "The brand's least used color"
		}),
		neutral: r.String({
			title: "Neutral",
			description: "The base neutral color"
		}),
		base100: r.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: r.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: r.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: r.Object({
		base: r.Number({
			title: "Base font size",
			description: "The base font size in pixels. It is safe to keep it as is"
		}),
		heading: a,
		body: o,
		alternatives: r.Array(r.Object({
			body: o,
			heading: a
		}, { additionalProperties: !1 }), {
			title: "Alternative fonts",
			description: "Alternative fonts that can be suggested to the user. Takes the same shape"
		})
	}, { additionalProperties: !1 })
}, { additionalProperties: !1 });
r.Array(s);
function c(e) {
	return {
		...e,
		colors: Object.entries(e.colors).reduce((e, [t, n]) => {
			let r = l(n);
			return {
				...e,
				[t]: r
			};
		}, {})
	};
}
function l(e) {
	if (n.valid(e)) return e;
	if (/ok(lch|lab)\(([^)]+)\)/.test(e)) {
		let t = e.replace(/,/g, " ");
		if (n.valid(t)) return t;
	}
	if (/^([a-z]+)-([0-9]+)$/.test(e)) {
		let [n, r] = e.split("-"), i = t[n]?.[r];
		if (i) return i;
	}
	return e;
}
export { i as b, s as c, c as d };

//# sourceMappingURL=theme.BZxygK2s.js.map