import{ag as h,D as s,j as a,ao as y,ap as A,aq as b,z as u,a5 as T,A as v,B as i,T as g,O as m,E as C,N as j,ar as x}from"./main-crazy-owls-work.js";import{R as L,C as w}from"./row-DAt4Bs0l.js";import{F as p}from"./index-DLeF0Q26.js";import{A as k}from"./index-B1hhaeCD.js";import{C as B}from"./index-9x8aFyWV.js";import{I as _}from"./index-n9eEtX5J.js";import"./mediaQueryUtil-BSyvLspT.js";import"./index-DbMzUBXN.js";import"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./EyeOutlined-BpDfhdMV.js";import"./addEventListener-vmiZntWB.js";import"./LeftOutlined-i89HTNl0.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const M=[{count:0,icon:a(y,{}),slug:"active_account_count",title:s("Active Account")},{count:0,icon:a(A,{}),slug:"published_post_count",title:s("Published Post")},{count:0,icon:a(b,{}),slug:"active_schedule_count",title:s("Active Schedule")}];function d(){const{data:t,isLoading:e}=h({queryFn:async()=>{const{data:o}=await u("analytics",void 0,void 0,"GET");return M.map(c=>T(c,f=>{f.count=(o==null?void 0:o[c.slug])||0}))},queryKey:["analytics"]});return{analytics:t||[],isAnalyticsLoading:e}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const{Title:r}=g;function N(){const{token:t}=v.useToken(),{analytics:e}=d();return a("div",{className:"mt-5",children:a(L,{gutter:20,children:e.map(o=>a(w,{span:6,children:i(B,{children:[i(p,{className:"mb-2",justify:"space-between",children:[a(r,{level:2,style:{color:t.colorPrimary,marginBottom:0},children:o.count}),a(k,{icon:o.icon,size:60,style:{background:t.colorPrimaryBg,color:t.colorText,transform:"translate(4px, -10px)"}})]}),a(r,{level:5,style:{marginBottom:0},children:o.title})]})},o.slug))})})}const q=""+new URL("bit-social-ba-assets-841.svg",import.meta.url).href;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};function D(){const{data:t,isLoading:e}=h({queryFn:async()=>u("user-info",void 0,void 0,"GET"),queryKey:["user-info"]});return{isUserInfoLoading:e,userInfo:t==null?void 0:t.data}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const{Text:n,Title:l}=g;function P(){const{isUserInfoLoading:t,userInfo:e}=D();return t?a(m,{}):i(p,{align:"center",justify:"center",style:{paddingBottom:40,position:"relative"},vertical:!0,children:[i(l,{style:{left:"30px",position:"absolute",top:"20px"},children:[s("Hi")," ",e==null?void 0:e.username]}),a(_,{className:"mt-2",height:"300px",preview:!1,src:q}),a(l,{className:"mt-3",level:3,children:s("Welcome to Bit Social")}),a(n,{style:{color:"blue"},children:s("Thanks for using Bit Social")}),a(n,{children:s("Smart solution for WordPress post Schedule")}),a(x,{className:"mt-2",to:"/accounts",children:i(C,{size:"large",type:"primary",children:[s("Accounts"),a(j,{style:{transform:"translateY(-2px)"}})]})})," "]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};function Y(){const{analytics:t,isAnalyticsLoading:e}=d();return e?a(m,{}):t.some(c=>Number(c.count)>0)?a(N,{}):a(P,{})}export{Y as default};
