import{Kt as e,Q as t,Qt as n,R as r,Tn as i,Y as a,Z as o,at as s,c,fr as l,i as u,it as d,or as f,r as p,st as m}from"./dist-CoD0k1Bd.js";import{t as h}from"./createLucideIcon-D0h14Jw-.js";import{t as g}from"./search-B4f4vYLn.js";import{t as _}from"./Input-C3DwKNOf.js";import{t as v}from"./button-mN_poAXs.js";import{t as y}from"./routes-BZ4t1sNs.js";import{t as b}from"./Heading-CCd5Tysh.js";import{t as x}from"./badge-n_RZ0blh.js";import{t as S}from"./Pagination-BRYVDO_a.js";var C=h(`arrow-big-left`,[[`path`,{d:`M10.793 19.793a.707.707 0 0 0 1.207-.5V16a1 1 0 0 1 1-1h6a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-6a1 1 0 0 1-1-1V4.707a.707.707 0 0 0-1.207-.5l-6.94 6.94a1.207 1.207 0 0 0 0 1.707z`,key:`qbhtmx`}]]),w={class:`flex flex-col space-y-6`},T={class:`flex items-center justify-between gap-4`},E={class:`w-full max-w-sm`},D={method:`GET`,action:`/campaigns/drafts`},O={class:`relative`},k={class:`overflow-hidden rounded-xl border`},A={class:`w-full text-sm`},j={class:`bg-muted/50 text-left text-xs uppercase text-muted-foreground`},M={key:0,class:`px-4 py-3 font-medium`},N={class:`divide-y`},P={class:`px-4 py-3 text-right tabular-nums text-muted-foreground`},F={class:`px-4 py-3 font-medium`},I={class:`text-xs text-muted-foreground`},L={key:0,class:`px-4 py-3 text-muted-foreground`},R={class:`px-4 py-3 text-right tabular-nums`},z={class:`px-4 py-3 text-muted-foreground`},B={class:`tabular-nums`},V={class:`text-xs tabular-nums`},H={class:`px-4 py-3 text-center`},U={class:`px-4 py-3 text-right`},W={class:`flex flex-wrap justify-end gap-1`},G={key:0},K=[`colspan`],q=m({layout:{breadcrumbs:[{title:`Dashboard`,href:y()},{title:`Campaign`,href:`/campaigns`},{title:`Draft`,href:`/campaigns/drafts`}]},__name:`Drafts`,props:{campaigns:{},filters:{}},setup(m){let h=m,y=c().props.auth.user?.is_admin??!1;return(c,m)=>(e(),t(r,null,[s(f(p),{title:`Draft Campaign`}),a(`div`,w,[a(`div`,T,[s(b,{title:`Draft Campaign`,description:`Campaign tersimpan — bisa diaktifkan kembali`}),s(f(v),{"as-child":``},{default:i(()=>[s(f(u),{href:`/campaigns`},{default:i(()=>[s(f(C),{class:`size-4`}),m[0]||=d(` Kembali `,-1)]),_:1})]),_:1})]),a(`div`,E,[a(`form`,D,[a(`div`,O,[s(f(g),{class:`absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),s(f(_),{name:`search`,"default-value":h.filters.search??``,placeholder:`Cari judul campaign…`,class:`pl-9`},null,8,[`default-value`])])])]),a(`div`,k,[a(`table`,A,[a(`thead`,j,[a(`tr`,null,[m[1]||=a(`th`,{class:`px-4 py-3 font-medium text-right`},`ID`,-1),m[2]||=a(`th`,{class:`px-4 py-3 font-medium`},`Judul`,-1),f(y)?(e(),t(`th`,M,`Kategori`)):o(``,!0),m[3]||=a(`th`,{class:`px-4 py-3 font-medium text-right`},`Budget Harian`,-1),m[4]||=a(`th`,{class:`px-4 py-3 font-medium`},`Dibuat`,-1),m[5]||=a(`th`,{class:`px-4 py-3 font-medium text-center`},`Status`,-1),m[6]||=a(`th`,{class:`px-4 py-3 font-medium text-right`},`Aksi`,-1)])]),a(`tbody`,N,[(e(!0),t(r,null,n(h.campaigns.data,n=>(e(),t(`tr`,{key:n.id,class:`hover:bg-muted/30`},[a(`td`,P,l(n.id),1),a(`td`,F,[d(l(n.judul)+` `,1),a(`div`,I,l(n.user?.name),1)]),f(y)?(e(),t(`td`,L,l(n.kategoris?.map(e=>e.nama_kategori).join(`, `)||`—`),1)):o(``,!0),a(`td`,R,`Rp `+l((n.budget_harian??0).toLocaleString(`id-ID`)),1),a(`td`,z,[a(`div`,B,l(new Date(n.created_at).toLocaleDateString(`id-ID`,{day:`2-digit`,month:`short`,year:`numeric`})),1),a(`div`,V,l(new Date(n.created_at).toLocaleTimeString(`id-ID`,{hour:`2-digit`,minute:`2-digit`})),1)]),a(`td`,H,[s(f(x),{variant:`outline`},{default:i(()=>[...m[7]||=[d(`Draft`,-1)]]),_:1})]),a(`td`,U,[a(`div`,W,[s(f(v),{"as-child":``,size:`sm`},{default:i(()=>[s(f(u),{href:`/campaigns/${n.id}/restore`},{default:i(()=>[...m[8]||=[d(`Aktifkan`,-1)]]),_:1},8,[`href`])]),_:2},1024),s(f(v),{"as-child":``,variant:`ghost`,size:`sm`},{default:i(()=>[s(f(u),{href:`/campaigns/${n.id}/edit`},{default:i(()=>[...m[9]||=[d(`Edit`,-1)]]),_:1},8,[`href`])]),_:2},1024),s(f(v),{"as-child":``,variant:`destructive`,size:`sm`},{default:i(()=>[s(f(u),{href:`/campaigns/${n.id}`,method:`delete`,as:`delete`},{default:i(()=>[...m[10]||=[d(`Hapus`,-1)]]),_:1},8,[`href`])]),_:2},1024)])])]))),128)),h.campaigns.data.length===0?(e(),t(`tr`,G,[a(`td`,{colspan:f(y)?7:6,class:`px-4 py-8 text-center text-muted-foreground`},`Belum ada draft.`,8,K)])):o(``,!0)])])]),s(S,{links:h.campaigns.links,from:h.campaigns.from,to:h.campaigns.to,total:h.campaigns.total},null,8,[`links`,`from`,`to`,`total`])])],64))}});export{q as default};