@burdenoff/microfe-kadaikodi 2026.704.1 → 2026.704.3

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 (77) hide show
  1. package/dist/kadaikodi/hooks/useKadaikodiApi.js +77 -26
  2. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  3. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +297 -479
  4. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  5. package/dist/kadaikodi/pages/admin/AdminDashboard.js +114 -400
  6. package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
  7. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +166 -292
  8. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
  9. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +282 -453
  10. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  11. package/dist/kadaikodi/pages/admin/AdminProfilePage.js +115 -242
  12. package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
  13. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +2 -2
  14. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
  15. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  16. package/dist/kadaikodi/pages/admin/UserManagementPage.js +5 -5
  17. package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
  18. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +503 -627
  19. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  20. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +339 -282
  21. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  22. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +323 -422
  23. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  24. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -383
  25. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  26. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +249 -208
  27. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  28. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +1 -1
  29. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  30. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +1 -1
  31. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  32. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +171 -627
  33. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  34. package/dist/kadaikodi/pages/common/HelpSupportPage.js +331 -415
  35. package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
  36. package/dist/kadaikodi/pages/common/NotificationCenterPage.js +18 -670
  37. package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
  38. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  39. package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -2
  40. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  41. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +191 -369
  42. package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
  43. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +233 -389
  44. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  45. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  46. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
  47. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  48. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +76 -118
  49. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
  50. package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
  51. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +135 -213
  52. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
  53. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +272 -774
  54. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  55. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +232 -343
  56. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  57. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +112 -600
  58. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  59. package/dist/kadaikodi/pages/investor/InvestorDashboard.js +127 -294
  60. package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
  61. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +204 -290
  62. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  63. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +159 -500
  64. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
  65. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +399 -487
  66. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
  67. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +13 -13
  68. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  69. package/dist/kadaikodi/pages/worker/WorkerDashboard.js +192 -296
  70. package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
  71. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +245 -397
  72. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
  73. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +85 -117
  74. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
  75. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +177 -395
  76. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
  77. package/package.json +1 -1
@@ -2,436 +2,310 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { MetricsCard as n } from "../../components/MetricsCard.js";
4
4
  import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { formatCurrency as i } from "../../utils/formatters.js";
6
- import { useEffect as a, useState as o } from "react";
7
- import { ArrowLeft as s, Award as c, BarChart3 as l, Calendar as u, Download as d, IndianRupee as f, Loader2 as p, PieChart as m, ShoppingBag as h, ShoppingCart as g, TrendingDown as _, TrendingUp as v } from "lucide-react";
8
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
9
- import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
5
+ import { useAdminAnalytics as i, useDashboardStats as a } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatCurrency as o } from "../../utils/formatters.js";
7
+ import { useMemo as s } from "react";
8
+ import { ArrowLeft as c, Award as l, BarChart3 as u, Calendar as d, Clock as f, Download as p, IndianRupee as m, Loader2 as h, ShoppingBag as g, ShoppingCart as _, Star as v, Store as y, TrendingUp as b } from "lucide-react";
9
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
10
+ import { EmphasisPanel as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
10
11
  //#region src/kadaikodi/pages/admin/AdminFinancialPage.tsx
11
- function C() {
12
- let { navigateTo: C } = e(), [w, T] = o(!0), [E, D] = o("30d"), [O, k] = o(null);
13
- a(() => {
14
- T(!0);
15
- let e = setTimeout(() => {
16
- k({
17
- totalRevenue: 285e4,
18
- monthlyRevenue: 425e3,
19
- revenueGrowth: 12.5,
20
- totalOrders: 15420,
21
- averageOrderValue: 185,
22
- commission: 142500,
23
- payouts: 28e4,
24
- pendingPayouts: 45e3,
25
- topPerformingCarts: [
26
- {
27
- id: "1",
28
- name: "South Indian Express",
29
- revenue: 125e3,
30
- orders: 850
31
- },
32
- {
33
- id: "2",
34
- name: "Pizza Corner",
35
- revenue: 98e3,
36
- orders: 620
37
- },
38
- {
39
- id: "3",
40
- name: "Biryani House",
41
- revenue: 87e3,
42
- orders: 580
43
- },
44
- {
45
- id: "4",
46
- name: "Healthy Bites",
47
- revenue: 76e3,
48
- orders: 490
49
- },
50
- {
51
- id: "5",
52
- name: "Street Food Junction",
53
- revenue: 65e3,
54
- orders: 420
55
- }
56
- ],
57
- revenueByCategory: [
58
- {
59
- category: "South Indian",
60
- amount: 75e4,
61
- percentage: 26.3
62
- },
63
- {
64
- category: "North Indian",
65
- amount: 62e4,
66
- percentage: 21.8
67
- },
68
- {
69
- category: "Chinese",
70
- amount: 485e3,
71
- percentage: 17
72
- },
73
- {
74
- category: "Fast Food",
75
- amount: 425e3,
76
- percentage: 14.9
77
- },
78
- {
79
- category: "Beverages",
80
- amount: 32e4,
81
- percentage: 11.2
82
- },
83
- {
84
- category: "Desserts",
85
- amount: 25e4,
86
- percentage: 8.8
87
- }
88
- ],
89
- monthlyTrends: [
90
- {
91
- month: "Jan",
92
- revenue: 38e4,
93
- orders: 1200,
94
- commission: 19e3
95
- },
96
- {
97
- month: "Feb",
98
- revenue: 42e4,
99
- orders: 1350,
100
- commission: 21e3
101
- },
102
- {
103
- month: "Mar",
104
- revenue: 395e3,
105
- orders: 1280,
106
- commission: 19750
107
- },
108
- {
109
- month: "Apr",
110
- revenue: 44e4,
111
- orders: 1420,
112
- commission: 22e3
113
- },
114
- {
115
- month: "May",
116
- revenue: 465e3,
117
- orders: 1580,
118
- commission: 23250
119
- },
120
- {
121
- month: "Jun",
122
- revenue: 425e3,
123
- orders: 1400,
124
- commission: 21250
125
- }
126
- ]
127
- }), T(!1);
128
- }, 1e3);
129
- return () => clearTimeout(e);
130
- }, [E]);
131
- let A = (e) => i(e, { minimumFractionDigits: 0 }), j = () => {
132
- alert("Financial report export initiated");
133
- }, M = (e) => e === 0 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-status-warning-text" }) : e === 1 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-text-secondary" }) : e === 2 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ y("span", {
12
+ function T() {
13
+ let { navigateTo: T } = e(), { data: E, isLoading: D } = a(), { data: O, isLoading: k } = i(), A = D || k, j = (e) => o(e, { minimumFractionDigits: 0 }), M = s(() => E && E.totalOrders > 0 ? E.totalRevenue / E.totalOrders : 0, [E]), N = s(() => {
14
+ let e = Object.entries(O?.categoryDistribution ?? {}), t = e.reduce((e, [, t]) => e + t, 0);
15
+ return e.map(([e, n]) => ({
16
+ category: e,
17
+ count: n,
18
+ percentage: t > 0 ? n / t * 100 : 0
19
+ })).sort((e, t) => t.count - e.count);
20
+ }, [O]), P = O?.topProviders ?? [], F = O?.orderTrends ?? [], I = (e) => e.replace(/_/g, " ").toLowerCase(), L = (e) => e === "delivered" ? "bg-status-success-bg-subtle text-status-success-text" : e === "cancelled" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-warning-bg-subtle text-status-warning-text", R = () => {
21
+ let e = [];
22
+ e.push("Kadaikodi Financial Report"), e.push(""), e.push("Metric,Value"), e.push(`Total Revenue,${E?.totalRevenue ?? 0}`), e.push(`Total Orders,${E?.totalOrders ?? 0}`), e.push(`Average Order Value,${Math.round(M)}`), e.push(`Pending Orders,${E?.pendingOrders ?? 0}`), e.push(""), e.push("Cart Category Distribution"), e.push("Category,Carts,Share %"), N.forEach((t) => {
23
+ e.push(`${t.category},${t.count},${(t.percentage ?? 0).toFixed(1)}`);
24
+ }), e.push(""), e.push("Top Performing Carts"), e.push("Cart,Category,Rating"), P.forEach((t) => {
25
+ e.push(`${t.name},${t.category},${t.rating ?? 0}`);
26
+ }), e.push(""), e.push("Recent Orders"), e.push("Date,Status,Amount"), F.forEach((t) => {
27
+ e.push(`${new Date(t.createdAt).toISOString().slice(0, 10)},${t.status},${t.total ?? 0}`);
28
+ });
29
+ let t = new Blob([e.join("\n")], { type: "text/csv;charset=utf-8;" }), n = URL.createObjectURL(t), r = document.createElement("a");
30
+ r.href = n, r.download = `kadaikodi-financial-report-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, r.click(), URL.revokeObjectURL(n);
31
+ }, z = (e) => e < 3 ? /* @__PURE__ */ x(l, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ x("span", {
134
32
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-secondary",
135
33
  children: e + 1
136
34
  });
137
- return w ? /* @__PURE__ */ y(t, {
35
+ return A ? /* @__PURE__ */ x(t, {
138
36
  title: "Financial Reports",
139
37
  description: "Loading financial data...",
140
- children: /* @__PURE__ */ b("div", {
38
+ children: /* @__PURE__ */ S("div", {
141
39
  className: "flex flex-col items-center justify-center py-20",
142
- children: [/* @__PURE__ */ y(p, { className: "h-10 w-10 animate-spin text-text-secondary mb-4" }), /* @__PURE__ */ y("p", {
40
+ children: [/* @__PURE__ */ x(h, { className: "h-10 w-10 animate-spin text-text-secondary mb-4" }), /* @__PURE__ */ x("p", {
143
41
  className: "text-text-secondary",
144
42
  children: "Loading financial data..."
145
43
  })]
146
44
  })
147
- }) : O ? /* @__PURE__ */ b(t, {
45
+ }) : E ? /* @__PURE__ */ S(t, {
148
46
  title: "Financial Reports",
149
- description: "Revenue, commissions, payouts, and financial trends",
150
- actions: /* @__PURE__ */ b("div", {
47
+ description: "Revenue, top carts and financial trends",
48
+ actions: /* @__PURE__ */ S("div", {
151
49
  className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-3",
152
- children: [
153
- /* @__PURE__ */ b("button", {
154
- type: "button",
155
- onClick: () => C("/admin"),
156
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
157
- children: [/* @__PURE__ */ y(s, { className: "h-4 w-4" }), " Back"]
158
- }),
159
- /* @__PURE__ */ b("select", {
160
- value: E,
161
- onChange: (e) => D(e.target.value),
162
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
163
- children: [
164
- /* @__PURE__ */ y("option", {
165
- value: "7d",
166
- children: "Last 7 days"
167
- }),
168
- /* @__PURE__ */ y("option", {
169
- value: "30d",
170
- children: "Last 30 days"
171
- }),
172
- /* @__PURE__ */ y("option", {
173
- value: "90d",
174
- children: "Last 3 months"
175
- }),
176
- /* @__PURE__ */ y("option", {
177
- value: "1y",
178
- children: "Last year"
179
- })
180
- ]
181
- }),
182
- /* @__PURE__ */ b("button", {
183
- type: "button",
184
- onClick: j,
185
- className: "flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
186
- children: [/* @__PURE__ */ y(d, { className: "h-4 w-4" }), " Export Report"]
187
- })
188
- ]
50
+ children: [/* @__PURE__ */ S("button", {
51
+ type: "button",
52
+ onClick: () => T("/admin"),
53
+ className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
54
+ children: [/* @__PURE__ */ x(c, { className: "h-4 w-4" }), " Back"]
55
+ }), /* @__PURE__ */ S("button", {
56
+ type: "button",
57
+ onClick: R,
58
+ className: "flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
59
+ children: [/* @__PURE__ */ x(p, { className: "h-4 w-4" }), " Export Report"]
60
+ })]
189
61
  }),
190
62
  children: [
191
- /* @__PURE__ */ y(S, {
63
+ /* @__PURE__ */ x(w, {
192
64
  className: "mb-6",
193
- children: "The money view of Kadaikodi. Use this page to track total and monthly revenue, see the platform commission you've earned, and stay on top of payouts owed to cart owners and workers — then export a report for accounting or investor updates. Adjust the date range to compare periods and watch the trend."
65
+ children: "The money view of Kadaikodi. Track total revenue and order volume, see which carts and categories drive the most business, and watch how orders trend over time — then export a CSV for accounting or investor updates."
194
66
  }),
195
- /* @__PURE__ */ b(x, {
67
+ /* @__PURE__ */ S(C, {
196
68
  className: "mb-8",
197
- children: [/* @__PURE__ */ y("h2", {
69
+ children: [/* @__PURE__ */ x("h2", {
198
70
  className: "mb-4 text-lg font-semibold text-text-primary",
199
71
  children: "Financial Summary"
200
- }), /* @__PURE__ */ b("div", {
72
+ }), /* @__PURE__ */ S("div", {
201
73
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
202
74
  children: [
203
- /* @__PURE__ */ y(n, {
204
- icon: /* @__PURE__ */ y(f, { className: "h-5 w-5" }),
205
- value: A(O.totalRevenue),
206
- label: "Total Revenue",
207
- trend: "up",
208
- trendValue: `+${O.revenueGrowth}% vs last period`
75
+ /* @__PURE__ */ x(n, {
76
+ featured: !0,
77
+ icon: /* @__PURE__ */ x(m, { className: "h-5 w-5" }),
78
+ value: j(E.totalRevenue),
79
+ label: "Total Revenue"
209
80
  }),
210
- /* @__PURE__ */ y(n, {
211
- icon: /* @__PURE__ */ y(v, { className: "h-5 w-5" }),
212
- value: A(O.monthlyRevenue),
213
- label: "Monthly Revenue",
214
- trendValue: "Current month"
81
+ /* @__PURE__ */ x(n, {
82
+ icon: /* @__PURE__ */ x(g, { className: "h-5 w-5" }),
83
+ value: (E.totalOrders ?? 0).toLocaleString("en-IN"),
84
+ label: "Total Orders"
215
85
  }),
216
- /* @__PURE__ */ y(n, {
217
- icon: /* @__PURE__ */ y(m, { className: "h-5 w-5" }),
218
- value: A(O.commission),
219
- label: "Commission Earned",
220
- trendValue: "Platform commission"
86
+ /* @__PURE__ */ x(n, {
87
+ icon: /* @__PURE__ */ x(b, { className: "h-5 w-5" }),
88
+ value: j(M),
89
+ label: "Avg Order Value"
221
90
  }),
222
- /* @__PURE__ */ y(n, {
223
- icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
224
- value: A(O.pendingPayouts),
225
- label: "Pending Payouts",
226
- trendValue: "Amount pending"
91
+ /* @__PURE__ */ x(n, {
92
+ icon: /* @__PURE__ */ x(f, { className: "h-5 w-5" }),
93
+ value: (E.pendingOrders ?? 0).toLocaleString("en-IN"),
94
+ label: "Pending Orders"
227
95
  })
228
96
  ]
229
97
  })]
230
98
  }),
231
- /* @__PURE__ */ b("div", {
99
+ /* @__PURE__ */ S("div", {
232
100
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",
233
- children: [/* @__PURE__ */ b("div", {
101
+ children: [/* @__PURE__ */ S("div", {
234
102
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
235
- children: [/* @__PURE__ */ b("div", {
103
+ children: [/* @__PURE__ */ S("div", {
236
104
  className: "flex items-center gap-2 mb-4",
237
- children: [/* @__PURE__ */ y(g, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h3", {
105
+ children: [/* @__PURE__ */ x(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
238
106
  className: "text-lg font-semibold text-text-primary",
239
107
  children: "Top Performing Carts"
240
108
  })]
241
- }), /* @__PURE__ */ y("div", {
109
+ }), P.length > 0 ? /* @__PURE__ */ x("div", {
242
110
  className: "space-y-3",
243
- children: O.topPerformingCarts.map((e, t) => /* @__PURE__ */ b("div", {
111
+ children: P.map((e, t) => /* @__PURE__ */ S("div", {
244
112
  className: "flex items-center justify-between rounded-lg bg-bg-sunken/50 p-3",
245
- children: [/* @__PURE__ */ b("div", {
113
+ children: [/* @__PURE__ */ S("div", {
246
114
  className: "flex items-center gap-3",
247
- children: [M(t), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
115
+ children: [z(t), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
248
116
  className: "text-sm font-medium text-text-primary",
249
117
  children: e.name
250
- }), /* @__PURE__ */ b("p", {
251
- className: "text-xs text-text-secondary",
252
- children: [e.orders, " orders"]
118
+ }), /* @__PURE__ */ x("p", {
119
+ className: "text-xs text-text-secondary capitalize",
120
+ children: I(e.category)
253
121
  })] })]
254
- }), /* @__PURE__ */ y("p", {
255
- className: "text-sm font-semibold text-text-primary",
256
- children: A(e.revenue)
122
+ }), /* @__PURE__ */ S("p", {
123
+ className: "text-sm font-semibold text-text-primary flex items-center gap-1",
124
+ children: [/* @__PURE__ */ x(v, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }), (e.rating ?? 0).toFixed(1)]
257
125
  })]
258
126
  }, e.id))
127
+ }) : /* @__PURE__ */ x("p", {
128
+ className: "text-sm text-text-secondary",
129
+ children: "Top-performing carts will be ranked here once orders start flowing."
259
130
  })]
260
- }), /* @__PURE__ */ b("div", {
131
+ }), /* @__PURE__ */ S("div", {
261
132
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
262
- children: [/* @__PURE__ */ b("div", {
133
+ children: [/* @__PURE__ */ S("div", {
263
134
  className: "flex items-center gap-2 mb-4",
264
- children: [/* @__PURE__ */ y(l, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h3", {
135
+ children: [/* @__PURE__ */ x(u, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
265
136
  className: "text-lg font-semibold text-text-primary",
266
- children: "Revenue by Category"
137
+ children: "Cart Category Distribution"
267
138
  })]
268
- }), /* @__PURE__ */ y("div", {
139
+ }), N.length > 0 ? /* @__PURE__ */ x("div", {
269
140
  className: "space-y-3",
270
- children: O.revenueByCategory.map((e) => /* @__PURE__ */ b("div", { children: [
271
- /* @__PURE__ */ b("div", {
141
+ children: N.map((e) => /* @__PURE__ */ S("div", { children: [
142
+ /* @__PURE__ */ S("div", {
272
143
  className: "flex items-center justify-between mb-1",
273
- children: [/* @__PURE__ */ y("span", {
274
- className: "text-sm font-medium text-text-primary",
275
- children: e.category
276
- }), /* @__PURE__ */ b("span", {
144
+ children: [/* @__PURE__ */ x("span", {
145
+ className: "text-sm font-medium text-text-primary capitalize",
146
+ children: I(e.category)
147
+ }), /* @__PURE__ */ S("span", {
277
148
  className: "text-sm text-text-secondary",
278
- children: [e.percentage, "%"]
149
+ children: [(e.percentage ?? 0).toFixed(1), "%"]
279
150
  })]
280
151
  }),
281
- /* @__PURE__ */ y("div", {
152
+ /* @__PURE__ */ x("div", {
282
153
  className: "w-full bg-bg-sunken rounded-full h-2",
283
- children: /* @__PURE__ */ y("div", {
154
+ children: /* @__PURE__ */ x("div", {
284
155
  className: "bg-action-primary-bg h-2 rounded-full transition-all duration-300",
285
156
  style: { width: `${e.percentage}%` }
286
157
  })
287
158
  }),
288
- /* @__PURE__ */ y("div", {
159
+ /* @__PURE__ */ x("div", {
289
160
  className: "text-right mt-1",
290
- children: /* @__PURE__ */ y("span", {
161
+ children: /* @__PURE__ */ S("span", {
291
162
  className: "text-sm font-semibold text-text-primary",
292
- children: A(e.amount)
163
+ children: [
164
+ (e.count ?? 0).toLocaleString("en-IN"),
165
+ " ",
166
+ /* @__PURE__ */ x("span", {
167
+ className: "text-xs font-normal text-text-secondary",
168
+ children: e.count === 1 ? "cart" : "carts"
169
+ })
170
+ ]
293
171
  })
294
172
  })
295
173
  ] }, e.category))
174
+ }) : /* @__PURE__ */ x("p", {
175
+ className: "text-sm text-text-secondary",
176
+ children: "Cart categories will appear here as carts are onboarded."
296
177
  })]
297
178
  })]
298
179
  }),
299
- /* @__PURE__ */ b("div", {
180
+ F.length > 0 && /* @__PURE__ */ S("div", {
300
181
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6 mb-8",
301
- children: [/* @__PURE__ */ b("div", {
182
+ children: [/* @__PURE__ */ S("div", {
302
183
  className: "flex items-center gap-2 mb-4",
303
- children: [/* @__PURE__ */ y(u, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h3", {
184
+ children: [/* @__PURE__ */ x(d, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
304
185
  className: "text-lg font-semibold text-text-primary",
305
- children: "Monthly Trends"
186
+ children: "Recent Orders"
306
187
  })]
307
- }), /* @__PURE__ */ y("div", {
188
+ }), /* @__PURE__ */ x("div", {
308
189
  className: "overflow-x-auto",
309
- children: /* @__PURE__ */ b("table", {
190
+ children: /* @__PURE__ */ S("table", {
310
191
  className: "w-full",
311
- children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", {
192
+ children: [/* @__PURE__ */ x("thead", { children: /* @__PURE__ */ S("tr", {
312
193
  className: "border-b border-border-subtle bg-bg-sunken/50",
313
194
  children: [
314
- /* @__PURE__ */ y("th", {
195
+ /* @__PURE__ */ x("th", {
315
196
  className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
316
- children: "Month"
317
- }),
318
- /* @__PURE__ */ y("th", {
319
- className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider",
320
- children: "Revenue"
197
+ children: "Date"
321
198
  }),
322
- /* @__PURE__ */ y("th", {
323
- className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider",
324
- children: "Orders"
199
+ /* @__PURE__ */ x("th", {
200
+ className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
201
+ children: "Status"
325
202
  }),
326
- /* @__PURE__ */ y("th", {
203
+ /* @__PURE__ */ x("th", {
327
204
  className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider",
328
- children: "Commission"
205
+ children: "Amount"
329
206
  })
330
207
  ]
331
- }) }), /* @__PURE__ */ y("tbody", {
208
+ }) }), /* @__PURE__ */ x("tbody", {
332
209
  className: "divide-y divide-border",
333
- children: O.monthlyTrends.map((e) => /* @__PURE__ */ b("tr", {
210
+ children: F.map((e) => /* @__PURE__ */ S("tr", {
334
211
  className: "hover:bg-accent/50 transition-colors",
335
212
  children: [
336
- /* @__PURE__ */ y("td", {
213
+ /* @__PURE__ */ x("td", {
337
214
  className: "px-4 py-3 text-sm font-medium text-text-primary",
338
- children: e.month
215
+ children: new Date(e.createdAt).toLocaleDateString("en-IN", {
216
+ day: "2-digit",
217
+ month: "short",
218
+ year: "numeric"
219
+ })
339
220
  }),
340
- /* @__PURE__ */ y("td", {
341
- className: "px-4 py-3 text-sm text-right text-text-primary",
342
- children: A(e.revenue)
343
- }),
344
- /* @__PURE__ */ y("td", {
345
- className: "px-4 py-3 text-sm text-right text-text-primary",
346
- children: e.orders.toLocaleString("en-IN")
221
+ /* @__PURE__ */ x("td", {
222
+ className: "px-4 py-3 text-sm",
223
+ children: /* @__PURE__ */ x("span", {
224
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize ${L(e.status)}`,
225
+ children: e.status.replace(/_/g, " ")
226
+ })
347
227
  }),
348
- /* @__PURE__ */ y("td", {
228
+ /* @__PURE__ */ x("td", {
349
229
  className: "px-4 py-3 text-sm text-right text-text-primary",
350
- children: A(e.commission)
230
+ children: j(e.total ?? 0)
351
231
  })
352
232
  ]
353
- }, e.month))
233
+ }, e.id))
354
234
  })]
355
235
  })
356
236
  })]
357
237
  }),
358
- /* @__PURE__ */ b("div", {
238
+ /* @__PURE__ */ S("div", {
359
239
  className: "grid grid-cols-1 md:grid-cols-3 gap-6",
360
240
  children: [
361
- /* @__PURE__ */ b("div", {
241
+ /* @__PURE__ */ S("div", {
362
242
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
363
243
  children: [
364
- /* @__PURE__ */ y(h, { className: "h-8 w-8 text-primary mx-auto mb-3" }),
365
- /* @__PURE__ */ y("h4", {
244
+ /* @__PURE__ */ x(g, { className: "h-8 w-8 text-primary mx-auto mb-3" }),
245
+ /* @__PURE__ */ x("h4", {
366
246
  className: "text-lg font-semibold text-text-primary mb-2",
367
247
  children: "Total Orders"
368
248
  }),
369
- /* @__PURE__ */ y("p", {
249
+ /* @__PURE__ */ x("p", {
370
250
  className: "text-2xl font-bold text-primary",
371
- children: O.totalOrders.toLocaleString("en-IN")
251
+ children: (E.totalOrders ?? 0).toLocaleString("en-IN")
372
252
  }),
373
- /* @__PURE__ */ y("p", {
253
+ /* @__PURE__ */ x("p", {
374
254
  className: "text-sm text-text-secondary mt-1",
375
- children: "All time orders"
255
+ children: "All-time orders"
376
256
  })
377
257
  ]
378
258
  }),
379
- /* @__PURE__ */ b("div", {
259
+ /* @__PURE__ */ S("div", {
380
260
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
381
261
  children: [
382
- /* @__PURE__ */ y(l, { className: "h-8 w-8 text-status-success-text mx-auto mb-3" }),
383
- /* @__PURE__ */ y("h4", {
262
+ /* @__PURE__ */ x(u, { className: "h-8 w-8 text-status-success-text mx-auto mb-3" }),
263
+ /* @__PURE__ */ x("h4", {
384
264
  className: "text-lg font-semibold text-text-primary mb-2",
385
265
  children: "Average Order Value"
386
266
  }),
387
- /* @__PURE__ */ y("p", {
267
+ /* @__PURE__ */ x("p", {
388
268
  className: "text-2xl font-bold text-status-success-text",
389
- children: A(O.averageOrderValue)
269
+ children: j(M)
390
270
  }),
391
- /* @__PURE__ */ y("p", {
271
+ /* @__PURE__ */ x("p", {
392
272
  className: "text-sm text-text-secondary mt-1",
393
273
  children: "Per order average"
394
274
  })
395
275
  ]
396
276
  }),
397
- /* @__PURE__ */ b("div", {
277
+ /* @__PURE__ */ S("div", {
398
278
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
399
279
  children: [
400
- /* @__PURE__ */ y(f, { className: "h-8 w-8 text-text-primary mx-auto mb-3" }),
401
- /* @__PURE__ */ y("h4", {
280
+ /* @__PURE__ */ x(y, { className: "h-8 w-8 text-text-primary mx-auto mb-3" }),
281
+ /* @__PURE__ */ x("h4", {
402
282
  className: "text-lg font-semibold text-text-primary mb-2",
403
- children: "Total Payouts"
283
+ children: "Active Carts"
404
284
  }),
405
- /* @__PURE__ */ y("p", {
285
+ /* @__PURE__ */ x("p", {
406
286
  className: "text-2xl font-bold text-text-primary",
407
- children: A(O.payouts)
287
+ children: (E.activeProviders ?? 0).toLocaleString("en-IN")
408
288
  }),
409
- /* @__PURE__ */ y("p", {
289
+ /* @__PURE__ */ x("p", {
410
290
  className: "text-sm text-text-secondary mt-1",
411
- children: "Paid to cart owners"
291
+ children: "Currently live on the platform"
412
292
  })
413
293
  ]
414
294
  })
415
295
  ]
416
296
  })
417
297
  ]
418
- }) : /* @__PURE__ */ y(t, {
298
+ }) : /* @__PURE__ */ x(t, {
419
299
  title: "Financial Reports",
420
300
  description: "Unable to load financial data",
421
- children: /* @__PURE__ */ y(r, {
301
+ children: /* @__PURE__ */ x(r, {
422
302
  illustration: "empty-data",
423
303
  title: "No financial data available",
424
- description: "We couldn't load the financial figures for this period. Try a different date range or check back shortly.",
425
- action: /* @__PURE__ */ y("button", {
426
- type: "button",
427
- onClick: () => D("30d"),
428
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
429
- children: "Reset to last 30 days"
430
- })
304
+ description: "We couldn't load the financial figures right now. Please check back shortly."
431
305
  })
432
306
  });
433
307
  }
434
308
  //#endregion
435
- export { C as AdminFinancialPage };
309
+ export { T as AdminFinancialPage };
436
310
 
437
311
  //# sourceMappingURL=AdminFinancialPage.js.map