import{q as d,j as e,$ as m}from"./app-CffHYkHW.js";import{A as x}from"./app-layout-D-VS7nVU.js";import{a as h,b as u,c as j,d as n,e as a,f as g,h as t}from"./table-DVZTgtP_.js";import{C as b,a as N,b as f,c as _,d as v}from"./card-X_CDEGIm.js";import"./utils-C8zp8JNC.js";import"./button-qhe8lrPU.js";import"./sheet-Bisw0FSz.js";import"./index-C0loMkA3.js";import"./index-Cy5bElus.js";import"./index-DPkgfxsD.js";import"./x-BfabuQJD.js";import"./createLucideIcon-DAR-hy5d.js";import"./index-C9NeyPdJ.js";import"./index-CjqRk3xD.js";import"./truck-DnoS8QCL.js";import"./package-BHw0cifz.js";import"./shopping-bag-AryJS2XX.js";import"./app-logo-icon-D3Jzt_fn.js";import"./bluetooth-context-CLrE8g1i.js";import"./index-Dw4sHwMN.js";import"./sonner-CPUj7IiR.js";import"./select-ClrGyhQo.js";import"./chevron-down-C5A3yn87.js";import"./input-Bw4IOOzt.js";const k=[{title:"Diskon Paket",href:route("apps.discount-packages.index")},{title:"Detail Diskon Paket",href:"#"}];function Q(){const{discountPackage:i}=d().props,l=s=>{if(s==="App\\Models\\Menu")return"menu";if(s==="App\\Models\\ProductVariant")return"product"},o=s=>{var r;return(r=s==null?void 0:s.items)!=null&&r.product_variant_values?s.items.product_variant_values.map(p=>{var c;return(c=p.variant_value)==null?void 0:c.name}).filter(Boolean).join(" "):""};return e.jsxs(x,{breadcrumbs:k,children:[e.jsx(m,{title:"Detail Diskon Paket"}),e.jsx("div",{className:"p-4",children:e.jsxs(b,{children:[e.jsxs(N,{children:[e.jsx(f,{children:i.name}),e.jsxs(_,{children:[e.jsx("sup",{children:"Rp"})," ",i.total_price.toLocaleString()]})]}),e.jsx(v,{children:e.jsx(h,{children:e.jsxs(u,{children:[e.jsx(j,{children:e.jsxs(n,{className:"bg-muted/50 divide-muted/50",children:[e.jsx(a,{className:"w-[50px] text-center",children:"No"}),e.jsx(a,{children:"Nama Produk"}),e.jsx(a,{className:"text-center",children:"Harga Modal"}),e.jsx(a,{className:"text-center",children:"Harga Jual"}),e.jsx(a,{className:"text-start",children:"Harga Estimasi"})]})}),e.jsxs(g,{children:[i.discount_package_items.map((s,r)=>e.jsxs(n,{className:"hover:bg-transparent",children:[e.jsx(t,{className:"text-center",children:r+1}),e.jsx(t,{children:l(s.items_type)==="menu"?s.items.name:`${s.items.product.name} ${o(s)}`}),e.jsxs(t,{className:"text-right",children:[e.jsx("sup",{children:"Rp"})," ",s.items.capital_price.toLocaleString()]}),e.jsxs(t,{className:"text-right",children:[e.jsx("sup",{children:"Rp"})," ",l(s.items_type)==="menu"?s.items.selling_price.toLocaleString():s.items.price.toLocaleString()]}),e.jsxs(t,{className:"text-right",children:[e.jsx("sup",{children:"Rp"})," ",s.estimate_price.toLocaleString()]})]},r)),e.jsxs(n,{className:"bg-muted/50 divide-muted/50",children:[e.jsx(t,{colSpan:4,className:"text-right font-bold",children:"Grand Total"}),e.jsxs(t,{className:"text-right font-bold",children:[e.jsx("sup",{children:"Rp"})," ",i.total_price.toLocaleString()]})]})]})]})})})]})})]})}export{Q as default};
