import { n as head_default, o as vue_exports, r as link_default, s as router } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { n as Avatar_default, t as AppLayout_default } from "./AppLayout-VvVFrkTb.js";
//#region resources/js/Pages/Members/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Index",
	__ssrInlineRender: true,
	props: {
		q: {},
		sort: {},
		members: {},
		total: {}
	},
	setup(__props) {
		const props = __props;
		const query = (0, vue_exports.ref)(props.q);
		let t$1 = null;
		function search() {
			clearTimeout(t$1);
			t$1 = setTimeout(() => router.get("/members", {
				q: query.value,
				sort: props.sort
			}, {
				preserveState: true,
				replace: true
			}), 300);
		}
		function setSort(e) {
			router.get("/members", {
				q: query.value,
				sort: e.target.value
			}, { preserveState: true });
		}
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: (0, vue_exports.unref)(t)("Members") }, 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-[var(--c-container)]"${_scopeId}><div class="mb-5 flex flex-wrap items-center gap-3"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-extrabold tracking-tight"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Members"))}</h1><p class="text-sm text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.total)} ${(0, server_renderer_exports.ssrInterpolate)(__props.total === 1 ? (0, vue_exports.unref)(t)("member") : (0, vue_exports.unref)(t)("members"))}</p></div><div class="ml-auto flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2"${_scopeId}><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-ink-muted"${_scopeId}><circle cx="11" cy="11" r="7"${_scopeId}></circle><path d="m21 21-4.3-4.3"${_scopeId}></path></svg><input${(0, server_renderer_exports.ssrRenderAttr)("value", query.value)} type="search"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", (0, vue_exports.unref)(t)("Find a member…"))} class="w-44 border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0"${_scopeId}></div><select${(0, server_renderer_exports.ssrRenderAttr)("value", __props.sort)} class="rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary"${_scopeId}><option value="newest"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Newest"))}</option><option value="name"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Name (A–Z)"))}</option><option value="posts"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Most posts"))}</option></select></div>`);
						if (!__props.members.data.length) _push(`<div class="rounded-c border border-dashed border-line bg-surface p-12 text-center text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("No members found."))}</div>`);
						else {
							_push(`<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"${_scopeId}><!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(__props.members.data, (m) => {
								_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
									key: m.id,
									href: m.url,
									class: "flex flex-col items-center rounded-c border border-line bg-surface p-6 text-center shadow-sm transition hover:-translate-y-0.5 hover:shadow-md"
								}, {
									default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
										if (_push) {
											_push((0, server_renderer_exports.ssrRenderComponent)(Avatar_default, {
												avatar: m,
												size: 88
											}, null, _parent, _scopeId));
											_push(`<div class="mt-3 flex items-center gap-1.5"${_scopeId}><span class="font-bold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(m.name)}</span>`);
											if (m.isAdmin) _push(`<span class="rounded bg-primary px-1.5 py-0.5 text-[10px] font-bold uppercase text-white shadow-sm"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Admin"))}</span>`);
											else if (m.trust) _push(`<span class="${(0, server_renderer_exports.ssrRenderClass)([m.trust.level >= 4 ? "bg-amber-400/20 text-amber-500" : m.trust.level >= 1 ? "bg-primary/15 text-primary" : "bg-ink/10 text-ink-muted", "rounded px-1.5 py-0.5 text-[10px] font-semibold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(m.trust.level >= 4 ? "★ " : "")}${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)(m.trust.label))}</span>`);
											else _push(`<!---->`);
											_push(`</div>`);
											if (m.bio) _push(`<p class="mt-1 line-clamp-2 text-xs text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(m.bio)}</p>`);
											else _push(`<!---->`);
											_push(`<div class="mt-3 flex items-center gap-3 text-xs text-ink-muted"${_scopeId}><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("{n} posts", { n: m.posts }))}</span><span${_scopeId}>·</span><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Joined {date}", { date: m.joined }))}</span></div>`);
										} else return [
											(0, vue_exports.createVNode)(Avatar_default, {
												avatar: m,
												size: 88
											}, null, 8, ["avatar"]),
											(0, vue_exports.createVNode)("div", { class: "mt-3 flex items-center gap-1.5" }, [(0, vue_exports.createVNode)("span", { class: "font-bold" }, (0, vue_exports.toDisplayString)(m.name), 1), m.isAdmin ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
												key: 0,
												class: "rounded bg-primary px-1.5 py-0.5 text-[10px] font-bold uppercase text-white shadow-sm"
											}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Admin")), 1)) : m.trust ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
												key: 1,
												class: ["rounded px-1.5 py-0.5 text-[10px] font-semibold", m.trust.level >= 4 ? "bg-amber-400/20 text-amber-500" : m.trust.level >= 1 ? "bg-primary/15 text-primary" : "bg-ink/10 text-ink-muted"]
											}, (0, vue_exports.toDisplayString)(m.trust.level >= 4 ? "★ " : "") + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)(m.trust.label)), 3)) : (0, vue_exports.createCommentVNode)("", true)]),
											m.bio ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
												key: 0,
												class: "mt-1 line-clamp-2 text-xs text-ink-2"
											}, (0, vue_exports.toDisplayString)(m.bio), 1)) : (0, vue_exports.createCommentVNode)("", true),
											(0, vue_exports.createVNode)("div", { class: "mt-3 flex items-center gap-3 text-xs text-ink-muted" }, [
												(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{n} posts", { n: m.posts })), 1),
												(0, vue_exports.createVNode)("span", null, "·"),
												(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Joined {date}", { date: m.joined })), 1)
											])
										];
									}),
									_: 2
								}, _parent, _scopeId));
							});
							_push(`<!--]--></div>`);
						}
						if (__props.members.next) {
							_push(`<div class="py-6 text-center"${_scopeId}>`);
							_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
								href: __props.members.next,
								class: "rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2"
							}, {
								default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
									if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Load more"))}`);
									else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Load more")), 1)];
								}),
								_: 1
							}, _parent, _scopeId));
							_push(`</div>`);
						} else _push(`<!---->`);
						_push(`</div>`);
					} else return [(0, vue_exports.createVNode)("div", { class: "mx-auto max-w-[var(--c-container)]" }, [
						(0, vue_exports.createVNode)("div", { class: "mb-5 flex flex-wrap items-center gap-3" }, [
							(0, vue_exports.createVNode)("div", null, [(0, vue_exports.createVNode)("h1", { class: "text-2xl font-extrabold tracking-tight" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Members")), 1), (0, vue_exports.createVNode)("p", { class: "text-sm text-ink-muted" }, (0, vue_exports.toDisplayString)(__props.total) + " " + (0, vue_exports.toDisplayString)(__props.total === 1 ? (0, vue_exports.unref)(t)("member") : (0, vue_exports.unref)(t)("members")), 1)]),
							(0, vue_exports.createVNode)("div", { class: "ml-auto flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2" }, [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
								width: "16",
								height: "16",
								viewBox: "0 0 24 24",
								fill: "none",
								stroke: "currentColor",
								"stroke-width": "2",
								class: "text-ink-muted"
							}, [(0, vue_exports.createVNode)("circle", {
								cx: "11",
								cy: "11",
								r: "7"
							}), (0, vue_exports.createVNode)("path", { d: "m21 21-4.3-4.3" })])), (0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
								"onUpdate:modelValue": ($event) => query.value = $event,
								onInput: search,
								type: "search",
								placeholder: (0, vue_exports.unref)(t)("Find a member…"),
								class: "w-44 border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0"
							}, null, 40, ["onUpdate:modelValue", "placeholder"]), [[vue_exports.vModelText, query.value]])]),
							(0, vue_exports.createVNode)("select", {
								value: __props.sort,
								onChange: setSort,
								class: "rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary"
							}, [
								(0, vue_exports.createVNode)("option", { value: "newest" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Newest")), 1),
								(0, vue_exports.createVNode)("option", { value: "name" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Name (A–Z)")), 1),
								(0, vue_exports.createVNode)("option", { value: "posts" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Most posts")), 1)
							], 40, ["value"])
						]),
						!__props.members.data.length ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 0,
							class: "rounded-c border border-dashed border-line bg-surface p-12 text-center text-ink-muted"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("No members found.")), 1)) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 1,
							class: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
						}, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.members.data, (m) => {
							return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)((0, vue_exports.unref)(link_default), {
								key: m.id,
								href: m.url,
								class: "flex flex-col items-center rounded-c border border-line bg-surface p-6 text-center shadow-sm transition hover:-translate-y-0.5 hover:shadow-md"
							}, {
								default: (0, vue_exports.withCtx)(() => [
									(0, vue_exports.createVNode)(Avatar_default, {
										avatar: m,
										size: 88
									}, null, 8, ["avatar"]),
									(0, vue_exports.createVNode)("div", { class: "mt-3 flex items-center gap-1.5" }, [(0, vue_exports.createVNode)("span", { class: "font-bold" }, (0, vue_exports.toDisplayString)(m.name), 1), m.isAdmin ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
										key: 0,
										class: "rounded bg-primary px-1.5 py-0.5 text-[10px] font-bold uppercase text-white shadow-sm"
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Admin")), 1)) : m.trust ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
										key: 1,
										class: ["rounded px-1.5 py-0.5 text-[10px] font-semibold", m.trust.level >= 4 ? "bg-amber-400/20 text-amber-500" : m.trust.level >= 1 ? "bg-primary/15 text-primary" : "bg-ink/10 text-ink-muted"]
									}, (0, vue_exports.toDisplayString)(m.trust.level >= 4 ? "★ " : "") + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)(m.trust.label)), 3)) : (0, vue_exports.createCommentVNode)("", true)]),
									m.bio ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
										key: 0,
										class: "mt-1 line-clamp-2 text-xs text-ink-2"
									}, (0, vue_exports.toDisplayString)(m.bio), 1)) : (0, vue_exports.createCommentVNode)("", true),
									(0, vue_exports.createVNode)("div", { class: "mt-3 flex items-center gap-3 text-xs text-ink-muted" }, [
										(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("{n} posts", { n: m.posts })), 1),
										(0, vue_exports.createVNode)("span", null, "·"),
										(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Joined {date}", { date: m.joined })), 1)
									])
								]),
								_: 2
							}, 1032, ["href"]);
						}), 128))])),
						__props.members.next ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 2,
							class: "py-6 text-center"
						}, [(0, vue_exports.createVNode)((0, vue_exports.unref)(link_default), {
							href: __props.members.next,
							class: "rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2"
						}, {
							default: (0, vue_exports.withCtx)(() => [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Load more")), 1)]),
							_: 1
						}, 8, ["href"])])) : (0, vue_exports.createCommentVNode)("", true)
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Members/Index.vue
var _sfc_setup = Index_vue_vue_type_script_setup_true_lang_default.setup;
Index_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/Members/Index.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Index_default = Index_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Index_default as default };
