import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, Link, router, useForm } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelText, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { AlertCircle, Edit2, Mail, MapPin, Phone, Plus, Search, Trash2, Truck, User, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Suppliers/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: {
		suppliers: {},
		filters: {}
	},
	setup(__props) {
		const search = ref(__props.filters.search || "");
		let timeoutId = null;
		watch(search, () => {
			if (timeoutId) clearTimeout(timeoutId);
			timeoutId = setTimeout(() => {
				router.get(route("suppliers.index"), { search: search.value }, {
					preserveState: true,
					replace: true
				});
			}, 400);
		});
		const isFormModalOpen = ref(false);
		const isDeleteModalOpen = ref(false);
		const editingSupplier = ref(null);
		const supplierToDelete = ref(null);
		const form = useForm({
			name: "",
			phone: "",
			email: "",
			address: "",
			contact_person: ""
		});
		const openCreateModal = () => {
			editingSupplier.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (supplier) => {
			editingSupplier.value = supplier;
			form.clearErrors();
			form.name = supplier.name;
			form.phone = supplier.phone || "";
			form.email = supplier.email || "";
			form.address = supplier.address || "";
			form.contact_person = supplier.contact_person || "";
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingSupplier.value) form.put(route("suppliers.update", editingSupplier.value.id), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("suppliers.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const confirmDelete = (supplier) => {
			supplierToDelete.value = supplier;
			isDeleteModalOpen.value = true;
		};
		const submitDelete = () => {
			if (supplierToDelete.value) router.delete(route("suppliers.destroy", supplierToDelete.value.id), { onSuccess: () => {
				isDeleteModalOpen.value = false;
				supplierToDelete.value = null;
			} });
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Supplier Manager - CafePOS" }, 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 sm:flex-row sm:items-center sm:justify-between"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50"${_scopeId}>Supplier Manager</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Manage raw ingredient partners and coffee bean suppliers. </p></div><button class="px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-xl text-xs font-bold transition-all duration-200 flex items-center gap-2 shadow-sm hover:shadow hover:-translate-y-0.5 self-start sm:self-auto cursor-pointer border-0"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Plus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Add Supplier</span></button></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm space-y-4"${_scopeId}><div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 px-5 pt-5"${_scopeId}><div class="relative w-full sm:max-w-md"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Search), { class: "absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
						_push(`<input${ssrRenderAttr("value", search.value)} type="text" placeholder="Search suppliers by name, email, or contact person..." class="w-full pl-10 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100 placeholder-slate-400"${_scopeId}></div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400"${_scopeId}> Total: ${ssrInterpolate(__props.suppliers.total)} Suppliers </div></div><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left text-xs"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 font-bold text-slate-500 dark:text-slate-400"${_scopeId}><th class="p-3"${_scopeId}>Supplier Name</th><th class="p-3"${_scopeId}>Contact Person</th><th class="p-3"${_scopeId}>Phone</th><th class="p-3"${_scopeId}>Email</th><th class="p-3"${_scopeId}>Address</th><th class="p-3 text-right pr-4"${_scopeId}>Actions</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800"${_scopeId}>`);
						if (__props.suppliers.data.length === 0) _push(`<tr${_scopeId}><td colspan="6" class="p-8 text-center text-slate-400 italic"${_scopeId}> No suppliers registered. Click &quot;Add Supplier&quot; to register one. </td></tr>`);
						else _push(`<!---->`);
						_push(`<!--[-->`);
						ssrRenderList(__props.suppliers.data, (sp) => {
							_push(`<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-900/20 transition-colors text-slate-800 dark:text-slate-200 font-medium"${_scopeId}><td class="p-3 font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Truck), { class: "h-4 w-4 text-slate-400 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>${ssrInterpolate(sp.name)}</span></td><td class="p-3"${_scopeId}>`);
							if (sp.contact_person) {
								_push(`<div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(User), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(sp.contact_person)}</span></div>`);
							} else _push(`<span class="text-slate-400 italic"${_scopeId}>-</span>`);
							_push(`</td><td class="p-3"${_scopeId}>`);
							if (sp.phone) {
								_push(`<div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Phone), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(sp.phone)}</span></div>`);
							} else _push(`<span class="text-slate-400 italic"${_scopeId}>-</span>`);
							_push(`</td><td class="p-3"${_scopeId}>`);
							if (sp.email) {
								_push(`<div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Mail), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(sp.email)}</span></div>`);
							} else _push(`<span class="text-slate-400 italic"${_scopeId}>-</span>`);
							_push(`</td><td class="p-3 max-w-xs truncate"${_scopeId}>`);
							if (sp.address) {
								_push(`<div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(MapPin), { class: "h-3.5 w-3.5 text-slate-400 flex-shrink-0" }, null, _parent, _scopeId));
								_push(`<span class="truncate"${_scopeId}>${ssrInterpolate(sp.address)}</span></div>`);
							} else _push(`<span class="text-slate-400 italic"${_scopeId}>-</span>`);
							_push(`</td><td class="p-3 text-right pr-4"${_scopeId}><div class="flex items-center justify-end gap-1.5"${_scopeId}><button class="p-1.5 rounded-lg text-slate-400 hover:text-slate-650 dark:hover:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors cursor-pointer border-0 bg-transparent" title="Edit Supplier"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Edit2), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
							_push(`</button><button class="p-1.5 rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50/20 transition-colors cursor-pointer border-0 bg-transparent" title="Delete Supplier"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
							_push(`</button></div></td></tr>`);
						});
						_push(`<!--]--></tbody></table></div>`);
						if (__props.suppliers.last_page > 1) {
							_push(`<div class="flex flex-wrap items-center justify-between gap-4 pt-4 border-t border-slate-200 dark:border-slate-800"${_scopeId}><div class="text-xs text-slate-500 dark:text-slate-400 font-semibold"${_scopeId}> Page ${ssrInterpolate(__props.suppliers.current_page)} of ${ssrInterpolate(__props.suppliers.last_page)}</div><div class="flex items-center gap-1"${_scopeId}><!--[-->`);
							ssrRenderList(__props.suppliers.links, (link, lIdx) => {
								_push(ssrRenderComponent(unref(Link), {
									key: lIdx,
									style: link.url || lIdx === 0 || lIdx === __props.suppliers.links.length - 1 ? null : { display: "none" },
									href: link.url || "#",
									class: [
										"px-3 py-1.5 text-xs font-semibold rounded-lg border transition-all cursor-pointer select-none",
										link.active ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-650 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900",
										!link.url ? "opacity-40 cursor-not-allowed" : ""
									]
								}, null, _parent, _scopeId));
							});
							_push(`<!--]--></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 bg-slate-950/60 backdrop-blur-sm"${_scopeId}><form class="w-full max-w-lg bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200 flex flex-col max-h-[90vh]"${_scopeId}><div class="px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between flex-shrink-0 bg-slate-50/50 dark:bg-slate-900/10"${_scopeId}><h3 class="text-sm font-bold text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(editingSupplier.value ? "Edit Supplier" : "Register New Supplier")}</h3><button type="button" class="text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 cursor-pointer border-0 bg-transparent"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button></div><div class="flex-1 overflow-y-auto p-6 space-y-4"${_scopeId}><div class="space-y-1"${_scopeId}><label for="name" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Supplier Name <span class="text-rose-500"${_scopeId}>*</span></label><input id="name"${ssrRenderAttr("value", unref(form).name)} type="text" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100" placeholder="e.g. Sumatra Coffee Beans Corp"${_scopeId}>`);
							if (unref(form).errors.name) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.name)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="contact_person" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Contact Person</label><input id="contact_person"${ssrRenderAttr("value", unref(form).contact_person)} type="text" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100" placeholder="e.g. John Doe"${_scopeId}>`);
							if (unref(form).errors.contact_person) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.contact_person)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="grid grid-cols-1 sm:grid-cols-2 gap-4"${_scopeId}><div class="space-y-1"${_scopeId}><label for="phone" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Phone Number</label><input id="phone"${ssrRenderAttr("value", unref(form).phone)} type="text" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100" placeholder="e.g. 08123456789"${_scopeId}>`);
							if (unref(form).errors.phone) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.phone)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="email" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Email Address</label><input id="email"${ssrRenderAttr("value", unref(form).email)} type="email" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100" placeholder="e.g. sales@sumatracoffee.com"${_scopeId}>`);
							if (unref(form).errors.email) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.email)}</p>`);
							else _push(`<!---->`);
							_push(`</div></div><div class="space-y-1"${_scopeId}><label for="address" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Office Address</label><textarea id="address" rows="3" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100" placeholder="Full office address details..."${_scopeId}>${ssrInterpolate(unref(form).address)}</textarea>`);
							if (unref(form).errors.address) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.address)}</p>`);
							else _push(`<!---->`);
							_push(`</div></div><div class="flex items-center justify-end gap-3 p-6 border-t border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 flex-shrink-0"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-transparent"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer border-0"${_scopeId}>${ssrInterpolate(unref(form).processing ? "Saving..." : "Save")}</button></div></form></div>`);
						} else _push(`<!---->`);
						if (isDeleteModalOpen.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"${_scopeId}><div class="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6"${_scopeId}><div class="flex items-center gap-3 text-rose-600 dark:text-rose-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<h3 class="text-lg font-bold"${_scopeId}>Delete Supplier</h3></div><p class="text-sm text-slate-550 dark:text-slate-400 font-medium"${_scopeId}> Are you sure you want to delete supplier <strong class="text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(supplierToDelete.value?.name)}</strong>? This will decouple it from historical stock records, but the stock quantities will remain unchanged. </p><div class="flex items-center justify-end gap-3"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-transparent"${_scopeId}> Cancel </button><button class="px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer border-0"${_scopeId}> Delete Supplier </button></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						createVNode("div", { class: "space-y-6" }, [createVNode("div", { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50" }, "Supplier Manager"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Manage raw ingredient partners and coffee bean suppliers. ")]), createVNode("button", {
							onClick: openCreateModal,
							class: "px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-xl text-xs font-bold transition-all duration-200 flex items-center gap-2 shadow-sm hover:shadow hover:-translate-y-0.5 self-start sm:self-auto cursor-pointer border-0"
						}, [createVNode(unref(Plus), { class: "h-4 w-4" }), createVNode("span", null, "Add Supplier")])]), createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm space-y-4" }, [
							createVNode("div", { class: "flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 px-5 pt-5" }, [createVNode("div", { class: "relative w-full sm:max-w-md" }, [createVNode(unref(Search), { class: "absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
								"onUpdate:modelValue": ($event) => search.value = $event,
								type: "text",
								placeholder: "Search suppliers by name, email, or contact person...",
								class: "w-full pl-10 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100 placeholder-slate-400"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, search.value]])]), createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400" }, " Total: " + toDisplayString(__props.suppliers.total) + " Suppliers ", 1)]),
							createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left text-xs" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 font-bold text-slate-500 dark:text-slate-400" }, [
								createVNode("th", { class: "p-3" }, "Supplier Name"),
								createVNode("th", { class: "p-3" }, "Contact Person"),
								createVNode("th", { class: "p-3" }, "Phone"),
								createVNode("th", { class: "p-3" }, "Email"),
								createVNode("th", { class: "p-3" }, "Address"),
								createVNode("th", { class: "p-3 text-right pr-4" }, "Actions")
							])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800" }, [__props.suppliers.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "6",
								class: "p-8 text-center text-slate-400 italic"
							}, " No suppliers registered. Click \"Add Supplier\" to register one. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.suppliers.data, (sp) => {
								return openBlock(), createBlock("tr", {
									key: sp.id,
									class: "hover:bg-slate-50/30 dark:hover:bg-slate-900/20 transition-colors text-slate-800 dark:text-slate-200 font-medium"
								}, [
									createVNode("td", { class: "p-3 font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2" }, [createVNode(unref(Truck), { class: "h-4 w-4 text-slate-400 flex-shrink-0" }), createVNode("span", null, toDisplayString(sp.name), 1)]),
									createVNode("td", { class: "p-3" }, [sp.contact_person ? (openBlock(), createBlock("div", {
										key: 0,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(User), { class: "h-3.5 w-3.5 text-slate-400" }), createVNode("span", null, toDisplayString(sp.contact_person), 1)])) : (openBlock(), createBlock("span", {
										key: 1,
										class: "text-slate-400 italic"
									}, "-"))]),
									createVNode("td", { class: "p-3" }, [sp.phone ? (openBlock(), createBlock("div", {
										key: 0,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(Phone), { class: "h-3.5 w-3.5 text-slate-400" }), createVNode("span", null, toDisplayString(sp.phone), 1)])) : (openBlock(), createBlock("span", {
										key: 1,
										class: "text-slate-400 italic"
									}, "-"))]),
									createVNode("td", { class: "p-3" }, [sp.email ? (openBlock(), createBlock("div", {
										key: 0,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(Mail), { class: "h-3.5 w-3.5 text-slate-400" }), createVNode("span", null, toDisplayString(sp.email), 1)])) : (openBlock(), createBlock("span", {
										key: 1,
										class: "text-slate-400 italic"
									}, "-"))]),
									createVNode("td", { class: "p-3 max-w-xs truncate" }, [sp.address ? (openBlock(), createBlock("div", {
										key: 0,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(MapPin), { class: "h-3.5 w-3.5 text-slate-400 flex-shrink-0" }), createVNode("span", { class: "truncate" }, toDisplayString(sp.address), 1)])) : (openBlock(), createBlock("span", {
										key: 1,
										class: "text-slate-400 italic"
									}, "-"))]),
									createVNode("td", { class: "p-3 text-right pr-4" }, [createVNode("div", { class: "flex items-center justify-end gap-1.5" }, [createVNode("button", {
										onClick: ($event) => openEditModal(sp),
										class: "p-1.5 rounded-lg text-slate-400 hover:text-slate-650 dark:hover:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors cursor-pointer border-0 bg-transparent",
										title: "Edit Supplier"
									}, [createVNode(unref(Edit2), { class: "h-3.5 w-3.5" })], 8, ["onClick"]), createVNode("button", {
										onClick: ($event) => confirmDelete(sp),
										class: "p-1.5 rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50/20 transition-colors cursor-pointer border-0 bg-transparent",
										title: "Delete Supplier"
									}, [createVNode(unref(Trash2), { class: "h-3.5 w-3.5" })], 8, ["onClick"])])])
								]);
							}), 128))])])]),
							__props.suppliers.last_page > 1 ? (openBlock(), createBlock("div", {
								key: 0,
								class: "flex flex-wrap items-center justify-between gap-4 pt-4 border-t border-slate-200 dark:border-slate-800"
							}, [createVNode("div", { class: "text-xs text-slate-500 dark:text-slate-400 font-semibold" }, " Page " + toDisplayString(__props.suppliers.current_page) + " of " + toDisplayString(__props.suppliers.last_page), 1), createVNode("div", { class: "flex items-center gap-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.suppliers.links, (link, lIdx) => {
								return withDirectives((openBlock(), createBlock(unref(Link), {
									key: lIdx,
									href: link.url || "#",
									class: [
										"px-3 py-1.5 text-xs font-semibold rounded-lg border transition-all cursor-pointer select-none",
										link.active ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-650 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900",
										!link.url ? "opacity-40 cursor-not-allowed" : ""
									],
									innerHTML: link.label
								}, null, 8, [
									"href",
									"class",
									"innerHTML"
								])), [[vShow, link.url || lIdx === 0 || lIdx === __props.suppliers.links.length - 1]]);
							}), 128))])])) : createCommentVNode("", true)
						])]),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 0,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "w-full max-w-lg bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200 flex flex-col max-h-[90vh]"
						}, [
							createVNode("div", { class: "px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between flex-shrink-0 bg-slate-50/50 dark:bg-slate-900/10" }, [createVNode("h3", { class: "text-sm font-bold text-slate-900 dark:text-slate-100" }, toDisplayString(editingSupplier.value ? "Edit Supplier" : "Register New Supplier"), 1), createVNode("button", {
								type: "button",
								onClick: ($event) => isFormModalOpen.value = false,
								class: "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 cursor-pointer border-0 bg-transparent"
							}, [createVNode(unref(X), { class: "h-4 w-4" })], 8, ["onClick"])]),
							createVNode("div", { class: "flex-1 overflow-y-auto p-6 space-y-4" }, [
								createVNode("div", { class: "space-y-1" }, [
									createVNode("label", {
										for: "name",
										class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
									}, [createTextVNode("Supplier Name "), createVNode("span", { class: "text-rose-500" }, "*")]),
									withDirectives(createVNode("input", {
										id: "name",
										"onUpdate:modelValue": ($event) => unref(form).name = $event,
										type: "text",
										required: "",
										class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100",
										placeholder: "e.g. Sumatra Coffee Beans Corp"
									}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).name]]),
									unref(form).errors.name ? (openBlock(), createBlock("p", {
										key: 0,
										class: "text-xs text-rose-600 mt-1"
									}, toDisplayString(unref(form).errors.name), 1)) : createCommentVNode("", true)
								]),
								createVNode("div", { class: "space-y-1" }, [
									createVNode("label", {
										for: "contact_person",
										class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
									}, "Contact Person"),
									withDirectives(createVNode("input", {
										id: "contact_person",
										"onUpdate:modelValue": ($event) => unref(form).contact_person = $event,
										type: "text",
										class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100",
										placeholder: "e.g. John Doe"
									}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).contact_person]]),
									unref(form).errors.contact_person ? (openBlock(), createBlock("p", {
										key: 0,
										class: "text-xs text-rose-600 mt-1"
									}, toDisplayString(unref(form).errors.contact_person), 1)) : createCommentVNode("", true)
								]),
								createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-2 gap-4" }, [createVNode("div", { class: "space-y-1" }, [
									createVNode("label", {
										for: "phone",
										class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
									}, "Phone Number"),
									withDirectives(createVNode("input", {
										id: "phone",
										"onUpdate:modelValue": ($event) => unref(form).phone = $event,
										type: "text",
										class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100",
										placeholder: "e.g. 08123456789"
									}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).phone]]),
									unref(form).errors.phone ? (openBlock(), createBlock("p", {
										key: 0,
										class: "text-xs text-rose-600 mt-1"
									}, toDisplayString(unref(form).errors.phone), 1)) : createCommentVNode("", true)
								]), createVNode("div", { class: "space-y-1" }, [
									createVNode("label", {
										for: "email",
										class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
									}, "Email Address"),
									withDirectives(createVNode("input", {
										id: "email",
										"onUpdate:modelValue": ($event) => unref(form).email = $event,
										type: "email",
										class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100",
										placeholder: "e.g. sales@sumatracoffee.com"
									}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).email]]),
									unref(form).errors.email ? (openBlock(), createBlock("p", {
										key: 0,
										class: "text-xs text-rose-600 mt-1"
									}, toDisplayString(unref(form).errors.email), 1)) : createCommentVNode("", true)
								])]),
								createVNode("div", { class: "space-y-1" }, [
									createVNode("label", {
										for: "address",
										class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
									}, "Office Address"),
									withDirectives(createVNode("textarea", {
										id: "address",
										"onUpdate:modelValue": ($event) => unref(form).address = $event,
										rows: "3",
										class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100",
										placeholder: "Full office address details..."
									}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).address]]),
									unref(form).errors.address ? (openBlock(), createBlock("p", {
										key: 0,
										class: "text-xs text-rose-600 mt-1"
									}, toDisplayString(unref(form).errors.address), 1)) : createCommentVNode("", true)
								])
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3 p-6 border-t border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 flex-shrink-0" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => isFormModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-transparent"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(form).processing,
								class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer border-0"
							}, toDisplayString(unref(form).processing ? "Saving..." : "Save"), 9, ["disabled"])])
						], 32)])) : createCommentVNode("", true),
						isDeleteModalOpen.value ? (openBlock(), createBlock("div", {
							key: 1,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6" }, [
							createVNode("div", { class: "flex items-center gap-3 text-rose-600 dark:text-rose-400" }, [createVNode(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }), createVNode("h3", { class: "text-lg font-bold" }, "Delete Supplier")]),
							createVNode("p", { class: "text-sm text-slate-550 dark:text-slate-400 font-medium" }, [
								createTextVNode(" Are you sure you want to delete supplier "),
								createVNode("strong", { class: "text-slate-800 dark:text-slate-200" }, toDisplayString(supplierToDelete.value?.name), 1),
								createTextVNode("? This will decouple it from historical stock records, but the stock quantities will remain unchanged. ")
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3" }, [createVNode("button", {
								onClick: ($event) => isDeleteModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-transparent"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								onClick: submitDelete,
								class: "px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer border-0"
							}, " Delete Supplier ")])
						])])) : createCommentVNode("", true)
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Suppliers/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/CafePOS/Suppliers/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 };
