import{_,a as m}from"./CRjpF7qy.js";import{_ as b}from"./Co_Pqrtl.js";import{_ as u,a as f}from"./DfqdNhl2.js";import{_ as $,a as C}from"./BSaEE8c4.js";import{_ as D}from"./DdeO54y7.js";import{h as N,e as j,f as A,c,o as r,I,g as e,t as a,a as o,b as s,w as t,d,J as v,K as w}from"./BzhixHsn.js";import{u as S}from"./G5O1m7ek.js";import{U as V}from"./B7rqDUE4.js";import{M as B}from"./BeItb1S1.js";import{Z as F}from"./D0pu0OPX.js";import"./BmLyE0U0.js";import"./CMS48I6h.js";const L={class:"flex flex-1 flex-col gap-4 p-4"},M={key:0,class:"flex h-96 items-center justify-center"},Z={key:1,class:"space-y-4"},q={class:"grid gap-4 md:grid-cols-2 lg:grid-cols-3"},E={class:"rounded-full bg-blue-100/50 p-2 dark:bg-blue-900/20"},J={class:"text-2xl font-bold"},K={class:"rounded-full bg-green-100/50 p-2 dark:bg-green-900/20"},P={class:"text-2xl font-bold"},T={class:"rounded-full bg-amber-100/50 p-2 dark:bg-amber-900/20"},z={class:"text-2xl font-bold"},G={class:"grid gap-4 md:grid-cols-2 lg:grid-cols-7"},H={class:"space-y-8"},O={class:"ml-4 space-y-1"},Q={class:"text-sm leading-none font-medium"},R={class:"text-muted-foreground text-sm"},W={class:"text-muted-foreground ml-auto text-xs font-medium"},X={class:"space-y-8"},Y={class:"bg-muted flex h-9 w-9 items-center justify-center rounded-full"},ee={class:"ml-4 space-y-1"},se={class:"text-sm leading-none font-medium"},te={class:"text-muted-foreground text-sm"},xe=N({__name:"index",async setup(ae){let p,h;const{t:n}=j(),{data:i,status:y}=([p,h]=A(()=>S("/api/v1/admin/dashboard/stats")),p=await p,h(),p),x=g=>new Intl.NumberFormat("en-US").format(g),k=g=>new Date(g).toLocaleDateString();return(g,oe)=>(r(),c("div",L,[e(y)==="pending"?(r(),c("div",M,a(e(n)("common.loading")),1)):e(i)?(r(),c("div",Z,[o("div",q,[s(e(m),null,{default:t(()=>[s(e(u),{class:"flex flex-row items-center justify-between space-y-0 pb-2"},{default:t(()=>[s(e(f),{class:"text-sm font-medium"},{default:t(()=>[d(a(e(n)("admin.pages.dashboard.totalUsers")),1)]),_:1}),o("div",E,[s(e(V),{class:"h-4 w-4 text-blue-600 dark:text-blue-400"})])]),_:1}),s(e(_),null,{default:t(()=>[o("div",J,a(x(e(i).overview.total_users)),1)]),_:1})]),_:1}),s(e(m),null,{default:t(()=>[s(e(u),{class:"flex flex-row items-center justify-between space-y-0 pb-2"},{default:t(()=>[s(e(f),{class:"text-sm font-medium"},{default:t(()=>[d(a(e(n)("admin.pages.dashboard.conversations")),1)]),_:1}),o("div",K,[s(e(B),{class:"h-4 w-4 text-green-600 dark:text-green-400"})])]),_:1}),s(e(_),null,{default:t(()=>[o("div",P,a(x(e(i).overview.total_conversations)),1)]),_:1})]),_:1}),s(e(m),null,{default:t(()=>[s(e(u),{class:"flex flex-row items-center justify-between space-y-0 pb-2"},{default:t(()=>[s(e(f),{class:"text-sm font-medium"},{default:t(()=>[d(a(e(n)("admin.pages.dashboard.documents")),1)]),_:1}),o("div",T,[s(e(F),{class:"h-4 w-4 text-amber-600 dark:text-amber-400"})])]),_:1}),s(e(_),null,{default:t(()=>[o("div",z,a(x(e(i).overview.total_documents)),1)]),_:1})]),_:1})]),o("div",G,[s(e(m),{class:"col-span-4"},{default:t(()=>[s(e(u),null,{default:t(()=>[s(e(f),null,{default:t(()=>[d(a(e(n)("admin.pages.dashboard.recentUsers")),1)]),_:1}),s(e(b),null,{default:t(()=>[d(a(e(n)("admin.pages.dashboard.recentUsersDesc")),1)]),_:1})]),_:1}),s(e(_),null,{default:t(()=>[o("div",H,[(r(!0),c(v,null,w(e(i).recent_users,l=>(r(),c("div",{key:l.email,class:"flex items-center"},[s(e($),{class:"h-9 w-9"},{default:t(()=>[s(e(C),{src:l.avatar_url||"",alt:l.name},null,8,["src","alt"]),s(e(D),null,{default:t(()=>[d(a(l.name?.substring(0,2).toUpperCase()||"U"),1)]),_:2},1024)]),_:2},1024),o("div",O,[o("p",Q,a(l.name||e(n)("admin.pages.dashboard.unnamed")),1),o("p",R,a(l.email),1)]),o("div",W,a(k(l.created_at)),1)]))),128))])]),_:1})]),_:1}),s(e(m),{class:"col-span-3"},{default:t(()=>[s(e(u),null,{default:t(()=>[s(e(f),null,{default:t(()=>[d(a(e(n)("admin.pages.dashboard.topAssistants")),1)]),_:1}),s(e(b),null,{default:t(()=>[d(a(e(n)("admin.pages.dashboard.topAssistantsDesc")),1)]),_:1})]),_:1}),s(e(_),null,{default:t(()=>[o("div",X,[(r(!0),c(v,null,w(e(i).top_assistants,(l,U)=>(r(),c("div",{key:l.name,class:"flex items-center"},[o("div",Y,a(U+1),1),o("div",ee,[o("p",se,a(l.name),1),o("p",te,a(e(n)("admin.pages.dashboard.conversationsCount",{count:l.count})),1)])]))),128))])]),_:1})]),_:1})])])):I("",!0)]))}});export{xe as default};
