import { Head } from "@inertiajs/vue3";
import { computed, defineComponent, onMounted, unref, useSSRContext } from "vue";
import { ssrInterpolate, ssrRenderComponent, ssrRenderList, ssrRenderStyle } from "vue/server-renderer";
import { Printer } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Transactions/KitchenPrint.vue?vue&type=script&setup=true&lang.ts
var KitchenPrint_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "KitchenPrint",
	__ssrInlineRender: true,
	props: {
		transaction: {},
		appName: {}
	},
	setup(__props) {
		const urlParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");
		const isRaw = computed(() => urlParams.get("raw") === "true");
		onMounted(() => {
			if (!isRaw.value) window.print();
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Cetak Tiket Dapur" }, null, _parent));
			if (isRaw.value) {
				_push(`<div class="w-[58mm] text-black font-mono leading-tight p-0 m-0 bg-white" style="${ssrRenderStyle({
					"zoom": "0.8",
					"transform-origin": "top left",
					"max-width": "58mm"
				})}"><div class="text-center space-y-1 pb-2.5 border-b border-dashed border-black text-black"><h1 class="text-[13px] font-black uppercase tracking-wider">TIKET DAPUR</h1><div class="text-[10.5px] font-black"> Outlet: <span>${ssrInterpolate(__props.transaction.outlet?.name)}</span></div><div class="text-[10.5px] font-black"> Waktu: ${ssrInterpolate(__props.transaction.created_at)}</div></div><div class="py-2.5 border-b border-dashed border-black text-center text-black"><div class="text-[11px] font-black uppercase tracking-wide">${ssrInterpolate(__props.transaction.order_type === "dine_in" ? "*** DINE IN ***" : __props.transaction.order_type === "delivery" ? "*** DELIVERY ***" : "*** TAKE AWAY ***")}</div>`);
				if (__props.transaction.order_type === "dine_in" && __props.transaction.table) _push(`<div class="mt-1.5 text-[16px] font-black tracking-wider"> MEJA: ${ssrInterpolate(__props.transaction.table.number)}</div>`);
				else _push(`<!---->`);
				if (__props.transaction.queue_number) _push(`<div class="mt-1 text-[16px] font-black tracking-wider"> ANTREAN: #${ssrInterpolate(__props.transaction.queue_number)}</div>`);
				else _push(`<!---->`);
				_push(`<div class="text-[9px] font-black pt-1.5 truncate"> ID: ${ssrInterpolate(__props.transaction.transaction_number)}</div></div><div class="py-2 divide-y divide-dotted divide-black text-black"><!--[-->`);
				ssrRenderList(__props.transaction.items, (item) => {
					_push(`<div class="py-2"><div class="flex items-start gap-2.5"><span class="text-[13px] font-black px-1.5 py-0.5 border-2 border-black rounded min-w-[28px] text-center text-black bg-transparent">${ssrInterpolate(item.qty)}</span><div class="flex-1"><span class="text-[11px] font-black uppercase tracking-wide">${ssrInterpolate(item.product?.name || "Unknown Item")}</span>`);
					if (item.variant) _push(`<span class="block text-[9px] font-extrabold uppercase mt-0.5"> [ VARIAN: ${ssrInterpolate(item.variant)} ] </span>`);
					else _push(`<!---->`);
					if (item.modifiers.length > 0) {
						_push(`<div class="mt-1 pl-1.5 border-l border-black space-y-0.5"><!--[-->`);
						ssrRenderList(item.modifiers, (m) => {
							_push(`<div class="text-[9px] font-black uppercase flex items-center gap-1"><span>*</span><span>${ssrInterpolate(m.name)}</span></div>`);
						});
						_push(`<!--]--></div>`);
					} else _push(`<!---->`);
					_push(`</div></div></div>`);
				});
				_push(`<!--]--></div><div class="pt-2.5 border-t border-dashed border-black text-center text-black"><p class="text-[9px] font-black uppercase tracking-wider">*** DAPUR CAFE POS ***</p><p class="text-[8.5px] mt-0.5 font-bold">Harap segera diproses &amp; disajikan.</p></div></div>`);
			} else {
				_push(`<div class="min-h-screen bg-slate-100 dark:bg-slate-900 py-8 px-4 flex flex-col items-center print:items-start print:p-0 print:bg-white"><div class="no-print mb-6 w-full max-w-[58mm] flex items-center justify-between gap-4 bg-white dark:bg-slate-950 p-3.5 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm"><span class="text-xs font-bold text-slate-500">Tiket Dapur</span><button class="flex items-center justify-center gap-1.5 px-3 py-1.5 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-xs font-bold rounded-lg cursor-pointer">`);
				_push(ssrRenderComponent(unref(Printer), { class: "h-3.5 w-3.5" }, null, _parent));
				_push(` Cetak Ulang </button></div><div class="print-container bg-white text-black p-4 w-[58mm] border border-slate-250 shadow-md font-mono leading-tight print:p-0 print:m-0"><div class="text-center space-y-1 pb-2.5 border-b border-dashed border-black text-black"><h1 class="text-[13px] font-black uppercase tracking-wider">TIKET DAPUR</h1><div class="text-[10.5px] font-black"> Outlet: <span>${ssrInterpolate(__props.transaction.outlet?.name)}</span></div><div class="text-[10.5px] font-black"> Waktu: ${ssrInterpolate(__props.transaction.created_at)}</div></div><div class="py-2.5 border-b border-dashed border-black text-center text-black"><div class="text-[11px] font-black uppercase tracking-wide">${ssrInterpolate(__props.transaction.order_type === "dine_in" ? "*** DINE IN ***" : __props.transaction.order_type === "delivery" ? "*** DELIVERY ***" : "*** TAKE AWAY ***")}</div>`);
				if (__props.transaction.order_type === "dine_in" && __props.transaction.table) _push(`<div class="mt-1.5 text-[16px] font-black tracking-wider"> MEJA: ${ssrInterpolate(__props.transaction.table.number)}</div>`);
				else _push(`<!---->`);
				if (__props.transaction.queue_number) _push(`<div class="mt-1 text-[16px] font-black tracking-wider"> ANTREAN: #${ssrInterpolate(__props.transaction.queue_number)}</div>`);
				else _push(`<!---->`);
				_push(`<div class="text-[9px] font-black pt-1.5 truncate"> ID: ${ssrInterpolate(__props.transaction.transaction_number)}</div></div><div class="py-2 divide-y divide-dotted divide-black text-black"><!--[-->`);
				ssrRenderList(__props.transaction.items, (item) => {
					_push(`<div class="py-2"><div class="flex items-start gap-2.5"><span class="text-[13px] font-black px-1.5 py-0.5 border-2 border-black rounded min-w-[28px] text-center text-black bg-transparent">${ssrInterpolate(item.qty)}</span><div class="flex-1"><span class="text-[11px] font-black uppercase tracking-wide">${ssrInterpolate(item.product?.name || "Unknown Item")}</span>`);
					if (item.variant) _push(`<span class="block text-[9px] font-extrabold uppercase mt-0.5"> [ VARIAN: ${ssrInterpolate(item.variant)} ] </span>`);
					else _push(`<!---->`);
					if (item.modifiers.length > 0) {
						_push(`<div class="mt-1 pl-1.5 border-l border-black space-y-0.5"><!--[-->`);
						ssrRenderList(item.modifiers, (m) => {
							_push(`<div class="text-[9px] font-black uppercase flex items-center gap-1"><span>*</span><span>${ssrInterpolate(m.name)}</span></div>`);
						});
						_push(`<!--]--></div>`);
					} else _push(`<!---->`);
					_push(`</div></div></div>`);
				});
				_push(`<!--]--></div><div class="pt-2.5 border-t border-dashed border-black text-center text-black"><p class="text-[9px] font-black uppercase tracking-wider">*** DAPUR CAFE POS ***</p><p class="text-[8.5px] mt-0.5 font-bold">Harap segera diproses &amp; disajikan.</p></div></div></div>`);
			}
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Transactions/KitchenPrint.vue
var _sfc_setup = KitchenPrint_vue_vue_type_script_setup_true_lang_default.setup;
KitchenPrint_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/Transactions/KitchenPrint.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var KitchenPrint_default = KitchenPrint_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { KitchenPrint_default as default };
