import{Kt as e,Q as t,Qt as n,R as r,Tn as i,X as a,Y as o,Z as s,at as 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"./arrow-left-GfHRP_1N.js";import{t as g}from"./external-link-B6J7_Ipw.js";import{t as _}from"./button-mN_poAXs.js";import{t as v}from"./routes-BZ4t1sNs.js";import{t as y}from"./Heading-CCd5Tysh.js";import{t as b}from"./badge-n_RZ0blh.js";var x={class:`flex flex-col space-y-6`},S={class:`mt-2 flex items-center gap-2`},C={class:`text-sm text-muted-foreground`},w={class:`grid grid-cols-1 gap-4 sm:grid-cols-3`},T={class:`rounded-xl border p-4`},E={class:`mt-1 text-2xl font-bold tabular-nums`},D={class:`rounded-xl border p-4`},O={class:`mt-1 text-2xl font-bold tabular-nums`},k={class:`rounded-xl border p-4`},A={class:`mt-1 text-2xl font-bold tabular-nums`},j={class:`overflow-hidden rounded-xl border`},M={class:`w-full text-sm`},N={class:`divide-y`},P={class:`px-4 py-3 tabular-nums`},F={class:`px-4 py-3 font-medium`},I={class:`px-4 py-3`},L=[`href`],R={class:`truncate`},z={class:`px-4 py-3 text-muted-foreground`},B={class:`px-4 py-3 text-center`},V={class:`px-4 py-3 text-right tabular-nums`},H={class:`px-4 py-3 text-right tabular-nums`},U={class:`px-4 py-3 text-right font-semibold tabular-nums`},W={class:`px-4 py-3 text-right tabular-nums`},G={class:`px-4 py-3 text-right tabular-nums`},K={key:0},q=m({layout:{breadcrumbs:[{title:`Dashboard`,href:v()},{title:`Kategori Landing`,href:`/kategoris`},{title:`Report`,href:`/kategoris`}]},__name:`Report`,props:{kategori:{},ads:{},totals:{}},setup(m){let v=m;return(m,q)=>(e(),t(r,null,[c(f(p),{title:`Report — ${v.kategori.nama_kategori}`},null,8,[`title`]),o(`div`,x,[o(`div`,null,[c(f(_),{"as-child":``,variant:`ghost`,size:`sm`,class:`mb-2`},{default:i(()=>[c(f(u),{href:`/kategoris`},{default:i(()=>[c(f(h),{class:`size-4`}),q[0]||=d(` Kembali`,-1)]),_:1})]),_:1}),c(y,{title:`Report: ${v.kategori.nama_kategori}`,description:`Statistik klik per campaign pada kategori ini`},null,8,[`title`]),o(`div`,S,[c(f(b),{variant:v.kategori.jenis===`Redirect`?`outline`:`secondary`},{default:i(()=>[d(l(v.kategori.jenis),1)]),_:1},8,[`variant`]),o(`span`,C,` Dilihat `+l(v.kategori.viewed.toLocaleString(`id-ID`))+`x `,1)])]),o(`div`,w,[o(`div`,T,[q[1]||=o(`div`,{class:`text-xs text-muted-foreground uppercase`},`Klik Hari Ini`,-1),o(`div`,E,l(v.totals.klik_hari_ini.toLocaleString(`id-ID`)),1)]),o(`div`,D,[q[2]||=o(`div`,{class:`text-xs text-muted-foreground uppercase`},`Klik 7 Hari`,-1),o(`div`,O,l(v.totals.klik_7_hari.toLocaleString(`id-ID`)),1)]),o(`div`,k,[q[3]||=o(`div`,{class:`text-xs text-muted-foreground uppercase`},`Total Klik`,-1),o(`div`,A,l(v.totals.klik_total.toLocaleString(`id-ID`)),1)])]),o(`div`,j,[o(`table`,M,[q[6]||=o(`thead`,{class:`bg-muted/50 text-left text-xs uppercase text-muted-foreground`},[o(`tr`,null,[o(`th`,{class:`px-4 py-3 font-medium`},`No`),o(`th`,{class:`px-4 py-3 font-medium`},`Iklan`),o(`th`,{class:`px-4 py-3 font-medium`},`URL`),o(`th`,{class:`px-4 py-3 font-medium`},`Pemilik`),o(`th`,{class:`px-4 py-3 font-medium text-center`},`Status`),o(`th`,{class:`px-4 py-3 font-medium text-right`},`Klik Hari Ini`),o(`th`,{class:`px-4 py-3 font-medium text-right`},`Klik 7 Hari`),o(`th`,{class:`px-4 py-3 font-medium text-right`},`Total Klik`),o(`th`,{class:`px-4 py-3 font-medium text-right`},`Tayang Hari Ini`),o(`th`,{class:`px-4 py-3 font-medium text-right`},`Total Tayang`)])],-1),o(`tbody`,N,[(e(!0),t(r,null,n(v.ads,n=>(e(),t(`tr`,{key:n.id,class:`hover:bg-muted/30`},[o(`td`,P,l(n.no),1),o(`td`,F,l(n.judul),1),o(`td`,I,[o(`a`,{href:n.url,target:`_blank`,class:`inline-flex max-w-56 items-center gap-1 truncate font-mono text-xs text-primary hover:underline`},[o(`span`,R,l(n.url),1),c(f(g),{class:`size-3 shrink-0`})],8,L)]),o(`td`,z,l(n.user??`—`),1),o(`td`,B,[n.is_paused?(e(),a(f(b),{key:0,variant:`secondary`},{default:i(()=>[...q[4]||=[d(`Dijeda`,-1)]]),_:1})):(e(),a(f(b),{key:1,variant:`outline`},{default:i(()=>[d(l(n.status),1)]),_:2},1024))]),o(`td`,V,l(n.klik_hari_ini.toLocaleString(`id-ID`)),1),o(`td`,H,l(n.klik_7_hari.toLocaleString(`id-ID`)),1),o(`td`,U,l(n.klik_total.toLocaleString(`id-ID`)),1),o(`td`,W,l(n.muncul_hari_ini.toLocaleString(`id-ID`)),1),o(`td`,G,l(n.muncul_total.toLocaleString(`id-ID`)),1)]))),128)),v.ads.length===0?(e(),t(`tr`,K,[...q[5]||=[o(`td`,{colspan:`10`,class:`px-4 py-8 text-center text-muted-foreground`},` Belum ada campaign pada kategori ini. `,-1)]])):s(``,!0)])])])])],64))}});export{q as default};