import { a as usePage, n as head_default, o as vue_exports, s as router } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { t as AdminLayout_default } from "./AdminLayout-BLq37u6l.js";
//#region resources/js/Pages/Admin/Languages.vue?vue&type=script&setup=true&lang.ts
var field = "rounded-lg border-line bg-appbg text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary text-sm";
var Languages_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Languages",
	__ssrInlineRender: true,
	props: {
		coverage: {},
		catalogSize: {},
		addable: {},
		aiConfigured: { type: Boolean },
		translating: {}
	},
	setup(__props) {
		const props = __props;
		const page = usePage();
		const flash = (0, vue_exports.computed)(() => page.props.flash?.message);
		const siteLocale = (0, vue_exports.computed)(() => page.props.site?.locale ?? "en");
		const rows = (0, vue_exports.reactive)([...props.coverage]);
		const busy = (0, vue_exports.reactive)({ ...props.translating });
		let timer = null;
		function anyBusy() {
			return Object.values(busy).some(Boolean);
		}
		async function tick() {
			try {
				const data = await (await fetch("/admin/languages/status", { headers: { Accept: "application/json" } })).json();
				rows.splice(0, rows.length, ...data.coverage);
				Object.assign(busy, data.translating);
				if (!anyBusy()) stop();
			} catch {}
		}
		function startPolling() {
			if (!timer) timer = window.setInterval(tick, 3e3);
		}
		function stop() {
			if (timer) {
				clearInterval(timer);
				timer = null;
			}
		}
		(0, vue_exports.onBeforeUnmount)(stop);
		if (anyBusy()) startPolling();
		function translate(code) {
			router.post("/admin/languages/translate", { locale: code }, {
				preserveScroll: true,
				onSuccess: () => {
					busy[code] = true;
					startPolling();
				}
			});
		}
		function removeLocale(code, label) {
			if (!confirm(t("Remove {language} and all its translations?", { language: label }))) return;
			router.delete("/admin/languages", {
				data: { locale: code },
				preserveScroll: true
			});
		}
		function setDefault(code) {
			router.post("/admin/languages/default", { locale: code }, { preserveScroll: true });
		}
		const addCode = (0, vue_exports.ref)("");
		const addAndTranslate = (0, vue_exports.ref)(true);
		function addLanguage() {
			if (!addCode.value) return;
			router.post("/admin/languages/add", {
				locale: addCode.value,
				translate: addAndTranslate.value
			}, {
				preserveScroll: true,
				onSuccess: () => {
					if (addAndTranslate.value) {
						busy[addCode.value] = true;
						startPolling();
					}
					addCode.value = "";
				}
			});
		}
		const editing = (0, vue_exports.ref)(null);
		const editLabel = (0, vue_exports.ref)("");
		const strings = (0, vue_exports.ref)([]);
		const filter = (0, vue_exports.ref)("");
		const loadingStrings = (0, vue_exports.ref)(false);
		const filtered = (0, vue_exports.computed)(() => {
			const q = filter.value.trim().toLowerCase();
			if (!q) return strings.value;
			return strings.value.filter((s) => s.key.toLowerCase().includes(q) || s.value.toLowerCase().includes(q));
		});
		async function openEditor(code, label) {
			editing.value = code;
			editLabel.value = label;
			loadingStrings.value = true;
			filter.value = "";
			try {
				strings.value = (await (await fetch(`/admin/languages/strings?locale=${encodeURIComponent(code)}`, { headers: { Accept: "application/json" } })).json()).strings;
			} finally {
				loadingStrings.value = false;
			}
		}
		function saveString(row) {
			router.post("/admin/languages/string", {
				locale: editing.value,
				key: row.key,
				value: row.value
			}, {
				preserveScroll: true,
				preserveState: true
			});
		}
		function closeEditor() {
			editing.value = null;
			strings.value = [];
		}
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: (0, vue_exports.unref)(t)("Admin · Languages") }, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(AdminLayout_default, null, {
				title: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Languages"))}`);
					else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Languages")), 1)];
				}),
				subtitle: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Translate the interface into any language — powered by AI"))}`);
					else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Translate the interface into any language — powered by AI")), 1)];
				}),
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						if (flash.value) _push(`<div class="mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(flash.value)}</div>`);
						else _push(`<!---->`);
						if (!__props.aiConfigured) _push(`<div class="mb-5 rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Connect an AI provider in Admin → AI to enable one-click auto-translation. You can still add languages and edit strings by hand."))}</div>`);
						else _push(`<!---->`);
						_push(`<section class="rounded-2xl border border-line bg-surface p-5"${_scopeId}><div class="mb-4 flex items-center justify-between"${_scopeId}><div${_scopeId}><h3 class="text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Interface languages"))}</h3><p class="text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("{count} translatable strings in the interface.", { count: __props.catalogSize }))}</p></div></div><div class="overflow-hidden rounded-xl border border-line"${_scopeId}><table class="w-full text-sm"${_scopeId}><thead class="bg-appbg text-left text-xs text-ink-muted"${_scopeId}><tr${_scopeId}><th class="px-4 py-2 font-semibold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Language"))}</th><th class="px-4 py-2 font-semibold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Coverage"))}</th><th class="px-4 py-2 font-semibold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Default"))}</th><th class="px-4 py-2 text-right font-semibold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Actions"))}</th></tr></thead><tbody class="divide-y divide-line"${_scopeId}><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(rows, (row) => {
							_push(`<tr${_scopeId}><td class="px-4 py-3"${_scopeId}><div class="font-semibold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(row.label)}</div><div class="text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(row.code)}`);
							if (row.rtl) _push(`<span class="ml-1"${_scopeId}>· RTL</span>`);
							else _push(`<!---->`);
							if (row.source) _push(`<span class="ml-1"${_scopeId}>· ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("source"))}</span>`);
							else _push(`<!---->`);
							_push(`</div></td><td class="px-4 py-3"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><div class="h-1.5 w-32 overflow-hidden rounded-full bg-surface-2"${_scopeId}><div class="${(0, server_renderer_exports.ssrRenderClass)([row.percent === 100 ? "bg-emerald-500" : "bg-primary", "h-full transition-all"])}" style="${(0, server_renderer_exports.ssrRenderStyle)({ width: row.percent + "%" })}"${_scopeId}></div></div><span class="text-xs text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(row.percent)}%</span>`);
							if (row.missing > 0) _push(`<span class="text-xs text-ink-muted"${_scopeId}>· ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("{n} missing", { n: row.missing }))}</span>`);
							else _push(`<!---->`);
							_push(`</div>`);
							if (row.error) _push(`<p class="mt-1 text-xs text-rose-400"${_scopeId}>⚠ ${(0, server_renderer_exports.ssrInterpolate)(row.error)}</p>`);
							else _push(`<!---->`);
							_push(`</td><td class="px-4 py-3"${_scopeId}><input type="radio" name="default"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(siteLocale.value === row.code) ? " checked" : ""} class="text-primary focus:ring-primary"${_scopeId}></td><td class="px-4 py-3"${_scopeId}><div class="flex items-center justify-end gap-2"${_scopeId}>`);
							if (!row.source) {
								_push(`<!--[-->`);
								if (__props.aiConfigured && row.missing > 0) _push(`<button${(0, server_renderer_exports.ssrIncludeBooleanAttr)(busy[row.code]) ? " disabled" : ""} class="rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600 disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(busy[row.code] ? (0, vue_exports.unref)(t)("Translating…") : (0, vue_exports.unref)(t)("Translate {n}", { n: row.missing }))}</button>`);
								else _push(`<!---->`);
								_push(`<button class="rounded-lg bg-surface-2 px-3 py-1.5 text-xs font-semibold text-ink hover:bg-appbg"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Edit"))}</button><button class="rounded-lg px-2 py-1.5 text-xs font-semibold text-rose-400 hover:bg-rose-500/10"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Remove"))}</button><!--]-->`);
							} else _push(`<span class="text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Built-in"))}</span>`);
							_push(`</div></td></tr>`);
						});
						_push(`<!--]--></tbody></table></div></section><section class="mt-6 rounded-2xl border border-line bg-surface p-5"${_scopeId}><h3 class="mb-1 text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Add a language"))}</h3><p class="mb-4 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Pick a language and Convoro will create it — translate it instantly with AI, or fill it in yourself."))}</p><div class="flex flex-wrap items-center gap-3"${_scopeId}><select class="${(0, server_renderer_exports.ssrRenderClass)([field, "min-w-48 px-3 py-2"])}"${_scopeId}><option value=""${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(addCode.value) ? (0, server_renderer_exports.ssrLooseContain)(addCode.value, "") : (0, server_renderer_exports.ssrLooseEqual)(addCode.value, "")) ? " selected" : ""}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Choose a language…"))}</option><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(__props.addable, (a) => {
							_push(`<option${(0, server_renderer_exports.ssrRenderAttr)("value", a.code)}${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(addCode.value) ? (0, server_renderer_exports.ssrLooseContain)(addCode.value, a.code) : (0, server_renderer_exports.ssrLooseEqual)(addCode.value, a.code)) ? " selected" : ""}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(a.label)} (${(0, server_renderer_exports.ssrInterpolate)(a.code)})</option>`);
						});
						_push(`<!--]--></select><label class="flex items-center gap-2 text-sm text-ink-2"${_scopeId}><input${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(addAndTranslate.value) ? (0, server_renderer_exports.ssrLooseContain)(addAndTranslate.value, null) : addAndTranslate.value) ? " checked" : ""} type="checkbox"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!__props.aiConfigured) ? " disabled" : ""} class="rounded border-line text-primary focus:ring-primary"${_scopeId}> ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Auto-translate now"))}</label><button${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!addCode.value) ? " disabled" : ""} class="rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600 disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Add language"))}</button></div></section>`);
						if (editing.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"${_scopeId}><div class="flex max-h-[85vh] w-full max-w-3xl flex-col rounded-2xl border border-line bg-surface shadow-2xl"${_scopeId}><div class="flex items-center justify-between border-b border-line px-5 py-4"${_scopeId}><h3 class="text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Edit {language}", { language: editLabel.value }))}</h3><button class="text-ink-muted hover:text-ink"${_scopeId}>✕</button></div><div class="border-b border-line px-5 py-3"${_scopeId}><input${(0, server_renderer_exports.ssrRenderAttr)("value", filter.value)} class="${(0, server_renderer_exports.ssrRenderClass)([field, "w-full px-3 py-2"])}"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", (0, vue_exports.unref)(t)("Filter strings…"))}${_scopeId}></div><div class="flex-1 overflow-y-auto px-5 py-3"${_scopeId}>`);
							if (loadingStrings.value) _push(`<p class="py-8 text-center text-sm text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Loading…"))}</p>`);
							else _push(`<!---->`);
							_push(`<!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(filtered.value, (row) => {
								_push(`<div class="border-b border-line py-2 last:border-0"${_scopeId}><div class="mb-1 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(row.key)}</div><input${(0, server_renderer_exports.ssrRenderAttr)("value", row.value)} class="${(0, server_renderer_exports.ssrRenderClass)([field, "w-full px-3 py-1.5"])}"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", row.key)}${_scopeId}></div>`);
							});
							_push(`<!--]-->`);
							if (!loadingStrings.value && filtered.value.length === 0) _push(`<p class="py-8 text-center text-sm text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("No strings match."))}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="border-t border-line px-5 py-3 text-right"${_scopeId}><button class="rounded-lg bg-surface-2 px-4 py-2 text-sm font-semibold text-ink hover:bg-appbg"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Done"))}</button></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						flash.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 0,
							class: "mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300"
						}, (0, vue_exports.toDisplayString)(flash.value), 1)) : (0, vue_exports.createCommentVNode)("", true),
						!__props.aiConfigured ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 1,
							class: "mb-5 rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Connect an AI provider in Admin → AI to enable one-click auto-translation. You can still add languages and edit strings by hand.")), 1)) : (0, vue_exports.createCommentVNode)("", true),
						(0, vue_exports.createVNode)("section", { class: "rounded-2xl border border-line bg-surface p-5" }, [(0, vue_exports.createVNode)("div", { class: "mb-4 flex items-center justify-between" }, [(0, vue_exports.createVNode)("div", null, [(0, vue_exports.createVNode)("h3", { class: "text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Interface languages")), 1), (0, vue_exports.createVNode)("p", { class: "text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{count} translatable strings in the interface.", { count: __props.catalogSize })), 1)])]), (0, vue_exports.createVNode)("div", { class: "overflow-hidden rounded-xl border border-line" }, [(0, vue_exports.createVNode)("table", { class: "w-full text-sm" }, [(0, vue_exports.createVNode)("thead", { class: "bg-appbg text-left text-xs text-ink-muted" }, [(0, vue_exports.createVNode)("tr", null, [
							(0, vue_exports.createVNode)("th", { class: "px-4 py-2 font-semibold" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Language")), 1),
							(0, vue_exports.createVNode)("th", { class: "px-4 py-2 font-semibold" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Coverage")), 1),
							(0, vue_exports.createVNode)("th", { class: "px-4 py-2 font-semibold" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Default")), 1),
							(0, vue_exports.createVNode)("th", { class: "px-4 py-2 text-right font-semibold" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Actions")), 1)
						])]), (0, vue_exports.createVNode)("tbody", { class: "divide-y divide-line" }, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(rows, (row) => {
							return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("tr", { key: row.code }, [
								(0, vue_exports.createVNode)("td", { class: "px-4 py-3" }, [(0, vue_exports.createVNode)("div", { class: "font-semibold text-ink" }, (0, vue_exports.toDisplayString)(row.label), 1), (0, vue_exports.createVNode)("div", { class: "text-xs text-ink-muted" }, [
									(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)(row.code), 1),
									row.rtl ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
										key: 0,
										class: "ml-1"
									}, "· RTL")) : (0, vue_exports.createCommentVNode)("", true),
									row.source ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
										key: 1,
										class: "ml-1"
									}, "· " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("source")), 1)) : (0, vue_exports.createCommentVNode)("", true)
								])]),
								(0, vue_exports.createVNode)("td", { class: "px-4 py-3" }, [(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [
									(0, vue_exports.createVNode)("div", { class: "h-1.5 w-32 overflow-hidden rounded-full bg-surface-2" }, [(0, vue_exports.createVNode)("div", {
										class: ["h-full transition-all", row.percent === 100 ? "bg-emerald-500" : "bg-primary"],
										style: { width: row.percent + "%" }
									}, null, 6)]),
									(0, vue_exports.createVNode)("span", { class: "text-xs text-ink-2" }, (0, vue_exports.toDisplayString)(row.percent) + "%", 1),
									row.missing > 0 ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
										key: 0,
										class: "text-xs text-ink-muted"
									}, "· " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{n} missing", { n: row.missing })), 1)) : (0, vue_exports.createCommentVNode)("", true)
								]), row.error ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
									key: 0,
									class: "mt-1 text-xs text-rose-400"
								}, "⚠ " + (0, vue_exports.toDisplayString)(row.error), 1)) : (0, vue_exports.createCommentVNode)("", true)]),
								(0, vue_exports.createVNode)("td", { class: "px-4 py-3" }, [(0, vue_exports.createVNode)("input", {
									type: "radio",
									name: "default",
									checked: siteLocale.value === row.code,
									class: "text-primary focus:ring-primary",
									onChange: ($event) => setDefault(row.code)
								}, null, 40, ["checked", "onChange"])]),
								(0, vue_exports.createVNode)("td", { class: "px-4 py-3" }, [(0, vue_exports.createVNode)("div", { class: "flex items-center justify-end gap-2" }, [!row.source ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)(vue_exports.Fragment, { key: 0 }, [
									__props.aiConfigured && row.missing > 0 ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("button", {
										key: 0,
										disabled: busy[row.code],
										class: "rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600 disabled:opacity-50",
										onClick: ($event) => translate(row.code)
									}, (0, vue_exports.toDisplayString)(busy[row.code] ? (0, vue_exports.unref)(t)("Translating…") : (0, vue_exports.unref)(t)("Translate {n}", { n: row.missing })), 9, ["disabled", "onClick"])) : (0, vue_exports.createCommentVNode)("", true),
									(0, vue_exports.createVNode)("button", {
										class: "rounded-lg bg-surface-2 px-3 py-1.5 text-xs font-semibold text-ink hover:bg-appbg",
										onClick: ($event) => openEditor(row.code, row.label)
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Edit")), 9, ["onClick"]),
									(0, vue_exports.createVNode)("button", {
										class: "rounded-lg px-2 py-1.5 text-xs font-semibold text-rose-400 hover:bg-rose-500/10",
										onClick: ($event) => removeLocale(row.code, row.label)
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Remove")), 9, ["onClick"])
								], 64)) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
									key: 1,
									class: "text-xs text-ink-muted"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Built-in")), 1))])])
							]);
						}), 128))])])])]),
						(0, vue_exports.createVNode)("section", { class: "mt-6 rounded-2xl border border-line bg-surface p-5" }, [
							(0, vue_exports.createVNode)("h3", { class: "mb-1 text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Add a language")), 1),
							(0, vue_exports.createVNode)("p", { class: "mb-4 text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Pick a language and Convoro will create it — translate it instantly with AI, or fill it in yourself.")), 1),
							(0, vue_exports.createVNode)("div", { class: "flex flex-wrap items-center gap-3" }, [
								(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("select", {
									"onUpdate:modelValue": ($event) => addCode.value = $event,
									class: [field, "min-w-48 px-3 py-2"]
								}, [(0, vue_exports.createVNode)("option", { value: "" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Choose a language…")), 1), ((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.addable, (a) => {
									return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("option", {
										key: a.code,
										value: a.code
									}, (0, vue_exports.toDisplayString)(a.label) + " (" + (0, vue_exports.toDisplayString)(a.code) + ")", 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vue_exports.vModelSelect, addCode.value]]),
								(0, vue_exports.createVNode)("label", { class: "flex items-center gap-2 text-sm text-ink-2" }, [(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
									"onUpdate:modelValue": ($event) => addAndTranslate.value = $event,
									type: "checkbox",
									disabled: !__props.aiConfigured,
									class: "rounded border-line text-primary focus:ring-primary"
								}, null, 8, ["onUpdate:modelValue", "disabled"]), [[vue_exports.vModelCheckbox, addAndTranslate.value]]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Auto-translate now")), 1)]),
								(0, vue_exports.createVNode)("button", {
									disabled: !addCode.value,
									class: "rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600 disabled:opacity-50",
									onClick: addLanguage
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Add language")), 9, ["disabled"])
							])
						]),
						editing.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 2,
							class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
							onClick: (0, vue_exports.withModifiers)(closeEditor, ["self"])
						}, [(0, vue_exports.createVNode)("div", { class: "flex max-h-[85vh] w-full max-w-3xl flex-col rounded-2xl border border-line bg-surface shadow-2xl" }, [
							(0, vue_exports.createVNode)("div", { class: "flex items-center justify-between border-b border-line px-5 py-4" }, [(0, vue_exports.createVNode)("h3", { class: "text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Edit {language}", { language: editLabel.value })), 1), (0, vue_exports.createVNode)("button", {
								class: "text-ink-muted hover:text-ink",
								onClick: closeEditor
							}, "✕")]),
							(0, vue_exports.createVNode)("div", { class: "border-b border-line px-5 py-3" }, [(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
								"onUpdate:modelValue": ($event) => filter.value = $event,
								class: [field, "w-full px-3 py-2"],
								placeholder: (0, vue_exports.unref)(t)("Filter strings…")
							}, null, 8, ["onUpdate:modelValue", "placeholder"]), [[vue_exports.vModelText, filter.value]])]),
							(0, vue_exports.createVNode)("div", { class: "flex-1 overflow-y-auto px-5 py-3" }, [
								loadingStrings.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
									key: 0,
									class: "py-8 text-center text-sm text-ink-muted"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Loading…")), 1)) : (0, vue_exports.createCommentVNode)("", true),
								((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(filtered.value, (row) => {
									return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
										key: row.key,
										class: "border-b border-line py-2 last:border-0"
									}, [(0, vue_exports.createVNode)("div", { class: "mb-1 text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)(row.key), 1), (0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
										"onUpdate:modelValue": ($event) => row.value = $event,
										class: [field, "w-full px-3 py-1.5"],
										placeholder: row.key,
										onBlur: ($event) => saveString(row),
										onKeyup: (0, vue_exports.withKeys)(($event) => saveString(row), ["enter"])
									}, null, 40, [
										"onUpdate:modelValue",
										"placeholder",
										"onBlur",
										"onKeyup"
									]), [[vue_exports.vModelText, row.value]])]);
								}), 128)),
								!loadingStrings.value && filtered.value.length === 0 ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
									key: 1,
									class: "py-8 text-center text-sm text-ink-muted"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("No strings match.")), 1)) : (0, vue_exports.createCommentVNode)("", true)
							]),
							(0, vue_exports.createVNode)("div", { class: "border-t border-line px-5 py-3 text-right" }, [(0, vue_exports.createVNode)("button", {
								class: "rounded-lg bg-surface-2 px-4 py-2 text-sm font-semibold text-ink hover:bg-appbg",
								onClick: closeEditor
							}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Done")), 1)])
						])])) : (0, vue_exports.createCommentVNode)("", true)
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Admin/Languages.vue
var _sfc_setup = Languages_vue_vue_type_script_setup_true_lang_default.setup;
Languages_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = (0, vue_exports.useSSRContext)();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Admin/Languages.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Languages_default = Languages_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Languages_default as default };
