import { a as usePage, i as useForm, 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 AppLayout_default } from "./AppLayout-Cibl7rtt.js";
//#region resources/js/Pages/Panel.vue?vue&type=script&setup=true&lang.ts
var Panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Panel",
	__ssrInlineRender: true,
	props: {
		tenants: {},
		account: {}
	},
	setup(__props) {
		const form = useForm({ name: "" });
		function create() {
			form.post("/panel/communities", {
				preserveScroll: true,
				onSuccess: () => form.reset("name")
			});
		}
		const flash = (0, vue_exports.computed)(() => usePage().props.flash?.status);
		const statusTone = {
			active: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",
			provisioning: "bg-amber-500/15 text-amber-600 dark:text-amber-400",
			failed: "bg-rose-500/15 text-rose-600 dark:text-rose-400"
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: (0, vue_exports.unref)(t)("Managed hosting") }, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(AppLayout_default, null, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="mx-auto max-w-2xl"${_scopeId}><div class="flex items-center justify-between"${_scopeId}><span class="text-xs font-bold uppercase tracking-wide text-primary"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Proof of concept"))}</span><a href="/panel/order" class="text-sm font-semibold text-primary hover:text-primary-600"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("View plans →"))}</a></div><h1 class="mt-1 text-2xl font-black tracking-tight"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Your communities"))}</h1><p class="mt-1 text-sm text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Signed in as {name} ({email}). Spin up a hosted community — you’re made its admin automatically, with the same Convoro Account.", {
							name: __props.account.name,
							email: __props.account.email
						}))}</p>`);
						if (flash.value) _push(`<div class="mt-4 rounded-lg border border-primary/30 bg-primary/[0.06] px-4 py-2.5 text-sm font-medium text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(flash.value)}</div>`);
						else _push(`<!---->`);
						_push(`<form class="mt-5 flex flex-wrap gap-2 rounded-c border border-line bg-surface p-4"${_scopeId}><input${(0, server_renderer_exports.ssrRenderAttr)("value", (0, vue_exports.unref)(form).name)} type="text" maxlength="60"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", (0, vue_exports.unref)(t)("Community name, e.g. Acme Makers"))} class="min-w-[220px] flex-1 rounded-lg border-line bg-surface-2 text-sm text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary"${_scopeId}><button type="submit"${(0, server_renderer_exports.ssrIncludeBooleanAttr)((0, vue_exports.unref)(form).processing || !(0, vue_exports.unref)(form).name.trim()) ? " disabled" : ""} class="rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600 disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(form).processing ? (0, vue_exports.unref)(t)("Provisioning…") : (0, vue_exports.unref)(t)("Create community"))}</button></form><div class="mt-6 space-y-3"${_scopeId}><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(__props.tenants, (t$1) => {
							_push(`<div class="rounded-c border border-line bg-surface p-4"${_scopeId}><div class="flex flex-wrap items-center gap-2"${_scopeId}><h2 class="font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.name)}</h2><span class="${(0, server_renderer_exports.ssrRenderClass)([statusTone[t$1.status], "rounded px-1.5 py-0.5 text-[10px] font-bold uppercase"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.status)}</span><span class="text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.createdAgo)}</span>`);
							if (t$1.status === "active") _push(`<div class="ml-auto flex items-center gap-2"${_scopeId}><a${(0, server_renderer_exports.ssrRenderAttr)("href", `/panel/communities/${t$1.id}/manage`)} class="rounded-lg border border-line bg-surface px-3 py-1.5 text-xs font-semibold text-ink-2 hover:bg-surface-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Manage"))}</a><button type="button" class="rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Open community →"))}</button></div>`);
							else _push(`<!---->`);
							_push(`</div>`);
							if (t$1.error) _push(`<p class="mt-1 text-sm text-rose-500"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.error)}</p>`);
							else _push(`<!---->`);
							if (t$1.status === "active") {
								_push(`<div class="mt-2 grid gap-1.5 text-sm text-ink-2"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" class="text-emerald-500"${_scopeId}><path d="M20 6 9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"${_scopeId}></path></svg><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("You are an admin here"))}</span><span class="text-ink-muted"${_scopeId}>·</span><!--[-->`);
								(0, server_renderer_exports.ssrRenderList)(t$1.admins, (a) => {
									_push(`<span class="font-mono text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(a)}</span>`);
								});
								_push(`<!--]--></div><div class="flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-ink-muted"${_scopeId}><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("{n} member(s)", { n: t$1.users }))}</span><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("{n} categorie(s) seeded", { n: t$1.categories }))}</span><span class="font-mono"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("isolated DB:"))} ${(0, server_renderer_exports.ssrInterpolate)(t$1.database)}</span></div></div>`);
							} else _push(`<!---->`);
							_push(`</div>`);
						});
						_push(`<!--]-->`);
						if (!__props.tenants.length) _push(`<p class="rounded-c border border-dashed border-line py-10 text-center text-sm text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("No communities yet — create one above."))}</p>`);
						else _push(`<!---->`);
						_push(`</div><p class="mt-6 text-xs leading-relaxed text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("POC scope: each community is provisioned into its own isolated database, the full forum schema is migrated, base content is seeded, and your Convoro Account is set as admin. Production adds a deploy + DNS step (a real subdomain) and SSO so this same login works across the support forums too."))}</p></div>`);
					} else return [(0, vue_exports.createVNode)("div", { class: "mx-auto max-w-2xl" }, [
						(0, vue_exports.createVNode)("div", { class: "flex items-center justify-between" }, [(0, vue_exports.createVNode)("span", { class: "text-xs font-bold uppercase tracking-wide text-primary" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Proof of concept")), 1), (0, vue_exports.createVNode)("a", {
							href: "/panel/order",
							class: "text-sm font-semibold text-primary hover:text-primary-600"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("View plans →")), 1)]),
						(0, vue_exports.createVNode)("h1", { class: "mt-1 text-2xl font-black tracking-tight" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Your communities")), 1),
						(0, vue_exports.createVNode)("p", { class: "mt-1 text-sm text-ink-2" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Signed in as {name} ({email}). Spin up a hosted community — you’re made its admin automatically, with the same Convoro Account.", {
							name: __props.account.name,
							email: __props.account.email
						})), 1),
						flash.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 0,
							class: "mt-4 rounded-lg border border-primary/30 bg-primary/[0.06] px-4 py-2.5 text-sm font-medium text-ink"
						}, (0, vue_exports.toDisplayString)(flash.value), 1)) : (0, vue_exports.createCommentVNode)("", true),
						(0, vue_exports.createVNode)("form", {
							class: "mt-5 flex flex-wrap gap-2 rounded-c border border-line bg-surface p-4",
							onSubmit: (0, vue_exports.withModifiers)(create, ["prevent"])
						}, [(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
							"onUpdate:modelValue": ($event) => (0, vue_exports.unref)(form).name = $event,
							type: "text",
							maxlength: "60",
							placeholder: (0, vue_exports.unref)(t)("Community name, e.g. Acme Makers"),
							class: "min-w-[220px] flex-1 rounded-lg border-line bg-surface-2 text-sm text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary"
						}, null, 8, ["onUpdate:modelValue", "placeholder"]), [[vue_exports.vModelText, (0, vue_exports.unref)(form).name]]), (0, vue_exports.createVNode)("button", {
							type: "submit",
							disabled: (0, vue_exports.unref)(form).processing || !(0, vue_exports.unref)(form).name.trim(),
							class: "rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600 disabled:opacity-50"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(form).processing ? (0, vue_exports.unref)(t)("Provisioning…") : (0, vue_exports.unref)(t)("Create community")), 9, ["disabled"])], 32),
						(0, vue_exports.createVNode)("div", { class: "mt-6 space-y-3" }, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.tenants, (t$2) => {
							return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: t$2.id,
								class: "rounded-c border border-line bg-surface p-4"
							}, [
								(0, vue_exports.createVNode)("div", { class: "flex flex-wrap items-center gap-2" }, [
									(0, vue_exports.createVNode)("h2", { class: "font-bold text-ink" }, (0, vue_exports.toDisplayString)(t$2.name), 1),
									(0, vue_exports.createVNode)("span", { class: ["rounded px-1.5 py-0.5 text-[10px] font-bold uppercase", statusTone[t$2.status]] }, (0, vue_exports.toDisplayString)(t$2.status), 3),
									(0, vue_exports.createVNode)("span", { class: "text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)(t$2.createdAgo), 1),
									t$2.status === "active" ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
										key: 0,
										class: "ml-auto flex items-center gap-2"
									}, [(0, vue_exports.createVNode)("a", {
										href: `/panel/communities/${t$2.id}/manage`,
										class: "rounded-lg border border-line bg-surface px-3 py-1.5 text-xs font-semibold text-ink-2 hover:bg-surface-2"
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Manage")), 9, ["href"]), (0, vue_exports.createVNode)("button", {
										type: "button",
										class: "rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600",
										onClick: ($event) => (0, vue_exports.unref)(router).post(`/panel/communities/${t$2.id}/enter`)
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Open community →")), 9, ["onClick"])])) : (0, vue_exports.createCommentVNode)("", true)
								]),
								t$2.error ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
									key: 0,
									class: "mt-1 text-sm text-rose-500"
								}, (0, vue_exports.toDisplayString)(t$2.error), 1)) : (0, vue_exports.createCommentVNode)("", true),
								t$2.status === "active" ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
									key: 1,
									class: "mt-2 grid gap-1.5 text-sm text-ink-2"
								}, [(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [
									((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
										width: "14",
										height: "14",
										viewBox: "0 0 24 24",
										fill: "none",
										stroke: "currentColor",
										"stroke-width": "2.5",
										class: "text-emerald-500"
									}, [(0, vue_exports.createVNode)("path", {
										d: "M20 6 9 17l-5-5",
										"stroke-linecap": "round",
										"stroke-linejoin": "round"
									})])),
									(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("You are an admin here")), 1),
									(0, vue_exports.createVNode)("span", { class: "text-ink-muted" }, "·"),
									((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(t$2.admins, (a) => {
										return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
											key: a,
											class: "font-mono text-xs text-ink-muted"
										}, (0, vue_exports.toDisplayString)(a), 1);
									}), 128))
								]), (0, vue_exports.createVNode)("div", { class: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-ink-muted" }, [
									(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{n} member(s)", { n: t$2.users })), 1),
									(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{n} categorie(s) seeded", { n: t$2.categories })), 1),
									(0, vue_exports.createVNode)("span", { class: "font-mono" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("isolated DB:")) + " " + (0, vue_exports.toDisplayString)(t$2.database), 1)
								])])) : (0, vue_exports.createCommentVNode)("", true)
							]);
						}), 128)), !__props.tenants.length ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
							key: 0,
							class: "rounded-c border border-dashed border-line py-10 text-center text-sm text-ink-muted"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("No communities yet — create one above.")), 1)) : (0, vue_exports.createCommentVNode)("", true)]),
						(0, vue_exports.createVNode)("p", { class: "mt-6 text-xs leading-relaxed text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("POC scope: each community is provisioned into its own isolated database, the full forum schema is migrated, base content is seeded, and your Convoro Account is set as admin. Production adds a deploy + DNS step (a real subdomain) and SSO so this same login works across the support forums too.")), 1)
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Panel.vue
var _sfc_setup = Panel_vue_vue_type_script_setup_true_lang_default.setup;
Panel_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/Panel.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Panel_default = Panel_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Panel_default as default };
