import { i as __toESM } from "../_runtime.mjs";
import { $ as require_react, G as TooltipPositioner, J as TooltipRoot, K as TooltipPortal, Q as require_jsx_runtime, U as TooltipProvider$1, W as TooltipPopup, q as TooltipTrigger$1 } from "../_libs/@base-ui/react+[...].mjs";
import { o as lazyRouteComponent, s as createFileRoute } from "../_libs/@tanstack/react-router+[...].mjs";
import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
import { t as twMerge } from "../_libs/tailwind-merge.mjs";
import { G as ArrowUp, J as ArrowRight, L as Command, V as ChevronUp, X as ArrowDown, Y as ArrowLeft, Z as ArrowBigUp, _ as Option } from "../_libs/lucide-react.mjs";
import { n as string, t as object } from "../_libs/zod.mjs";
//#region node_modules/.nitro/vite/services/ssr/assets/routes-9nZumcXQ.js
var import_react = /* @__PURE__ */ __toESM(require_react());
var import_jsx_runtime = require_jsx_runtime();
function cn(...inputs) {
	return twMerge(clsx(inputs));
}
var modifierTokenPattern = /(Shift|Control|Ctrl|Command|Cmd|Meta|Alt|Option|⇧|⌃|⌘|⌥|↑|↓|←|→|\s+|\/|\+)/gi;
var modifierLabels = {
	command: "Command",
	control: "Control",
	option: "Option",
	shift: "Shift"
};
var arrowLabels = {
	down: "Arrow down",
	left: "Arrow left",
	right: "Arrow right",
	up: "Arrow up"
};
function getShortcutModifier(value) {
	const normalized = value.toLowerCase();
	if (value === "⌘" || normalized === "command") return "command";
	if (normalized === "cmd" || normalized === "meta") return "command";
	if (value === "⌃" || normalized === "control") return "control";
	if (normalized === "ctrl") return "control";
	if (value === "⌥" || normalized === "option") return "option";
	if (normalized === "alt") return "option";
	if (value === "⇧" || normalized === "shift") return "shift";
	return null;
}
function getShortcutArrow(value) {
	if (value === "↑") return "up";
	if (value === "↓") return "down";
	if (value === "←") return "left";
	if (value === "→") return "right";
	return null;
}
function tokenizeShortcut(value) {
	const rawTokens = value.split(modifierTokenPattern).filter((token) => token.length > 0);
	const shortcutTokens = [];
	for (let index = 0; index < rawTokens.length; index += 1) {
		const token = rawTokens[index];
		const modifier = getShortcutModifier(token);
		const arrow = getShortcutArrow(token);
		if (modifier) {
			shortcutTokens.push({
				type: "modifier",
				modifier,
				label: modifierLabels[modifier]
			});
			continue;
		}
		if (arrow) {
			shortcutTokens.push({
				type: "arrow",
				arrow,
				label: arrowLabels[arrow]
			});
			continue;
		}
		if (token === "/") {
			shortcutTokens.push({
				type: "separator",
				value: token
			});
			continue;
		}
		if (token === "+") {
			const previousModifier = getShortcutModifier(rawTokens[index - 1] ?? "");
			const nextModifier = getShortcutModifier(rawTokens[index + 1] ?? "");
			if (previousModifier || nextModifier) continue;
		}
		if (token.trim().length === 0) continue;
		shortcutTokens.push({
			type: "text",
			value: token
		});
	}
	return shortcutTokens;
}
function ShortcutModifierIcon({ modifier }) {
	const className = "size-[10px] shrink-0 stroke-[2.4]";
	if (modifier === "shift") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowBigUp, {
		"aria-hidden": "true",
		className
	});
	if (modifier === "control") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronUp, {
		"aria-hidden": "true",
		className
	});
	if (modifier === "command") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Command, {
		"aria-hidden": "true",
		className
	});
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, {
		"aria-hidden": "true",
		className
	});
}
function ShortcutArrowIcon({ arrow }) {
	const className = "size-[10px] shrink-0 stroke-[2.4]";
	if (arrow === "up") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowUp, {
		"aria-hidden": "true",
		className
	});
	if (arrow === "down") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowDown, {
		"aria-hidden": "true",
		className
	});
	if (arrow === "left") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, {
		"aria-hidden": "true",
		className
	});
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowRight, {
		"aria-hidden": "true",
		className
	});
}
function ShortcutText({ value }) {
	const tokens = tokenizeShortcut(value);
	if (tokens.length === 0) return null;
	return tokens.map((token) => {
		if (token.type === "modifier") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutModifierIcon, { modifier: token.modifier }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			className: "sr-only",
			children: token.label
		})] }, `modifier-${token.modifier}`);
		if (token.type === "arrow") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutArrowIcon, { arrow: token.arrow }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			className: "sr-only",
			children: token.label
		})] }, `arrow-${token.arrow}`);
		if (token.type === "separator") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			"aria-hidden": "true",
			className: "mx-0.5",
			children: token.value
		}, `separator-${token.value}`);
		return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: token.value }, `text-${token.value}`);
	});
}
function KeyboardShortcutContent({ children, className }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
		className: cn("inline-flex items-center gap-1 align-middle leading-none", className),
		children: import_react.Children.map(children, (child) => {
			if (typeof child === "string" || typeof child === "number") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutText, { value: String(child) });
			return child;
		})
	});
}
function Kbd({ className, children, ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("kbd", {
		className: cn("inline-flex items-center rounded border border-border/70 bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground data-[active=true]:border-primary/40 data-[active=true]:bg-primary data-[active=true]:text-primary-foreground", className),
		...props,
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyboardShortcutContent, { children })
	});
}
function TooltipProvider({ delay = 0, ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProvider$1, {
		"data-slot": "tooltip-provider",
		delay,
		...props
	});
}
function Tooltip$1({ ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipRoot, {
		"data-slot": "tooltip",
		...props
	});
}
function TooltipTrigger({ ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger$1, {
		"data-slot": "tooltip-trigger",
		...props
	});
}
function TooltipContent({ className, positionerClassName, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPositioner, {
		align,
		alignOffset,
		side,
		sideOffset,
		className: cn("isolate z-50", positionerClassName),
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPopup, {
			"data-slot": "tooltip-content",
			className: cn("z-50 flex max-h-[min(24rem,calc(100vh-2rem))] max-w-[min(42rem,calc(100vw-2rem))] min-w-0 origin-(--transform-origin) items-center gap-1.5 overflow-x-hidden overflow-y-auto rounded-md bg-secondary px-3 py-1.5 text-xs [overflow-wrap:anywhere] whitespace-pre-wrap text-secondary-foreground has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
			...props,
			children
		})
	}) });
}
function TitleTooltip({ title, children, kbd, rows, side, align, sideOffset, className, positionerClassName }) {
	if (!title) return children;
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tooltip$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, { render: children }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
		side,
		align,
		sideOffset,
		className,
		positionerClassName,
		children: rows ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			className: "flex flex-col gap-1",
			children: rows.map((row, rowOffset) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
				className: "flex items-center justify-between gap-3",
				children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
					className: "min-w-0",
					children: row.title
				}), row.kbd ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Kbd, {
					"data-slot": "kbd",
					children: row.kbd
				}) : null]
			}, `tooltip-row-${rowOffset}`))
		}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			className: "min-w-0",
			children: title
		}), kbd ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Kbd, {
			"data-slot": "kbd",
			children: kbd
		}) : null] })
	})] });
}
var SPINNER_CELLS = [
	{
		id: "top-left",
		className: "pico-spinner-pixel-0"
	},
	{
		id: "top",
		className: "pico-spinner-pixel-1"
	},
	{
		id: "top-right",
		className: "pico-spinner-pixel-2"
	},
	{
		id: "right",
		className: "pico-spinner-pixel-5"
	},
	{
		id: "bottom-right",
		className: "pico-spinner-pixel-8"
	},
	{
		id: "bottom",
		className: "pico-spinner-pixel-7"
	},
	{
		id: "bottom-left",
		className: "pico-spinner-pixel-6"
	},
	{
		id: "left",
		className: "pico-spinner-pixel-3"
	}
];
var SPINNER_SIZE_CLASS_NAMES = {
	xs: "size-3",
	sm: "size-3.5",
	md: "size-4"
};
function Spinner({ className, size = "sm", "aria-label": ariaLabel = "Loading", ...props }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
		role: "status",
		"aria-label": ariaLabel,
		"data-pico-spinner-size": size,
		className: cn("pico-spinner pointer-events-none inline-flex shrink-0 items-center justify-center font-mono leading-none text-primary select-none", SPINNER_SIZE_CLASS_NAMES[size], className),
		...props,
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
			"aria-hidden": "true",
			className: "pico-spinner-pixels",
			children: SPINNER_CELLS.map((cell) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn("pico-spinner-pixel", cell.className) }, cell.id))
		})
	});
}
var SHIKI_BUNDLED_THEME_PAIR_DEFINITIONS = [
	{
		id: "shiki-pair-ayu",
		label: "Ayu",
		description: "Use Ayu Light in light mode and Ayu Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"ayu-light",
			"ayu-dark",
			"Ayu",
			"Ayu Light",
			"Ayu Dark",
			"ayu"
		],
		classes: {
			light: "shiki-theme-ayu-light",
			dark: "shiki-theme-ayu-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-ayu-mirage",
		label: "Ayu Mirage",
		description: "Use Ayu Light in light mode and Ayu Mirage in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"ayu-light",
			"ayu-mirage",
			"Ayu Mirage",
			"Ayu Light",
			"ayu",
			"mirage"
		],
		classes: {
			light: "shiki-theme-ayu-light",
			dark: "shiki-theme-ayu-mirage"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-catppuccin-frappe",
		label: "Catppuccin Frappé",
		description: "Use Catppuccin Latte in light mode and Catppuccin Frappé in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"catppuccin-latte",
			"catppuccin-frappe",
			"Catppuccin Frappé",
			"Catppuccin Latte",
			"catppuccin",
			"frappe",
			"frappé",
			"latte"
		],
		classes: {
			light: "shiki-theme-catppuccin-latte",
			dark: "shiki-theme-catppuccin-frappe"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-catppuccin-macchiato",
		label: "Catppuccin Macchiato",
		description: "Use Catppuccin Latte in light mode and Catppuccin Macchiato in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"catppuccin-latte",
			"catppuccin-macchiato",
			"Catppuccin Macchiato",
			"Catppuccin Latte",
			"catppuccin",
			"macchiato",
			"latte"
		],
		classes: {
			light: "shiki-theme-catppuccin-latte",
			dark: "shiki-theme-catppuccin-macchiato"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-catppuccin-mocha",
		label: "Catppuccin Mocha",
		description: "Use Catppuccin Latte in light mode and Catppuccin Mocha in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"catppuccin-latte",
			"catppuccin-mocha",
			"Catppuccin Mocha",
			"Catppuccin Latte",
			"catppuccin",
			"mocha",
			"latte"
		],
		classes: {
			light: "shiki-theme-catppuccin-latte",
			dark: "shiki-theme-catppuccin-mocha"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-everforest",
		label: "Everforest",
		description: "Use Everforest Light in light mode and Everforest Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"everforest-light",
			"everforest-dark",
			"Everforest",
			"Everforest Light",
			"Everforest Dark",
			"everforest"
		],
		classes: {
			light: "shiki-theme-everforest-light",
			dark: "shiki-theme-everforest-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-github",
		label: "GitHub",
		description: "Use GitHub Light in light mode and GitHub Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"github-light",
			"github-dark",
			"GitHub",
			"GitHub Light",
			"GitHub Dark",
			"github"
		],
		classes: {
			light: "shiki-theme-github-light",
			dark: "shiki-theme-github-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-github-default",
		label: "GitHub Default",
		description: "Use GitHub Light Default in light mode and GitHub Dark Default in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"github-light-default",
			"github-dark-default",
			"GitHub Default",
			"GitHub Light Default",
			"GitHub Dark Default",
			"github",
			"default"
		],
		classes: {
			light: "shiki-theme-github-light-default",
			dark: "shiki-theme-github-dark-default"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-github-high-contrast",
		label: "GitHub High Contrast",
		description: "Use GitHub Light High Contrast in light mode and GitHub Dark High Contrast in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"github-light-high-contrast",
			"github-dark-high-contrast",
			"GitHub High Contrast",
			"GitHub Light High Contrast",
			"GitHub Dark High Contrast",
			"github",
			"high contrast",
			"contrast"
		],
		classes: {
			light: "shiki-theme-github-light-high-contrast",
			dark: "shiki-theme-github-dark-high-contrast"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-gruvbox-hard",
		label: "Gruvbox Hard",
		description: "Use Gruvbox Light Hard in light mode and Gruvbox Dark Hard in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"gruvbox-light-hard",
			"gruvbox-dark-hard",
			"Gruvbox Hard",
			"Gruvbox Light Hard",
			"Gruvbox Dark Hard",
			"gruvbox",
			"hard"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-hard",
			dark: "shiki-theme-gruvbox-dark-hard"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-gruvbox-medium",
		label: "Gruvbox Medium",
		description: "Use Gruvbox Light Medium in light mode and Gruvbox Dark Medium in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"gruvbox-light-medium",
			"gruvbox-dark-medium",
			"Gruvbox Medium",
			"Gruvbox Light Medium",
			"Gruvbox Dark Medium",
			"gruvbox",
			"medium"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-medium",
			dark: "shiki-theme-gruvbox-dark-medium"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-gruvbox-soft",
		label: "Gruvbox Soft",
		description: "Use Gruvbox Light Soft in light mode and Gruvbox Dark Soft in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"gruvbox-light-soft",
			"gruvbox-dark-soft",
			"Gruvbox Soft",
			"Gruvbox Light Soft",
			"Gruvbox Dark Soft",
			"gruvbox",
			"soft"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-soft",
			dark: "shiki-theme-gruvbox-dark-soft"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-kanagawa-dragon",
		label: "Kanagawa Dragon",
		description: "Use Kanagawa Lotus in light mode and Kanagawa Dragon in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"kanagawa-lotus",
			"kanagawa-dragon",
			"Kanagawa Dragon",
			"Kanagawa Lotus",
			"kanagawa",
			"lotus",
			"dragon"
		],
		classes: {
			light: "shiki-theme-kanagawa-lotus",
			dark: "shiki-theme-kanagawa-dragon"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-kanagawa-wave",
		label: "Kanagawa Wave",
		description: "Use Kanagawa Lotus in light mode and Kanagawa Wave in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"kanagawa-lotus",
			"kanagawa-wave",
			"Kanagawa Wave",
			"Kanagawa Lotus",
			"kanagawa",
			"lotus",
			"wave"
		],
		classes: {
			light: "shiki-theme-kanagawa-lotus",
			dark: "shiki-theme-kanagawa-wave"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-material-theme",
		label: "Material Theme",
		description: "Use Material Theme Lighter in light mode and Material Theme in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"material-theme-lighter",
			"material-theme",
			"Material Theme",
			"Material Theme Lighter",
			"material",
			"lighter"
		],
		classes: {
			light: "shiki-theme-material-theme-lighter",
			dark: "shiki-theme-material-theme"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-material-theme-darker",
		label: "Material Theme Darker",
		description: "Use Material Theme Lighter in light mode and Material Theme Darker in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"material-theme-lighter",
			"material-theme-darker",
			"Material Theme Darker",
			"Material Theme Lighter",
			"material",
			"darker",
			"lighter"
		],
		classes: {
			light: "shiki-theme-material-theme-lighter",
			dark: "shiki-theme-material-theme-darker"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-material-theme-ocean",
		label: "Material Theme Ocean",
		description: "Use Material Theme Lighter in light mode and Material Theme Ocean in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"material-theme-lighter",
			"material-theme-ocean",
			"Material Theme Ocean",
			"Material Theme Lighter",
			"material",
			"ocean",
			"lighter"
		],
		classes: {
			light: "shiki-theme-material-theme-lighter",
			dark: "shiki-theme-material-theme-ocean"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-material-theme-palenight",
		label: "Material Theme Palenight",
		description: "Use Material Theme Lighter in light mode and Material Theme Palenight in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"material-theme-lighter",
			"material-theme-palenight",
			"Material Theme Palenight",
			"Material Theme Lighter",
			"material",
			"palenight",
			"lighter"
		],
		classes: {
			light: "shiki-theme-material-theme-lighter",
			dark: "shiki-theme-material-theme-palenight"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-min",
		label: "Min",
		description: "Use Min Light in light mode and Min Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"min-light",
			"min-dark",
			"Min",
			"Min Light",
			"Min Dark",
			"min",
			"minimal"
		],
		classes: {
			light: "shiki-theme-min-light",
			dark: "shiki-theme-min-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-night-owl",
		label: "Night Owl",
		description: "Use Night Owl Light in light mode and Night Owl in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"night-owl-light",
			"night-owl",
			"Night Owl",
			"Night Owl Light",
			"night owl"
		],
		classes: {
			light: "shiki-theme-night-owl-light",
			dark: "shiki-theme-night-owl"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-one",
		label: "One",
		description: "Use One Light in light mode and One Dark Pro in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"one-light",
			"one-dark-pro",
			"One",
			"One Light",
			"One Dark Pro",
			"one",
			"atom"
		],
		classes: {
			light: "shiki-theme-one-light",
			dark: "shiki-theme-one-dark-pro"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-plus",
		label: "Plus",
		description: "Use Light Plus in light mode and Dark Plus in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"light-plus",
			"dark-plus",
			"Plus",
			"Light Plus",
			"Dark Plus",
			"plus",
			"vscode",
			"visual studio code"
		],
		classes: {
			light: "shiki-theme-light-plus",
			dark: "shiki-theme-dark-plus"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-rose-pine",
		label: "Rosé Pine",
		description: "Use Rosé Pine Dawn in light mode and Rosé Pine in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"rose-pine-dawn",
			"rose-pine",
			"Rosé Pine",
			"Rosé Pine Dawn",
			"rose pine",
			"rosé pine",
			"dawn"
		],
		classes: {
			light: "shiki-theme-rose-pine-dawn",
			dark: "shiki-theme-rose-pine"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-rose-pine-moon",
		label: "Rosé Pine Moon",
		description: "Use Rosé Pine Dawn in light mode and Rosé Pine Moon in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"rose-pine-dawn",
			"rose-pine-moon",
			"Rosé Pine Moon",
			"Rosé Pine Dawn",
			"rose pine",
			"rosé pine",
			"moon",
			"dawn"
		],
		classes: {
			light: "shiki-theme-rose-pine-dawn",
			dark: "shiki-theme-rose-pine-moon"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-slack",
		label: "Slack",
		description: "Use Slack Ochin in light mode and Slack Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"slack-ochin",
			"slack-dark",
			"Slack",
			"Slack Ochin",
			"Slack Dark",
			"slack",
			"ochin"
		],
		classes: {
			light: "shiki-theme-slack-ochin",
			dark: "shiki-theme-slack-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-solarized",
		label: "Solarized",
		description: "Use Solarized Light in light mode and Solarized Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"solarized-light",
			"solarized-dark",
			"Solarized",
			"Solarized Light",
			"Solarized Dark",
			"solarized"
		],
		classes: {
			light: "shiki-theme-solarized-light",
			dark: "shiki-theme-solarized-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-vitesse",
		label: "Vitesse",
		description: "Use Vitesse Light in light mode and Vitesse Dark in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"vitesse-light",
			"vitesse-dark",
			"Vitesse",
			"Vitesse Light",
			"Vitesse Dark",
			"vitesse"
		],
		classes: {
			light: "shiki-theme-vitesse-light",
			dark: "shiki-theme-vitesse-dark"
		},
		selectorModes: ["auto"]
	},
	{
		id: "shiki-pair-vitesse-black",
		label: "Vitesse Black",
		description: "Use Vitesse Light in light mode and Vitesse Black in dark mode.",
		keywords: [
			"shiki",
			"auto",
			"system",
			"light",
			"dark",
			"vitesse-light",
			"vitesse-black",
			"Vitesse Black",
			"Vitesse Light",
			"vitesse",
			"black"
		],
		classes: {
			light: "shiki-theme-vitesse-light",
			dark: "shiki-theme-vitesse-black"
		},
		selectorModes: ["auto"]
	}
];
var SHIKI_BUNDLED_THEME_DEFINITIONS = [
	{
		id: "shiki-andromeeda",
		label: "Andromeeda",
		description: "Use Andromeeda theme (dark).",
		keywords: [
			"shiki",
			"andromeeda",
			"Andromeeda",
			"andromeeda",
			"dark"
		],
		classes: {
			light: "shiki-theme-andromeeda",
			dark: "shiki-theme-andromeeda"
		},
		mode: "dark"
	},
	{
		id: "shiki-aurora-x",
		label: "Aurora X",
		description: "Use Aurora X theme (dark).",
		keywords: [
			"shiki",
			"aurora-x",
			"Aurora X",
			"aurora-x",
			"dark"
		],
		classes: {
			light: "shiki-theme-aurora-x",
			dark: "shiki-theme-aurora-x"
		},
		mode: "dark"
	},
	{
		id: "shiki-ayu-dark",
		label: "Ayu Dark",
		description: "Use Ayu Dark theme (dark).",
		keywords: [
			"shiki",
			"ayu-dark",
			"Ayu Dark",
			"ayu-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-ayu-dark",
			dark: "shiki-theme-ayu-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-ayu-light",
		label: "Ayu Light",
		description: "Use Ayu Light theme (light).",
		keywords: [
			"shiki",
			"ayu-light",
			"Ayu Light",
			"ayu-light",
			"light"
		],
		classes: {
			light: "shiki-theme-ayu-light",
			dark: "shiki-theme-ayu-light"
		},
		mode: "light"
	},
	{
		id: "shiki-ayu-mirage",
		label: "Ayu Mirage",
		description: "Use Ayu Mirage theme (dark).",
		keywords: [
			"shiki",
			"ayu-mirage",
			"Ayu Mirage",
			"ayu-mirage",
			"dark"
		],
		classes: {
			light: "shiki-theme-ayu-mirage",
			dark: "shiki-theme-ayu-mirage"
		},
		mode: "dark"
	},
	{
		id: "shiki-catppuccin-frappe",
		label: "Catppuccin Frappé",
		description: "Use Catppuccin Frappé theme (dark).",
		keywords: [
			"shiki",
			"catppuccin-frappe",
			"Catppuccin Frappé",
			"catppuccin-frappe",
			"dark"
		],
		classes: {
			light: "shiki-theme-catppuccin-frappe",
			dark: "shiki-theme-catppuccin-frappe"
		},
		mode: "dark"
	},
	{
		id: "shiki-catppuccin-latte",
		label: "Catppuccin Latte",
		description: "Use Catppuccin Latte theme (light).",
		keywords: [
			"shiki",
			"catppuccin-latte",
			"Catppuccin Latte",
			"catppuccin-latte",
			"light"
		],
		classes: {
			light: "shiki-theme-catppuccin-latte",
			dark: "shiki-theme-catppuccin-latte"
		},
		mode: "light"
	},
	{
		id: "shiki-catppuccin-macchiato",
		label: "Catppuccin Macchiato",
		description: "Use Catppuccin Macchiato theme (dark).",
		keywords: [
			"shiki",
			"catppuccin-macchiato",
			"Catppuccin Macchiato",
			"catppuccin-macchiato",
			"dark"
		],
		classes: {
			light: "shiki-theme-catppuccin-macchiato",
			dark: "shiki-theme-catppuccin-macchiato"
		},
		mode: "dark"
	},
	{
		id: "shiki-catppuccin-mocha",
		label: "Catppuccin Mocha",
		description: "Use Catppuccin Mocha theme (dark).",
		keywords: [
			"shiki",
			"catppuccin-mocha",
			"Catppuccin Mocha",
			"catppuccin-mocha",
			"dark"
		],
		classes: {
			light: "shiki-theme-catppuccin-mocha",
			dark: "shiki-theme-catppuccin-mocha"
		},
		mode: "dark"
	},
	{
		id: "shiki-dark-plus",
		label: "Dark Plus",
		description: "Use Dark Plus theme (dark).",
		keywords: [
			"shiki",
			"dark-plus",
			"Dark Plus",
			"dark-plus",
			"dark"
		],
		classes: {
			light: "shiki-theme-dark-plus",
			dark: "shiki-theme-dark-plus"
		},
		mode: "dark"
	},
	{
		id: "shiki-dracula",
		label: "Dracula Theme",
		description: "Use Dracula Theme theme (dark).",
		keywords: [
			"shiki",
			"dracula",
			"Dracula Theme",
			"dracula",
			"dark"
		],
		classes: {
			light: "shiki-theme-dracula",
			dark: "shiki-theme-dracula"
		},
		mode: "dark"
	},
	{
		id: "shiki-dracula-soft",
		label: "Dracula Theme Soft",
		description: "Use Dracula Theme Soft theme (dark).",
		keywords: [
			"shiki",
			"dracula-soft",
			"Dracula Theme Soft",
			"dracula-soft",
			"dark"
		],
		classes: {
			light: "shiki-theme-dracula-soft",
			dark: "shiki-theme-dracula-soft"
		},
		mode: "dark"
	},
	{
		id: "shiki-everforest-dark",
		label: "Everforest Dark",
		description: "Use Everforest Dark theme (dark).",
		keywords: [
			"shiki",
			"everforest-dark",
			"Everforest Dark",
			"everforest-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-everforest-dark",
			dark: "shiki-theme-everforest-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-everforest-light",
		label: "Everforest Light",
		description: "Use Everforest Light theme (light).",
		keywords: [
			"shiki",
			"everforest-light",
			"Everforest Light",
			"everforest-light",
			"light"
		],
		classes: {
			light: "shiki-theme-everforest-light",
			dark: "shiki-theme-everforest-light"
		},
		mode: "light"
	},
	{
		id: "shiki-github-dark",
		label: "GitHub Dark",
		description: "Use GitHub Dark theme (dark).",
		keywords: [
			"shiki",
			"github-dark",
			"GitHub Dark",
			"github-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-github-dark",
			dark: "shiki-theme-github-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-github-dark-default",
		label: "GitHub Dark Default",
		description: "Use GitHub Dark Default theme (dark).",
		keywords: [
			"shiki",
			"github-dark-default",
			"GitHub Dark Default",
			"github-dark-default",
			"dark"
		],
		classes: {
			light: "shiki-theme-github-dark-default",
			dark: "shiki-theme-github-dark-default"
		},
		mode: "dark"
	},
	{
		id: "shiki-github-dark-dimmed",
		label: "GitHub Dark Dimmed",
		description: "Use GitHub Dark Dimmed theme (dark).",
		keywords: [
			"shiki",
			"github-dark-dimmed",
			"GitHub Dark Dimmed",
			"github-dark-dimmed",
			"dark"
		],
		classes: {
			light: "shiki-theme-github-dark-dimmed",
			dark: "shiki-theme-github-dark-dimmed"
		},
		mode: "dark"
	},
	{
		id: "shiki-github-dark-high-contrast",
		label: "GitHub Dark High Contrast",
		description: "Use GitHub Dark High Contrast theme (dark).",
		keywords: [
			"shiki",
			"github-dark-high-contrast",
			"GitHub Dark High Contrast",
			"github-dark-high-contrast",
			"dark"
		],
		classes: {
			light: "shiki-theme-github-dark-high-contrast",
			dark: "shiki-theme-github-dark-high-contrast"
		},
		mode: "dark"
	},
	{
		id: "shiki-github-light",
		label: "GitHub Light",
		description: "Use GitHub Light theme (light).",
		keywords: [
			"shiki",
			"github-light",
			"GitHub Light",
			"github-light",
			"light"
		],
		classes: {
			light: "shiki-theme-github-light",
			dark: "shiki-theme-github-light"
		},
		mode: "light"
	},
	{
		id: "shiki-github-light-default",
		label: "GitHub Light Default",
		description: "Use GitHub Light Default theme (light).",
		keywords: [
			"shiki",
			"github-light-default",
			"GitHub Light Default",
			"github-light-default",
			"light"
		],
		classes: {
			light: "shiki-theme-github-light-default",
			dark: "shiki-theme-github-light-default"
		},
		mode: "light"
	},
	{
		id: "shiki-github-light-high-contrast",
		label: "GitHub Light High Contrast",
		description: "Use GitHub Light High Contrast theme (light).",
		keywords: [
			"shiki",
			"github-light-high-contrast",
			"GitHub Light High Contrast",
			"github-light-high-contrast",
			"light"
		],
		classes: {
			light: "shiki-theme-github-light-high-contrast",
			dark: "shiki-theme-github-light-high-contrast"
		},
		mode: "light"
	},
	{
		id: "shiki-gruvbox-dark-hard",
		label: "Gruvbox Dark Hard",
		description: "Use Gruvbox Dark Hard theme (dark).",
		keywords: [
			"shiki",
			"gruvbox-dark-hard",
			"Gruvbox Dark Hard",
			"gruvbox-dark-hard",
			"dark"
		],
		classes: {
			light: "shiki-theme-gruvbox-dark-hard",
			dark: "shiki-theme-gruvbox-dark-hard"
		},
		mode: "dark"
	},
	{
		id: "shiki-gruvbox-dark-medium",
		label: "Gruvbox Dark Medium",
		description: "Use Gruvbox Dark Medium theme (dark).",
		keywords: [
			"shiki",
			"gruvbox-dark-medium",
			"Gruvbox Dark Medium",
			"gruvbox-dark-medium",
			"dark"
		],
		classes: {
			light: "shiki-theme-gruvbox-dark-medium",
			dark: "shiki-theme-gruvbox-dark-medium"
		},
		mode: "dark"
	},
	{
		id: "shiki-gruvbox-dark-soft",
		label: "Gruvbox Dark Soft",
		description: "Use Gruvbox Dark Soft theme (dark).",
		keywords: [
			"shiki",
			"gruvbox-dark-soft",
			"Gruvbox Dark Soft",
			"gruvbox-dark-soft",
			"dark"
		],
		classes: {
			light: "shiki-theme-gruvbox-dark-soft",
			dark: "shiki-theme-gruvbox-dark-soft"
		},
		mode: "dark"
	},
	{
		id: "shiki-gruvbox-light-hard",
		label: "Gruvbox Light Hard",
		description: "Use Gruvbox Light Hard theme (light).",
		keywords: [
			"shiki",
			"gruvbox-light-hard",
			"Gruvbox Light Hard",
			"gruvbox-light-hard",
			"light"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-hard",
			dark: "shiki-theme-gruvbox-light-hard"
		},
		mode: "light"
	},
	{
		id: "shiki-gruvbox-light-medium",
		label: "Gruvbox Light Medium",
		description: "Use Gruvbox Light Medium theme (light).",
		keywords: [
			"shiki",
			"gruvbox-light-medium",
			"Gruvbox Light Medium",
			"gruvbox-light-medium",
			"light"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-medium",
			dark: "shiki-theme-gruvbox-light-medium"
		},
		mode: "light"
	},
	{
		id: "shiki-gruvbox-light-soft",
		label: "Gruvbox Light Soft",
		description: "Use Gruvbox Light Soft theme (light).",
		keywords: [
			"shiki",
			"gruvbox-light-soft",
			"Gruvbox Light Soft",
			"gruvbox-light-soft",
			"light"
		],
		classes: {
			light: "shiki-theme-gruvbox-light-soft",
			dark: "shiki-theme-gruvbox-light-soft"
		},
		mode: "light"
	},
	{
		id: "shiki-horizon",
		label: "Horizon",
		description: "Use Horizon theme (dark).",
		keywords: [
			"shiki",
			"horizon",
			"Horizon",
			"horizon",
			"dark"
		],
		classes: {
			light: "shiki-theme-horizon",
			dark: "shiki-theme-horizon"
		},
		mode: "dark"
	},
	{
		id: "shiki-horizon-bright",
		label: "Horizon Bright",
		description: "Use Horizon Bright theme (dark).",
		keywords: [
			"shiki",
			"horizon-bright",
			"Horizon Bright",
			"horizon-bright",
			"dark"
		],
		classes: {
			light: "shiki-theme-horizon-bright",
			dark: "shiki-theme-horizon-bright"
		},
		mode: "dark"
	},
	{
		id: "shiki-houston",
		label: "Houston",
		description: "Use Houston theme (dark).",
		keywords: [
			"shiki",
			"houston",
			"Houston",
			"houston",
			"dark"
		],
		classes: {
			light: "shiki-theme-houston",
			dark: "shiki-theme-houston"
		},
		mode: "dark"
	},
	{
		id: "shiki-kanagawa-dragon",
		label: "Kanagawa Dragon",
		description: "Use Kanagawa Dragon theme (dark).",
		keywords: [
			"shiki",
			"kanagawa-dragon",
			"Kanagawa Dragon",
			"kanagawa-dragon",
			"dark"
		],
		classes: {
			light: "shiki-theme-kanagawa-dragon",
			dark: "shiki-theme-kanagawa-dragon"
		},
		mode: "dark"
	},
	{
		id: "shiki-kanagawa-lotus",
		label: "Kanagawa Lotus",
		description: "Use Kanagawa Lotus theme (light).",
		keywords: [
			"shiki",
			"kanagawa-lotus",
			"Kanagawa Lotus",
			"kanagawa-lotus",
			"light"
		],
		classes: {
			light: "shiki-theme-kanagawa-lotus",
			dark: "shiki-theme-kanagawa-lotus"
		},
		mode: "light"
	},
	{
		id: "shiki-kanagawa-wave",
		label: "Kanagawa Wave",
		description: "Use Kanagawa Wave theme (dark).",
		keywords: [
			"shiki",
			"kanagawa-wave",
			"Kanagawa Wave",
			"kanagawa-wave",
			"dark"
		],
		classes: {
			light: "shiki-theme-kanagawa-wave",
			dark: "shiki-theme-kanagawa-wave"
		},
		mode: "dark"
	},
	{
		id: "shiki-laserwave",
		label: "LaserWave",
		description: "Use LaserWave theme (dark).",
		keywords: [
			"shiki",
			"laserwave",
			"LaserWave",
			"laserwave",
			"dark"
		],
		classes: {
			light: "shiki-theme-laserwave",
			dark: "shiki-theme-laserwave"
		},
		mode: "dark"
	},
	{
		id: "shiki-light-plus",
		label: "Light Plus",
		description: "Use Light Plus theme (light).",
		keywords: [
			"shiki",
			"light-plus",
			"Light Plus",
			"light-plus",
			"light"
		],
		classes: {
			light: "shiki-theme-light-plus",
			dark: "shiki-theme-light-plus"
		},
		mode: "light"
	},
	{
		id: "shiki-material-theme",
		label: "Material Theme",
		description: "Use Material Theme theme (dark).",
		keywords: [
			"shiki",
			"material-theme",
			"Material Theme",
			"material-theme",
			"dark"
		],
		classes: {
			light: "shiki-theme-material-theme",
			dark: "shiki-theme-material-theme"
		},
		mode: "dark"
	},
	{
		id: "shiki-material-theme-darker",
		label: "Material Theme Darker",
		description: "Use Material Theme Darker theme (dark).",
		keywords: [
			"shiki",
			"material-theme-darker",
			"Material Theme Darker",
			"material-theme-darker",
			"dark"
		],
		classes: {
			light: "shiki-theme-material-theme-darker",
			dark: "shiki-theme-material-theme-darker"
		},
		mode: "dark"
	},
	{
		id: "shiki-material-theme-lighter",
		label: "Material Theme Lighter",
		description: "Use Material Theme Lighter theme (light).",
		keywords: [
			"shiki",
			"material-theme-lighter",
			"Material Theme Lighter",
			"material-theme-lighter",
			"light"
		],
		classes: {
			light: "shiki-theme-material-theme-lighter",
			dark: "shiki-theme-material-theme-lighter"
		},
		mode: "light"
	},
	{
		id: "shiki-material-theme-ocean",
		label: "Material Theme Ocean",
		description: "Use Material Theme Ocean theme (dark).",
		keywords: [
			"shiki",
			"material-theme-ocean",
			"Material Theme Ocean",
			"material-theme-ocean",
			"dark"
		],
		classes: {
			light: "shiki-theme-material-theme-ocean",
			dark: "shiki-theme-material-theme-ocean"
		},
		mode: "dark"
	},
	{
		id: "shiki-material-theme-palenight",
		label: "Material Theme Palenight",
		description: "Use Material Theme Palenight theme (dark).",
		keywords: [
			"shiki",
			"material-theme-palenight",
			"Material Theme Palenight",
			"material-theme-palenight",
			"dark"
		],
		classes: {
			light: "shiki-theme-material-theme-palenight",
			dark: "shiki-theme-material-theme-palenight"
		},
		mode: "dark"
	},
	{
		id: "shiki-min-dark",
		label: "Min Dark",
		description: "Use Min Dark theme (dark).",
		keywords: [
			"shiki",
			"min-dark",
			"Min Dark",
			"min-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-min-dark",
			dark: "shiki-theme-min-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-min-light",
		label: "Min Light",
		description: "Use Min Light theme (light).",
		keywords: [
			"shiki",
			"min-light",
			"Min Light",
			"min-light",
			"light"
		],
		classes: {
			light: "shiki-theme-min-light",
			dark: "shiki-theme-min-light"
		},
		mode: "light"
	},
	{
		id: "shiki-monokai",
		label: "Monokai",
		description: "Use Monokai theme (dark).",
		keywords: [
			"shiki",
			"monokai",
			"Monokai",
			"monokai",
			"dark"
		],
		classes: {
			light: "shiki-theme-monokai",
			dark: "shiki-theme-monokai"
		},
		mode: "dark"
	},
	{
		id: "shiki-night-owl",
		label: "Night Owl",
		description: "Use Night Owl theme (dark).",
		keywords: [
			"shiki",
			"night-owl",
			"Night Owl",
			"night-owl",
			"dark"
		],
		classes: {
			light: "shiki-theme-night-owl",
			dark: "shiki-theme-night-owl"
		},
		mode: "dark"
	},
	{
		id: "shiki-night-owl-light",
		label: "Night Owl Light",
		description: "Use Night Owl Light theme (light).",
		keywords: [
			"shiki",
			"night-owl-light",
			"Night Owl Light",
			"night-owl-light",
			"light"
		],
		classes: {
			light: "shiki-theme-night-owl-light",
			dark: "shiki-theme-night-owl-light"
		},
		mode: "light"
	},
	{
		id: "shiki-nord",
		label: "Nord",
		description: "Use Nord theme (dark).",
		keywords: [
			"shiki",
			"nord",
			"Nord",
			"nord",
			"dark"
		],
		classes: {
			light: "shiki-theme-nord",
			dark: "shiki-theme-nord"
		},
		mode: "dark"
	},
	{
		id: "shiki-one-dark-pro",
		label: "One Dark Pro",
		description: "Use One Dark Pro theme (dark).",
		keywords: [
			"shiki",
			"one-dark-pro",
			"One Dark Pro",
			"one-dark-pro",
			"dark"
		],
		classes: {
			light: "shiki-theme-one-dark-pro",
			dark: "shiki-theme-one-dark-pro"
		},
		mode: "dark"
	},
	{
		id: "shiki-one-light",
		label: "One Light",
		description: "Use One Light theme (light).",
		keywords: [
			"shiki",
			"one-light",
			"One Light",
			"one-light",
			"light"
		],
		classes: {
			light: "shiki-theme-one-light",
			dark: "shiki-theme-one-light"
		},
		mode: "light"
	},
	{
		id: "shiki-plastic",
		label: "Plastic",
		description: "Use Plastic theme (dark).",
		keywords: [
			"shiki",
			"plastic",
			"Plastic",
			"plastic",
			"dark"
		],
		classes: {
			light: "shiki-theme-plastic",
			dark: "shiki-theme-plastic"
		},
		mode: "dark"
	},
	{
		id: "shiki-poimandres",
		label: "Poimandres",
		description: "Use Poimandres theme (dark).",
		keywords: [
			"shiki",
			"poimandres",
			"Poimandres",
			"poimandres",
			"dark"
		],
		classes: {
			light: "shiki-theme-poimandres",
			dark: "shiki-theme-poimandres"
		},
		mode: "dark"
	},
	{
		id: "shiki-red",
		label: "Red",
		description: "Use Red theme (dark).",
		keywords: [
			"shiki",
			"red",
			"Red",
			"red",
			"dark"
		],
		classes: {
			light: "shiki-theme-red",
			dark: "shiki-theme-red"
		},
		mode: "dark"
	},
	{
		id: "shiki-rose-pine",
		label: "Rosé Pine",
		description: "Use Rosé Pine theme (dark).",
		keywords: [
			"shiki",
			"rose-pine",
			"Rosé Pine",
			"rose-pine",
			"dark"
		],
		classes: {
			light: "shiki-theme-rose-pine",
			dark: "shiki-theme-rose-pine"
		},
		mode: "dark"
	},
	{
		id: "shiki-rose-pine-dawn",
		label: "Rosé Pine Dawn",
		description: "Use Rosé Pine Dawn theme (light).",
		keywords: [
			"shiki",
			"rose-pine-dawn",
			"Rosé Pine Dawn",
			"rose-pine-dawn",
			"light"
		],
		classes: {
			light: "shiki-theme-rose-pine-dawn",
			dark: "shiki-theme-rose-pine-dawn"
		},
		mode: "light"
	},
	{
		id: "shiki-rose-pine-moon",
		label: "Rosé Pine Moon",
		description: "Use Rosé Pine Moon theme (dark).",
		keywords: [
			"shiki",
			"rose-pine-moon",
			"Rosé Pine Moon",
			"rose-pine-moon",
			"dark"
		],
		classes: {
			light: "shiki-theme-rose-pine-moon",
			dark: "shiki-theme-rose-pine-moon"
		},
		mode: "dark"
	},
	{
		id: "shiki-slack-dark",
		label: "Slack Dark",
		description: "Use Slack Dark theme (dark).",
		keywords: [
			"shiki",
			"slack-dark",
			"Slack Dark",
			"slack-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-slack-dark",
			dark: "shiki-theme-slack-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-slack-ochin",
		label: "Slack Ochin",
		description: "Use Slack Ochin theme (light).",
		keywords: [
			"shiki",
			"slack-ochin",
			"Slack Ochin",
			"slack-ochin",
			"light"
		],
		classes: {
			light: "shiki-theme-slack-ochin",
			dark: "shiki-theme-slack-ochin"
		},
		mode: "light"
	},
	{
		id: "shiki-snazzy-light",
		label: "Snazzy Light",
		description: "Use Snazzy Light theme (light).",
		keywords: [
			"shiki",
			"snazzy-light",
			"Snazzy Light",
			"snazzy-light",
			"light"
		],
		classes: {
			light: "shiki-theme-snazzy-light",
			dark: "shiki-theme-snazzy-light"
		},
		mode: "light"
	},
	{
		id: "shiki-solarized-dark",
		label: "Solarized Dark",
		description: "Use Solarized Dark theme (dark).",
		keywords: [
			"shiki",
			"solarized-dark",
			"Solarized Dark",
			"solarized-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-solarized-dark",
			dark: "shiki-theme-solarized-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-solarized-light",
		label: "Solarized Light",
		description: "Use Solarized Light theme (light).",
		keywords: [
			"shiki",
			"solarized-light",
			"Solarized Light",
			"solarized-light",
			"light"
		],
		classes: {
			light: "shiki-theme-solarized-light",
			dark: "shiki-theme-solarized-light"
		},
		mode: "light"
	},
	{
		id: "shiki-synthwave-84",
		label: "Synthwave '84",
		description: "Use Synthwave '84 theme (dark).",
		keywords: [
			"shiki",
			"synthwave-84",
			"Synthwave '84",
			"synthwave-84",
			"dark"
		],
		classes: {
			light: "shiki-theme-synthwave-84",
			dark: "shiki-theme-synthwave-84"
		},
		mode: "dark"
	},
	{
		id: "shiki-tokyo-night",
		label: "Tokyo Night",
		description: "Use Tokyo Night theme (dark).",
		keywords: [
			"shiki",
			"tokyo-night",
			"Tokyo Night",
			"tokyo-night",
			"dark"
		],
		classes: {
			light: "shiki-theme-tokyo-night",
			dark: "shiki-theme-tokyo-night"
		},
		mode: "dark"
	},
	{
		id: "shiki-vesper",
		label: "Vesper",
		description: "Use Vesper theme (dark).",
		keywords: [
			"shiki",
			"vesper",
			"Vesper",
			"vesper",
			"dark"
		],
		classes: {
			light: "shiki-theme-vesper",
			dark: "shiki-theme-vesper"
		},
		mode: "dark"
	},
	{
		id: "shiki-vitesse-black",
		label: "Vitesse Black",
		description: "Use Vitesse Black theme (dark).",
		keywords: [
			"shiki",
			"vitesse-black",
			"Vitesse Black",
			"vitesse-black",
			"dark"
		],
		classes: {
			light: "shiki-theme-vitesse-black",
			dark: "shiki-theme-vitesse-black"
		},
		mode: "dark"
	},
	{
		id: "shiki-vitesse-dark",
		label: "Vitesse Dark",
		description: "Use Vitesse Dark theme (dark).",
		keywords: [
			"shiki",
			"vitesse-dark",
			"Vitesse Dark",
			"vitesse-dark",
			"dark"
		],
		classes: {
			light: "shiki-theme-vitesse-dark",
			dark: "shiki-theme-vitesse-dark"
		},
		mode: "dark"
	},
	{
		id: "shiki-vitesse-light",
		label: "Vitesse Light",
		description: "Use Vitesse Light theme (light).",
		keywords: [
			"shiki",
			"vitesse-light",
			"Vitesse Light",
			"vitesse-light",
			"light"
		],
		classes: {
			light: "shiki-theme-vitesse-light",
			dark: "shiki-theme-vitesse-light"
		},
		mode: "light"
	}
];
var THEME_COLOR_MODES = [
	"auto",
	"light",
	"dark"
];
var PICO_CODE_SHIKI_THEME = "pico-code";
var PICO_DIFF_SHIKI_THEMES = {
	light: "pico-diff-light",
	dark: "pico-diff-dark"
};
var PICO_SHIKI_VARIABLE_DEFAULTS = {
	foreground: "var(--code-fg)",
	background: "var(--background)",
	"token-comment": "var(--code-comment)",
	"token-constant": "var(--code-number)",
	"token-keyword": "var(--code-keyword)",
	"token-parameter": "var(--code-variable)",
	"token-function": "var(--code-title)",
	"token-string": "var(--code-string)",
	"token-string-expression": "var(--code-string)",
	"token-punctuation": "var(--code-meta)",
	"token-link": "var(--code-title)",
	"token-inserted": "var(--success)",
	"token-deleted": "var(--danger)",
	"token-changed": "var(--warning)",
	"ansi-black": "var(--background)",
	"ansi-red": "var(--danger)",
	"ansi-green": "var(--success)",
	"ansi-yellow": "var(--warning)",
	"ansi-blue": "var(--primary)",
	"ansi-magenta": "var(--code-keyword)",
	"ansi-cyan": "var(--code-meta)",
	"ansi-white": "var(--foreground)",
	"ansi-bright-black": "var(--muted-foreground)",
	"ansi-bright-red": "var(--danger)",
	"ansi-bright-green": "var(--success)",
	"ansi-bright-yellow": "var(--warning)",
	"ansi-bright-blue": "var(--primary)",
	"ansi-bright-magenta": "var(--code-keyword)",
	"ansi-bright-cyan": "var(--code-meta)",
	"ansi-bright-white": "var(--foreground)"
};
var THEME_DEFINITIONS = [
	{
		id: "default",
		label: "Default",
		description: "Use Pico's default palette.",
		keywords: ["pico", "default"],
		classes: {
			light: "light",
			dark: "dark"
		}
	},
	{
		id: "flexoki",
		label: "Flexoki",
		description: "Use Flexoki's warm paper and inky dark palettes.",
		keywords: [
			"flexoki",
			"warm",
			"paper",
			"inky"
		],
		classes: {
			light: "flexoki-light",
			dark: "flexoki-dark"
		}
	},
	...SHIKI_BUNDLED_THEME_DEFINITIONS,
	...SHIKI_BUNDLED_THEME_PAIR_DEFINITIONS
];
var THEME_FAMILIES = THEME_DEFINITIONS.map((theme) => theme.id);
var APPLIED_THEME_CLASSES = Array.from(new Set(THEME_DEFINITIONS.flatMap((theme) => [theme.classes.light, theme.classes.dark])));
function isThemeFamily(value) {
	return THEME_FAMILIES.includes(value);
}
function getThemeDefinition(theme) {
	return THEME_DEFINITIONS.find((definition) => definition.id === theme) ?? THEME_DEFINITIONS[0];
}
function themeDefinitionMode(definition) {
	return "mode" in definition ? definition.mode : void 0;
}
function themeFamilyFixedMode(theme) {
	return themeDefinitionMode(getThemeDefinition(normalizeThemeFamily(theme)));
}
function themeDefinitionSelectorModes(definition) {
	if ("selectorModes" in definition && definition.selectorModes) return definition.selectorModes;
	const fixedMode = themeDefinitionMode(definition);
	return fixedMode ? [fixedMode] : THEME_COLOR_MODES;
}
function themeFamilySupportsColorMode(theme, mode) {
	return themeDefinitionSelectorModes(getThemeDefinition(normalizeThemeFamily(theme))).includes(mode);
}
function appliedThemeClassColorMode(themeClass) {
	const normalized = typeof themeClass === "string" ? themeClass.trim() : "";
	if (!normalized) return void 0;
	for (const definition of THEME_DEFINITIONS) {
		if (definition.classes.dark === normalized) return themeDefinitionMode(definition) ?? "dark";
		if (definition.classes.light === normalized) return themeDefinitionMode(definition) ?? "light";
	}
}
function normalizeThemeFamily(value) {
	const normalized = typeof value === "string" ? value.trim() : "";
	if (isThemeFamily(normalized)) return normalized;
	for (const definition of THEME_DEFINITIONS) if (definition.classes.light === normalized || definition.classes.dark === normalized) return definition.id;
	return "default";
}
function normalizeThemeColorMode(value) {
	if (value === "auto" || value === "system") return "auto";
	if (value === "light" || value === "dark") return value;
	return appliedThemeClassColorMode(value) ?? "auto";
}
function resolvedThemeMode(mode, systemTheme) {
	if (mode === "auto") return systemTheme === "dark" ? "dark" : "light";
	return mode;
}
function appliedThemeClass(family, mode, systemTheme) {
	const definition = getThemeDefinition(normalizeThemeFamily(family));
	const resolvedMode = themeDefinitionMode(definition) ?? resolvedThemeMode(mode, systemTheme);
	return definition.classes[resolvedMode];
}
function themeFamilyLabel(theme) {
	return getThemeDefinition(normalizeThemeFamily(theme)).label;
}
function themeFamilyDescription(theme) {
	return getThemeDefinition(normalizeThemeFamily(theme)).description;
}
function themeFamilyKeywords(theme) {
	const definition = getThemeDefinition(normalizeThemeFamily(theme));
	return [
		definition.id,
		definition.label,
		definition.description,
		...definition.keywords
	];
}
function themeColorModeLabel(mode, systemTheme) {
	if (mode === "auto") {
		if (!systemTheme) return "Auto";
		return `Auto (${resolvedThemeMode(mode, systemTheme) === "light" ? "Light" : "Dark"})`;
	}
	return mode === "light" ? "Light" : "Dark";
}
var THEME_STORAGE_KEY = "pico-theme";
var THEME_COLOR_MODE_STORAGE_KEY = "pico-theme-color-mode";
var APPLIED_THEME_STORAGE_KEY = "pico-applied-theme";
var DRAFT_DIRECTORY_STORAGE_KEY = "pico-draft-directory";
var SIDEBAR_DIRECTORIES_STORAGE_KEY = "pico-sidebar-directories";
var COLLAPSED_DIRECTORIES_STORAGE_KEY = "pico-collapsed-directories";
var PINNED_SESSIONS_STORAGE_KEY = "pico-pinned-sessions";
var RECENT_DIRECTORIES_STORAGE_KEY = "pico-recent-directories";
var SESSION_DONE_SOUND_ENABLED_STORAGE_KEY = "pico-session-done-sound";
var SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY = "pico-session-done-desktop-notifications";
var HIDE_TOOL_BLOCKS_STORAGE_KEY = "pico-hide-tools";
var CENTER_MESSAGES_STORAGE_KEY = "pico-center-messages";
var AUTO_SCROLL_ENABLED_STORAGE_KEY = "pico-auto-scroll";
var RIGHT_SIDEBAR_OPEN_STORAGE_KEY = "pico-right-sidebar-open";
var RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY = "pico-right-sidebar-active-tab";
var RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY = "pico-right-sidebar-widths";
var RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY = "pico-right-sidebar-file-tree-width";
var RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY = "pico-right-sidebar-history-height";
var RIGHT_SIDEBAR_HISTORY_TAB_STORAGE_KEY = "pico-right-sidebar-history-tab";
var PROMPT_DRAFTS_STORAGE_KEY = "pico-prompt-drafts";
var VIEWER_CONTEXT_STORAGE_KEY = "pico-context-id";
function createContextId() {
	if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `ctx-${crypto.randomUUID()}`;
	return `ctx-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
}
function safeLocalStorageGetItem(key) {
	try {
		return window.localStorage.getItem(key);
	} catch {
		return null;
	}
}
function safeLocalStorageSetItem(key, value) {
	try {
		window.localStorage.setItem(key, value);
		return true;
	} catch {
		return false;
	}
}
function safeSessionStorageGetItem(key) {
	try {
		return window.sessionStorage.getItem(key);
	} catch {
		return null;
	}
}
function safeSessionStorageSetItem(key, value) {
	try {
		window.sessionStorage.setItem(key, value);
		return true;
	} catch {
		return false;
	}
}
function normalizeStoredDirectoryList(value) {
	if (!Array.isArray(value)) return [];
	const nextDirectories = [];
	const seen = /* @__PURE__ */ new Set();
	for (const entry of value) {
		const normalized = typeof entry === "string" ? entry.trim() : "";
		if (!normalized || seen.has(normalized)) continue;
		seen.add(normalized);
		nextDirectories.push(normalized);
	}
	return nextDirectories;
}
function sessionListEntryKey(sessionLike = {}) {
	if (sessionLike.path) return `path:${sessionLike.path}`;
	if (sessionLike.id) return `id:${sessionLike.id}`;
	return "";
}
function normalizeSessionSelectionKeys(value) {
	if (!Array.isArray(value)) return [];
	const keys = [];
	const seen = /* @__PURE__ */ new Set();
	for (const entry of value) {
		const key = typeof entry === "string" ? entry.trim() : "";
		if (!key || seen.has(key)) continue;
		seen.add(key);
		keys.push(key);
	}
	return keys;
}
function promptDraftKey(target = {}) {
	if (target.sessionId) return `session:${target.sessionId}`;
	if (target.sessionFile) return `file:${target.sessionFile}`;
	return `draft:${target.cwd?.trim() || "default"}`;
}
function promptDraftKeyMatchesOwner(draftKey, ownerKey) {
	if (!ownerKey) return false;
	if (draftKey === ownerKey) return true;
	return ownerKey === promptDraftKey() && draftKey.startsWith("draft:");
}
function loadStoredPromptDrafts() {
	try {
		const raw = safeSessionStorageGetItem(PROMPT_DRAFTS_STORAGE_KEY);
		if (!raw) return {};
		const parsed = JSON.parse(raw);
		return parsed && typeof parsed === "object" ? parsed : {};
	} catch {
		return {};
	}
}
function readStoredPromptDraft(target = {}) {
	const value = loadStoredPromptDrafts()[promptDraftKey(target)];
	return typeof value === "string" ? value : void 0;
}
function rememberStoredPromptDraft(target = {}, text = "") {
	const key = promptDraftKey(target);
	const drafts = loadStoredPromptDrafts();
	const nextValue = typeof text === "string" ? text : "";
	if (nextValue) drafts[key] = nextValue;
	else delete drafts[key];
	return safeSessionStorageSetItem(PROMPT_DRAFTS_STORAGE_KEY, JSON.stringify(drafts));
}
function readStoredSidebarDirectories() {
	try {
		const raw = safeLocalStorageGetItem(SIDEBAR_DIRECTORIES_STORAGE_KEY);
		if (raw == null) return {
			directories: [],
			hasStoredValue: false
		};
		return {
			directories: normalizeStoredDirectoryList(JSON.parse(raw)),
			hasStoredValue: true
		};
	} catch {
		return {
			directories: [],
			hasStoredValue: false
		};
	}
}
function readStoredPinnedSessionKeys() {
	try {
		const raw = safeLocalStorageGetItem(PINNED_SESSIONS_STORAGE_KEY);
		if (!raw) return [];
		return normalizeSessionSelectionKeys(JSON.parse(raw));
	} catch {
		return [];
	}
}
function readStoredCollapsedDirectories() {
	try {
		const raw = safeLocalStorageGetItem(COLLAPSED_DIRECTORIES_STORAGE_KEY);
		if (!raw) return {};
		const parsed = JSON.parse(raw);
		if (!parsed || typeof parsed !== "object") return {};
		return Object.fromEntries(Object.entries(parsed).flatMap(([key, value]) => {
			const normalizedKey = key.trim();
			return normalizedKey ? [[normalizedKey, Boolean(value)]] : [];
		}));
	} catch {
		return {};
	}
}
function readStoredDraftDirectory() {
	return (safeLocalStorageGetItem("pico-draft-directory") ?? "").trim();
}
function readStoredRecentDirectories() {
	try {
		const raw = safeLocalStorageGetItem(RECENT_DIRECTORIES_STORAGE_KEY);
		if (!raw) return [];
		return normalizeStoredDirectoryList(JSON.parse(raw));
	} catch {
		return [];
	}
}
function readStoredTheme() {
	return normalizeThemeFamily((safeLocalStorageGetItem("pico-theme") ?? "default").trim());
}
function readStoredThemeColorMode() {
	return normalizeThemeColorMode((safeLocalStorageGetItem("pico-theme-color-mode") ?? safeLocalStorageGetItem("pico-theme") ?? "auto").trim());
}
function readStoredHideToolBlocks() {
	return safeLocalStorageGetItem(HIDE_TOOL_BLOCKS_STORAGE_KEY) === "1";
}
function readStoredCenterMessages() {
	return safeLocalStorageGetItem(CENTER_MESSAGES_STORAGE_KEY) === "1";
}
function readStoredAutoScrollEnabled() {
	const value = safeLocalStorageGetItem(AUTO_SCROLL_ENABLED_STORAGE_KEY);
	return value == null ? true : value !== "0";
}
function readStoredRightSidebarOpen() {
	return safeLocalStorageGetItem(RIGHT_SIDEBAR_OPEN_STORAGE_KEY) === "1";
}
function readStoredSessionDoneSoundEnabled() {
	const value = safeLocalStorageGetItem(SESSION_DONE_SOUND_ENABLED_STORAGE_KEY);
	return value == null ? true : value !== "0";
}
function readStoredSessionDoneDesktopNotificationsEnabled() {
	const value = safeLocalStorageGetItem(SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY);
	return value == null ? true : value !== "0";
}
var EXPLORE_TOOL_NAMES = new Set([
	"read",
	"grep",
	"glob",
	"find",
	"ls",
	"list",
	"rg"
]);
var EXPLORE_SHELL_COMMAND_NAMES = new Set([
	"find",
	"grep",
	"ls",
	"rg"
]);
var SKIPPABLE_SHELL_COMMAND_NAMES = new Set([
	"cd",
	"export",
	"pwd",
	"set"
]);
var SHELL_COMMAND_WRAPPER_NAMES = new Set([
	"command",
	"env",
	"noglob",
	"sudo",
	"time"
]);
function normalizeToolArgs(args) {
	if (!args) return void 0;
	if (typeof args === "object") return args;
	if (typeof args !== "string") return void 0;
	try {
		const parsed = JSON.parse(args);
		return parsed && typeof parsed === "object" ? parsed : void 0;
	} catch {
		return;
	}
}
function getToolArgText(args, key) {
	const value = args?.[key];
	return typeof value === "string" && value.trim() ? value.trim() : "";
}
function toolCommandPreviewFromArgs(args) {
	if (typeof args === "string" && args.trim()) return args.trim();
	const normalizedArgs = normalizeToolArgs(args);
	return getToolArgText(normalizedArgs, "description") || getToolArgText(normalizedArgs, "command") || getToolArgText(normalizedArgs, "path") || getToolArgText(normalizedArgs, "filePath");
}
function rawShellCommandTextFromTool(name, args) {
	if (name !== "bash") return "";
	if (typeof args === "string") {
		const trimmed = args.trim();
		if (!trimmed) return "";
		try {
			const parsed = JSON.parse(trimmed);
			if (parsed && typeof parsed === "object" && "command" in parsed) {
				const command = parsed.command;
				return typeof command === "string" ? command.trim() : trimmed;
			}
		} catch {
			return trimmed;
		}
		return trimmed;
	}
	return getToolArgText(normalizeToolArgs(args), "command") || toolCommandPreviewFromArgs(args);
}
function pathBaseName(path) {
	const normalized = path.replace(/\\/g, "/").trim();
	if (!normalized) return "";
	const parts = normalized.split("/");
	return parts[parts.length - 1] || normalized;
}
function shellCommandNameFromSegment(segment) {
	let text = segment.trim();
	while (text) {
		const assignmentMatch = text.match(/^(?:env\s+)?[A-Za-z_][A-Za-z0-9_]*=(?:"[^"]*"|'[^']*'|\S*)\s*/);
		if (assignmentMatch) {
			text = text.slice(assignmentMatch[0].length).trimStart();
			continue;
		}
		const commandMatch = text.match(/^([./A-Za-z0-9_-]+)\b/);
		if (!commandMatch) return "";
		const commandPath = commandMatch[1] || "";
		const commandName = pathBaseName(commandPath);
		if (!SHELL_COMMAND_WRAPPER_NAMES.has(commandName)) return commandName;
		text = text.slice(commandPath.length).trimStart();
	}
	return "";
}
function exploreShellCommandNameFromTool(name, args) {
	if (name !== "bash") return "";
	const segments = rawShellCommandTextFromTool(name, args).split(/(?:&&|\|\||;)/);
	for (const segment of segments) {
		const commandName = shellCommandNameFromSegment(segment);
		if (!commandName || SKIPPABLE_SHELL_COMMAND_NAMES.has(commandName)) continue;
		return EXPLORE_SHELL_COMMAND_NAMES.has(commandName) ? commandName : "";
	}
	return "";
}
function toolCategoryFromTool(name, args) {
	return EXPLORE_TOOL_NAMES.has(name || "") || Boolean(exploreShellCommandNameFromTool(name, args)) ? "explore" : void 0;
}
function previewUrlForImage(image) {
	return `data:${image.mimeType};base64,${image.data}`;
}
function normalizePromptImage(image) {
	if (!image || typeof image !== "object") return null;
	let mimeType = typeof image.mimeType === "string" ? image.mimeType.trim() : "";
	let data = typeof image.data === "string" ? image.data.trim() : "";
	if (!data) return null;
	const dataUrlMatch = data.match(/^data:([^;,]+);base64,(.+)$/i);
	if (dataUrlMatch) {
		if (!mimeType) mimeType = dataUrlMatch[1] ?? mimeType;
		data = dataUrlMatch[2] ?? "";
	}
	if (!mimeType || !/^image\//i.test(mimeType) || !data) return null;
	return {
		type: "image",
		mimeType,
		data,
		previewUrl: previewUrlForImage({
			mimeType,
			data
		})
	};
}
function extractMessageText(message) {
	if (typeof message?.content === "string") return message.content;
	if (!Array.isArray(message?.content)) return "";
	return message.content.flatMap((part) => part?.type === "text" ? [part.text || ""] : []).join("\n");
}
function extractToolText(result) {
	if (!result || !Array.isArray(result.content)) return "";
	return result.content.flatMap((part) => part?.type === "text" && typeof part.text === "string" ? [part.text] : []).join("\n");
}
function extractMessageImages(message) {
	if (!Array.isArray(message?.content)) return [];
	return message.content.flatMap((part) => {
		if (part?.type !== "image") return [];
		const image = normalizePromptImage(part);
		return image ? [image] : [];
	});
}
function normalizeStreamingBehavior(value) {
	return value === "steer" || value === "followUp" ? value : void 0;
}
function stableJsonValue(value) {
	if (value == null) return "";
	if (typeof value !== "object") return JSON.stringify(value);
	if (Array.isArray(value)) return `[${value.map((entry) => stableJsonValue(entry)).join(",")}]`;
	return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableJsonValue(value[key])}`).join(",")}}`;
}
function sameContextUsage(left, right) {
	return stableJsonValue(left) === stableJsonValue(right);
}
function samePromptImages(leftImages = [], rightImages = []) {
	if (leftImages.length !== rightImages.length) return false;
	for (let index = 0; index < leftImages.length; index += 1) {
		const left = leftImages[index];
		const right = rightImages[index];
		if (!left || !right) return false;
		if (left.mimeType !== right.mimeType) return false;
		if (left.data !== right.data) return false;
		if (left.previewUrl !== right.previewUrl) return false;
	}
	return true;
}
function sameUserMessageBody(left, right) {
	return left.text === right.text && samePromptImages(left.images, right.images) && Boolean(left.queued) === Boolean(right.queued) && left.streamingBehavior === right.streamingBehavior;
}
function sameUserMessageContent(left, right) {
	return (left.itemKey || "") === (right.itemKey || "") && sameUserMessageBody(left, right);
}
function sameAssistantBlockPayload(left, right) {
	if (!left || !right || left.type !== right.type) return false;
	switch (left.type) {
		case "text": return right.type === "text" && left.text === right.text && Boolean(left.isError) === Boolean(right.isError);
		case "thinking": return right.type === "thinking" && left.text === right.text && (left.summaryLabel || "") === (right.summaryLabel || "");
		case "tool": return right.type === "tool" && (left.callId || "") === (right.callId || "") && (left.name || "") === (right.name || "") && stableJsonValue(left.args) === stableJsonValue(right.args) && left.output === right.output && stableJsonValue(left.details) === stableJsonValue(right.details) && Boolean(left.isError) === Boolean(right.isError) && Boolean(left.running) === Boolean(right.running);
		case "compaction": return right.type === "compaction" && left.summary === right.summary && left.tokensBefore === right.tokensBefore;
		default: return false;
	}
}
function sameAssistantBlock(left, right) {
	return (left.blockKey || "") === (right.blockKey || "") && sameAssistantBlockPayload(left, right);
}
function sameAssistantModel(left, right) {
	if (left === right) return true;
	if (!left || !right) return false;
	return left.id === right.id && (left.provider || "") === (right.provider || "") && (left.name || "") === (right.name || "") && Boolean(left.reasoning) === Boolean(right.reasoning);
}
function sameAssistantMessageMeta(left, right) {
	return sameAssistantModel(left.model, right.model) && left.done === false === (right.done === false);
}
function sameStateItem(left, right) {
	if (!left || !right || left.kind !== right.kind) return false;
	if ((left.itemKey || "") !== (right.itemKey || "")) return false;
	if (left.kind === "user" && right.kind === "user") return (left.pendingId || "") === (right.pendingId || "") && sameUserMessageContent(left, right);
	if (left.kind !== "assistant" || right.kind !== "assistant") return false;
	if (Boolean(left.streaming) !== Boolean(right.streaming)) return false;
	if (!sameAssistantMessageMeta(left, right)) return false;
	if (left.blocks.length !== right.blocks.length) return false;
	for (let index = 0; index < left.blocks.length; index += 1) if (!sameAssistantBlock(left.blocks[index], right.blocks[index])) return false;
	return true;
}
function previousAssistantBlockByKey(blocks, blockKey) {
	if (!blockKey) return void 0;
	return blocks.find((block) => block.blockKey === blockKey);
}
function assistantBlockRenderKey(block) {
	return block?.renderKey || block?.blockKey || "";
}
function withAssistantBlockRenderKey(block, previousBlock) {
	const renderKey = assistantBlockRenderKey(previousBlock);
	if (!renderKey || block.renderKey === renderKey) return block;
	return {
		...block,
		renderKey
	};
}
function sameAssistantBlockListPayload(leftBlocks, rightBlocks) {
	if (leftBlocks.length !== rightBlocks.length) return false;
	for (let index = 0; index < leftBlocks.length; index += 1) if (!sameAssistantBlockPayload(leftBlocks[index], rightBlocks[index])) return false;
	return true;
}
function reconcileAssistantBlocks(previousBlocks, nextBlocks) {
	let changed = previousBlocks.length !== nextBlocks.length;
	const reconciled = [];
	for (let index = 0; index < nextBlocks.length; index += 1) {
		const nextBlock = nextBlocks[index];
		const previousBlock = previousAssistantBlockByKey(previousBlocks, nextBlock.blockKey) || previousBlocks[index];
		if (previousBlock && sameAssistantBlock(previousBlock, nextBlock)) {
			reconciled.push(previousBlock);
			continue;
		}
		changed = true;
		if (previousBlock?.type === nextBlock.type && ((previousBlock.blockKey || "") === (nextBlock.blockKey || "") || sameAssistantBlockPayload(previousBlock, nextBlock))) {
			reconciled.push(withAssistantBlockRenderKey(nextBlock, previousBlock));
			continue;
		}
		reconciled.push(nextBlock);
	}
	return changed ? reconciled : previousBlocks;
}
function conversationItemRenderKey(item) {
	return item?.renderKey || item?.itemKey || "";
}
function withConversationItemRenderKey(item, previousItem) {
	const renderKey = conversationItemRenderKey(previousItem);
	if (!renderKey || item.renderKey === renderKey) return item;
	return {
		...item,
		renderKey
	};
}
function reconcileConversationItems(previousItems, nextItems) {
	if (previousItems.length === 0) return nextItems;
	const previousItemsByKey = /* @__PURE__ */ new Map();
	const previousItemsByRenderKey = /* @__PURE__ */ new Map();
	for (const item of previousItems) {
		if (item.itemKey && !previousItemsByKey.has(item.itemKey)) previousItemsByKey.set(item.itemKey, item);
		const renderKey = conversationItemRenderKey(item);
		if (renderKey && !previousItemsByRenderKey.has(renderKey)) previousItemsByRenderKey.set(renderKey, item);
	}
	let changed = previousItems.length !== nextItems.length;
	const reconciled = [];
	for (let index = 0; index < nextItems.length; index += 1) {
		const nextItem = nextItems[index];
		const nextRenderKey = conversationItemRenderKey(nextItem);
		const previousItem = (nextItem.itemKey ? previousItemsByKey.get(nextItem.itemKey) : void 0) || (nextRenderKey ? previousItemsByRenderKey.get(nextRenderKey) : void 0) || previousItems[index];
		if (!previousItem || previousItem.kind !== nextItem.kind) {
			changed = true;
			reconciled.push(nextItem);
			continue;
		}
		if (sameStateItem(previousItem, nextItem)) {
			reconciled.push(previousItem);
			continue;
		}
		if (previousItem.kind === "user" && nextItem.kind === "user") {
			if (sameUserMessageBody(previousItem, nextItem)) {
				changed = true;
				reconciled.push(withConversationItemRenderKey(nextItem, previousItem));
				continue;
			}
		}
		if (previousItem.kind === "assistant" && nextItem.kind === "assistant") {
			const blocks = reconcileAssistantBlocks(previousItem.blocks, nextItem.blocks);
			const sameLogicalItem = (previousItem.itemKey || "") === (nextItem.itemKey || "");
			const sameRenderItem = conversationItemRenderKey(previousItem) === conversationItemRenderKey(nextItem);
			const finalizingStreamingItem = Boolean(previousItem.streaming) && !nextItem.streaming && sameAssistantBlockListPayload(previousItem.blocks, nextItem.blocks);
			const itemWithStableRenderKey = sameLogicalItem || sameRenderItem || finalizingStreamingItem ? withConversationItemRenderKey(nextItem, previousItem) : nextItem;
			if (sameLogicalItem && blocks === previousItem.blocks && Boolean(previousItem.streaming) === Boolean(nextItem.streaming) && sameAssistantMessageMeta(previousItem, nextItem)) {
				reconciled.push(previousItem);
				continue;
			}
			changed = true;
			reconciled.push(blocks === itemWithStableRenderKey.blocks ? itemWithStableRenderKey : {
				...itemWithStableRenderKey,
				blocks
			});
			continue;
		}
		changed = true;
		reconciled.push(nextItem);
	}
	return changed ? reconciled : previousItems;
}
function assistantStopMessage(message) {
	const stopReason = typeof message?.stopReason === "string" ? message.stopReason : "";
	const errorMessage = typeof message?.errorMessage === "string" ? message.errorMessage.trim() : "";
	if (stopReason === "aborted") return errorMessage && errorMessage !== "Request was aborted" ? errorMessage : "Operation aborted";
	if (stopReason === "error") return `Error: ${errorMessage || "Unknown error"}`;
	return "";
}
function assistantStopIsError(message) {
	const stopReason = typeof message?.stopReason === "string" ? message.stopReason : "";
	return stopReason === "aborted" || stopReason === "error";
}
function assistantModelFromMessage(message) {
	const id = typeof message?.model === "string" ? message.model.trim() : "";
	if (!id) return void 0;
	const provider = typeof message?.provider === "string" ? message.provider.trim() : "";
	return {
		id,
		...provider ? { provider } : {}
	};
}
function assistantItemMetadataFromMessage(message) {
	const model = assistantModelFromMessage(message);
	return model ? { model } : {};
}
function applyAssistantStopToToolBlocks(blocks, stopMessage) {
	let changed = false;
	const nextBlocks = blocks.map((block) => {
		if (block.type !== "tool" || block.output.trim()) return block;
		changed = true;
		return {
			...block,
			output: stopMessage,
			isError: true,
			running: false
		};
	});
	return changed ? nextBlocks : blocks;
}
function assistantBlocksFromMessage(message, keyPrefix = "assistant") {
	let blocks = [];
	const toolBlockIndexByCallId = /* @__PURE__ */ new Map();
	const content = Array.isArray(message?.content) ? message.content : [];
	const stopMessage = assistantStopMessage(message);
	const stopIsError = assistantStopIsError(message);
	for (let index = 0; index < content.length; index += 1) {
		const part = content[index];
		const partKey = `${keyPrefix}:part:${index}`;
		if (part?.type === "text") blocks.push({
			type: "text",
			blockKey: `${partKey}:text`,
			text: part.text || ""
		});
		if (part?.type === "thinking") {
			const thinkingText = part.thinking || "";
			if (thinkingText.trim()) blocks.push({
				type: "thinking",
				blockKey: `${partKey}:thinking`,
				text: thinkingText,
				...typeof part.summaryLabel === "string" ? { summaryLabel: part.summaryLabel } : {}
			});
		}
		if (part?.type === "toolCall") {
			const callId = typeof part.id === "string" ? part.id.trim() : "";
			const toolName = typeof part.name === "string" ? part.name : void 0;
			const category = toolCategoryFromTool(toolName, part.arguments);
			const toolBlock = {
				type: "tool",
				blockKey: callId ? `${keyPrefix}:tool:${callId}` : `${partKey}:tool`,
				...callId ? { callId } : {},
				...toolName ? { name: toolName } : {},
				...category ? { category } : {},
				args: part.arguments,
				output: "",
				details: void 0,
				isError: false,
				running: true
			};
			const existingIndex = callId ? toolBlockIndexByCallId.get(callId) : void 0;
			const existingBlock = existingIndex !== void 0 ? blocks[existingIndex] : void 0;
			if (existingIndex !== void 0 && existingBlock?.type === "tool") {
				blocks[existingIndex] = {
					...existingBlock,
					...toolBlock.name ? { name: toolBlock.name } : {},
					...toolBlock.category || existingBlock.category ? { category: toolBlock.category || existingBlock.category } : {},
					args: toolBlock.args,
					running: true
				};
				continue;
			}
			if (callId) toolBlockIndexByCallId.set(callId, blocks.length);
			blocks.push(toolBlock);
		}
	}
	if (stopMessage) if (blocks.some((block) => block.type === "tool")) blocks = applyAssistantStopToToolBlocks(blocks, stopMessage);
	else blocks.push({
		type: "text",
		blockKey: `${keyPrefix}:stop`,
		text: stopMessage,
		...stopIsError ? { isError: true } : {}
	});
	return blocks;
}
function createCompactionSummaryItem(summary, tokensBefore, itemKey = "compaction") {
	return {
		kind: "assistant",
		itemKey,
		blocks: [{
			type: "compaction",
			blockKey: `${itemKey}:compaction`,
			summary: typeof summary === "string" ? summary : "",
			tokensBefore: Number.isFinite(Number(tokensBefore)) ? Number(tokensBefore) : 0
		}],
		streaming: false
	};
}
function mutateToolBlockInItems(items, callId, mutate) {
	if (!callId) return;
	for (let index = items.length - 1; index >= 0; index -= 1) {
		const item = items[index];
		if (item?.kind !== "assistant") continue;
		for (const block of item.blocks) {
			if (block.type !== "tool" || block.callId !== callId) continue;
			mutate(block);
			return;
		}
	}
}
function applyToolResultToBlock(block, update) {
	if (!update) return block;
	if (block.output === update.output && block.details === update.details && block.isError === update.isError && !block.running) return block;
	return {
		...block,
		output: update.output,
		details: update.details,
		isError: update.isError,
		running: false
	};
}
function applyToolResultsToBlocks(blocks, toolResultsByCallId) {
	if (toolResultsByCallId.size === 0) return blocks;
	let changed = false;
	const nextBlocks = blocks.map((block) => {
		if (block.type !== "tool" || !block.callId) return block;
		const nextBlock = applyToolResultToBlock(block, toolResultsByCallId.get(block.callId));
		if (nextBlock !== block) changed = true;
		return nextBlock;
	});
	return changed ? nextBlocks : blocks;
}
function mergeAssistantBlocksForStreaming(options) {
	const previousBlocks = options.previousBlocks ?? [];
	const withToolResults = (blocks) => options.toolResultsByCallId ? applyToolResultsToBlocks(blocks, options.toolResultsByCallId) : blocks;
	if (previousBlocks.length === 0) return withToolResults(options.nextBlocks);
	const previousToolByCallId = /* @__PURE__ */ new Map();
	previousBlocks.forEach((block) => {
		if (block.type === "tool" && block.callId) previousToolByCallId.set(block.callId, block);
	});
	const nextToolCallIds = /* @__PURE__ */ new Set();
	const mergedNextBlocks = options.nextBlocks.map((block, index) => {
		if (block.type === "tool" && block.callId) {
			nextToolCallIds.add(block.callId);
			const previousTool = previousToolByCallId.get(block.callId);
			if (previousTool) return {
				...block,
				renderKey: assistantBlockRenderKey(previousTool),
				category: block.category || previousTool.category,
				output: previousTool.output || block.output,
				details: previousTool.details ?? block.details,
				isError: previousTool.isError || block.isError,
				running: previousTool.running === false ? false : block.running
			};
		}
		const previousBlock = options.preserveBlockRenderKeysByIndex ? previousBlocks[index] : void 0;
		if (previousBlock?.type === block.type) return withAssistantBlockRenderKey(block, previousBlock);
		return block;
	});
	if (!options.preserveMissingTools) return withToolResults(mergedNextBlocks);
	const missingPreviousTools = previousBlocks.flatMap((block, index) => block.type === "tool" && Boolean(block.callId) && !nextToolCallIds.has(block.callId || "") ? [{
		block,
		index
	}] : []);
	if (missingPreviousTools.length === 0) return withToolResults(mergedNextBlocks);
	const blocks = [];
	let missingIndex = 0;
	for (let index = 0; index < mergedNextBlocks.length; index += 1) {
		while (missingIndex < missingPreviousTools.length && missingPreviousTools[missingIndex].index <= index) {
			blocks.push(missingPreviousTools[missingIndex].block);
			missingIndex += 1;
		}
		blocks.push(mergedNextBlocks[index]);
	}
	while (missingIndex < missingPreviousTools.length) {
		blocks.push(missingPreviousTools[missingIndex].block);
		missingIndex += 1;
	}
	return withToolResults(blocks);
}
function mergeStreamingAssistantBlocks(options) {
	return mergeAssistantBlocksForStreaming({
		previousBlocks: options.previousStreamingItem?.blocks,
		nextBlocks: options.nextBlocks,
		toolResultsByCallId: options.toolResultsByCallId,
		preserveMissingTools: true
	});
}
function appendAssistantItem(items, item) {
	items.push(item);
	return item;
}
function findStreamingAssistantItem(items) {
	for (let index = items.length - 1; index >= 0; index -= 1) {
		const item = items[index];
		if (item?.kind === "assistant" && item.streaming) return item;
	}
	return null;
}
function isPendingConversationItem(item) {
	return item.kind === "user" && (Boolean(item.pendingId) || item.itemKey?.startsWith("pending:"));
}
function isOptimisticPendingConversationItem(item) {
	return item.kind === "user" && Boolean(item.pendingId?.startsWith("optimistic:"));
}
function sameUserPromptBody(left, right) {
	return left.text === right.text && samePromptImages(left.images, right.images);
}
function hasMatchingCommittedUserItem(candidate, committedItems, previousIndex) {
	const startIndex = Math.max(0, previousIndex);
	for (let index = startIndex; index < committedItems.length; index += 1) {
		const item = committedItems[index];
		if (item?.kind !== "user") continue;
		if (sameUserPromptBody(candidate, item)) return true;
	}
	return false;
}
function mergePendingItemsForSync(options) {
	if (!options.preserveOptimisticItems) return [];
	const mergedPendingItems = [];
	for (let previousIndex = 0; previousIndex < options.previousItems.length; previousIndex += 1) {
		const previousItem = options.previousItems[previousIndex];
		if (previousItem?.kind !== "user" || !isOptimisticPendingConversationItem(previousItem) || previousItem.queued) continue;
		if (hasMatchingCommittedUserItem(previousItem, options.committedItems, previousIndex)) continue;
		mergedPendingItems.push(previousItem);
	}
	return mergedPendingItems;
}
function committedItemsFromPrevious(previousItems) {
	return previousItems.filter((item) => {
		if (isPendingConversationItem(item) || isQueuedConversationItem(item)) return false;
		return !(item.kind === "assistant" && item.streaming);
	});
}
function isQueuedConversationItem(item) {
	return item.kind === "user" && Boolean(item.queued);
}
function messageItemIndex(item) {
	const match = item.itemKey?.match(/^message:(\d+)$/);
	if (!match) return -1;
	return Number(match[1]);
}
function nextMessageItemIndex(items) {
	let maxIndex = -1;
	for (const item of items) maxIndex = Math.max(maxIndex, messageItemIndex(item));
	return maxIndex + 1;
}
function uniqueRenderKey(preferredKey, items) {
	const existingRenderKeys = new Set(items.flatMap((item) => {
		const key = conversationItemRenderKey(item);
		return key ? [key] : [];
	}));
	if (!existingRenderKeys.has(preferredKey)) return preferredKey;
	let suffix = 1;
	while (existingRenderKeys.has(`${preferredKey}:streaming:${suffix}`)) suffix += 1;
	return `${preferredKey}:streaming:${suffix}`;
}
function streamingAssistantRenderKey(options) {
	const previousRenderKey = conversationItemRenderKey(options.previousStreamingItem || void 0);
	if (previousRenderKey && !options.items.some((item) => conversationItemRenderKey(item) === previousRenderKey)) return previousRenderKey;
	const optimisticUserCount = options.items.filter((item) => item.kind === "user" && isOptimisticPendingConversationItem(item)).length;
	const predictedAssistantIndex = (options.hasMessages ? options.messages.length : nextMessageItemIndex(options.items)) + optimisticUserCount;
	return uniqueRenderKey(`message:${Math.max(0, predictedAssistantIndex)}`, options.items);
}
function messageIsQueued(message) {
	const metadata = message?.metadata && typeof message.metadata === "object" ? message.metadata : void 0;
	return Boolean(message.queued || metadata?.queued);
}
function authoritativeItemsFromSync(sync) {
	if (!Array.isArray(sync.items)) return null;
	return sync.items.filter((item) => !isPendingConversationItem(item) && !isQueuedConversationItem(item));
}
function buildItemsFromSync(sync, previousItems = []) {
	const authoritativeItems = authoritativeItemsFromSync(sync);
	const hasAuthoritativeItems = Array.isArray(authoritativeItems);
	const hasMessages = Array.isArray(sync.messages);
	const hasPendingUserMessages = Array.isArray(sync.pendingUserMessages);
	const hasStreamingMessageUpdate = Object.prototype.hasOwnProperty.call(sync, "streamingMessage");
	const hasStreamingUpdate = typeof sync.streaming === "boolean" || hasStreamingMessageUpdate;
	if (!hasAuthoritativeItems && !hasMessages && !hasPendingUserMessages && !hasStreamingUpdate) return {
		items: previousItems,
		currentAssistantItem: findStreamingAssistantItem(previousItems)
	};
	if (authoritativeItems) {
		const streamingItems = authoritativeItems.filter((item) => item.kind === "assistant" && item.streaming);
		const items = authoritativeItems.filter((item) => !(item.kind === "assistant" && item.streaming));
		const preserveOptimisticItems = Boolean(sync.draft) || streamingItems.length > 0 || Boolean(sync.streaming);
		items.push(...mergePendingItemsForSync({
			previousItems,
			committedItems: items,
			preserveOptimisticItems
		}));
		items.push(...streamingItems);
		const reconciledItems = reconcileConversationItems(previousItems, items);
		return {
			items: reconciledItems,
			currentAssistantItem: findStreamingAssistantItem(reconciledItems)
		};
	}
	const items = hasMessages ? [] : committedItemsFromPrevious(previousItems);
	const toolResultsByCallId = /* @__PURE__ */ new Map();
	const messages = Array.isArray(sync.messages) ? sync.messages : [];
	for (let index = 0; index < messages.length; index += 1) {
		const message = messages[index];
		const itemKey = `message:${index}`;
		if (message.role === "user") {
			if (messageIsQueued(message)) continue;
			items.push({
				kind: "user",
				itemKey,
				text: extractMessageText(message),
				images: extractMessageImages(message),
				streamingBehavior: normalizeStreamingBehavior(message.streamingBehavior ?? message.deliverAs ?? message?.metadata?.streamingBehavior ?? message?.metadata?.deliverAs)
			});
			continue;
		}
		if (message.role === "assistant") {
			appendAssistantItem(items, {
				kind: "assistant",
				itemKey,
				blocks: assistantBlocksFromMessage(message, itemKey),
				streaming: false,
				...assistantItemMetadataFromMessage(message)
			});
			continue;
		}
		if (message.role === "compactionSummary") {
			items.push(createCompactionSummaryItem(message.summary, message.tokensBefore, itemKey));
			continue;
		}
		if (message.role === "toolResult") {
			const callId = typeof message.toolCallId === "string" ? message.toolCallId.trim() : "";
			const update = {
				output: extractMessageText(message),
				details: message.details,
				isError: Boolean(message.isError)
			};
			if (callId) toolResultsByCallId.set(callId, update);
			mutateToolBlockInItems(items, callId, (block) => {
				block.output = update.output;
				block.details = update.details;
				block.isError = update.isError;
				block.running = false;
			});
		}
	}
	const previousStreamingItem = findStreamingAssistantItem(previousItems);
	const shouldRenderStreaming = typeof sync.streaming === "boolean" ? sync.streaming : sync.streamingMessage != null ? true : Boolean(previousStreamingItem);
	const pendingItems = mergePendingItemsForSync({
		previousItems,
		committedItems: items,
		preserveOptimisticItems: Boolean(sync.draft) || shouldRenderStreaming
	});
	if (shouldRenderStreaming && pendingItems.length === 0) {
		const lastItemIndex = items.length - 1;
		const lastItem = items[lastItemIndex];
		if (lastItem?.kind === "assistant") items[lastItemIndex] = {
			...lastItem,
			done: false
		};
	}
	items.push(...pendingItems);
	if (shouldRenderStreaming) if (sync.streamingMessage?.role === "assistant") {
		const renderKey = streamingAssistantRenderKey({
			hasMessages,
			messages,
			items,
			previousStreamingItem
		});
		items.push({
			kind: "assistant",
			itemKey: "streaming",
			renderKey,
			blocks: mergeStreamingAssistantBlocks({
				previousStreamingItem,
				nextBlocks: assistantBlocksFromMessage(sync.streamingMessage, renderKey),
				toolResultsByCallId
			}),
			streaming: true,
			done: false,
			...assistantItemMetadataFromMessage(sync.streamingMessage)
		});
	} else if (previousStreamingItem && !hasStreamingMessageUpdate) {
		const blocks = applyToolResultsToBlocks(previousStreamingItem.blocks, toolResultsByCallId);
		items.push(blocks === previousStreamingItem.blocks ? previousStreamingItem : {
			...previousStreamingItem,
			blocks
		});
	} else {
		const renderKey = streamingAssistantRenderKey({
			hasMessages,
			messages,
			items,
			previousStreamingItem
		});
		items.push({
			kind: "assistant",
			itemKey: "streaming",
			renderKey,
			blocks: mergeStreamingAssistantBlocks({
				previousStreamingItem,
				nextBlocks: [],
				toolResultsByCallId
			}),
			streaming: true,
			done: false
		});
	}
	const reconciledItems = reconcileConversationItems(previousItems, items);
	return {
		items: reconciledItems,
		currentAssistantItem: findStreamingAssistantItem(reconciledItems)
	};
}
function sanitizeThinkingSummaryText(value) {
	if (typeof value !== "string") return "";
	let text = value.replace(/\r\n?/g, "\n");
	text = text.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, (_match, altText) => altText || "image");
	text = text.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, "$1");
	text = text.replace(/```([\s\S]*?)```/g, "$1");
	text = text.replace(/`([^`]+)`/g, "$1");
	text = text.replace(/\*\*([^*]+)\*\*/g, "$1");
	text = text.replace(/__([^_]+)__/g, "$1");
	text = text.replace(/\*([^*\n]+)\*/g, "$1");
	text = text.replace(/_([^_\n]+)_/g, "$1");
	text = text.replace(/^\s{0,3}#{1,6}\s+/gm, "");
	text = text.replace(/^\s*>\s?/gm, "");
	text = text.replace(/^\s*[-*+]\s+/gm, "");
	text = text.replace(/^\s*\d+\.\s+/gm, "");
	text = text.replace(/\/var\/folders\/[^\s)]*\/pi-clipboard-[A-Za-z0-9-]+\.(?:png|jpe?g|gif|webp)\b/gi, "pasted image");
	text = text.replace(/\s+/g, " ").trim();
	return text;
}
function primaryThinkingSummaryText(value) {
	if (typeof value !== "string") return "";
	const normalized = value.replace(/\r\n?/g, "\n");
	const paragraphs = normalized.split(/\n\s*\n+/).flatMap((part) => {
		const summary = sanitizeThinkingSummaryText(part);
		return summary ? [summary] : [];
	});
	if (paragraphs.length) return paragraphs[0] || "";
	return sanitizeThinkingSummaryText(normalized);
}
function meaningfulHiddenThinkingLabel(value) {
	const label = sanitizeThinkingSummaryText(value);
	return label && label !== "Thinking..." && label !== "Thinking" ? label : void 0;
}
function truncateThinkingSummary(text, maxLength = 140) {
	const normalized = text.replace(/\s+/g, " ").trim();
	if (!normalized) return "";
	if (normalized.length <= maxLength) return normalized;
	return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}…`;
}
function thinkingSummaryText(block, options = {}) {
	const blockLabel = meaningfulHiddenThinkingLabel(block?.summaryLabel);
	if (blockLabel) return truncateThinkingSummary(blockLabel);
	const text = primaryThinkingSummaryText(block?.text);
	if (!text) return options.allowPlaceholder ? "Thinking…" : "";
	return truncateThinkingSummary(text);
}
function createInitialSessionState() {
	return {
		connected: false,
		replaying: false,
		streaming: false,
		compacting: false,
		draft: true,
		messages: [],
		items: [],
		historyOffset: 0,
		historyTotalCount: 0,
		firstMessage: "",
		thinkingLevel: "off",
		availableThinkingLevels: ["off"],
		availableModels: [],
		availableSkills: [],
		hideThinkingBlock: false,
		contextUsage: void 0,
		uiState: {
			statuses: {},
			editorText: ""
		}
	};
}
function flattenTree(tree) {
	const flatNodes = [];
	function visit(node, depth) {
		const entry = node.entry;
		const role = entry.message?.role;
		const label = node.label;
		const contentParts = [
			label,
			role ? `${role}:` : "",
			entry.message?.text,
			entry.summary,
			entry.text,
			entry.message?.command,
			entry.modelId,
			entry.thinkingLevel,
			entry.name,
			entry.label,
			...entry.message?.toolCalls?.map((toolCall) => toolCall.preview || toolCall.name || "") ?? []
		];
		flatNodes.push({
			id: entry.id,
			parentId: entry.parentId,
			depth,
			label,
			labelTimestamp: node.labelTimestamp,
			streaming: Boolean(node.streaming),
			timestamp: entry.timestamp,
			type: entry.type,
			role,
			text: contentParts.filter(Boolean).join(" ").trim(),
			node
		});
		for (const child of node.children || []) visit(child, depth + 1);
	}
	for (const node of tree) visit(node, 0);
	return flatNodes;
}
function getSessionTitle(summary) {
	if (summary?.title?.trim()) return summary.title.trim();
	if (summary?.name?.trim()) return summary.name.trim();
	return "New session";
}
var $$splitComponentImporter = () => import("./routes-C8qT6Oju.mjs");
var indexSearchSchema = object({ session: string().optional() });
var Route = createFileRoute("/")({
	validateSearch: indexSearchSchema,
	component: lazyRouteComponent($$splitComponentImporter, "component")
});
//#endregion
export { normalizeThemeFamily as $, Tooltip$1 as A, createCompactionSummaryItem as B, SESSION_DONE_SOUND_ENABLED_STORAGE_KEY as C, themeFamilyDescription as Ct, THEME_FAMILIES as D, themeFamilySupportsColorMode as Dt, THEME_COLOR_MODE_STORAGE_KEY as E, themeFamilyLabel as Et, appliedThemeClass as F, extractToolText as G, createInitialSessionState as H, appliedThemeClassColorMode as I, mergeAssistantBlocksForStreaming as J, flattenTree as K, assistantBlocksFromMessage as L, TooltipProvider as M, TooltipTrigger as N, THEME_STORAGE_KEY as O, thinkingSummaryText as Ot, VIEWER_CONTEXT_STORAGE_KEY as P, normalizeThemeColorMode as Q, buildItemsFromSync as R, SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY as S, themeColorModeLabel as St, Spinner as T, themeFamilyKeywords as Tt, extractMessageImages as U, createContextId as V, extractMessageText as W, normalizeSessionSelectionKeys as X, normalizePromptImage as Y, normalizeStoredDirectoryList as Z, RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY as _, rememberStoredPromptDraft as _t, COLLAPSED_DIRECTORIES_STORAGE_KEY as a, readStoredCollapsedDirectories as at, RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY as b, sameContextUsage as bt, Kbd as c, readStoredPinnedSessionKeys as ct, PICO_DIFF_SHIKI_THEMES as d, readStoredRightSidebarOpen as dt, previewUrlForImage as et, PICO_SHIKI_VARIABLE_DEFAULTS as f, readStoredSessionDoneDesktopNotificationsEnabled as ft, RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY as g, readStoredThemeColorMode as gt, RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY as h, readStoredTheme as ht, CENTER_MESSAGES_STORAGE_KEY as i, readStoredCenterMessages as it, TooltipContent as j, TitleTooltip as k, toolCategoryFromTool as kt, KeyboardShortcutContent as l, readStoredPromptDraft as lt, RECENT_DIRECTORIES_STORAGE_KEY as m, readStoredSidebarDirectories as mt, APPLIED_THEME_STORAGE_KEY as n, promptDraftKeyMatchesOwner as nt, DRAFT_DIRECTORY_STORAGE_KEY as o, readStoredDraftDirectory as ot, PINNED_SESSIONS_STORAGE_KEY as p, readStoredSessionDoneSoundEnabled as pt, getSessionTitle as q, AUTO_SCROLL_ENABLED_STORAGE_KEY as r, readStoredAutoScrollEnabled as rt, HIDE_TOOL_BLOCKS_STORAGE_KEY as s, readStoredHideToolBlocks as st, APPLIED_THEME_CLASSES as t, promptDraftKey as tt, PICO_CODE_SHIKI_THEME as u, readStoredRecentDirectories as ut, RIGHT_SIDEBAR_HISTORY_TAB_STORAGE_KEY as v, safeLocalStorageGetItem as vt, SIDEBAR_DIRECTORIES_STORAGE_KEY as w, themeFamilyFixedMode as wt, Route as x, sessionListEntryKey as xt, RIGHT_SIDEBAR_OPEN_STORAGE_KEY as y, safeLocalStorageSetItem as yt, cn as z };
