PageSourceSearch

https://www.hmix.ai/assets/DashboardV2-CFDu6dhA.js

js hmix.ai collected 2026-10-05 14:36:11 UTC 16,244 bytes, 1 lines download raw bytes

1import{a as C,j as e}from"./chunk-three-BTWAGdoL.js";import{a as $}from"./chunk-query-NCR7N3-H.js";import{B as g,C as o,n as d}from"./index-CmZofxmK.js";import{Q as O,y as b,S as P,bg as R,t as S,aJ as I,b5 as u,b6 as v,P as j,aj as L,as as B,C as f,J as M,b7 as E,b9 as T,an as V,aI as W,g as _,al as H,ag as z,z as q}from"./chunk-icons-CmzO8GHu.js";import{m as a,A as G}from"./chunk-motion-j-A2nUUC.js";import"./chunk-router-DABpbG10.js";import"./chunk-uppy-Ddo71Xia.js";import"./chunk-charts-D8AvoNRl.js";import"./chunk-utils-CL3reoUV.js";import"./chunk-maps-ByCLyVpA.js";import"./chunk-radix-CYYWsbOs.js";function re(){const[n,w]=C.useState("30d"),{data:l,isLoading:N,refetch:y,isFetching:c}=$({queryKey:["wholesale-dashboard-v2",n],queryFn:async()=>{const t=await fetch(`/api/wholesale/dashboard?period=${n}`,{credentials:"include"});if(!t.ok)throw new Error("Failed to fetch dashboard");return t.json()},refetchInterval:300*1e3,refetchOnWindowFocus:!1,refetchOnMount:!1}),k=[{title:"Total Revenue",value:l?.totalRevenue||458320,change:28.5,icon:O,trend:"up",prefix:"$",color:"from-emerald-500 to-green-600",sparkData:[30,45,38,52,48,65,72,78,82,95,88,92]},{title:"Total Orders",value:l?.totalOrders||1234,change:15.3,icon:b,trend:"up",color:"from-blue-500 to-cyan-600",sparkData:[20,28,25,32,35,40,38,42,45,48,52,55]},{title:"Active Retailers",value:l?.activeRetailers||89,change:8.7,icon:P,trend:"up",color:"from-purple-500 to-pink-600",sparkData:[65,68,67,70,72,75,78,80,82,85,87,89]},{title:"Avg Order Value",value:l?.avgOrderValue||371,change:-3.2,icon:R,trend:"down",prefix:"$",color:"from-orange-500 to-red-600",sparkData:[380,385,375,390,380,370,375,365,370,372,368,371]}],m=l?.orderStatus||{pending:23,processing:45,shipped:67,delivered:234,cancelled:5},A=l?.topProducts||[{id:"1",name:"Premium Mint Collection Bundle",sales:342,revenue:45600,stock:125,trend:15.2,image:"/api/placeholder/80/80"},{id:"2",name:"Exotic Fruits Variety Pack",sales:287,revenue:38200,stock:89,trend:8.5,image:"/api/placeholder/80/80"},{id:"3",name:"Classic Tobacco Series",sales:256,revenue:32100,stock:234,trend:-5.3,image:"/api/placeholder/80/80"},{id:"4",name:"Ice Collection Bundle",sales:198,revenue:28700,stock:56,trend:22.1,image:"/api/placeholder/80/80"}],D=l?.recentOrders||[{id:"#WH-2024-001",customer:"Miami Lounge Group",items:25,total:3450,status:"shipped",time:"5 min ago"},{id:"#WH-2024-002",customer:"NYC Premium Retailers",items:45,total:5670,status:"processing",time:"1 hour ago"},{id:"#WH-2024-003",customer:"LA Distribution Co",items:15,total:2340,status:"pending",time:"2 hours ago"},{id:"#WH-2024-004",customer:"Vegas Entertainment LLC",items:38,total:4890,status:"delivered",time:"3 hours ago"}],x={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.05,delayChildren:.1}}},i={hidden:{opacity:0,y:20,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:300,damping:24}}},F=t=>{switch(t){case"pending":return"bg-yellow-500/20 text-yellow-400 border-yellow-500/30";case"processing":return"bg-blue-500/20 text-blue-400 border-blue-500/30";case"shipped":return"bg-purple-500/20 text-purple-400 border-purple-500/30";case"delivered":return"bg-green-500/20 text-green-400 border-green-500/30";case"cancelled":return"bg-red-500/20 text-red-400 border-red-500/30";default:return"bg-gray-500/20 text-gray-400 border-gray-500/30"}};if(N)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-black via-gray-950 to-black",children:e.jsx(a.div,{animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"},children:e.jsx(S,{className:"w-12 h-12 text-[#D4AF37]"})})});const h=Object.values(m).reduce((t,s)=>t+s,0);return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-950 via-black to-gray-950 p-6",children:[e.jsxs("div",{className:"fixed inset-0 -z-10",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-[#D4AF37]/5 via-transparent to-transparent"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_left,_var(--tw-gradient-stops))] from-blue-900/5 via-trans
1parent to-transparent"}),e.jsx("div",{className:"absolute inset-0 bg-grid-white/[0.02]"})]}),e.jsxs(a.div,{variants:x,initial:"hidden",animate:"visible",className:"max-w-7xl mx-auto space-y-8",children:[e.jsx(a.div,{variants:i,className:"relative",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx(a.h1,{className:"text-5xl font-bold bg-gradient-to-r from-white via-[#D4AF37] to-white bg-clip-text text-transparent",initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{duration:.6,ease:"easeOut"},children:"Wholesale Dashboard"}),e.jsx(a.p,{className:"text-gray-400 mt-2 text-lg",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:"Monitor your distribution network performance"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(a.div,{variants:i,className:"flex gap-2 bg-black/40 backdrop-blur-xl p-1.5 rounded-2xl border border-white/10",children:["24h","7d","30d","90d","1y"].map(t=>e.jsx("button",{onClick:()=>w(t),className:`px-6 py-2.5 rounded-xl font-medium transition-all duration-300 ${n===t?"bg-gradient-to-r from-[#D4AF37] to-[#F4E4BC] text-black shadow-lg shadow-[#D4AF37]/30":"text-gray-400 hover:text-white hover:bg-white/5"}`,children:t==="24h"?"Today":t==="7d"?"Week":t==="30d"?"Month":t==="90d"?"Quarter":"Year"},t))}),e.jsx(g,{onClick:()=>y(),disabled:c,variant:"outline",size:"icon",className:"border-white/10 text-white hover:bg-white/10 hover:text-[#D4AF37] transition-all",children:e.jsx(I,{className:`w-4 h-4 ${c?"animate-spin":""}`})})]})]})}),e.jsx(a.div,{variants:x,className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:k.map(t=>{const s=t.icon;return e.jsx(a.div,{variants:i,whileHover:{scale:1.02,translateY:-4},className:"relative",children:e.jsxs(o,{className:"relative overflow-hidden bg-gradient-to-br from-black/60 via-black/40 to-black/60 border-white/10 backdrop-blur-xl hover:border-[#D4AF37]/30 transition-all duration-300",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#D4AF37]/5 to-transparent opacity-0 hover:opacity-100 transition-opacity duration-300"}),e.jsxs("div",{className:"relative p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:`p-3 bg-gradient-to-br ${t.color} rounded-2xl shadow-lg`,children:e.jsx(s,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:`flex items-center gap-1 text-sm font-medium ${t.trend==="up"?"text-emerald-400":t.trend==="down"?"text-red-400":"text-gray-400"}`,children:[t.trend==="up"?e.jsx(u,{className:"w-4 h-4"}):t.trend==="down"?e.jsx(v,{className:"w-4 h-4"}):null,Math.abs(t.change),"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400 mb-1",children:t.title}),e.jsxs("p",{className:"text-3xl font-bold text-white",children:[t.prefix,typeof t.value=="number"?t.value.toLocaleString():t.value,t.suffix]})]}),t.sparkData&&e.jsx("div",{className:"h-12 flex items-end gap-1",children:t.sparkData.map((r,p)=>e.jsx(a.div,{className:"flex-1 bg-gradient-to-t from-[#D4AF37]/20 to-[#D4AF37]/60 rounded-t-sm",initial:{height:0},animate:{height:`${r/Math.max(...t.sparkData)*100}%`},transition:{delay:.5+p*.03,duration:.3}},p))})]})]})},t.title)})}),e.jsx(a.div,{variants:i,children:e.jsxs(o,{className:"bg-gradient-to-br from-black/60 via-black/40 to-black/60 border-white/10 backdrop-blur-xl",children:[e.jsx("div",{className:"p-6 border-b border-white/10",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{className:"w-5 h-5 text-[#D4AF37]"}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Order Pipeline"})]}),e.jsxs(d,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30",children:[h," Total Orders"]})]})}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:Object.entries(m).map(([t,s],r)=>e.jsx(a.div,{initial:{opacity:0,scale:.8}
1,animate:{opacity:1,scale:1},transition:{delay:.5+r*.1},className:"relative",children:e.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-br from-white/5 to-white/10 hover:from-white/10 hover:to-white/15 transition-all duration-300 cursor-pointer group",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-xs text-gray-400 capitalize",children:t}),t!=="cancelled"&&r<3&&e.jsx(L,{className:"w-4 h-4 text-gray-600 group-hover:text-[#D4AF37] transition-colors"})]}),e.jsx("p",{className:"text-2xl font-bold text-white",children:s}),e.jsx("div",{className:"mt-2 h-1 bg-black/50 rounded-full overflow-hidden",children:e.jsx(a.div,{className:`h-full ${t==="pending"?"bg-yellow-500":t==="processing"?"bg-blue-500":t==="shipped"?"bg-purple-500":t==="delivered"?"bg-green-500":"bg-red-500"}`,initial:{width:0},animate:{width:`${s/h*100}%`},transition:{duration:1,delay:.5+r*.1}})})]})},t))})})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx(a.div,{variants:i,className:"lg:col-span-2",children:e.jsxs(o,{className:"bg-gradient-to-br from-black/60 via-black/40 to-black/60 border-white/10 backdrop-blur-xl",children:[e.jsx("div",{className:"p-6 border-b border-white/10",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"w-5 h-5 text-[#D4AF37]"}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Top Performing Products"})]}),e.jsxs(g,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white",children:["View All",e.jsx(f,{className:"w-4 h-4 ml-1"})]})]})}),e.jsx("div",{className:"p-6 space-y-4",children:A.map((t,s)=>e.jsxs(a.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:s*.1},className:"flex items-center gap-4 p-4 rounded-xl bg-gradient-to-r from-white/5 to-white/10 hover:from-white/10 hover:to-white/15 transition-all duration-300 cursor-pointer group",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-16 h-16 rounded-lg bg-gradient-to-br from-[#D4AF37]/20 to-[#D4AF37]/5 flex items-center justify-center",children:e.jsx(M,{className:"w-8 h-8 text-[#D4AF37]"})}),e.jsx("div",{className:"absolute -top-1 -right-1 w-6 h-6 bg-gradient-to-r from-[#D4AF37] to-[#F4E4BC] rounded-full flex items-center justify-center text-black text-xs font-bold",children:s+1})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold text-white group-hover:text-[#D4AF37] transition-colors",children:t.name}),e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("span",{className:"text-sm text-gray-400",children:[t.sales," units"]}),e.jsxs("span",{className:"text-sm text-emerald-400 font-semibold",children:["$",t.revenue.toLocaleString()]})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:`flex items-center gap-1 text-sm font-medium ${t.trend>0?"text-emerald-400":"text-red-400"}`,children:[t.trend>0?e.jsx(u,{className:"w-4 h-4"}):e.jsx(v,{className:"w-4 h-4"}),Math.abs(t.trend),"%"]}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[t.stock," in stock"]})]})]},t.id))})]})}),e.jsx(a.div,{variants:i,children:e.jsxs(o,{className:"bg-gradient-to-br from-black/60 via-black/40 to-black/60 border-white/10 backdrop-blur-xl",children:[e.jsx("div",{className:"p-6 border-b border-white/10",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"w-5 h-5 text-[#D4AF37]"}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Recent Orders"}),e.jsx("div",{className:"ml-auto w-2 h-2 bg-emerald-400 rounded-full animate-pulse"})]})}),e.jsx("div",{className:"p-6 space-y-3",children:e.jsx(G,{children:D.map((t,s)=>e.jsxs(a.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{delay:s*.05},className:"p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-all duration-300 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs font-mono text-[#D4AF37]",children:t.id}),e.jsx(d,{className:`text-xs ${F(t.status)}`,children:t.status})]}),e.jsx("p",{className:"text-sm font-medium text-white truncate",children:t.customer}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsxs("span",{className:"text-xs text-gray-400",children:[t.items," items"]}),e.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",t.total.toLocaleStr
1ing()]})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t.time})]},t.id))})})]})})]}),e.jsx(a.div,{variants:i,children:e.jsxs(o,{className:"bg-gradient-to-br from-purple-900/20 to-pink-900/20 border-purple-500/20",children:[e.jsx("div",{className:"p-6 border-b border-purple-500/10",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(T,{className:"w-5 h-5 text-[#D4AF37]"}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"AI Business Insights"})]}),e.jsx(d,{className:"bg-gradient-to-r from-purple-500/20 to-pink-500/20 text-purple-300 border-purple-500/30",children:"Powered by AI"})]})}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[{title:"Growth Opportunity",value:"East Coast Markets",insight:"32% untapped potential",icon:V,color:"from-green-500 to-emerald-600"},{title:"Inventory Alert",value:"3 Products Low",insight:"Restock by Friday",icon:W,color:"from-yellow-500 to-orange-600"},{title:"Best Retailer",value:"Miami Group LLC",insight:"$125K this quarter",icon:_,color:"from-purple-500 to-pink-600"},{title:"Efficiency Score",value:"94%",insight:"+5% from last month",icon:H,color:"from-blue-500 to-cyan-600"}].map((t,s)=>{const r=t.icon;return e.jsxs(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1+s*.1},whileHover:{scale:1.05},className:"relative overflow-hidden rounded-xl bg-gradient-to-br from-white/5 to-white/10 p-4 hover:from-white/10 hover:to-white/15 transition-all duration-300",children:[e.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${t.color} opacity-10`}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`p-2 rounded-lg bg-gradient-to-br ${t.color} w-fit mb-3`,children:e.jsx(r,{className:"w-5 h-5 text-white"})}),e.jsx("p",{className:"text-xs text-gray-400 mb-1",children:t.title}),e.jsx("p",{className:"text-lg font-bold text-white mb-1",children:t.value}),e.jsx("p",{className:"text-sm text-[#D4AF37]",children:t.insight})]})]},t.title)})})})]})}),e.jsx(a.div,{variants:i,children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"New Order",icon:b,color:"from-blue-500 to-blue-600"},{label:"Add Product",icon:j,color:"from-green-500 to-green-600"},{label:"Create Invoice",icon:z,color:"from-purple-500 to-purple-600"},{label:"View Reports",icon:q,color:"from-orange-500 to-orange-600"}].map((t,s)=>{const r=t.icon;return e.jsxs(a.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:1.2+s*.05},whileHover:{scale:1.05},whileTap:{scale:.95},className:"p-4 rounded-xl bg-gradient-to-r from-white/5 to-white/10 hover:from-white/10 hover:to-white/15 transition-all duration-300 group relative overflow-hidden",children:[e.jsx("div",{className:`absolute inset-0 bg-gradient-to-r ${t.color} opacity-0 group-hover:opacity-10 transition-opacity`}),e.jsxs("div",{className:"relative flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg bg-gradient-to-r ${t.color}`,children:e.jsx(r,{className:"w-5 h-5 text-white"})}),e.jsx("span",{className:"text-white font-medium",children:t.label}),e.jsx(f,{className:"w-4 h-4 text-gray-400 ml-auto group-hover:text-white transition-colors"})]})]},t.label)})})})]})]})}export{re as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.