import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, router, useForm, usePage } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Check, Edit2, Key, Mail, Search, Shield, Trash2, User, UserPlus } from "lucide-vue-next";
//#region resources/js/Pages/Users/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "Index",
	__ssrInlineRender: true,
	props: {
		users: {},
		roles: {},
		filters: {}
	},
	setup(__props) {
		const props = __props;
		const search = ref(props.filters.search || "");
		const roleFilter = ref(props.filters.role || "");
		let timeoutId = null;
		const performFilter = () => {
			if (timeoutId) clearTimeout(timeoutId);
			timeoutId = setTimeout(() => {
				router.get(route("users.index"), {
					search: search.value,
					role: roleFilter.value
				}, {
					preserveState: true,
					replace: true
				});
			}, 400);
		};
		watch(search, performFilter);
		watch(roleFilter, performFilter);
		const isFormModalOpen = ref(false);
		const isDeleteModalOpen = ref(false);
		const editingUser = ref(null);
		const userToDelete = ref(null);
		const form = useForm({
			name: "",
			email: "",
			password: "",
			roles: []
		});
		const openCreateModal = () => {
			editingUser.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const page = usePage();
		const openEditModal = (user) => {
			editingUser.value = user;
			form.clearErrors();
			form.name = user.name;
			form.email = user.email;
			form.password = "";
			form.roles = user.roles.map((r) => r.name);
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingUser.value) form.put(route("users.update", editingUser.value.id), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("users.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const openDeleteModal = (user) => {
			userToDelete.value = user;
			isDeleteModalOpen.value = true;
		};
		const deleteUser = () => {
			if (!userToDelete.value) return;
			router.delete(route("users.destroy", userToDelete.value.id), { onSuccess: () => {
				isDeleteModalOpen.value = false;
				userToDelete.value = null;
			} });
		};
		const toggleFormRole = (roleName) => {
			const idx = form.roles.indexOf(roleName);
			if (idx > -1) form.roles.splice(idx, 1);
			else form.roles.push(roleName);
		};
		const getInitials = (name) => {
			if (!name) return "U";
			const parts = name.trim().split(/\s+/).filter(Boolean);
			if (parts.length === 0) return "U";
			return parts.map((n) => n[0]).slice(0, 2).join("").toUpperCase();
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "User Management" }, null, _parent));
			_push(ssrRenderComponent(AdminLayout_default, null, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="space-y-6"${_scopeId}><div class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50"${_scopeId}>User Management</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Create, modify, and assign security roles to system users. </p></div><div${_scopeId}><button class="inline-flex items-center gap-2 px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(UserPlus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(` Add User </button></div></div>`);
						if (unref(page).props.flash?.success) {
							_push(`<div class="bg-emerald-50 dark:bg-emerald-950/30 border border-emerald-200 dark:border-emerald-900/50 text-emerald-800 dark:text-emerald-400 rounded-xl p-4 text-sm flex items-center gap-3"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Check), { class: "h-5 w-5 text-emerald-600 dark:text-emerald-400 shrink-0" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>${ssrInterpolate(unref(page).props.flash?.success)}</span></div>`);
						} else _push(`<!---->`);
						if (unref(page).props.flash?.error) _push(`<div class="bg-rose-50 dark:bg-rose-950/30 border border-rose-200 dark:border-rose-900/50 text-rose-800 dark:text-rose-400 rounded-xl p-4 text-sm flex items-center gap-3"${_scopeId}><span class="font-bold text-rose-600 dark:text-rose-400"${_scopeId}>Error:</span><span${_scopeId}>${ssrInterpolate(unref(page).props.flash?.error)}</span></div>`);
						else _push(`<!---->`);
						_push(`<div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm flex flex-col md:flex-row gap-4 items-center justify-between"${_scopeId}><div class="flex flex-col md:flex-row w-full md:items-center gap-4"${_scopeId}><div class="relative w-full md:max-w-xs"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400 dark:text-slate-500" }, null, _parent, _scopeId));
						_push(`<input${ssrRenderAttr("value", search.value)} type="text" placeholder="Search by name or email..." class="w-full pl-9 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"${_scopeId}></div><div class="w-full md:w-48"${_scopeId}><select class="w-full px-3 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(roleFilter.value) ? ssrLooseContain(roleFilter.value, "") : ssrLooseEqual(roleFilter.value, "")) ? " selected" : ""}${_scopeId}>All Roles</option><!--[-->`);
						ssrRenderList(__props.roles, (role) => {
							_push(`<option${ssrRenderAttr("value", role.name)}${ssrIncludeBooleanAttr(Array.isArray(roleFilter.value) ? ssrLooseContain(roleFilter.value, role.name) : ssrLooseEqual(roleFilter.value, role.name)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(role.name)}</option>`);
						});
						_push(`<!--]--></select></div></div><div class="text-sm text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}> Total Users: <span class="font-semibold text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(__props.users.total)}</span></div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"${_scopeId}><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider"${_scopeId}><th class="px-6 py-4"${_scopeId}>User</th><th class="px-6 py-4"${_scopeId}>Assigned Roles</th><th class="px-6 py-4"${_scopeId}>Created Date</th><th class="px-6 py-4 text-right"${_scopeId}>Actions</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800 text-sm"${_scopeId}>`);
						if (__props.users.data.length === 0) _push(`<tr${_scopeId}><td colspan="4" class="px-6 py-12 text-center text-slate-500 dark:text-slate-400"${_scopeId}> No users match your filters. </td></tr>`);
						else _push(`<!---->`);
						_push(`<!--[-->`);
						ssrRenderList(__props.users.data, (user) => {
							_push(`<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-900/50 transition-colors"${_scopeId}><td class="px-6 py-4"${_scopeId}><div class="flex items-center gap-3"${_scopeId}><div class="h-9 w-9 rounded-full bg-gradient-to-br from-red-500 to-rose-600 text-white flex items-center justify-center font-bold text-xs shadow-sm"${_scopeId}>${ssrInterpolate(getInitials(user.name))}</div><div${_scopeId}><div class="font-medium text-slate-900 dark:text-slate-100 flex items-center gap-1.5"${_scopeId}>${ssrInterpolate(user.name)} `);
							if (user.id === unref(page).props.auth.user.id) _push(`<span class="text-[10px] font-semibold bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-400 px-1.5 py-0.5 rounded-full border border-red-100 dark:border-red-900/50"${_scopeId}>You</span>`);
							else _push(`<!---->`);
							_push(`</div><div class="text-xs text-slate-500 dark:text-slate-400"${_scopeId}>${ssrInterpolate(user.email)}</div></div></div></td><td class="px-6 py-4"${_scopeId}><div class="flex flex-wrap gap-1"${_scopeId}><!--[-->`);
							ssrRenderList(user.roles, (role) => {
								_push(`<span class="${ssrRenderClass(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border", role.name === "Super Admin" ? "bg-slate-900 text-slate-50 border-slate-800 dark:bg-slate-50 dark:text-slate-900 dark:border-slate-200" : "bg-red-50 text-red-700 border-red-150 dark:bg-red-950/30 dark:text-red-400 dark:border-red-900/50"])}"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Shield), { class: "h-3 w-3" }, null, _parent, _scopeId));
								_push(` ${ssrInterpolate(role.name)}</span>`);
							});
							_push(`<!--]-->`);
							if (user.roles.length === 0) _push(`<span class="text-xs text-slate-400 italic"${_scopeId}>No Roles</span>`);
							else _push(`<!---->`);
							_push(`</div></td><td class="px-6 py-4 text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>${ssrInterpolate(user.created_at)}</td><td class="px-6 py-4 text-right whitespace-nowrap"${_scopeId}><div class="flex items-center justify-end gap-2"${_scopeId}><button class="p-1.5 rounded-lg text-slate-500 hover:text-slate-900 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-900 transition-colors" title="Edit User"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Edit2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button><button${ssrIncludeBooleanAttr(user.id === unref(page).props.auth.user.id) ? " disabled" : ""} class="p-1.5 rounded-lg text-slate-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/30 transition-colors disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-slate-400 cursor-pointer disabled:cursor-not-allowed" title="Delete User"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button></div></td></tr>`);
						});
						_push(`<!--]--></tbody></table></div>`);
						if (__props.users.last_page > 1) {
							_push(`<div class="border-t border-slate-200 dark:border-slate-800 px-6 py-4 flex items-center justify-between bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><div class="flex-1 flex justify-between sm:hidden"${_scopeId}><button${ssrIncludeBooleanAttr(!__props.users.prev_page_url) ? " disabled" : ""} class="relative inline-flex items-center px-4 py-2 border border-slate-300 dark:border-slate-800 text-sm font-medium rounded-md text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-50 transition-colors"${_scopeId}> Previous </button><button${ssrIncludeBooleanAttr(!__props.users.next_page_url) ? " disabled" : ""} class="ml-3 relative inline-flex items-center px-4 py-2 border border-slate-300 dark:border-slate-800 text-sm font-medium rounded-md text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-50 transition-colors"${_scopeId}> Next </button></div><div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"${_scopeId}><div${_scopeId}><p class="text-sm text-slate-700 dark:text-slate-400"${_scopeId}> Showing page <span class="font-medium text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(__props.users.current_page)}</span> of <span class="font-medium text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(__props.users.last_page)}</span></p></div><div${_scopeId}><nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination"${_scopeId}><!--[-->`);
							ssrRenderList(__props.users.links, (link, idx) => {
								_push(`<button${ssrIncludeBooleanAttr(!link.url) ? " disabled" : ""} class="${ssrRenderClass([
									link.active ? "z-10 bg-red-500 border-red-500 text-white focus:ring-red-500" : "bg-white dark:bg-slate-950 border-slate-300 dark:border-slate-800 text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900",
									"relative inline-flex items-center px-3 py-2 border text-xs font-medium disabled:opacity-50 transition-colors cursor-pointer",
									idx === 0 ? "rounded-l-md" : "",
									idx === __props.users.links.length - 1 ? "rounded-r-md" : ""
								])}"${_scopeId}>${link.label ?? ""}</button>`);
							});
							_push(`<!--]--></nav></div></div></div>`);
						} else _push(`<!---->`);
						_push(`</div></div>`);
						if (isFormModalOpen.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm transition-opacity"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xl w-full max-w-lg overflow-hidden flex flex-col max-h-[90vh] animate-in zoom-in-95 duration-200"${_scopeId}><div class="px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><h3 class="text-base font-semibold text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(editingUser.value ? "Edit User details" : "Create new User")}</h3><button class="rounded-lg p-1 text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-900 hover:text-slate-600 dark:hover:text-slate-300 transition-colors"${_scopeId}> × </button></div><form class="flex flex-col overflow-hidden"${_scopeId}><div class="p-6 overflow-y-auto space-y-5"${_scopeId}><div class="space-y-1.5"${_scopeId}><label for="form-name" class="block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Full Name</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(User), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input id="form-name"${ssrRenderAttr("value", unref(form).name)} type="text" required placeholder="Jane Doe" class="w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"${_scopeId}></div>`);
							if (unref(form).errors.name) _push(`<span class="text-xs text-red-600 dark:text-red-400 font-medium"${_scopeId}>${ssrInterpolate(unref(form).errors.name)}</span>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1.5"${_scopeId}><label for="form-email" class="block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Email Address</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Mail), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input id="form-email"${ssrRenderAttr("value", unref(form).email)} type="email" required placeholder="jane.doe@example.com" class="w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"${_scopeId}></div>`);
							if (unref(form).errors.email) _push(`<span class="text-xs text-red-600 dark:text-red-400 font-medium"${_scopeId}>${ssrInterpolate(unref(form).errors.email)}</span>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1.5"${_scopeId}><label for="form-password" class="block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}> Password `);
							if (editingUser.value) _push(`<span class="text-[10px] text-slate-400 italic normal-case font-normal"${_scopeId}>(Leave blank to keep current)</span>`);
							else _push(`<!---->`);
							_push(`</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Key), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input id="form-password"${ssrRenderAttr("value", unref(form).password)} type="password"${ssrIncludeBooleanAttr(!editingUser.value) ? " required" : ""} placeholder="••••••••" class="w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"${_scopeId}></div>`);
							if (unref(form).errors.password) _push(`<span class="text-xs text-red-600 dark:text-red-400 font-medium"${_scopeId}>${ssrInterpolate(unref(form).errors.password)}</span>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-2"${_scopeId}><span class="block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Assign Security Roles</span><div class="grid grid-cols-2 gap-3 border border-slate-200 dark:border-slate-800 rounded-lg p-3.5 bg-slate-50/50 dark:bg-slate-900/30"${_scopeId}><!--[-->`);
							ssrRenderList(__props.roles, (role) => {
								_push(`<div class="flex items-center space-x-2.5 cursor-pointer select-none"${_scopeId}><div class="${ssrRenderClass(["h-4.5 w-4.5 rounded border flex items-center justify-center transition-all", unref(form).roles.includes(role.name) ? "bg-red-500 border-red-500 text-white" : "border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-900"])}"${_scopeId}>`);
								if (unref(form).roles.includes(role.name)) _push(ssrRenderComponent(unref(Check), { class: "h-3 w-3 stroke-[3]" }, null, _parent, _scopeId));
								else _push(`<!---->`);
								_push(`</div><span class="text-sm font-medium text-slate-700 dark:text-slate-350 capitalize"${_scopeId}>${ssrInterpolate(role.name)}</span></div>`);
							});
							_push(`<!--]--></div>`);
							if (unref(form).errors.roles) _push(`<span class="text-xs text-red-600 dark:text-red-400 font-medium"${_scopeId}>${ssrInterpolate(unref(form).errors.roles)}</span>`);
							else _push(`<!---->`);
							_push(`</div></div><div class="px-6 py-4 border-t border-slate-200 dark:border-slate-800 flex justify-end gap-3 bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><button type="button" class="px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors focus:outline-none"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50"${_scopeId}>`);
							if (unref(form).processing) _push(`<span${_scopeId}>Saving...</span>`);
							else _push(`<span${_scopeId}>Save Changes</span>`);
							_push(`</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isDeleteModalOpen.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xl w-full max-w-md overflow-hidden flex flex-col animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 text-center space-y-4"${_scopeId}><div class="mx-auto h-12 w-12 rounded-full bg-red-50 dark:bg-red-950/30 flex items-center justify-center border border-red-100 dark:border-red-900/50 text-red-600 dark:text-red-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-6 w-6" }, null, _parent, _scopeId));
							_push(`</div><div class="space-y-1"${_scopeId}><h3 class="text-base font-bold text-slate-900 dark:text-slate-50"${_scopeId}>Delete User Account</h3><p class="text-sm text-slate-500 dark:text-slate-400 leading-normal"${_scopeId}> Are you sure you want to delete <span class="font-semibold text-slate-950 dark:text-slate-50"${_scopeId}>${ssrInterpolate(userToDelete.value?.name)}</span>? This action is permanent and cannot be undone. </p></div></div><div class="px-6 py-4 border-t border-slate-200 dark:border-slate-800 flex justify-end gap-3 bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><button type="button" class="px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors"${_scopeId}> Cancel </button><button type="button" class="px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"${_scopeId}> Yes, Delete User </button></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						createVNode("div", { class: "space-y-6" }, [
							createVNode("div", { class: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50" }, "User Management"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Create, modify, and assign security roles to system users. ")]), createVNode("div", null, [createVNode("button", {
								onClick: openCreateModal,
								class: "inline-flex items-center gap-2 px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"
							}, [createVNode(unref(UserPlus), { class: "h-4 w-4" }), createTextVNode(" Add User ")])])]),
							unref(page).props.flash?.success ? (openBlock(), createBlock("div", {
								key: 0,
								class: "bg-emerald-50 dark:bg-emerald-950/30 border border-emerald-200 dark:border-emerald-900/50 text-emerald-800 dark:text-emerald-400 rounded-xl p-4 text-sm flex items-center gap-3"
							}, [createVNode(unref(Check), { class: "h-5 w-5 text-emerald-600 dark:text-emerald-400 shrink-0" }), createVNode("span", null, toDisplayString(unref(page).props.flash?.success), 1)])) : createCommentVNode("", true),
							unref(page).props.flash?.error ? (openBlock(), createBlock("div", {
								key: 1,
								class: "bg-rose-50 dark:bg-rose-950/30 border border-rose-200 dark:border-rose-900/50 text-rose-800 dark:text-rose-400 rounded-xl p-4 text-sm flex items-center gap-3"
							}, [createVNode("span", { class: "font-bold text-rose-600 dark:text-rose-400" }, "Error:"), createVNode("span", null, toDisplayString(unref(page).props.flash?.error), 1)])) : createCommentVNode("", true),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm flex flex-col md:flex-row gap-4 items-center justify-between" }, [createVNode("div", { class: "flex flex-col md:flex-row w-full md:items-center gap-4" }, [createVNode("div", { class: "relative w-full md:max-w-xs" }, [createVNode(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400 dark:text-slate-500" }), withDirectives(createVNode("input", {
								"onUpdate:modelValue": ($event) => search.value = $event,
								type: "text",
								placeholder: "Search by name or email...",
								class: "w-full pl-9 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, search.value]])]), createVNode("div", { class: "w-full md:w-48" }, [withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => roleFilter.value = $event,
								class: "w-full px-3 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"
							}, [createVNode("option", { value: "" }, "All Roles"), (openBlock(true), createBlock(Fragment, null, renderList(__props.roles, (role) => {
								return openBlock(), createBlock("option", {
									key: role.id,
									value: role.name
								}, toDisplayString(role.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, roleFilter.value]])])]), createVNode("div", { class: "text-sm text-slate-500 dark:text-slate-400 whitespace-nowrap" }, [createTextVNode(" Total Users: "), createVNode("span", { class: "font-semibold text-slate-900 dark:text-slate-50" }, toDisplayString(__props.users.total), 1)])]),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden" }, [createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider" }, [
								createVNode("th", { class: "px-6 py-4" }, "User"),
								createVNode("th", { class: "px-6 py-4" }, "Assigned Roles"),
								createVNode("th", { class: "px-6 py-4" }, "Created Date"),
								createVNode("th", { class: "px-6 py-4 text-right" }, "Actions")
							])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800 text-sm" }, [__props.users.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "4",
								class: "px-6 py-12 text-center text-slate-500 dark:text-slate-400"
							}, " No users match your filters. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.users.data, (user) => {
								return openBlock(), createBlock("tr", {
									key: user.id,
									class: "hover:bg-slate-50/50 dark:hover:bg-slate-900/50 transition-colors"
								}, [
									createVNode("td", { class: "px-6 py-4" }, [createVNode("div", { class: "flex items-center gap-3" }, [createVNode("div", { class: "h-9 w-9 rounded-full bg-gradient-to-br from-red-500 to-rose-600 text-white flex items-center justify-center font-bold text-xs shadow-sm" }, toDisplayString(getInitials(user.name)), 1), createVNode("div", null, [createVNode("div", { class: "font-medium text-slate-900 dark:text-slate-100 flex items-center gap-1.5" }, [createTextVNode(toDisplayString(user.name) + " ", 1), user.id === unref(page).props.auth.user.id ? (openBlock(), createBlock("span", {
										key: 0,
										class: "text-[10px] font-semibold bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-400 px-1.5 py-0.5 rounded-full border border-red-100 dark:border-red-900/50"
									}, "You")) : createCommentVNode("", true)]), createVNode("div", { class: "text-xs text-slate-500 dark:text-slate-400" }, toDisplayString(user.email), 1)])])]),
									createVNode("td", { class: "px-6 py-4" }, [createVNode("div", { class: "flex flex-wrap gap-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(user.roles, (role) => {
										return openBlock(), createBlock("span", {
											key: role.id,
											class: ["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border", role.name === "Super Admin" ? "bg-slate-900 text-slate-50 border-slate-800 dark:bg-slate-50 dark:text-slate-900 dark:border-slate-200" : "bg-red-50 text-red-700 border-red-150 dark:bg-red-950/30 dark:text-red-400 dark:border-red-900/50"]
										}, [createVNode(unref(Shield), { class: "h-3 w-3" }), createTextVNode(" " + toDisplayString(role.name), 1)], 2);
									}), 128)), user.roles.length === 0 ? (openBlock(), createBlock("span", {
										key: 0,
										class: "text-xs text-slate-400 italic"
									}, "No Roles")) : createCommentVNode("", true)])]),
									createVNode("td", { class: "px-6 py-4 text-slate-500 dark:text-slate-400 whitespace-nowrap" }, toDisplayString(user.created_at), 1),
									createVNode("td", { class: "px-6 py-4 text-right whitespace-nowrap" }, [createVNode("div", { class: "flex items-center justify-end gap-2" }, [createVNode("button", {
										onClick: ($event) => openEditModal(user),
										class: "p-1.5 rounded-lg text-slate-500 hover:text-slate-900 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-900 transition-colors",
										title: "Edit User"
									}, [createVNode(unref(Edit2), { class: "h-4 w-4" })], 8, ["onClick"]), createVNode("button", {
										onClick: ($event) => openDeleteModal(user),
										disabled: user.id === unref(page).props.auth.user.id,
										class: "p-1.5 rounded-lg text-slate-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/30 transition-colors disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-slate-400 cursor-pointer disabled:cursor-not-allowed",
										title: "Delete User"
									}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick", "disabled"])])])
								]);
							}), 128))])])]), __props.users.last_page > 1 ? (openBlock(), createBlock("div", {
								key: 0,
								class: "border-t border-slate-200 dark:border-slate-800 px-6 py-4 flex items-center justify-between bg-slate-50/50 dark:bg-slate-900/50"
							}, [createVNode("div", { class: "flex-1 flex justify-between sm:hidden" }, [createVNode("button", {
								disabled: !__props.users.prev_page_url,
								onClick: ($event) => __props.users.prev_page_url && unref(router).visit(__props.users.prev_page_url),
								class: "relative inline-flex items-center px-4 py-2 border border-slate-300 dark:border-slate-800 text-sm font-medium rounded-md text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-50 transition-colors"
							}, " Previous ", 8, ["disabled", "onClick"]), createVNode("button", {
								disabled: !__props.users.next_page_url,
								onClick: ($event) => __props.users.next_page_url && unref(router).visit(__props.users.next_page_url),
								class: "ml-3 relative inline-flex items-center px-4 py-2 border border-slate-300 dark:border-slate-800 text-sm font-medium rounded-md text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-50 transition-colors"
							}, " Next ", 8, ["disabled", "onClick"])]), createVNode("div", { class: "hidden sm:flex-1 sm:flex sm:items-center sm:justify-between" }, [createVNode("div", null, [createVNode("p", { class: "text-sm text-slate-700 dark:text-slate-400" }, [
								createTextVNode(" Showing page "),
								createVNode("span", { class: "font-medium text-slate-900 dark:text-slate-50" }, toDisplayString(__props.users.current_page), 1),
								createTextVNode(" of "),
								createVNode("span", { class: "font-medium text-slate-900 dark:text-slate-50" }, toDisplayString(__props.users.last_page), 1)
							])]), createVNode("div", null, [createVNode("nav", {
								class: "relative z-0 inline-flex rounded-md shadow-sm -space-x-px",
								"aria-label": "Pagination"
							}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.users.links, (link, idx) => {
								return openBlock(), createBlock("button", {
									key: idx,
									disabled: !link.url,
									onClick: ($event) => link.url && unref(router).visit(link.url),
									innerHTML: link.label,
									class: [
										link.active ? "z-10 bg-red-500 border-red-500 text-white focus:ring-red-500" : "bg-white dark:bg-slate-950 border-slate-300 dark:border-slate-800 text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900",
										"relative inline-flex items-center px-3 py-2 border text-xs font-medium disabled:opacity-50 transition-colors cursor-pointer",
										idx === 0 ? "rounded-l-md" : "",
										idx === __props.users.links.length - 1 ? "rounded-r-md" : ""
									]
								}, null, 10, [
									"disabled",
									"onClick",
									"innerHTML"
								]);
							}), 128))])])])])) : createCommentVNode("", true)])
						]),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 0,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							onClick: ($event) => isFormModalOpen.value = false,
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm transition-opacity"
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xl w-full max-w-lg overflow-hidden flex flex-col max-h-[90vh] animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-slate-50/50 dark:bg-slate-900/50" }, [createVNode("h3", { class: "text-base font-semibold text-slate-900 dark:text-slate-50" }, toDisplayString(editingUser.value ? "Edit User details" : "Create new User"), 1), createVNode("button", {
							onClick: ($event) => isFormModalOpen.value = false,
							class: "rounded-lg p-1 text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-900 hover:text-slate-600 dark:hover:text-slate-300 transition-colors"
						}, " × ", 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "flex flex-col overflow-hidden"
						}, [createVNode("div", { class: "p-6 overflow-y-auto space-y-5" }, [
							createVNode("div", { class: "space-y-1.5" }, [
								createVNode("label", {
									for: "form-name",
									class: "block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"
								}, "Full Name"),
								createVNode("div", { class: "relative" }, [createVNode(unref(User), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }), withDirectives(createVNode("input", {
									id: "form-name",
									"onUpdate:modelValue": ($event) => unref(form).name = $event,
									type: "text",
									required: "",
									placeholder: "Jane Doe",
									class: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).name]])]),
								unref(form).errors.name ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-xs text-red-600 dark:text-red-400 font-medium"
								}, toDisplayString(unref(form).errors.name), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1.5" }, [
								createVNode("label", {
									for: "form-email",
									class: "block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"
								}, "Email Address"),
								createVNode("div", { class: "relative" }, [createVNode(unref(Mail), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }), withDirectives(createVNode("input", {
									id: "form-email",
									"onUpdate:modelValue": ($event) => unref(form).email = $event,
									type: "email",
									required: "",
									placeholder: "jane.doe@example.com",
									class: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).email]])]),
								unref(form).errors.email ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-xs text-red-600 dark:text-red-400 font-medium"
								}, toDisplayString(unref(form).errors.email), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1.5" }, [
								createVNode("label", {
									for: "form-password",
									class: "block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"
								}, [createTextVNode(" Password "), editingUser.value ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-[10px] text-slate-400 italic normal-case font-normal"
								}, "(Leave blank to keep current)")) : createCommentVNode("", true)]),
								createVNode("div", { class: "relative" }, [createVNode(unref(Key), { class: "absolute left-3 top-2.5 h-4.5 w-4.5 text-slate-400" }), withDirectives(createVNode("input", {
									id: "form-password",
									"onUpdate:modelValue": ($event) => unref(form).password = $event,
									type: "password",
									required: !editingUser.value,
									placeholder: "••••••••",
									class: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-slate-950 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all"
								}, null, 8, ["onUpdate:modelValue", "required"]), [[vModelText, unref(form).password]])]),
								unref(form).errors.password ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-xs text-red-600 dark:text-red-400 font-medium"
								}, toDisplayString(unref(form).errors.password), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-2" }, [
								createVNode("span", { class: "block text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Assign Security Roles"),
								createVNode("div", { class: "grid grid-cols-2 gap-3 border border-slate-200 dark:border-slate-800 rounded-lg p-3.5 bg-slate-50/50 dark:bg-slate-900/30" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.roles, (role) => {
									return openBlock(), createBlock("div", {
										key: role.id,
										class: "flex items-center space-x-2.5 cursor-pointer select-none",
										onClick: ($event) => toggleFormRole(role.name)
									}, [createVNode("div", { class: ["h-4.5 w-4.5 rounded border flex items-center justify-center transition-all", unref(form).roles.includes(role.name) ? "bg-red-500 border-red-500 text-white" : "border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-900"] }, [unref(form).roles.includes(role.name) ? (openBlock(), createBlock(unref(Check), {
										key: 0,
										class: "h-3 w-3 stroke-[3]"
									})) : createCommentVNode("", true)], 2), createVNode("span", { class: "text-sm font-medium text-slate-700 dark:text-slate-350 capitalize" }, toDisplayString(role.name), 1)], 8, ["onClick"]);
								}), 128))]),
								unref(form).errors.roles ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-xs text-red-600 dark:text-red-400 font-medium"
								}, toDisplayString(unref(form).errors.roles), 1)) : createCommentVNode("", true)
							])
						]), createVNode("div", { class: "px-6 py-4 border-t border-slate-200 dark:border-slate-800 flex justify-end gap-3 bg-slate-50/50 dark:bg-slate-900/50" }, [createVNode("button", {
							type: "button",
							onClick: ($event) => isFormModalOpen.value = false,
							class: "px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors focus:outline-none"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							type: "submit",
							disabled: unref(form).processing,
							class: "px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50"
						}, [unref(form).processing ? (openBlock(), createBlock("span", { key: 0 }, "Saving...")) : (openBlock(), createBlock("span", { key: 1 }, "Save Changes"))], 8, ["disabled"])])], 32)])])) : createCommentVNode("", true),
						isDeleteModalOpen.value ? (openBlock(), createBlock("div", {
							key: 1,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							onClick: ($event) => isDeleteModalOpen.value = false,
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm"
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xl w-full max-w-md overflow-hidden flex flex-col animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 text-center space-y-4" }, [createVNode("div", { class: "mx-auto h-12 w-12 rounded-full bg-red-50 dark:bg-red-950/30 flex items-center justify-center border border-red-100 dark:border-red-900/50 text-red-600 dark:text-red-400" }, [createVNode(unref(Trash2), { class: "h-6 w-6" })]), createVNode("div", { class: "space-y-1" }, [createVNode("h3", { class: "text-base font-bold text-slate-900 dark:text-slate-50" }, "Delete User Account"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 leading-normal" }, [
							createTextVNode(" Are you sure you want to delete "),
							createVNode("span", { class: "font-semibold text-slate-950 dark:text-slate-50" }, toDisplayString(userToDelete.value?.name), 1),
							createTextVNode("? This action is permanent and cannot be undone. ")
						])])]), createVNode("div", { class: "px-6 py-4 border-t border-slate-200 dark:border-slate-800 flex justify-end gap-3 bg-slate-50/50 dark:bg-slate-900/50" }, [createVNode("button", {
							type: "button",
							onClick: ($event) => isDeleteModalOpen.value = false,
							class: "px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							type: "button",
							onClick: deleteUser,
							class: "px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 rounded-lg shadow-sm transition-all focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"
						}, " Yes, Delete User ")])])])) : createCommentVNode("", true)
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Users/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 = useSSRContext();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Users/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 };
