@burdenoff/microfe-kadaikodi 2026.626.2 → 2026.704.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/kadaikodi/hooks/useKadaikodiApi.js +260 -105
  2. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  3. package/dist/kadaikodi/pages/HomePage.js +4 -4
  4. package/dist/kadaikodi/pages/HomePage.js.map +1 -1
  5. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +341 -461
  6. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  7. package/dist/kadaikodi/pages/admin/AdminDashboard.js +115 -399
  8. package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
  9. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +140 -283
  10. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
  11. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +282 -453
  12. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  13. package/dist/kadaikodi/pages/admin/AdminProfilePage.js +115 -242
  14. package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
  15. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +2 -2
  16. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
  17. package/dist/kadaikodi/pages/admin/CartManagementPage.js +279 -333
  18. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  19. package/dist/kadaikodi/pages/admin/UserManagementPage.js +299 -372
  20. package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
  21. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +503 -627
  22. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  23. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +339 -282
  24. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  25. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +329 -432
  26. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  27. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -384
  28. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  29. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +249 -208
  30. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  31. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +276 -279
  32. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  33. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +229 -447
  34. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  35. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +171 -627
  36. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  37. package/dist/kadaikodi/pages/common/HelpSupportPage.js +331 -415
  38. package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
  39. package/dist/kadaikodi/pages/common/NotificationCenterPage.js +18 -670
  40. package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
  41. package/dist/kadaikodi/pages/common/SettingsPage.js +34 -46
  42. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  43. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +193 -447
  44. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
  45. package/dist/kadaikodi/pages/customer/CartDetailPage.js +6 -6
  46. package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
  47. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +2 -2
  48. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
  49. package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -2
  50. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  51. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +191 -369
  52. package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
  53. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +233 -389
  54. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  55. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +255 -215
  56. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  57. package/dist/kadaikodi/pages/customer/FavoritesPage.js +141 -178
  58. package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
  59. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
  60. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +155 -161
  61. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  62. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +76 -118
  63. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
  64. package/dist/kadaikodi/pages/customer/ReviewsPage.js +14 -140
  65. package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
  66. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +135 -213
  67. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
  68. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +272 -774
  69. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  70. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +258 -523
  71. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  72. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +112 -600
  73. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  74. package/dist/kadaikodi/pages/investor/InvestorDashboard.js +128 -295
  75. package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
  76. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +205 -291
  77. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  78. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +159 -500
  79. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
  80. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +426 -514
  81. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
  82. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +231 -225
  83. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  84. package/dist/kadaikodi/pages/worker/WorkerDashboard.js +197 -301
  85. package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
  86. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +247 -399
  87. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
  88. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +294 -327
  89. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
  90. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +179 -397
  91. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/kadaikodi/mocks/data.js +0 -1517
  94. package/dist/kadaikodi/mocks/data.js.map +0 -1
  95. package/dist/kadaikodi/mocks/users.js +0 -34
  96. package/dist/kadaikodi/mocks/users.js.map +0 -1
@@ -1,297 +1,218 @@
1
1
  import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
2
  import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { formatCurrency as r } from "../../utils/formatters.js";
5
- import { mockAdminAnalytics as i } from "../../mocks/data.js";
6
- import { useState as a } from "react";
7
- import { ArrowDownRight as o, ArrowUpRight as s, BarChart3 as c, CalendarDays as l, Clock as u, Download as d, IndianRupee as f, Percent as p, ShoppingCart as m, Star as h, Target as g, ThumbsUp as _, TrendingUp as v, Users as y } from "lucide-react";
8
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
9
- import { EmphasisPanel as C, NextSteps as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
4
+ import { EmptyState as r } from "../../components/EmptyState.js";
5
+ import { useOfferings as i, useOrders as a, useProviders as o, useReviews as s } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatCurrency as c } from "../../utils/formatters.js";
7
+ import { useMemo as l, useState as u } from "react";
8
+ import { ArrowDownRight as d, ArrowUpRight as f, BarChart3 as p, CalendarDays as m, Clock as h, Download as g, IndianRupee as _, Percent as v, ShoppingCart as y, Star as b, Target as ee, ThumbsUp as x, TrendingUp as S } from "lucide-react";
9
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
10
+ import { EmphasisPanel as E, NextSteps as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
10
11
  //#region src/kadaikodi/pages/cart-owner/AnalyticsDashboard.tsx
11
- var E = {
12
- revenue: {
13
- today: 12450,
14
- week: 87150,
15
- month: 348600,
16
- year: 4183200,
17
- growth: {
18
- daily: 12.5,
19
- weekly: 8.3,
20
- monthly: 15.2
12
+ var k = 864e5, A = {
13
+ FOOD_BEVERAGE: "Food & Beverage",
14
+ PERSONAL_CARE_BEAUTY: "Personal Care & Beauty",
15
+ CLOTHING_FASHION: "Clothing & Fashion",
16
+ REPAIR_MAINTENANCE: "Repair & Maintenance",
17
+ HOME_SERVICES: "Home Services",
18
+ HEALTH_WELLNESS: "Health & Wellness",
19
+ EDUCATION_SKILLS: "Education & Skills",
20
+ RETAIL_MERCHANDISE: "Retail & Merchandise",
21
+ GROCERY_ESSENTIALS: "Grocery & Essentials"
22
+ }, j = () => {
23
+ let e = /* @__PURE__ */ new Date();
24
+ return e.setHours(0, 0, 0, 0), e;
25
+ }, M = () => {
26
+ let { navigateTo: M, currentUser: N } = e(), [P, F] = u("week"), { data: I = [], isLoading: L } = o(), R = l(() => I.find((e) => e.ownerId === N?.id) ?? I[0], [I, N?.id]), z = R?.id, { data: B = [] } = a({ providerId: z }), { data: V = [] } = i(z), { data: H = [] } = s(z ?? ""), U = l(() => new Map(V.map((e) => [e.name, A[e.category] ?? e.category])), [V]), W = l(() => {
27
+ let e = B.filter((e) => e.status === "delivered"), t = j().getTime(), n = (t, n) => e.filter((e) => {
28
+ let r = new Date(e.orderDate).getTime();
29
+ return r >= t && r < n;
30
+ }).reduce((e, t) => e + t.total, 0), r = n(t, t + k), i = n(t - k, t), a = n(t - 6 * k, t + k), o = n(t - 13 * k, t - 6 * k), s = n(t - 29 * k, t + k), c = n(t - 59 * k, t - 29 * k), l = n(t - 364 * k, t + k), u = (e, t) => t > 0 ? Math.round((e - t) / t * 1e3) / 10 : null;
31
+ return {
32
+ today: r,
33
+ week: a,
34
+ month: s,
35
+ year: l,
36
+ dailyGrowth: u(r, i),
37
+ weeklyGrowth: u(a, o),
38
+ monthlyGrowth: u(s, c)
39
+ };
40
+ }, [B]), G = l(() => {
41
+ let e = B.length, t = B.filter((e) => e.status === "delivered"), n = B.filter((e) => e.status === "cancelled"), r = t.length > 0 ? Math.round(t.reduce((e, t) => e + t.total, 0) / t.length) : 0;
42
+ return {
43
+ total: e,
44
+ completed: t.length,
45
+ cancelled: n.length,
46
+ avgOrderValue: r,
47
+ acceptanceRate: e > 0 ? Math.round((e - n.length) / e * 100) : 0,
48
+ cancellationRate: e > 0 ? Math.round(n.length / e * 100) : 0,
49
+ completionRate: e > 0 ? Math.round(t.length / e * 100) : 0
50
+ };
51
+ }, [B]), { popularTimes: K, peakHours: q, peakDays: J } = l(() => {
52
+ let e = Array(24).fill(0), t = /* @__PURE__ */ new Map();
53
+ B.forEach((n) => {
54
+ let r = new Date(n.orderDate);
55
+ e[r.getHours()] += 1;
56
+ let i = r.toLocaleDateString("en-US", { weekday: "long" });
57
+ t.set(i, (t.get(i) ?? 0) + 1);
58
+ });
59
+ let n = e.map((e, t) => ({
60
+ hour: t,
61
+ orders: e
62
+ })).filter((e) => e.orders > 0);
63
+ return {
64
+ popularTimes: n,
65
+ peakHours: [...n].sort((e, t) => t.orders - e.orders).slice(0, 4),
66
+ peakDays: [...t.entries()].map(([e, t]) => ({
67
+ day: e,
68
+ orders: t
69
+ })).sort((e, t) => t.orders - e.orders).slice(0, 3)
70
+ };
71
+ }, [B]), { topSelling: Y, leastSelling: X, categories: Z } = l(() => {
72
+ let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
73
+ B.forEach((n) => n.items.forEach((n) => {
74
+ let r = U.get(n.name) ?? "Other", i = e.get(n.name) ?? {
75
+ quantity: 0,
76
+ revenue: 0,
77
+ category: r
78
+ };
79
+ i.quantity += n.quantity, i.revenue += n.price * n.quantity, e.set(n.name, i);
80
+ let a = t.get(r) ?? {
81
+ revenue: 0,
82
+ units: 0
83
+ };
84
+ a.revenue += n.price * n.quantity, a.units += n.quantity, t.set(r, a);
85
+ }));
86
+ let n = [...e.entries()].map(([e, t]) => ({
87
+ name: e,
88
+ ...t
89
+ }));
90
+ return {
91
+ topSelling: [...n].sort((e, t) => t.revenue - e.revenue).slice(0, 5),
92
+ leastSelling: [...n].sort((e, t) => e.quantity - t.quantity).slice(0, 3),
93
+ categories: [...t.entries()].map(([e, t]) => ({
94
+ category: e,
95
+ ...t
96
+ })).sort((e, t) => t.revenue - e.revenue)
97
+ };
98
+ }, [B, U]), Q = l(() => {
99
+ let e = H.length;
100
+ return {
101
+ count: e,
102
+ average: e > 0 ? H.reduce((e, t) => e + t.rating, 0) / e : 0,
103
+ positive: H.filter((e) => e.rating >= 4).length,
104
+ distribution: [
105
+ 5,
106
+ 4,
107
+ 3,
108
+ 2,
109
+ 1
110
+ ].map((e) => ({
111
+ star: e,
112
+ count: H.filter((t) => t.rating === e).length
113
+ })),
114
+ recent: [...H].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()).slice(0, 4)
115
+ };
116
+ }, [H]), te = l(() => {
117
+ let e = j().getTime(), t = [];
118
+ for (let n = 13; n >= 0; n--) {
119
+ let r = e - n * k, i = r + k, a = B.filter((e) => {
120
+ let t = new Date(e.orderDate).getTime();
121
+ return t >= r && t < i;
122
+ });
123
+ t.push({
124
+ date: new Date(r).toISOString(),
125
+ orders: a.length,
126
+ revenue: a.filter((e) => e.status === "delivered").reduce((e, t) => e + t.total, 0)
127
+ });
21
128
  }
22
- },
23
- orders: {
24
- total: 156,
25
- pending: 3,
26
- completed: 145,
27
- cancelled: 8,
28
- averageValue: 285,
29
- averagePreparationTime: 18,
30
- popularTimes: [
31
- {
32
- hour: 8,
33
- orders: 12
34
- },
35
- {
36
- hour: 9,
37
- orders: 15
38
- },
39
- {
40
- hour: 10,
41
- orders: 18
42
- },
43
- {
44
- hour: 11,
45
- orders: 22
46
- },
47
- {
48
- hour: 12,
49
- orders: 28
50
- },
51
- {
52
- hour: 13,
53
- orders: 32
54
- },
55
- {
56
- hour: 14,
57
- orders: 16
58
- },
59
- {
60
- hour: 15,
61
- orders: 12
62
- },
63
- {
64
- hour: 16,
65
- orders: 14
66
- },
67
- {
68
- hour: 17,
69
- orders: 18
70
- },
71
- {
72
- hour: 18,
73
- orders: 20
74
- },
75
- {
76
- hour: 19,
77
- orders: 25
78
- },
79
- {
80
- hour: 20,
81
- orders: 22
82
- },
83
- {
84
- hour: 21,
85
- orders: 15
86
- }
87
- ]
88
- },
89
- offerings: {
90
- topSelling: [
91
- {
92
- id: "1",
93
- name: "Masala Dosa",
94
- quantity: 245,
95
- revenue: 19600,
96
- category: "Food & Beverage"
97
- },
98
- {
99
- id: "2",
100
- name: "Haircut Service",
101
- quantity: 89,
102
- revenue: 11340,
103
- category: "Personal Care & Beauty"
104
- },
105
- {
106
- id: "3",
107
- name: "Filter Coffee",
108
- quantity: 312,
109
- revenue: 9360,
110
- category: "Food & Beverage"
111
- },
112
- {
113
- id: "4",
114
- name: "Mobile Repair",
115
- quantity: 67,
116
- revenue: 6680,
117
- category: "Repair & Maintenance"
118
- },
119
- {
120
- id: "5",
121
- name: "Pongal",
122
- quantity: 98,
123
- revenue: 5880,
124
- category: "Food & Beverage"
125
- }
126
- ],
127
- leastSelling: [
128
- {
129
- id: "6",
130
- name: "Bisi Bele Bath",
131
- quantity: 12,
132
- revenue: 1440,
133
- category: "Food & Beverage"
134
- },
135
- {
136
- id: "7",
137
- name: "Cleaning Service",
138
- quantity: 8,
139
- revenue: 640,
140
- category: "Home Services"
141
- },
142
- {
143
- id: "8",
144
- name: "Kosambari",
145
- quantity: 15,
146
- revenue: 450,
147
- category: "Food & Beverage"
148
- }
149
- ],
150
- categories: [
151
- {
152
- category: "Food & Beverage",
153
- revenue: 45e3,
154
- orders: 450
155
- },
156
- {
157
- category: "Personal Care & Beauty",
158
- revenue: 25e3,
159
- orders: 180
160
- },
161
- {
162
- category: "Repair & Maintenance",
163
- revenue: 15e3,
164
- orders: 120
165
- },
166
- {
167
- category: "Home Services",
168
- revenue: 8e3,
169
- orders: 80
170
- }
171
- ]
172
- },
173
- customers: {
174
- total: 342,
175
- new: 45,
176
- returning: 297,
177
- topCustomers: [
178
- {
179
- id: "1",
180
- name: "Rahul Sharma",
181
- orders: 23,
182
- totalSpent: 6555
183
- },
184
- {
185
- id: "2",
186
- name: "Priya Patel",
187
- orders: 19,
188
- totalSpent: 5415
189
- },
190
- {
191
- id: "3",
192
- name: "Amit Kumar",
193
- orders: 17,
194
- totalSpent: 4845
195
- },
196
- {
197
- id: "4",
198
- name: "Sneha Reddy",
199
- orders: 15,
200
- totalSpent: 4275
201
- },
202
- {
203
- id: "5",
204
- name: "Vijay Singh",
205
- orders: 14,
206
- totalSpent: 3990
207
- }
208
- ],
209
- satisfaction: {
210
- rating: 4.6,
211
- reviews: 89,
212
- positiveReviews: 78
213
- }
214
- },
215
- performance: {
216
- acceptanceRate: 94,
217
- cancellationRate: 6,
218
- onTimeDeliveryRate: 88,
219
- averageRating: 4.6,
220
- peakHours: [
221
- {
222
- hour: "12-1 PM",
223
- orders: 32
224
- },
225
- {
226
- hour: "1-2 PM",
227
- orders: 28
228
- },
229
- {
230
- hour: "7-8 PM",
231
- orders: 25
232
- },
233
- {
234
- hour: "8-9 PM",
235
- orders: 22
236
- }
237
- ],
238
- peakDays: [
239
- {
240
- day: "Sunday",
241
- orders: 45
242
- },
243
- {
244
- day: "Saturday",
245
- orders: 42
246
- },
247
- {
248
- day: "Friday",
249
- orders: 38
250
- }
251
- ]
252
- }
253
- }, D = () => {
254
- let { navigateTo: D } = e(), [O, k] = a("week"), A = Math.max(...E.orders.popularTimes.map((e) => e.orders)), j = Math.max(...E.offerings.categories.map((e) => e.revenue)), M = Math.max(...E.performance.peakHours.map((e) => e.orders)), N = Math.max(...E.performance.peakDays.map((e) => e.orders)), P = (e) => `${e > 0 ? "+" : ""}${e}%`;
255
- return /* @__PURE__ */ S(n, {
129
+ return t;
130
+ }, [B]), ne = Math.max(...K.map((e) => e.orders), 1), $ = Math.max(...Z.map((e) => e.revenue), 1), re = Math.max(...q.map((e) => e.orders), 1), ie = Math.max(...J.map((e) => e.orders), 1), ae = Math.max(...Q.distribution.map((e) => e.count), 1), oe = (e) => `${e > 0 ? "+" : ""}${e}%`;
131
+ if (L) return /* @__PURE__ */ w(n, {
132
+ title: "Analytics Dashboard",
133
+ description: "Business performance insights and data",
134
+ children: /* @__PURE__ */ w("div", {
135
+ className: "flex items-center justify-center py-24",
136
+ children: /* @__PURE__ */ w("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
137
+ })
138
+ });
139
+ if (!R) return /* @__PURE__ */ w(n, {
256
140
  title: "Analytics Dashboard",
257
141
  description: "Business performance insights and data",
258
- actions: /* @__PURE__ */ S("div", {
142
+ children: /* @__PURE__ */ w(r, {
143
+ illustration: "empty-data",
144
+ title: "No analytics yet",
145
+ description: "You don't have a service provider yet. Set up your cart and start taking orders to see your performance insights here.",
146
+ action: /* @__PURE__ */ w("button", {
147
+ type: "button",
148
+ onClick: () => M("/cart-owner/service-config"),
149
+ className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80",
150
+ children: "Set up your cart"
151
+ })
152
+ })
153
+ });
154
+ let se = [
155
+ {
156
+ label: "Today's Revenue",
157
+ value: W.today,
158
+ growth: W.dailyGrowth
159
+ },
160
+ {
161
+ label: "This Week",
162
+ value: W.week,
163
+ growth: W.weeklyGrowth
164
+ },
165
+ {
166
+ label: "This Month",
167
+ value: W.month,
168
+ growth: W.monthlyGrowth
169
+ },
170
+ {
171
+ label: "This Year",
172
+ value: W.year,
173
+ growth: null
174
+ }
175
+ ];
176
+ return /* @__PURE__ */ T(n, {
177
+ title: "Analytics Dashboard",
178
+ description: `Performance insights for ${R.name}`,
179
+ actions: /* @__PURE__ */ T("div", {
259
180
  className: "flex items-center gap-2",
260
- children: [/* @__PURE__ */ S("select", {
261
- value: O,
262
- onChange: (e) => k(e.target.value),
181
+ children: [/* @__PURE__ */ T("select", {
182
+ value: P,
183
+ onChange: (e) => F(e.target.value),
263
184
  className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
264
185
  children: [
265
- /* @__PURE__ */ x("option", {
186
+ /* @__PURE__ */ w("option", {
266
187
  value: "today",
267
188
  children: "Today"
268
189
  }),
269
- /* @__PURE__ */ x("option", {
190
+ /* @__PURE__ */ w("option", {
270
191
  value: "week",
271
192
  children: "This Week"
272
193
  }),
273
- /* @__PURE__ */ x("option", {
194
+ /* @__PURE__ */ w("option", {
274
195
  value: "month",
275
196
  children: "This Month"
276
197
  }),
277
- /* @__PURE__ */ x("option", {
198
+ /* @__PURE__ */ w("option", {
278
199
  value: "year",
279
200
  children: "This Year"
280
201
  })
281
202
  ]
282
- }), /* @__PURE__ */ S("button", {
203
+ }), /* @__PURE__ */ T("button", {
283
204
  type: "button",
284
205
  onClick: () => alert("Export feature coming soon!"),
285
206
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
286
- children: [/* @__PURE__ */ x(d, { className: "h-4 w-4" }), "Export"]
207
+ children: [/* @__PURE__ */ w(g, { className: "h-4 w-4" }), "Export"]
287
208
  })]
288
209
  }),
289
210
  children: [
290
- /* @__PURE__ */ x(T, {
211
+ /* @__PURE__ */ w(O, {
291
212
  className: "mb-6",
292
- children: "The performance story of your cart. Use this page to understand how your business is really doing — track revenue over time, see how orders break down, learn which hours are busiest so you can staff and stock accordingly, and spot your best-selling items. Change the date range to compare periods and act on what's growing (or slowing)."
213
+ children: "The performance story of your cart. Use this page to understand how your business is really doing — track revenue over time, see how orders break down, learn which hours are busiest so you can staff and stock accordingly, and spot your best-selling items. All figures are drawn from your live orders and reviews."
293
214
  }),
294
- /* @__PURE__ */ x(w, {
215
+ /* @__PURE__ */ w(D, {
295
216
  storageKey: "kadaikodi-owner-analytics",
296
217
  className: "mb-6",
297
218
  steps: [
@@ -299,297 +220,275 @@ var E = {
299
220
  id: "inventory",
300
221
  label: "Restock your best-sellers",
301
222
  description: "Make sure popular items never run out.",
302
- onClick: () => D("/owner/inventory")
223
+ onClick: () => M("/cart-owner/inventory")
303
224
  },
304
225
  {
305
226
  id: "orders",
306
227
  label: "Work through live orders",
307
228
  description: "Keep prep and delivery times sharp.",
308
- onClick: () => D("/owner/orders")
229
+ onClick: () => M("/cart-owner/orders")
309
230
  },
310
231
  {
311
232
  id: "staff",
312
233
  label: "Plan staff for peak hours",
313
234
  description: "Cover the busiest times you see here.",
314
- onClick: () => D("/owner/staff")
235
+ onClick: () => M("/cart-owner/staff")
315
236
  }
316
237
  ]
317
238
  }),
318
- /* @__PURE__ */ S("div", {
239
+ /* @__PURE__ */ T("div", {
319
240
  className: "space-y-6",
320
241
  children: [
321
- /* @__PURE__ */ S(C, { children: [/* @__PURE__ */ x("h2", {
242
+ /* @__PURE__ */ T(E, { children: [/* @__PURE__ */ w("h2", {
322
243
  className: "text-base font-semibold text-text-primary mb-3",
323
244
  children: "Revenue Overview"
324
- }), /* @__PURE__ */ x("div", {
245
+ }), /* @__PURE__ */ w("div", {
325
246
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
326
- children: [
327
- {
328
- label: "Today's Revenue",
329
- value: E.revenue.today,
330
- growth: E.revenue.growth.daily
331
- },
332
- {
333
- label: "This Week",
334
- value: E.revenue.week,
335
- growth: E.revenue.growth.weekly
336
- },
337
- {
338
- label: "This Month",
339
- value: E.revenue.month,
340
- growth: E.revenue.growth.monthly
341
- },
342
- {
343
- label: "This Year",
344
- value: E.revenue.year,
345
- growth: null
346
- }
347
- ].map((e) => /* @__PURE__ */ S("div", {
247
+ children: se.map((e) => /* @__PURE__ */ T("div", {
348
248
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
349
249
  children: [
350
- /* @__PURE__ */ S("div", {
250
+ /* @__PURE__ */ T("div", {
351
251
  className: "flex items-center justify-between",
352
- children: [/* @__PURE__ */ x("div", {
252
+ children: [/* @__PURE__ */ w("div", {
353
253
  className: "rounded-md bg-accent p-2",
354
- children: /* @__PURE__ */ x(f, { className: "h-5 w-5 text-text-secondary" })
355
- }), e.growth !== null && /* @__PURE__ */ S("div", {
254
+ children: /* @__PURE__ */ w(_, { className: "h-5 w-5 text-text-secondary" })
255
+ }), e.growth !== null && /* @__PURE__ */ T("div", {
356
256
  className: t("flex items-center gap-1 text-xs font-medium", e.growth >= 0 ? "text-status-success-text" : "text-status-error-text"),
357
- children: [e.growth >= 0 ? /* @__PURE__ */ x(s, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ x(o, { className: "h-3.5 w-3.5" }), P(e.growth)]
257
+ children: [e.growth >= 0 ? /* @__PURE__ */ w(f, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), oe(e.growth)]
358
258
  })]
359
259
  }),
360
- /* @__PURE__ */ x("p", {
260
+ /* @__PURE__ */ w("p", {
361
261
  className: "mt-3 text-2xl font-bold text-text-primary",
362
- children: r(e.value, { minimumFractionDigits: 0 })
262
+ children: c(e.value, { minimumFractionDigits: 0 })
363
263
  }),
364
- /* @__PURE__ */ x("p", {
264
+ /* @__PURE__ */ w("p", {
365
265
  className: "mt-1 text-sm text-text-secondary",
366
266
  children: e.label
367
267
  })
368
268
  ]
369
269
  }, e.label))
370
270
  })] }),
371
- /* @__PURE__ */ S("div", {
271
+ /* @__PURE__ */ T("div", {
372
272
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
373
- children: [/* @__PURE__ */ S("div", {
273
+ children: [/* @__PURE__ */ T("div", {
374
274
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
375
- children: [/* @__PURE__ */ x("div", {
275
+ children: [/* @__PURE__ */ w("div", {
376
276
  className: "border-b border-border-subtle px-5 py-4",
377
- children: /* @__PURE__ */ S("h2", {
277
+ children: /* @__PURE__ */ T("h2", {
378
278
  className: "text-base font-semibold text-text-primary flex items-center gap-2",
379
- children: [/* @__PURE__ */ x(m, { className: "h-4 w-4 text-text-secondary" }), "Order Statistics"]
279
+ children: [/* @__PURE__ */ w(y, { className: "h-4 w-4 text-text-secondary" }), "Order Statistics"]
380
280
  })
381
- }), /* @__PURE__ */ S("div", {
281
+ }), /* @__PURE__ */ w("div", {
382
282
  className: "p-5",
383
- children: [/* @__PURE__ */ S("div", {
384
- className: "grid grid-cols-2 gap-4 mb-5",
283
+ children: /* @__PURE__ */ T("div", {
284
+ className: "grid grid-cols-2 gap-4",
385
285
  children: [
386
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
286
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
387
287
  className: "text-xs text-text-secondary",
388
288
  children: "Total Orders"
389
- }), /* @__PURE__ */ x("p", {
289
+ }), /* @__PURE__ */ w("p", {
390
290
  className: "text-2xl font-bold text-text-primary",
391
- children: E.orders.total
291
+ children: G.total
392
292
  })] }),
393
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
293
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
394
294
  className: "text-xs text-text-secondary",
395
295
  children: "Avg. Order Value"
396
- }), /* @__PURE__ */ x("p", {
296
+ }), /* @__PURE__ */ w("p", {
397
297
  className: "text-2xl font-bold text-text-primary",
398
- children: r(E.orders.averageValue, { minimumFractionDigits: 0 })
298
+ children: c(G.avgOrderValue, { minimumFractionDigits: 0 })
399
299
  })] }),
400
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
300
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
401
301
  className: "text-xs text-text-secondary",
402
302
  children: "Completed"
403
- }), /* @__PURE__ */ x("p", {
303
+ }), /* @__PURE__ */ w("p", {
404
304
  className: "text-xl font-bold text-status-success-text",
405
- children: E.orders.completed
305
+ children: G.completed
406
306
  })] }),
407
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
307
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
408
308
  className: "text-xs text-text-secondary",
409
309
  children: "Cancelled"
410
- }), /* @__PURE__ */ x("p", {
310
+ }), /* @__PURE__ */ w("p", {
411
311
  className: "text-xl font-bold text-status-error-text",
412
- children: E.orders.cancelled
312
+ children: G.cancelled
413
313
  })] })
414
314
  ]
415
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
416
- className: "text-xs text-text-secondary mb-1",
417
- children: "Avg. Preparation Time"
418
- }), /* @__PURE__ */ S("p", {
419
- className: "text-sm font-medium text-text-primary",
420
- children: [E.orders.averagePreparationTime, " minutes"]
421
- })] })]
315
+ })
422
316
  })]
423
- }), /* @__PURE__ */ S("div", {
317
+ }), /* @__PURE__ */ T("div", {
424
318
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
425
- children: [/* @__PURE__ */ x("div", {
319
+ children: [/* @__PURE__ */ w("div", {
426
320
  className: "border-b border-border-subtle px-5 py-4",
427
- children: /* @__PURE__ */ S("h2", {
321
+ children: /* @__PURE__ */ T("h2", {
428
322
  className: "text-base font-semibold text-text-primary flex items-center gap-2",
429
- children: [/* @__PURE__ */ x(u, { className: "h-4 w-4 text-text-secondary" }), "Popular Times"]
323
+ children: [/* @__PURE__ */ w(h, { className: "h-4 w-4 text-text-secondary" }), "Popular Times"]
430
324
  })
431
- }), /* @__PURE__ */ x("div", {
325
+ }), /* @__PURE__ */ w("div", {
432
326
  className: "p-5 space-y-2",
433
- children: E.orders.popularTimes.map((e) => {
434
- let n = e.orders / A * 100;
435
- return /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
327
+ children: K.length === 0 ? /* @__PURE__ */ w("p", {
328
+ className: "text-sm text-text-secondary py-4 text-center",
329
+ children: "No order activity yet. Busy hours will appear here once orders come in."
330
+ }) : K.map((e) => {
331
+ let t = e.orders / ne * 100;
332
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
436
333
  className: "flex items-center justify-between text-xs mb-0.5",
437
- children: [/* @__PURE__ */ x("span", {
334
+ children: [/* @__PURE__ */ w("span", {
438
335
  className: "text-text-primary w-14",
439
336
  children: `${e.hour}:00`
440
- }), /* @__PURE__ */ S("span", {
337
+ }), /* @__PURE__ */ T("span", {
441
338
  className: "text-text-secondary",
442
339
  children: [e.orders, " orders"]
443
340
  })]
444
- }), /* @__PURE__ */ x("div", {
341
+ }), /* @__PURE__ */ w("div", {
445
342
  className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
446
- children: /* @__PURE__ */ x("div", {
447
- className: t("h-full rounded-full transition-all", e.orders > 25 ? "bg-status-error-bg-subtle" : e.orders > 18 ? "bg-status-warning-bg-subtle" : "bg-status-success-bg-subtle"),
448
- style: { width: `${n}%` }
343
+ children: /* @__PURE__ */ w("div", {
344
+ className: "h-full rounded-full bg-[var(--color-accent-soft)]",
345
+ style: { width: `${t}%` }
449
346
  })
450
347
  })] }, e.hour);
451
348
  })
452
349
  })]
453
350
  })]
454
351
  }),
455
- /* @__PURE__ */ S("section", { children: [/* @__PURE__ */ x("h2", {
352
+ /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ w("h2", {
456
353
  className: "text-base font-semibold text-text-primary mb-3",
457
354
  children: "Performance Metrics"
458
- }), /* @__PURE__ */ x("div", {
355
+ }), /* @__PURE__ */ w("div", {
459
356
  className: "grid grid-cols-2 lg:grid-cols-4 gap-4",
460
357
  children: [
461
358
  {
462
359
  label: "Acceptance Rate",
463
- value: `${E.performance.acceptanceRate}%`,
464
- icon: g,
360
+ value: `${G.acceptanceRate}%`,
361
+ icon: ee,
465
362
  color: "text-status-success-text"
466
363
  },
467
364
  {
468
365
  label: "Cancellation Rate",
469
- value: `${E.performance.cancellationRate}%`,
470
- icon: p,
366
+ value: `${G.cancellationRate}%`,
367
+ icon: v,
471
368
  color: "text-status-error-text"
472
369
  },
473
370
  {
474
- label: "On-Time Delivery",
475
- value: `${E.performance.onTimeDeliveryRate}%`,
476
- icon: u,
371
+ label: "Completion Rate",
372
+ value: `${G.completionRate}%`,
373
+ icon: S,
477
374
  color: "text-text-primary"
478
375
  },
479
376
  {
480
377
  label: "Average Rating",
481
- value: `${E.performance.averageRating}`,
482
- icon: h,
378
+ value: R.rating.toFixed(1),
379
+ icon: b,
483
380
  color: "text-status-warning-text"
484
381
  }
485
382
  ].map((e) => {
486
383
  let n = e.icon;
487
- return /* @__PURE__ */ S("div", {
384
+ return /* @__PURE__ */ T("div", {
488
385
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
489
- children: [/* @__PURE__ */ S("div", {
386
+ children: [/* @__PURE__ */ T("div", {
490
387
  className: "flex items-center gap-2 mb-2",
491
- children: [/* @__PURE__ */ x(n, { className: t("h-5 w-5", e.color) }), /* @__PURE__ */ x("span", {
388
+ children: [/* @__PURE__ */ w(n, { className: t("h-5 w-5", e.color) }), /* @__PURE__ */ w("span", {
492
389
  className: "text-xs text-text-secondary",
493
390
  children: e.label
494
391
  })]
495
- }), /* @__PURE__ */ x("p", {
392
+ }), /* @__PURE__ */ w("p", {
496
393
  className: t("text-2xl font-bold", e.color),
497
394
  children: e.value
498
395
  })]
499
396
  }, e.label);
500
397
  })
501
398
  })] }),
502
- /* @__PURE__ */ S("div", {
399
+ /* @__PURE__ */ T("div", {
503
400
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
504
- children: [/* @__PURE__ */ S("div", {
401
+ children: [/* @__PURE__ */ T("div", {
505
402
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
506
- children: [
507
- /* @__PURE__ */ x("div", {
508
- className: "border-b border-border-subtle px-5 py-4",
509
- children: /* @__PURE__ */ S("h2", {
510
- className: "text-base font-semibold text-text-primary flex items-center gap-2",
511
- children: [/* @__PURE__ */ x(v, { className: "h-4 w-4 text-text-secondary" }), "Top Selling Offerings"]
512
- })
513
- }),
514
- /* @__PURE__ */ x("div", {
515
- className: "divide-y divide-border",
516
- children: E.offerings.topSelling.map((e, t) => /* @__PURE__ */ S("div", {
517
- className: "flex items-center justify-between px-5 py-3",
518
- children: [/* @__PURE__ */ S("div", {
519
- className: "flex items-center gap-3",
520
- children: [/* @__PURE__ */ x("span", {
521
- className: "flex h-6 w-6 items-center justify-center rounded-full bg-bg-sunken text-xs font-medium text-text-secondary",
522
- children: t + 1
523
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
524
- className: "text-sm font-medium text-text-primary",
525
- children: e.name
526
- }), /* @__PURE__ */ S("p", {
527
- className: "text-xs text-text-secondary",
528
- children: [
529
- e.category,
530
- " | ",
531
- e.quantity,
532
- " sold"
533
- ]
534
- })] })]
535
- }), /* @__PURE__ */ x("span", {
403
+ children: [/* @__PURE__ */ w("div", {
404
+ className: "border-b border-border-subtle px-5 py-4",
405
+ children: /* @__PURE__ */ T("h2", {
406
+ className: "text-base font-semibold text-text-primary flex items-center gap-2",
407
+ children: [/* @__PURE__ */ w(S, { className: "h-4 w-4 text-text-secondary" }), "Top Selling Offerings"]
408
+ })
409
+ }), Y.length === 0 ? /* @__PURE__ */ w("p", {
410
+ className: "text-sm text-text-secondary p-5",
411
+ children: "No sales yet. Your best-selling items will appear here."
412
+ }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
413
+ className: "divide-y divide-border",
414
+ children: Y.map((e, t) => /* @__PURE__ */ T("div", {
415
+ className: "flex items-center justify-between px-5 py-3",
416
+ children: [/* @__PURE__ */ T("div", {
417
+ className: "flex items-center gap-3",
418
+ children: [/* @__PURE__ */ w("span", {
419
+ className: "flex h-6 w-6 items-center justify-center rounded-full bg-bg-sunken text-xs font-medium text-text-secondary",
420
+ children: t + 1
421
+ }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
536
422
  className: "text-sm font-medium text-text-primary",
537
- children: r(e.revenue, { minimumFractionDigits: 0 })
538
- })]
539
- }, e.id))
540
- }),
541
- /* @__PURE__ */ S("div", {
542
- className: "border-t border-border-subtle px-5 py-3",
543
- children: [/* @__PURE__ */ x("p", {
544
- className: "text-xs font-medium text-text-secondary mb-2",
545
- children: "Least Selling"
546
- }), E.offerings.leastSelling.map((e) => /* @__PURE__ */ S("div", {
547
- className: "flex items-center justify-between py-1.5",
548
- children: [/* @__PURE__ */ x("span", {
549
- className: "text-xs text-text-secondary",
550
423
  children: e.name
551
- }), /* @__PURE__ */ S("span", {
424
+ }), /* @__PURE__ */ T("p", {
552
425
  className: "text-xs text-text-secondary",
553
426
  children: [
427
+ e.category,
428
+ " | ",
554
429
  e.quantity,
555
- " sold |",
556
- " ",
557
- r(e.revenue, { minimumFractionDigits: 0 })
430
+ " sold"
558
431
  ]
559
- })]
560
- }, e.id))]
561
- })
562
- ]
563
- }), /* @__PURE__ */ S("div", {
432
+ })] })]
433
+ }), /* @__PURE__ */ w("span", {
434
+ className: "text-sm font-medium text-text-primary",
435
+ children: c(e.revenue, { minimumFractionDigits: 0 })
436
+ })]
437
+ }, e.name))
438
+ }), X.length > 0 && /* @__PURE__ */ T("div", {
439
+ className: "border-t border-border-subtle px-5 py-3",
440
+ children: [/* @__PURE__ */ w("p", {
441
+ className: "text-xs font-medium text-text-secondary mb-2",
442
+ children: "Least Selling"
443
+ }), X.map((e) => /* @__PURE__ */ T("div", {
444
+ className: "flex items-center justify-between py-1.5",
445
+ children: [/* @__PURE__ */ w("span", {
446
+ className: "text-xs text-text-secondary",
447
+ children: e.name
448
+ }), /* @__PURE__ */ T("span", {
449
+ className: "text-xs text-text-secondary",
450
+ children: [
451
+ e.quantity,
452
+ " sold |",
453
+ " ",
454
+ c(e.revenue, { minimumFractionDigits: 0 })
455
+ ]
456
+ })]
457
+ }, e.name))]
458
+ })] })]
459
+ }), /* @__PURE__ */ T("div", {
564
460
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
565
- children: [/* @__PURE__ */ x("div", {
461
+ children: [/* @__PURE__ */ w("div", {
566
462
  className: "border-b border-border-subtle px-5 py-4",
567
- children: /* @__PURE__ */ S("h2", {
463
+ children: /* @__PURE__ */ T("h2", {
568
464
  className: "text-base font-semibold text-text-primary flex items-center gap-2",
569
- children: [/* @__PURE__ */ x(c, { className: "h-4 w-4 text-text-secondary" }), "Category Performance"]
465
+ children: [/* @__PURE__ */ w(p, { className: "h-4 w-4 text-text-secondary" }), "Category Performance"]
570
466
  })
571
- }), /* @__PURE__ */ x("div", {
467
+ }), /* @__PURE__ */ w("div", {
572
468
  className: "p-5 space-y-4",
573
- children: E.offerings.categories.map((e) => {
574
- let t = e.revenue / j * 100;
575
- return /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
469
+ children: Z.length === 0 ? /* @__PURE__ */ w("p", {
470
+ className: "text-sm text-text-secondary py-4 text-center",
471
+ children: "No category data yet."
472
+ }) : Z.map((e) => {
473
+ let t = e.revenue / $ * 100;
474
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
576
475
  className: "flex items-center justify-between text-sm mb-1",
577
- children: [/* @__PURE__ */ x("span", {
476
+ children: [/* @__PURE__ */ w("span", {
578
477
  className: "text-text-primary",
579
478
  children: e.category
580
- }), /* @__PURE__ */ S("span", {
479
+ }), /* @__PURE__ */ T("span", {
581
480
  className: "text-text-secondary",
582
481
  children: [
583
- r(e.revenue, { minimumFractionDigits: 0 }),
482
+ c(e.revenue, { minimumFractionDigits: 0 }),
584
483
  " (",
585
- e.orders,
484
+ e.units,
586
485
  " ",
587
- "orders)"
486
+ "sold)"
588
487
  ]
589
488
  })]
590
- }), /* @__PURE__ */ x("div", {
489
+ }), /* @__PURE__ */ w("div", {
591
490
  className: "h-2.5 rounded-full bg-bg-sunken overflow-hidden",
592
- children: /* @__PURE__ */ x("div", {
491
+ children: /* @__PURE__ */ w("div", {
593
492
  className: "h-full rounded-full bg-[var(--color-accent-soft)]",
594
493
  style: { width: `${t}%` }
595
494
  })
@@ -598,261 +497,238 @@ var E = {
598
497
  })]
599
498
  })]
600
499
  }),
601
- /* @__PURE__ */ S("div", {
500
+ /* @__PURE__ */ T("div", {
602
501
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
603
- children: [/* @__PURE__ */ S("div", {
502
+ children: [/* @__PURE__ */ T("div", {
604
503
  className: "lg:col-span-2 rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
605
- children: [/* @__PURE__ */ x("div", {
504
+ children: [/* @__PURE__ */ w("div", {
606
505
  className: "border-b border-border-subtle px-5 py-4",
607
- children: /* @__PURE__ */ S("h2", {
506
+ children: /* @__PURE__ */ T("h2", {
608
507
  className: "text-base font-semibold text-text-primary flex items-center gap-2",
609
- children: [/* @__PURE__ */ x(y, { className: "h-4 w-4 text-text-secondary" }), "Customer Overview"]
508
+ children: [/* @__PURE__ */ w(b, { className: "h-4 w-4 text-text-secondary" }), "Reviews & Ratings"]
610
509
  })
611
- }), /* @__PURE__ */ S("div", {
510
+ }), /* @__PURE__ */ T("div", {
612
511
  className: "p-5",
613
- children: [
614
- /* @__PURE__ */ S("div", {
615
- className: "grid grid-cols-2 sm:grid-cols-4 gap-4 mb-5",
616
- children: [
617
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
618
- className: "text-xs text-text-secondary",
619
- children: "Total Customers"
620
- }), /* @__PURE__ */ x("p", {
621
- className: "text-xl font-bold text-text-primary",
622
- children: E.customers.total
623
- })] }),
624
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
625
- className: "text-xs text-text-secondary",
626
- children: "New This Month"
627
- }), /* @__PURE__ */ x("p", {
628
- className: "text-xl font-bold text-text-primary",
629
- children: E.customers.new
630
- })] }),
631
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
632
- className: "text-xs text-text-secondary",
633
- children: "Returning"
634
- }), /* @__PURE__ */ x("p", {
635
- className: "text-xl font-bold text-status-success-text",
636
- children: E.customers.returning
637
- })] }),
638
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
639
- className: "text-xs text-text-secondary",
640
- children: "Satisfaction"
641
- }), /* @__PURE__ */ S("p", {
642
- className: "text-xl font-bold text-status-warning-text flex items-center gap-1",
643
- children: [/* @__PURE__ */ x(h, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), E.customers.satisfaction.rating]
644
- })] })
645
- ]
512
+ children: [/* @__PURE__ */ T("div", {
513
+ className: "grid grid-cols-2 sm:grid-cols-3 gap-4 mb-5",
514
+ children: [
515
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
516
+ className: "text-xs text-text-secondary",
517
+ children: "Total Reviews"
518
+ }), /* @__PURE__ */ w("p", {
519
+ className: "text-xl font-bold text-text-primary",
520
+ children: Q.count
521
+ })] }),
522
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
523
+ className: "text-xs text-text-secondary",
524
+ children: "Average Rating"
525
+ }), /* @__PURE__ */ T("p", {
526
+ className: "text-xl font-bold text-status-warning-text flex items-center gap-1",
527
+ children: [/* @__PURE__ */ w(b, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), Q.count > 0 ? Q.average.toFixed(1) : "—"]
528
+ })] }),
529
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
530
+ className: "text-xs text-text-secondary",
531
+ children: "Positive (4★+)"
532
+ }), /* @__PURE__ */ w("p", {
533
+ className: "text-xl font-bold text-status-success-text",
534
+ children: Q.positive
535
+ })] })
536
+ ]
537
+ }), Q.count === 0 ? /* @__PURE__ */ w("p", {
538
+ className: "text-sm text-text-secondary py-4 text-center",
539
+ children: "No reviews yet. Customer reviews will appear here once you start fulfilling orders."
540
+ }) : /* @__PURE__ */ T(C, { children: [
541
+ /* @__PURE__ */ w("div", {
542
+ className: "space-y-1.5 mb-5",
543
+ children: Q.distribution.map((e) => /* @__PURE__ */ T("div", {
544
+ className: "flex items-center gap-2 text-xs",
545
+ children: [
546
+ /* @__PURE__ */ T("span", {
547
+ className: "w-8 text-text-secondary flex items-center gap-0.5",
548
+ children: [e.star, /* @__PURE__ */ w(b, { className: "h-3 w-3 fill-status-warning-text text-status-warning-text" })]
549
+ }),
550
+ /* @__PURE__ */ w("div", {
551
+ className: "flex-1 h-2 rounded-full bg-bg-sunken overflow-hidden",
552
+ children: /* @__PURE__ */ w("div", {
553
+ className: "h-full rounded-full bg-[var(--color-accent-soft)]",
554
+ style: { width: `${e.count / ae * 100}%` }
555
+ })
556
+ }),
557
+ /* @__PURE__ */ w("span", {
558
+ className: "w-6 text-right text-text-secondary",
559
+ children: e.count
560
+ })
561
+ ]
562
+ }, e.star))
646
563
  }),
647
- /* @__PURE__ */ x("p", {
564
+ /* @__PURE__ */ w("p", {
648
565
  className: "text-sm font-medium text-text-primary mb-2",
649
- children: "Top Customers"
566
+ children: "Recent Reviews"
650
567
  }),
651
- /* @__PURE__ */ x("div", {
652
- className: "overflow-x-auto",
653
- children: /* @__PURE__ */ S("table", {
654
- className: "w-full text-sm",
655
- children: [/* @__PURE__ */ x("thead", { children: /* @__PURE__ */ S("tr", {
656
- className: "border-b border-border-subtle",
657
- children: [
658
- /* @__PURE__ */ x("th", {
659
- className: "py-2 text-left font-medium text-text-secondary",
660
- children: "#"
661
- }),
662
- /* @__PURE__ */ x("th", {
663
- className: "py-2 text-left font-medium text-text-secondary",
664
- children: "Customer"
665
- }),
666
- /* @__PURE__ */ x("th", {
667
- className: "py-2 text-right font-medium text-text-secondary",
668
- children: "Orders"
669
- }),
670
- /* @__PURE__ */ x("th", {
671
- className: "py-2 text-right font-medium text-text-secondary",
672
- children: "Total Spent"
673
- })
674
- ]
675
- }) }), /* @__PURE__ */ x("tbody", { children: E.customers.topCustomers.map((e, t) => /* @__PURE__ */ S("tr", {
676
- className: "border-b border-border-subtle last:border-0",
677
- children: [
678
- /* @__PURE__ */ x("td", {
679
- className: "py-2.5 text-text-secondary",
680
- children: t + 1
681
- }),
682
- /* @__PURE__ */ x("td", {
683
- className: "py-2.5 font-medium text-text-primary",
684
- children: e.name
685
- }),
686
- /* @__PURE__ */ x("td", {
687
- className: "py-2.5 text-right text-text-primary",
688
- children: e.orders
689
- }),
690
- /* @__PURE__ */ x("td", {
691
- className: "py-2.5 text-right font-medium text-text-primary",
692
- children: r(e.totalSpent, { minimumFractionDigits: 0 })
568
+ /* @__PURE__ */ w("div", {
569
+ className: "space-y-3",
570
+ children: Q.recent.map((e) => /* @__PURE__ */ T("div", {
571
+ className: "rounded-md border border-border-subtle p-3 text-sm",
572
+ children: [/* @__PURE__ */ T("div", {
573
+ className: "flex items-center justify-between mb-1",
574
+ children: [/* @__PURE__ */ T("span", {
575
+ className: "flex items-center gap-0.5 text-status-warning-text text-xs font-medium",
576
+ children: [/* @__PURE__ */ w(b, { className: "h-3 w-3 fill-status-warning-text text-status-warning-text" }), e.rating.toFixed(1)]
577
+ }), /* @__PURE__ */ w("span", {
578
+ className: "text-xs text-text-secondary",
579
+ children: new Date(e.createdAt).toLocaleDateString("en-IN", {
580
+ day: "2-digit",
581
+ month: "short",
582
+ year: "numeric"
693
583
  })
694
- ]
695
- }, e.id)) })]
696
- })
697
- }),
698
- /* @__PURE__ */ x("div", {
699
- className: "mt-4 flex items-center gap-4 text-sm",
700
- children: /* @__PURE__ */ S("div", {
701
- className: "flex items-center gap-1.5",
702
- children: [/* @__PURE__ */ x(_, { className: "h-4 w-4 text-status-success-text" }), /* @__PURE__ */ S("span", {
703
- className: "text-text-secondary",
704
- children: [
705
- E.customers.satisfaction.positiveReviews,
706
- "/",
707
- E.customers.satisfaction.reviews,
708
- " positive reviews"
709
- ]
584
+ })]
585
+ }), e.review && /* @__PURE__ */ w("p", {
586
+ className: "text-xs text-text-secondary",
587
+ children: e.review
710
588
  })]
711
- })
589
+ }, e.id))
712
590
  })
713
- ]
591
+ ] })]
714
592
  })]
715
- }), /* @__PURE__ */ S("div", {
593
+ }), /* @__PURE__ */ T("div", {
716
594
  className: "space-y-6",
717
- children: [/* @__PURE__ */ S("div", {
718
- className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
719
- children: [/* @__PURE__ */ x("div", {
720
- className: "border-b border-border-subtle px-5 py-4",
721
- children: /* @__PURE__ */ S("h2", {
722
- className: "text-base font-semibold text-text-primary flex items-center gap-2",
723
- children: [/* @__PURE__ */ x(u, { className: "h-4 w-4 text-text-secondary" }), "Peak Hours"]
724
- })
725
- }), /* @__PURE__ */ x("div", {
726
- className: "p-5 space-y-3",
727
- children: E.performance.peakHours.map((e) => {
728
- let n = e.orders / M * 100;
729
- return /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
730
- className: "flex items-center justify-between text-xs mb-1",
731
- children: [/* @__PURE__ */ x("span", {
732
- className: "text-text-primary",
733
- children: e.hour
734
- }), /* @__PURE__ */ S("span", {
735
- className: "text-text-secondary",
736
- children: [e.orders, " orders"]
737
- })]
738
- }), /* @__PURE__ */ x("div", {
739
- className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
740
- children: /* @__PURE__ */ x("div", {
741
- className: t("h-full rounded-full", e.orders > 28 ? "bg-status-error-bg-subtle" : e.orders > 22 ? "bg-status-warning-bg-subtle" : "bg-status-success-bg-subtle"),
742
- style: { width: `${n}%` }
743
- })
744
- })] }, e.hour);
745
- })
746
- })]
747
- }), /* @__PURE__ */ S("div", {
748
- className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
749
- children: [/* @__PURE__ */ x("div", {
750
- className: "border-b border-border-subtle px-5 py-4",
751
- children: /* @__PURE__ */ S("h2", {
752
- className: "text-base font-semibold text-text-primary flex items-center gap-2",
753
- children: [/* @__PURE__ */ x(l, { className: "h-4 w-4 text-text-secondary" }), "Peak Days"]
754
- })
755
- }), /* @__PURE__ */ x("div", {
756
- className: "p-5 space-y-3",
757
- children: E.performance.peakDays.map((e) => {
758
- let t = e.orders / N * 100;
759
- return /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
760
- className: "flex items-center justify-between text-xs mb-1",
761
- children: [/* @__PURE__ */ x("span", {
762
- className: "text-text-primary",
763
- children: e.day
764
- }), /* @__PURE__ */ S("span", {
765
- className: "text-text-secondary",
766
- children: [e.orders, " orders"]
767
- })]
768
- }), /* @__PURE__ */ x("div", {
769
- className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
770
- children: /* @__PURE__ */ x("div", {
771
- className: "h-full rounded-full bg-[var(--color-accent-soft)]",
772
- style: { width: `${t}%` }
773
- })
774
- })] }, e.day);
595
+ children: [
596
+ /* @__PURE__ */ T("div", {
597
+ className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
598
+ children: [/* @__PURE__ */ w("div", {
599
+ className: "border-b border-border-subtle px-5 py-4",
600
+ children: /* @__PURE__ */ T("h2", {
601
+ className: "text-base font-semibold text-text-primary flex items-center gap-2",
602
+ children: [/* @__PURE__ */ w(h, { className: "h-4 w-4 text-text-secondary" }), "Peak Hours"]
603
+ })
604
+ }), /* @__PURE__ */ w("div", {
605
+ className: "p-5 space-y-3",
606
+ children: q.length === 0 ? /* @__PURE__ */ w("p", {
607
+ className: "text-sm text-text-secondary py-2 text-center",
608
+ children: "No data yet."
609
+ }) : q.map((e) => {
610
+ let t = e.orders / re * 100;
611
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
612
+ className: "flex items-center justify-between text-xs mb-1",
613
+ children: [/* @__PURE__ */ w("span", {
614
+ className: "text-text-primary",
615
+ children: `${e.hour}:00`
616
+ }), /* @__PURE__ */ T("span", {
617
+ className: "text-text-secondary",
618
+ children: [e.orders, " orders"]
619
+ })]
620
+ }), /* @__PURE__ */ w("div", {
621
+ className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
622
+ children: /* @__PURE__ */ w("div", {
623
+ className: "h-full rounded-full bg-[var(--color-accent-soft)]",
624
+ style: { width: `${t}%` }
625
+ })
626
+ })] }, e.hour);
627
+ })
628
+ })]
629
+ }),
630
+ /* @__PURE__ */ T("div", {
631
+ className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
632
+ children: [/* @__PURE__ */ w("div", {
633
+ className: "border-b border-border-subtle px-5 py-4",
634
+ children: /* @__PURE__ */ T("h2", {
635
+ className: "text-base font-semibold text-text-primary flex items-center gap-2",
636
+ children: [/* @__PURE__ */ w(m, { className: "h-4 w-4 text-text-secondary" }), "Peak Days"]
637
+ })
638
+ }), /* @__PURE__ */ w("div", {
639
+ className: "p-5 space-y-3",
640
+ children: J.length === 0 ? /* @__PURE__ */ w("p", {
641
+ className: "text-sm text-text-secondary py-2 text-center",
642
+ children: "No data yet."
643
+ }) : J.map((e) => {
644
+ let t = e.orders / ie * 100;
645
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
646
+ className: "flex items-center justify-between text-xs mb-1",
647
+ children: [/* @__PURE__ */ w("span", {
648
+ className: "text-text-primary",
649
+ children: e.day
650
+ }), /* @__PURE__ */ T("span", {
651
+ className: "text-text-secondary",
652
+ children: [e.orders, " orders"]
653
+ })]
654
+ }), /* @__PURE__ */ w("div", {
655
+ className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
656
+ children: /* @__PURE__ */ w("div", {
657
+ className: "h-full rounded-full bg-[var(--color-accent-soft)]",
658
+ style: { width: `${t}%` }
659
+ })
660
+ })] }, e.day);
661
+ })
662
+ })]
663
+ }),
664
+ Q.count > 0 && /* @__PURE__ */ w("div", {
665
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
666
+ children: /* @__PURE__ */ T("div", {
667
+ className: "flex items-center gap-1.5 text-sm",
668
+ children: [/* @__PURE__ */ w(x, { className: "h-4 w-4 text-status-success-text" }), /* @__PURE__ */ T("span", {
669
+ className: "text-text-secondary",
670
+ children: [
671
+ Q.positive,
672
+ "/",
673
+ Q.count,
674
+ " positive reviews"
675
+ ]
676
+ })]
775
677
  })
776
- })]
777
- })]
678
+ })
679
+ ]
778
680
  })]
779
681
  }),
780
- /* @__PURE__ */ S("div", {
682
+ /* @__PURE__ */ T("div", {
781
683
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
782
- children: [/* @__PURE__ */ x("div", {
684
+ children: [/* @__PURE__ */ w("div", {
783
685
  className: "border-b border-border-subtle px-5 py-4",
784
- children: /* @__PURE__ */ S("h2", {
686
+ children: /* @__PURE__ */ T("h2", {
785
687
  className: "text-base font-semibold text-text-primary flex items-center gap-2",
786
- children: [/* @__PURE__ */ x(v, { className: "h-4 w-4 text-text-secondary" }), "Daily Order Trends"]
688
+ children: [/* @__PURE__ */ w(S, { className: "h-4 w-4 text-text-secondary" }), "Daily Order Trends"]
787
689
  })
788
- }), /* @__PURE__ */ x("div", {
690
+ }), /* @__PURE__ */ w("div", {
789
691
  className: "overflow-x-auto",
790
- children: /* @__PURE__ */ S("table", {
692
+ children: /* @__PURE__ */ T("table", {
791
693
  className: "w-full text-sm",
792
- children: [/* @__PURE__ */ x("thead", { children: /* @__PURE__ */ S("tr", {
694
+ children: [/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", {
793
695
  className: "border-b border-border-subtle",
794
696
  children: [
795
- /* @__PURE__ */ x("th", {
697
+ /* @__PURE__ */ w("th", {
796
698
  className: "px-5 py-2.5 text-left font-medium text-text-secondary",
797
699
  children: "Date"
798
700
  }),
799
- /* @__PURE__ */ x("th", {
701
+ /* @__PURE__ */ w("th", {
800
702
  className: "px-5 py-2.5 text-right font-medium text-text-secondary",
801
703
  children: "Orders"
802
704
  }),
803
- /* @__PURE__ */ x("th", {
705
+ /* @__PURE__ */ w("th", {
804
706
  className: "px-5 py-2.5 text-right font-medium text-text-secondary",
805
707
  children: "Revenue"
806
708
  })
807
709
  ]
808
- }) }), /* @__PURE__ */ x("tbody", { children: i.orderTrends.map((e) => /* @__PURE__ */ S("tr", {
710
+ }) }), /* @__PURE__ */ w("tbody", { children: te.map((e) => /* @__PURE__ */ T("tr", {
809
711
  className: "border-b border-border-subtle last:border-0",
810
712
  children: [
811
- /* @__PURE__ */ x("td", {
713
+ /* @__PURE__ */ w("td", {
812
714
  className: "px-5 py-2.5 text-text-primary",
813
715
  children: new Date(e.date).toLocaleDateString("en-IN", {
814
716
  day: "2-digit",
815
717
  month: "short"
816
718
  })
817
719
  }),
818
- /* @__PURE__ */ x("td", {
720
+ /* @__PURE__ */ w("td", {
819
721
  className: "px-5 py-2.5 text-right text-text-primary",
820
722
  children: e.orders
821
723
  }),
822
- /* @__PURE__ */ x("td", {
724
+ /* @__PURE__ */ w("td", {
823
725
  className: "px-5 py-2.5 text-right font-medium text-text-primary",
824
- children: r(e.revenue, { minimumFractionDigits: 0 })
726
+ children: c(e.revenue, { minimumFractionDigits: 0 })
825
727
  })
826
728
  ]
827
729
  }, e.date)) })]
828
730
  })
829
731
  })]
830
- }),
831
- /* @__PURE__ */ S("div", {
832
- className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
833
- children: [/* @__PURE__ */ x("div", {
834
- className: "border-b border-border-subtle px-5 py-4",
835
- children: /* @__PURE__ */ S("h2", {
836
- className: "text-base font-semibold text-text-primary flex items-center gap-2",
837
- children: [/* @__PURE__ */ x(y, { className: "h-4 w-4 text-text-secondary" }), "Monthly Customer Growth"]
838
- })
839
- }), /* @__PURE__ */ S("div", {
840
- className: "p-5",
841
- children: [/* @__PURE__ */ x("div", {
842
- className: "flex items-end gap-1.5 h-20",
843
- children: i.customerGrowth.map((e) => {
844
- let t = Math.max(...i.customerGrowth.map((e) => e.newCustomers));
845
- return /* @__PURE__ */ x("div", {
846
- className: "flex-1 rounded-t bg-[var(--color-accent-soft)] hover:bg-[var(--color-accent-soft)] transition-colors cursor-default",
847
- style: { height: `${e.newCustomers / t * 100}%` },
848
- title: `${e.month}: ${e.newCustomers} new customers`
849
- }, e.month);
850
- })
851
- }), /* @__PURE__ */ x("div", {
852
- className: "flex justify-between mt-2 text-xs text-text-secondary",
853
- children: i.customerGrowth.length > 0 && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", { children: i.customerGrowth[0].month }), /* @__PURE__ */ x("span", { children: i.customerGrowth[i.customerGrowth.length - 1].month })] })
854
- })]
855
- })]
856
732
  })
857
733
  ]
858
734
  })
@@ -860,6 +736,6 @@ var E = {
860
736
  });
861
737
  };
862
738
  //#endregion
863
- export { D as AnalyticsDashboard };
739
+ export { M as AnalyticsDashboard };
864
740
 
865
741
  //# sourceMappingURL=AnalyticsDashboard.js.map