import { t as AdminLayout_default } from "./AdminLayout-CFTJa237.js";
import { Head, router } from "@inertiajs/vue3";
import { Fragment, computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, onMounted, onUnmounted, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, watch, withCtx, withDirectives } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList, ssrRenderStyle } from "vue/server-renderer";
import { AlertTriangle, ArrowUpRight, Award, Check, DollarSign, Printer, ShoppingBag, Store, TrendingUp } from "lucide-vue-next";
import VueApexCharts from "vue3-apexcharts";
//#region resources/js/Pages/CafePOS/Reports/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: {
		metrics: {},
		lowStockAlerts: {},
		salesTrend: {},
		topProducts: {},
		outlets: {},
		filters: {}
	},
	setup(__props) {
		const props = __props;
		const outletFilter = ref(props.filters.outlet_id || "");
		const startDate = ref(props.filters.start_date);
		const endDate = ref(props.filters.end_date);
		const submitFilters = () => {
			router.get(route("reports.index"), {
				outlet_id: outletFilter.value,
				start_date: startDate.value,
				end_date: endDate.value
			}, {
				preserveState: true,
				replace: true
			});
		};
		watch([
			outletFilter,
			startDate,
			endDate
		], () => {
			submitFilters();
		});
		const isDark = ref(false);
		onMounted(() => {
			isDark.value = document.documentElement.classList.contains("dark");
			const observer = new MutationObserver(() => {
				isDark.value = document.documentElement.classList.contains("dark");
			});
			observer.observe(document.documentElement, {
				attributes: true,
				attributeFilter: ["class"]
			});
			onUnmounted(() => {
				observer.disconnect();
			});
		});
		const chartOptions = computed(() => {
			return {
				chart: {
					id: "sales-trend-chart",
					type: "area",
					toolbar: { show: false },
					fontFamily: "Inter, sans-serif",
					background: "transparent",
					foreColor: isDark.value ? "#94a3b8" : "#64748b"
				},
				colors: ["#8c5a3c"],
				stroke: {
					curve: "smooth",
					width: 2.5
				},
				fill: {
					type: "gradient",
					gradient: {
						shadeIntensity: 1,
						opacityFrom: .25,
						opacityTo: .02,
						stops: [0, 100]
					}
				},
				markers: {
					size: 4,
					colors: ["#ffffff"],
					strokeColors: "#8c5a3c",
					strokeWidth: 2,
					hover: { size: 6 }
				},
				xaxis: {
					categories: props.salesTrend.map((p) => {
						const d = new Date(p.date);
						return `${d.getDate()}/${d.getMonth() + 1}`;
					}),
					axisBorder: { show: false },
					axisTicks: { show: false },
					labels: { style: { colors: isDark.value ? "#94a3b8" : "#64748b" } }
				},
				yaxis: { labels: {
					style: { colors: isDark.value ? "#94a3b8" : "#64748b" },
					formatter: (value) => {
						return `Rp ${(value / 1e3).toFixed(0)}k`;
					}
				} },
				grid: {
					borderColor: isDark.value ? "#334155" : "#e2e8f0",
					strokeDashArray: 4,
					xaxis: { lines: { show: false } },
					yaxis: { lines: { show: true } }
				},
				tooltip: {
					theme: isDark.value ? "dark" : "light",
					y: { formatter: (value) => {
						return `Rp ${value.toLocaleString("id-ID")}`;
					} }
				},
				dataLabels: { enabled: false }
			};
		});
		const chartSeries = computed(() => {
			return [{
				name: "Omzet",
				data: props.salesTrend.map((p) => p.total)
			}];
		});
		const maxQtySold = computed(() => {
			return Math.max(...props.topProducts.map((p) => p.qty), 1);
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Owner Reports & Analytics" }, 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 xl:flex-row xl:items-center xl:justify-between"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50"${_scopeId}>Reports &amp; Analytics</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Consolidated revenue overview, sales trend graphs, best selling items, and stock warning reports. </p></div><div class="flex flex-wrap items-center justify-end gap-3 w-full xl:w-auto"${_scopeId}><div class="flex flex-wrap items-center gap-3 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-3 shadow-sm"${_scopeId}><div class="flex items-center gap-1 text-slate-500 dark:text-slate-400 text-xs font-semibold uppercase pr-2 border-r border-slate-100 dark:border-slate-800"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Store), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Filter</span></div><select class="px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"${_scopeId}><option value="" class="dark:bg-slate-950"${ssrIncludeBooleanAttr(Array.isArray(outletFilter.value) ? ssrLooseContain(outletFilter.value, "") : ssrLooseEqual(outletFilter.value, "")) ? " selected" : ""}${_scopeId}>All Outlets</option><!--[-->`);
						ssrRenderList(__props.outlets, (ot) => {
							_push(`<option${ssrRenderAttr("value", String(ot.id))} class="dark:bg-slate-950"${ssrIncludeBooleanAttr(Array.isArray(outletFilter.value) ? ssrLooseContain(outletFilter.value, String(ot.id)) : ssrLooseEqual(outletFilter.value, String(ot.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ot.name)}</option>`);
						});
						_push(`<!--]--></select><div class="flex items-center gap-1.5"${_scopeId}><input${ssrRenderAttr("value", startDate.value)} type="date" class="px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"${_scopeId}><span class="text-xs text-slate-400"${_scopeId}>to</span><input${ssrRenderAttr("value", endDate.value)} type="date" class="px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"${_scopeId}></div></div><a${ssrRenderAttr("href", _ctx.route("reports.print", {
							outlet_id: outletFilter.value,
							start_date: startDate.value,
							end_date: endDate.value
						}))} target="_blank" class="px-3.5 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-xl text-xs font-bold cursor-pointer transition-all duration-200 flex items-center gap-2 shadow-sm hover:shadow-md hover:-translate-y-0.5 flex-shrink-0"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Printer), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Cetak Laporan</span></a></div></div><div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5"${_scopeId}><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between"${_scopeId}><div class="flex items-start justify-between"${_scopeId}><div class="space-y-1"${_scopeId}><span class="text-[10px] font-bold uppercase text-slate-400 tracking-wider"${_scopeId}>Total Omzet</span><h3 class="text-xl font-extrabold text-slate-900 dark:text-slate-50"${_scopeId}> Rp ${ssrInterpolate(Number(__props.metrics.total_revenue).toLocaleString("id-ID"))}</h3></div><div class="h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0"${_scopeId}>`);
						_push(ssrRenderComponent(unref(DollarSign), { class: "h-5 w-5" }, null, _parent, _scopeId));
						_push(`</div></div><div class="text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium"${_scopeId}>`);
						_push(ssrRenderComponent(unref(TrendingUp), { class: "h-3.5 w-3.5 text-emerald-500" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Sales revenue consolidated successfully.</span></div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between"${_scopeId}><div class="flex items-start justify-between"${_scopeId}><div class="space-y-1"${_scopeId}><span class="text-[10px] font-bold uppercase text-slate-400 tracking-wider"${_scopeId}>Total Transaksi</span><h3 class="text-xl font-extrabold text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(__props.metrics.total_transactions)} Orders </h3></div><div class="h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0"${_scopeId}>`);
						_push(ssrRenderComponent(unref(ShoppingBag), { class: "h-5 w-5" }, null, _parent, _scopeId));
						_push(`</div></div><div class="text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Check), { class: "h-3.5 w-3.5 text-emerald-500" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Valid orders processed at terminal.</span></div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between"${_scopeId}><div class="flex items-start justify-between"${_scopeId}><div class="space-y-1"${_scopeId}><span class="text-[10px] font-bold uppercase text-slate-400 tracking-wider"${_scopeId}>Rata-Rata Transaksi</span><h3 class="text-xl font-extrabold text-slate-900 dark:text-slate-50"${_scopeId}> Rp ${ssrInterpolate(Number(__props.metrics.average_ticket).toLocaleString("id-ID"))}</h3></div><div class="h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0"${_scopeId}>`);
						_push(ssrRenderComponent(unref(ArrowUpRight), { class: "h-5 w-5" }, null, _parent, _scopeId));
						_push(`</div></div><div class="text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium"${_scopeId}><span${_scopeId}>Average spending per ticket.</span></div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between"${_scopeId}><div class="flex items-start justify-between"${_scopeId}><div class="space-y-1"${_scopeId}><span class="text-[10px] font-bold uppercase text-slate-400 tracking-wider"${_scopeId}>Peringatan Stok</span><h3 class="${ssrRenderClass([__props.metrics.low_stock_count > 0 ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-50", "text-xl font-extrabold"])}"${_scopeId}>${ssrInterpolate(__props.metrics.low_stock_count)} Items Low </h3></div><div class="${ssrRenderClass([__props.metrics.low_stock_count > 0 ? "bg-amber-50 dark:bg-amber-95/20 text-amber-600" : "bg-slate-100 dark:bg-slate-900 text-slate-450", "h-10 w-10 rounded-lg flex items-center justify-center flex-shrink-0"])}"${_scopeId}>`);
						_push(ssrRenderComponent(unref(AlertTriangle), { class: "h-5 w-5" }, null, _parent, _scopeId));
						_push(`</div></div><div class="text-[10px] mt-4 flex items-center gap-1 font-medium text-slate-450 dark:text-slate-400"${_scopeId}>`);
						if (__props.metrics.low_stock_count > 0) _push(`<span class="text-amber-600 dark:text-amber-400"${_scopeId}>Critical ingredients below threshold.</span>`);
						else _push(`<span${_scopeId}>Inventory stock levels healthy.</span>`);
						_push(`</div></div></div><div class="grid grid-cols-1 lg:grid-cols-12 gap-6"${_scopeId}><div class="lg:col-span-8 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm flex flex-col space-y-4"${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50 uppercase tracking-wider flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(TrendingUp), { class: "h-4.5 w-4.5 text-slate-500" }, null, _parent, _scopeId));
						_push(` Tren Penjualan (Omzet Harian) </h2><div class="flex-1 min-h-[250px] relative"${_scopeId}>`);
						if (__props.salesTrend.length === 0) _push(`<div class="absolute inset-0 flex items-center justify-center text-slate-400 text-xs italic"${_scopeId}> Tidak ada data penjualan untuk rentang waktu terpilih. </div>`);
						else {
							_push(`<div class="absolute inset-0"${_scopeId}>`);
							_push(ssrRenderComponent(unref(VueApexCharts), {
								type: "area",
								height: "100%",
								width: "100%",
								options: chartOptions.value,
								series: chartSeries.value
							}, null, _parent, _scopeId));
							_push(`</div>`);
						}
						_push(`</div></div><div class="lg:col-span-4 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm flex flex-col space-y-4"${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50 uppercase tracking-wider flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Award), { class: "h-4.5 w-4.5 text-slate-500" }, null, _parent, _scopeId));
						_push(` Menu Terlaris </h2>`);
						if (__props.topProducts.length === 0) _push(`<div class="flex-1 flex items-center justify-center text-slate-400 text-xs italic py-12"${_scopeId}> Belum ada pesanan yang tercatat. </div>`);
						else {
							_push(`<div class="space-y-4"${_scopeId}><!--[-->`);
							ssrRenderList(__props.topProducts, (tp, idx) => {
								_push(`<div class="space-y-1.5"${_scopeId}><div class="flex items-center justify-between text-xs"${_scopeId}><div class="flex items-center gap-2 min-w-0"${_scopeId}><span class="font-bold text-red-600 dark:text-red-400"${_scopeId}>#${ssrInterpolate(idx + 1)}</span><span class="font-semibold text-slate-900 dark:text-slate-100 truncate"${_scopeId}>${ssrInterpolate(tp.name)}</span></div><span class="font-mono text-slate-500 dark:text-slate-400"${_scopeId}>${ssrInterpolate(tp.qty)} Porsi</span></div><div class="w-full bg-slate-100 dark:bg-slate-900 rounded-full h-2 overflow-hidden"${_scopeId}><div class="bg-gradient-to-r from-red-600 to-orange-500 h-full rounded-full transition-all duration-300" style="${ssrRenderStyle({ width: tp.qty / maxQtySold.value * 100 + "%" })}"${_scopeId}></div></div><div class="text-[9px] text-slate-450 dark:text-slate-400 text-right font-medium"${_scopeId}> Omzet: Rp ${ssrInterpolate(Number(tp.sales).toLocaleString("id-ID"))}</div></div>`);
							});
							_push(`<!--]--></div>`);
						}
						_push(`</div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4"${_scopeId}><h2 class="text-sm font-bold text-rose-600 dark:text-rose-450 uppercase tracking-wider flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(AlertTriangle), { class: "h-4.5 w-4.5 text-rose-500" }, null, _parent, _scopeId));
						_push(` Peringatan Stok Bahan &amp; Produk Menipis </h2><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-semibold text-slate-500 dark:text-slate-400"${_scopeId}><th class="p-3"${_scopeId}>Item Name</th><th class="p-3"${_scopeId}>Stock Type</th><th class="p-3"${_scopeId}>Outlet Channel</th><th class="p-3"${_scopeId}>Current Balance</th><th class="p-3 text-right"${_scopeId}>Minimum Level Alert</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800"${_scopeId}>`);
						if (__props.lowStockAlerts.length === 0) _push(`<tr${_scopeId}><td colspan="5" class="p-4 text-center text-slate-400 italic"${_scopeId}> Semua stok bahan baku dan produk di seluruh outlet dalam kondisi aman. </td></tr>`);
						else _push(`<!---->`);
						_push(`<!--[-->`);
						ssrRenderList(__props.lowStockAlerts, (warn, idx) => {
							_push(`<tr class="hover:bg-rose-50/10 dark:hover:bg-rose-950/10 transition-colors text-slate-800 dark:text-slate-300"${_scopeId}><td class="p-3 font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2"${_scopeId}><span class="h-2 w-2 rounded-full bg-rose-600 animate-ping"${_scopeId}></span><span${_scopeId}>${ssrInterpolate(warn.name)}</span></td><td class="p-3 font-semibold"${_scopeId}><span class="${ssrRenderClass(["px-1.5 py-0.5 rounded text-[10px] font-bold uppercase", warn.type === "Ingredient" ? "bg-indigo-50 dark:bg-indigo-950/20 text-indigo-750 dark:text-indigo-400" : "bg-amber-50 dark:bg-amber-950/20 text-amber-700 dark:text-amber-400"])}"${_scopeId}>${ssrInterpolate(warn.type)}</span></td><td class="p-3 font-medium"${_scopeId}>${ssrInterpolate(warn.outlet_name)}</td><td class="p-3 font-bold text-rose-600 dark:text-rose-450"${_scopeId}>${ssrInterpolate(Number(warn.stock_qty).toLocaleString("id-ID"))} ${ssrInterpolate(warn.unit)}</td><td class="p-3 text-right font-mono text-slate-500 dark:text-slate-400"${_scopeId}>${ssrInterpolate(Number(warn.threshold_qty).toLocaleString("id-ID"))} ${ssrInterpolate(warn.unit)}</td></tr>`);
						});
						_push(`<!--]--></tbody></table></div></div></div>`);
					} else return [createVNode("div", { class: "space-y-6" }, [
						createVNode("div", { class: "flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50" }, "Reports & Analytics"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Consolidated revenue overview, sales trend graphs, best selling items, and stock warning reports. ")]), createVNode("div", { class: "flex flex-wrap items-center justify-end gap-3 w-full xl:w-auto" }, [createVNode("div", { class: "flex flex-wrap items-center gap-3 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-3 shadow-sm" }, [
							createVNode("div", { class: "flex items-center gap-1 text-slate-500 dark:text-slate-400 text-xs font-semibold uppercase pr-2 border-r border-slate-100 dark:border-slate-800" }, [createVNode(unref(Store), { class: "h-4 w-4" }), createVNode("span", null, "Filter")]),
							withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => outletFilter.value = $event,
								class: "px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"
							}, [createVNode("option", {
								value: "",
								class: "dark:bg-slate-950"
							}, "All Outlets"), (openBlock(true), createBlock(Fragment, null, renderList(__props.outlets, (ot) => {
								return openBlock(), createBlock("option", {
									key: ot.id,
									value: String(ot.id),
									class: "dark:bg-slate-950"
								}, toDisplayString(ot.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, outletFilter.value]]),
							createVNode("div", { class: "flex items-center gap-1.5" }, [
								withDirectives(createVNode("input", {
									"onUpdate:modelValue": ($event) => startDate.value = $event,
									type: "date",
									class: "px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, startDate.value]]),
								createVNode("span", { class: "text-xs text-slate-400" }, "to"),
								withDirectives(createVNode("input", {
									"onUpdate:modelValue": ($event) => endDate.value = $event,
									type: "date",
									class: "px-2.5 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-white dark:bg-slate-950 text-xs font-medium focus:outline-none text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, endDate.value]])
							])
						]), createVNode("a", {
							href: _ctx.route("reports.print", {
								outlet_id: outletFilter.value,
								start_date: startDate.value,
								end_date: endDate.value
							}),
							target: "_blank",
							class: "px-3.5 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-xl text-xs font-bold cursor-pointer transition-all duration-200 flex items-center gap-2 shadow-sm hover:shadow-md hover:-translate-y-0.5 flex-shrink-0"
						}, [createVNode(unref(Printer), { class: "h-4 w-4" }), createVNode("span", null, "Cetak Laporan")], 8, ["href"])])]),
						createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5" }, [
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between" }, [createVNode("div", { class: "flex items-start justify-between" }, [createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-[10px] font-bold uppercase text-slate-400 tracking-wider" }, "Total Omzet"), createVNode("h3", { class: "text-xl font-extrabold text-slate-900 dark:text-slate-50" }, " Rp " + toDisplayString(Number(__props.metrics.total_revenue).toLocaleString("id-ID")), 1)]), createVNode("div", { class: "h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0" }, [createVNode(unref(DollarSign), { class: "h-5 w-5" })])]), createVNode("div", { class: "text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium" }, [createVNode(unref(TrendingUp), { class: "h-3.5 w-3.5 text-emerald-500" }), createVNode("span", null, "Sales revenue consolidated successfully.")])]),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between" }, [createVNode("div", { class: "flex items-start justify-between" }, [createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-[10px] font-bold uppercase text-slate-400 tracking-wider" }, "Total Transaksi"), createVNode("h3", { class: "text-xl font-extrabold text-slate-900 dark:text-slate-50" }, toDisplayString(__props.metrics.total_transactions) + " Orders ", 1)]), createVNode("div", { class: "h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0" }, [createVNode(unref(ShoppingBag), { class: "h-5 w-5" })])]), createVNode("div", { class: "text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium" }, [createVNode(unref(Check), { class: "h-3.5 w-3.5 text-emerald-500" }), createVNode("span", null, "Valid orders processed at terminal.")])]),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between" }, [createVNode("div", { class: "flex items-start justify-between" }, [createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-[10px] font-bold uppercase text-slate-400 tracking-wider" }, "Rata-Rata Transaksi"), createVNode("h3", { class: "text-xl font-extrabold text-slate-900 dark:text-slate-50" }, " Rp " + toDisplayString(Number(__props.metrics.average_ticket).toLocaleString("id-ID")), 1)]), createVNode("div", { class: "h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 flex items-center justify-center flex-shrink-0" }, [createVNode(unref(ArrowUpRight), { class: "h-5 w-5" })])]), createVNode("div", { class: "text-[10px] text-slate-450 dark:text-slate-400 mt-4 flex items-center gap-1 font-medium" }, [createVNode("span", null, "Average spending per ticket.")])]),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-5 shadow-sm relative overflow-hidden flex flex-col justify-between" }, [createVNode("div", { class: "flex items-start justify-between" }, [createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-[10px] font-bold uppercase text-slate-400 tracking-wider" }, "Peringatan Stok"), createVNode("h3", { class: ["text-xl font-extrabold", __props.metrics.low_stock_count > 0 ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-50"] }, toDisplayString(__props.metrics.low_stock_count) + " Items Low ", 3)]), createVNode("div", { class: ["h-10 w-10 rounded-lg flex items-center justify-center flex-shrink-0", __props.metrics.low_stock_count > 0 ? "bg-amber-50 dark:bg-amber-95/20 text-amber-600" : "bg-slate-100 dark:bg-slate-900 text-slate-450"] }, [createVNode(unref(AlertTriangle), { class: "h-5 w-5" })], 2)]), createVNode("div", { class: "text-[10px] mt-4 flex items-center gap-1 font-medium text-slate-450 dark:text-slate-400" }, [__props.metrics.low_stock_count > 0 ? (openBlock(), createBlock("span", {
								key: 0,
								class: "text-amber-600 dark:text-amber-400"
							}, "Critical ingredients below threshold.")) : (openBlock(), createBlock("span", { key: 1 }, "Inventory stock levels healthy."))])])
						]),
						createVNode("div", { class: "grid grid-cols-1 lg:grid-cols-12 gap-6" }, [createVNode("div", { class: "lg:col-span-8 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm flex flex-col space-y-4" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50 uppercase tracking-wider flex items-center gap-2" }, [createVNode(unref(TrendingUp), { class: "h-4.5 w-4.5 text-slate-500" }), createTextVNode(" Tren Penjualan (Omzet Harian) ")]), createVNode("div", { class: "flex-1 min-h-[250px] relative" }, [__props.salesTrend.length === 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "absolute inset-0 flex items-center justify-center text-slate-400 text-xs italic"
						}, " Tidak ada data penjualan untuk rentang waktu terpilih. ")) : (openBlock(), createBlock("div", {
							key: 1,
							class: "absolute inset-0"
						}, [createVNode(unref(VueApexCharts), {
							type: "area",
							height: "100%",
							width: "100%",
							options: chartOptions.value,
							series: chartSeries.value
						}, null, 8, ["options", "series"])]))])]), createVNode("div", { class: "lg:col-span-4 bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm flex flex-col space-y-4" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50 uppercase tracking-wider flex items-center gap-2" }, [createVNode(unref(Award), { class: "h-4.5 w-4.5 text-slate-500" }), createTextVNode(" Menu Terlaris ")]), __props.topProducts.length === 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "flex-1 flex items-center justify-center text-slate-400 text-xs italic py-12"
						}, " Belum ada pesanan yang tercatat. ")) : (openBlock(), createBlock("div", {
							key: 1,
							class: "space-y-4"
						}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.topProducts, (tp, idx) => {
							return openBlock(), createBlock("div", {
								key: idx,
								class: "space-y-1.5"
							}, [
								createVNode("div", { class: "flex items-center justify-between text-xs" }, [createVNode("div", { class: "flex items-center gap-2 min-w-0" }, [createVNode("span", { class: "font-bold text-red-600 dark:text-red-400" }, "#" + toDisplayString(idx + 1), 1), createVNode("span", { class: "font-semibold text-slate-900 dark:text-slate-100 truncate" }, toDisplayString(tp.name), 1)]), createVNode("span", { class: "font-mono text-slate-500 dark:text-slate-400" }, toDisplayString(tp.qty) + " Porsi", 1)]),
								createVNode("div", { class: "w-full bg-slate-100 dark:bg-slate-900 rounded-full h-2 overflow-hidden" }, [createVNode("div", {
									class: "bg-gradient-to-r from-red-600 to-orange-500 h-full rounded-full transition-all duration-300",
									style: { width: tp.qty / maxQtySold.value * 100 + "%" }
								}, null, 4)]),
								createVNode("div", { class: "text-[9px] text-slate-450 dark:text-slate-400 text-right font-medium" }, " Omzet: Rp " + toDisplayString(Number(tp.sales).toLocaleString("id-ID")), 1)
							]);
						}), 128))]))])]),
						createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4" }, [createVNode("h2", { class: "text-sm font-bold text-rose-600 dark:text-rose-450 uppercase tracking-wider flex items-center gap-2" }, [createVNode(unref(AlertTriangle), { class: "h-4.5 w-4.5 text-rose-500" }), createTextVNode(" Peringatan Stok Bahan & Produk Menipis ")]), 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-semibold text-slate-500 dark:text-slate-400" }, [
							createVNode("th", { class: "p-3" }, "Item Name"),
							createVNode("th", { class: "p-3" }, "Stock Type"),
							createVNode("th", { class: "p-3" }, "Outlet Channel"),
							createVNode("th", { class: "p-3" }, "Current Balance"),
							createVNode("th", { class: "p-3 text-right" }, "Minimum Level Alert")
						])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800" }, [__props.lowStockAlerts.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
							colspan: "5",
							class: "p-4 text-center text-slate-400 italic"
						}, " Semua stok bahan baku dan produk di seluruh outlet dalam kondisi aman. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.lowStockAlerts, (warn, idx) => {
							return openBlock(), createBlock("tr", {
								key: idx,
								class: "hover:bg-rose-50/10 dark:hover:bg-rose-950/10 transition-colors text-slate-800 dark:text-slate-300"
							}, [
								createVNode("td", { class: "p-3 font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2" }, [createVNode("span", { class: "h-2 w-2 rounded-full bg-rose-600 animate-ping" }), createVNode("span", null, toDisplayString(warn.name), 1)]),
								createVNode("td", { class: "p-3 font-semibold" }, [createVNode("span", { class: ["px-1.5 py-0.5 rounded text-[10px] font-bold uppercase", warn.type === "Ingredient" ? "bg-indigo-50 dark:bg-indigo-950/20 text-indigo-750 dark:text-indigo-400" : "bg-amber-50 dark:bg-amber-950/20 text-amber-700 dark:text-amber-400"] }, toDisplayString(warn.type), 3)]),
								createVNode("td", { class: "p-3 font-medium" }, toDisplayString(warn.outlet_name), 1),
								createVNode("td", { class: "p-3 font-bold text-rose-600 dark:text-rose-450" }, toDisplayString(Number(warn.stock_qty).toLocaleString("id-ID")) + " " + toDisplayString(warn.unit), 1),
								createVNode("td", { class: "p-3 text-right font-mono text-slate-500 dark:text-slate-400" }, toDisplayString(Number(warn.threshold_qty).toLocaleString("id-ID")) + " " + toDisplayString(warn.unit), 1)
							]);
						}), 128))])])])])
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Reports/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/Reports/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 };
