@burdenoff/microfe-kadaikodi 2026.802.1 → 2026.830.1

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 (58) hide show
  1. package/dist/kadaikodi/KadaikodiRoot.d.ts.map +1 -1
  2. package/dist/kadaikodi/KadaikodiRoot.js +69 -72
  3. package/dist/kadaikodi/KadaikodiRoot.js.map +1 -1
  4. package/dist/kadaikodi/components/InvestmentCard.d.ts.map +1 -1
  5. package/dist/kadaikodi/components/InvestmentCard.js +58 -54
  6. package/dist/kadaikodi/components/InvestmentCard.js.map +1 -1
  7. package/dist/kadaikodi/components/OrderCard.d.ts.map +1 -1
  8. package/dist/kadaikodi/components/StatusBadge.d.ts.map +1 -1
  9. package/dist/kadaikodi/components/StatusBadge.js +25 -14
  10. package/dist/kadaikodi/components/StatusBadge.js.map +1 -1
  11. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +24 -0
  12. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
  13. package/dist/kadaikodi/hooks/useKadaikodiApi.js +177 -132
  14. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  15. package/dist/kadaikodi/pages/HomePage.d.ts.map +1 -1
  16. package/dist/kadaikodi/pages/HomePage.js +284 -282
  17. package/dist/kadaikodi/pages/HomePage.js.map +1 -1
  18. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts +7 -2
  19. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts.map +1 -1
  20. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +319 -228
  21. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  22. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +1 -1
  23. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  24. package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts +10 -4
  25. package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts.map +1 -1
  26. package/dist/kadaikodi/pages/admin/CartManagementPage.js +320 -279
  27. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  28. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.d.ts.map +1 -1
  29. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +365 -292
  30. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -1
  31. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts +7 -2
  32. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts.map +1 -1
  33. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +300 -158
  34. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  35. package/dist/kadaikodi/pages/common/SettingsPage.js +286 -286
  36. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  37. package/dist/kadaikodi/pages/customer/CartDetailPage.d.ts.map +1 -1
  38. package/dist/kadaikodi/pages/customer/CartDetailPage.js +3 -3
  39. package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
  40. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts +13 -3
  41. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts.map +1 -1
  42. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +270 -220
  43. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
  44. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +97 -97
  45. package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts.map +1 -1
  46. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +1 -1
  47. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  48. package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +5 -3
  49. package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts.map +1 -1
  50. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +286 -199
  51. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  52. package/dist/kadaikodi/types/index.d.ts +46 -2
  53. package/dist/kadaikodi/types/index.d.ts.map +1 -1
  54. package/dist/shared/hooks/useTr.d.ts +2 -0
  55. package/dist/shared/hooks/useTr.d.ts.map +1 -0
  56. package/dist/shared/hooks/useTr.js +14 -0
  57. package/dist/shared/hooks/useTr.js.map +1 -0
  58. package/package.json +2 -2
@@ -1,19 +1,19 @@
1
1
  import { cn as e } from "../../utils/cn.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { EmptyState as n } from "../../components/EmptyState.js";
4
- import { useProviders as r, useUpdateProvider as ee } from "../../hooks/useKadaikodiApi.js";
5
- import { formatCurrency as te } from "../../utils/formatters.js";
6
- import { StatCard as i } from "../../components/viz/StatCard.js";
7
- import { SegmentedTabs as a } from "../../components/viz/SegmentedTabs.js";
4
+ import { useProviders as ee, useUpdateProvider as te } from "../../hooks/useKadaikodiApi.js";
5
+ import { formatCurrency as ne } from "../../utils/formatters.js";
6
+ import { StatCard as r } from "../../components/viz/StatCard.js";
7
+ import { SegmentedTabs as i } from "../../components/viz/SegmentedTabs.js";
8
8
  import "../../components/viz/index.js";
9
- import { Fragment as o, useMemo as s, useState as c } from "react";
10
- import { AlertCircle as l, Calendar as u, CheckCircle2 as d, ChevronDown as f, FileText as ne, IndianRupee as p, Loader2 as re, MapPin as ie, Search as m, Star as h, Store as g, X as _ } from "lucide-react";
11
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
- import { GlassCard as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
9
+ import { Fragment as a, useMemo as o, useState as s } from "react";
10
+ import { AlertCircle as c, Ban as re, Calendar as ie, CheckCircle2 as l, ChevronDown as u, FileText as d, IndianRupee as ae, Loader2 as oe, MapPin as se, Search as ce, Star as f, Store as p, X as le } from "lucide-react";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { GlassCard as ue, PagePurpose as de } from "@burdenoff/fe-libs/ui";
13
13
  //#region src/kadaikodi/pages/admin/CartManagementPage.tsx
14
- var b = (e) => e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase());
15
- function se(e) {
16
- let t = e.isVerified ? "verified" : e.isOpen ? "pending" : "inactive";
14
+ var g = (e) => e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase());
15
+ function _(e) {
16
+ let t = e.status ?? "DRAFT";
17
17
  return {
18
18
  id: e.id,
19
19
  name: e.name,
@@ -30,41 +30,68 @@ function se(e) {
30
30
  createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
31
31
  };
32
32
  }
33
- var x = {
34
- verified: {
33
+ var v = {
34
+ VERIFIED: {
35
35
  label: "Verified",
36
36
  cls: "bg-status-success-bg-subtle text-status-success-text"
37
37
  },
38
- pending: {
38
+ ACTIVE: {
39
+ label: "Active",
40
+ cls: "bg-status-success-bg-subtle text-status-success-text"
41
+ },
42
+ DRAFT: {
39
43
  label: "Pending",
40
44
  cls: "bg-status-warning-bg-subtle text-status-warning-text"
41
45
  },
42
- inactive: {
43
- label: "Inactive",
46
+ PAUSED: {
47
+ label: "Paused",
48
+ cls: "bg-status-warning-bg-subtle text-status-warning-text"
49
+ },
50
+ SUSPENDED: {
51
+ label: "Suspended",
52
+ cls: "bg-status-error-bg-subtle text-status-error-text"
53
+ },
54
+ ARCHIVED: {
55
+ label: "Archived",
44
56
  cls: "bg-bg-sunken text-text-secondary"
45
57
  }
46
- };
47
- function S() {
48
- let { data: S = [], isLoading: ce } = r(), C = ee(), [w, T] = c(null), E = (e, t) => {
49
- T({
58
+ }, y = [
59
+ "DRAFT",
60
+ "VERIFIED",
61
+ "ACTIVE",
62
+ "PAUSED",
63
+ "SUSPENDED",
64
+ "ARCHIVED"
65
+ ], b = (e) => e === "ACTIVE" || e === "VERIFIED" || e === "PAUSED" || e === "DRAFT";
66
+ function x() {
67
+ let { data: x = [], isLoading: fe } = ee(), S = te(), [C, w] = s(null), T = (e, t) => {
68
+ w({
50
69
  text: e,
51
70
  type: t
52
- }), setTimeout(() => T(null), 3500);
53
- }, [D, O] = c("all"), [k, A] = c(""), [j, M] = c(""), [N, P] = c("recent"), [F, I] = c(null), [L, R] = c(null), [z, B] = c("approve"), [V, H] = c(!1), [U, W] = c(""), G = s(() => S.map(se), [S]), K = s(() => ({
54
- all: G.length,
55
- verified: G.filter((e) => e.status === "verified").length,
56
- pending: G.filter((e) => e.status === "pending").length,
57
- inactive: G.filter((e) => e.status === "inactive").length
58
- }), [G]), q = s(() => {
59
- let e = G.filter((e) => e.rating > 0);
71
+ }), setTimeout(() => w(null), 3500);
72
+ }, [E, D] = s("all"), [O, k] = s(""), [A, j] = s(""), [M, N] = s("recent"), [P, F] = s(null), [I, L] = s(null), [R, z] = s("approve"), [B, V] = s(!1), [H, U] = s(""), W = o(() => x.map(_), [x]), G = o(() => {
73
+ let e = y.reduce((e, t) => (e[t] = W.filter((e) => e.status === t).length, e), {
74
+ DRAFT: 0,
75
+ ACTIVE: 0,
76
+ VERIFIED: 0,
77
+ PAUSED: 0,
78
+ SUSPENDED: 0,
79
+ ARCHIVED: 0
80
+ });
81
+ return {
82
+ all: W.length,
83
+ byStatus: e
84
+ };
85
+ }, [W]), K = o(() => {
86
+ let e = W.filter((e) => e.rating > 0);
60
87
  return e.length === 0 ? 0 : e.reduce((e, t) => e + t.rating, 0) / e.length;
61
- }, [G]), le = s(() => Array.from(new Set(G.map((e) => e.category))).sort(), [G]), J = s(() => {
62
- let e = [...G];
63
- if (D !== "all" && (e = e.filter((e) => e.status === D)), j && (e = e.filter((e) => e.category === j)), k) {
64
- let t = k.toLowerCase();
88
+ }, [W]), pe = o(() => Array.from(new Set(W.map((e) => e.category))).sort(), [W]), q = o(() => {
89
+ let e = [...W];
90
+ if (E !== "all" && (e = e.filter((e) => e.status === E)), A && (e = e.filter((e) => e.category === A)), O) {
91
+ let t = O.toLowerCase();
65
92
  e = e.filter((e) => e.name.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.address.toLowerCase().includes(t));
66
93
  }
67
- switch (N) {
94
+ switch (M) {
68
95
  case "name":
69
96
  e.sort((e, t) => e.name.localeCompare(t.name));
70
97
  break;
@@ -78,174 +105,189 @@ function S() {
78
105
  }
79
106
  return e;
80
107
  }, [
81
- G,
82
- D,
83
- j,
84
- k,
85
- N
86
- ]), Y = (e) => te(e, { minimumFractionDigits: 0 }), ue = (e) => new Date(e).toLocaleDateString("en-IN", {
108
+ W,
109
+ E,
110
+ A,
111
+ O,
112
+ M
113
+ ]), J = (e) => ne(e, { minimumFractionDigits: 0 }), Y = (e) => new Date(e).toLocaleDateString("en-IN", {
87
114
  year: "numeric",
88
115
  month: "short",
89
116
  day: "numeric"
90
117
  }), X = (e, t) => {
91
- R(e), B(t), W(""), H(!0);
92
- }, de = () => {
93
- if (!L) return;
94
- if (z === "reject" && !U.trim()) {
95
- E("Please provide a rejection reason", "error");
118
+ L(e), z(t), U(""), V(!0);
119
+ }, me = () => {
120
+ if (!I) return;
121
+ if (R === "reject" && !H.trim()) {
122
+ T("Please provide a rejection reason", "error");
96
123
  return;
97
124
  }
98
- let e = z === "approve" ? "VERIFIED" : z === "reject" ? "ARCHIVED" : "SUSPENDED";
99
- C.mutate({
100
- id: L.id,
125
+ let e = R === "approve" ? "VERIFIED" : R === "reject" ? "ARCHIVED" : R === "reinstate" ? "ACTIVE" : "SUSPENDED";
126
+ S.mutate({
127
+ id: I.id,
101
128
  input: { status: e }
102
129
  }, {
103
130
  onSuccess: () => {
104
- let e = z === "approve" ? "approved & verified" : z === "reject" ? "rejected" : "suspended";
105
- E(`"${L.name}" ${e}.`, "success"), H(!1), W("");
131
+ let e = R === "approve" ? "approved & verified" : R === "reject" ? "rejected" : R === "reinstate" ? "reinstated" : "suspended";
132
+ T(`"${I.name}" ${e}.`, "success"), V(!1), U("");
106
133
  },
107
- onError: () => E(`Could not ${z} "${L.name}". Please try again.`, "error")
134
+ onError: () => T(`Could not ${R} "${I.name}". Please try again.`, "error")
108
135
  });
109
- }, Z = ({ status: t }) => /* @__PURE__ */ v("span", {
110
- className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", x[t].cls),
111
- children: x[t].label
112
- }), Q = ({ m: t, compact: n }) => /* @__PURE__ */ y("div", {
136
+ }, Z = ({ status: t }) => /* @__PURE__ */ m("span", {
137
+ className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", v[t].cls),
138
+ children: v[t].label
139
+ }), Q = ({ m: t, compact: n }) => /* @__PURE__ */ h("div", {
113
140
  className: e("flex gap-2", n ? "flex-wrap" : "items-center justify-end"),
114
- children: [!t.isVerified && /* @__PURE__ */ v("button", {
115
- type: "button",
116
- onClick: () => X(t, "approve"),
117
- className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
118
- children: "Approve"
119
- }), t.status !== "inactive" && /* @__PURE__ */ v("button", {
120
- type: "button",
121
- onClick: () => X(t, "suspend"),
122
- className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
123
- children: "Suspend"
124
- })]
125
- }), $ = ({ m: e }) => /* @__PURE__ */ y("div", {
141
+ children: [
142
+ t.status !== "VERIFIED" && t.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
143
+ type: "button",
144
+ onClick: () => X(t, "approve"),
145
+ className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
146
+ children: "Approve"
147
+ }),
148
+ b(t.status) && /* @__PURE__ */ m("button", {
149
+ type: "button",
150
+ onClick: () => X(t, "suspend"),
151
+ className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
152
+ children: "Suspend"
153
+ }),
154
+ t.status === "SUSPENDED" && /* @__PURE__ */ m("button", {
155
+ type: "button",
156
+ onClick: () => X(t, "reinstate"),
157
+ className: "rounded-lg border border-status-success-text/40 px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors hover:bg-status-success-bg-subtle",
158
+ children: "Reinstate"
159
+ })
160
+ ]
161
+ }), $ = ({ m: e }) => /* @__PURE__ */ h("div", {
126
162
  className: "rounded-lg border border-border-subtle bg-bg-sunken/40 p-4",
127
- children: [/* @__PURE__ */ y("div", {
163
+ children: [/* @__PURE__ */ h("div", {
128
164
  className: "grid grid-cols-1 gap-6 md:grid-cols-2",
129
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h4", {
165
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h4", {
130
166
  className: "mb-3 text-sm font-semibold text-text-primary",
131
167
  children: "Business Details"
132
- }), /* @__PURE__ */ y("dl", {
168
+ }), /* @__PURE__ */ h("dl", {
133
169
  className: "space-y-2 text-sm",
134
170
  children: [
135
- /* @__PURE__ */ y("div", {
171
+ /* @__PURE__ */ h("div", {
136
172
  className: "flex gap-2",
137
- children: [/* @__PURE__ */ v("dt", {
173
+ children: [/* @__PURE__ */ m("dt", {
138
174
  className: "w-28 shrink-0 text-text-secondary",
139
175
  children: "Merchant"
140
- }), /* @__PURE__ */ v("dd", {
176
+ }), /* @__PURE__ */ m("dd", {
141
177
  className: "font-medium text-text-primary",
142
178
  children: e.name
143
179
  })]
144
180
  }),
145
- /* @__PURE__ */ y("div", {
181
+ /* @__PURE__ */ h("div", {
146
182
  className: "flex gap-2",
147
- children: [/* @__PURE__ */ v("dt", {
183
+ children: [/* @__PURE__ */ m("dt", {
148
184
  className: "w-28 shrink-0 text-text-secondary",
149
185
  children: "Category"
150
- }), /* @__PURE__ */ v("dd", {
186
+ }), /* @__PURE__ */ m("dd", {
151
187
  className: "text-text-primary",
152
- children: b(e.category)
188
+ children: g(e.category)
153
189
  })]
154
190
  }),
155
- e.address && /* @__PURE__ */ y("div", {
191
+ e.address && /* @__PURE__ */ h("div", {
156
192
  className: "flex gap-2",
157
- children: [/* @__PURE__ */ v("dt", {
193
+ children: [/* @__PURE__ */ m("dt", {
158
194
  className: "w-28 shrink-0 text-text-secondary",
159
195
  children: "Address"
160
- }), /* @__PURE__ */ y("dd", {
196
+ }), /* @__PURE__ */ h("dd", {
161
197
  className: "flex items-start gap-1 text-text-primary",
162
- children: [/* @__PURE__ */ v(ie, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-text-secondary" }), e.address]
198
+ children: [/* @__PURE__ */ m(se, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-text-secondary" }), e.address]
163
199
  })]
164
200
  }),
165
- /* @__PURE__ */ y("div", {
201
+ /* @__PURE__ */ h("div", {
166
202
  className: "flex gap-2",
167
- children: [/* @__PURE__ */ v("dt", {
203
+ children: [/* @__PURE__ */ m("dt", {
168
204
  className: "w-28 shrink-0 text-text-secondary",
169
205
  children: "Applied"
170
- }), /* @__PURE__ */ y("dd", {
206
+ }), /* @__PURE__ */ h("dd", {
171
207
  className: "flex items-center gap-1 text-text-primary",
172
- children: [/* @__PURE__ */ v(u, { className: "h-3.5 w-3.5 text-text-secondary" }), ue(e.createdAt)]
208
+ children: [/* @__PURE__ */ m(ie, { className: "h-3.5 w-3.5 text-text-secondary" }), Y(e.createdAt)]
173
209
  })]
174
210
  }),
175
- e.ownerId && /* @__PURE__ */ y("div", {
211
+ e.ownerId && /* @__PURE__ */ h("div", {
176
212
  className: "flex gap-2",
177
- children: [/* @__PURE__ */ v("dt", {
213
+ children: [/* @__PURE__ */ m("dt", {
178
214
  className: "w-28 shrink-0 text-text-secondary",
179
215
  children: "Owner ID"
180
- }), /* @__PURE__ */ v("dd", {
216
+ }), /* @__PURE__ */ m("dd", {
181
217
  className: "truncate font-mono text-xs text-text-primary",
182
218
  children: e.ownerId
183
219
  })]
184
220
  })
185
221
  ]
186
- })] }), /* @__PURE__ */ y("div", { children: [
187
- /* @__PURE__ */ v("h4", {
222
+ })] }), /* @__PURE__ */ h("div", { children: [
223
+ /* @__PURE__ */ m("h4", {
188
224
  className: "mb-3 text-sm font-semibold text-text-primary",
189
225
  children: "Performance"
190
226
  }),
191
- /* @__PURE__ */ y("div", {
227
+ /* @__PURE__ */ h("div", {
192
228
  className: "grid grid-cols-2 gap-3",
193
- children: [/* @__PURE__ */ y("div", {
229
+ children: [/* @__PURE__ */ h("div", {
194
230
  className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
195
231
  children: [
196
- /* @__PURE__ */ v("p", {
232
+ /* @__PURE__ */ m("p", {
197
233
  className: "text-xs text-text-secondary",
198
234
  children: "Rating"
199
235
  }),
200
- /* @__PURE__ */ y("p", {
236
+ /* @__PURE__ */ h("p", {
201
237
  className: "flex items-center gap-1 text-lg font-bold text-text-primary",
202
- children: [/* @__PURE__ */ v(h, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), e.rating > 0 ? e.rating.toFixed(1) : "—"]
238
+ children: [/* @__PURE__ */ m(f, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), e.rating > 0 ? e.rating.toFixed(1) : "—"]
203
239
  }),
204
- /* @__PURE__ */ y("p", {
240
+ /* @__PURE__ */ h("p", {
205
241
  className: "text-xs text-text-secondary",
206
242
  children: [e.reviewCount, " reviews"]
207
243
  })
208
244
  ]
209
- }), /* @__PURE__ */ y("div", {
245
+ }), /* @__PURE__ */ h("div", {
210
246
  className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
211
- children: [/* @__PURE__ */ v("p", {
247
+ children: [/* @__PURE__ */ m("p", {
212
248
  className: "text-xs text-text-secondary",
213
249
  children: "Avg Order Value"
214
- }), /* @__PURE__ */ y("p", {
250
+ }), /* @__PURE__ */ h("p", {
215
251
  className: "flex items-center gap-0.5 text-lg font-bold text-text-primary",
216
- children: [/* @__PURE__ */ v(p, { className: "h-3.5 w-3.5" }), e.avgOrderValue > 0 ? e.avgOrderValue.toLocaleString("en-IN") : "—"]
252
+ children: [/* @__PURE__ */ m(ae, { className: "h-3.5 w-3.5" }), e.avgOrderValue > 0 ? e.avgOrderValue.toLocaleString("en-IN") : "—"]
217
253
  })]
218
254
  })]
219
255
  }),
220
- e.serviceTypes.length > 0 && /* @__PURE__ */ v("div", {
256
+ e.serviceTypes.length > 0 && /* @__PURE__ */ m("div", {
221
257
  className: "mt-3 flex flex-wrap gap-1.5",
222
- children: e.serviceTypes.map((e) => /* @__PURE__ */ v("span", {
258
+ children: e.serviceTypes.map((e) => /* @__PURE__ */ m("span", {
223
259
  className: "rounded-full bg-bg-surface px-2 py-0.5 text-xs text-text-secondary",
224
- children: b(e)
260
+ children: g(e)
225
261
  }, e))
226
262
  })
227
263
  ] })]
228
- }), /* @__PURE__ */ y("div", {
264
+ }), /* @__PURE__ */ h("div", {
229
265
  className: "mt-4 flex flex-col items-start justify-between gap-3 border-t border-border-subtle pt-4 sm:flex-row sm:items-center",
230
- children: [/* @__PURE__ */ y("p", {
266
+ children: [/* @__PURE__ */ h("p", {
231
267
  className: "flex items-center gap-1.5 text-xs text-text-muted",
232
- children: [/* @__PURE__ */ v(ne, { className: "h-3.5 w-3.5" }), "Verification documents are not stored on the platform yet."]
233
- }), /* @__PURE__ */ y("div", {
268
+ children: [/* @__PURE__ */ m(d, { className: "h-3.5 w-3.5" }), "Verification documents are not stored on the platform yet."]
269
+ }), /* @__PURE__ */ h("div", {
234
270
  className: "flex flex-wrap gap-2",
235
271
  children: [
236
- !e.isVerified && /* @__PURE__ */ v("button", {
272
+ e.status !== "VERIFIED" && e.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
237
273
  type: "button",
238
274
  onClick: () => X(e, "reject"),
239
275
  className: "rounded-lg border border-status-error-text/40 px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
240
276
  children: "Reject"
241
277
  }),
242
- !e.isVerified && /* @__PURE__ */ v("button", {
278
+ e.status !== "VERIFIED" && e.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
243
279
  type: "button",
244
280
  onClick: () => X(e, "approve"),
245
281
  className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
246
282
  children: "Approve Merchant"
247
283
  }),
248
- e.status !== "inactive" && /* @__PURE__ */ v("button", {
284
+ e.status === "SUSPENDED" && /* @__PURE__ */ m("button", {
285
+ type: "button",
286
+ onClick: () => X(e, "reinstate"),
287
+ className: "rounded-lg border border-status-success-text/40 px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors hover:bg-status-success-bg-subtle",
288
+ children: "Reinstate Merchant"
289
+ }),
290
+ b(e.status) && /* @__PURE__ */ m("button", {
249
291
  type: "button",
250
292
  onClick: () => X(e, "suspend"),
251
293
  className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
@@ -255,130 +297,122 @@ function S() {
255
297
  })]
256
298
  })]
257
299
  });
258
- return ce ? /* @__PURE__ */ v(t, {
300
+ return fe ? /* @__PURE__ */ m(t, {
259
301
  title: "Merchants",
260
302
  description: "Loading merchants...",
261
- children: /* @__PURE__ */ y("div", {
303
+ children: /* @__PURE__ */ h("div", {
262
304
  className: "flex flex-col items-center justify-center py-20",
263
- children: [/* @__PURE__ */ v(re, { className: "mb-4 h-10 w-10 animate-spin text-text-secondary" }), /* @__PURE__ */ v("p", {
305
+ children: [/* @__PURE__ */ m(oe, { className: "mb-4 h-10 w-10 animate-spin text-text-secondary" }), /* @__PURE__ */ m("p", {
264
306
  className: "text-text-secondary",
265
307
  children: "Loading merchants..."
266
308
  })]
267
309
  })
268
- }) : /* @__PURE__ */ y(t, {
310
+ }) : /* @__PURE__ */ h(t, {
269
311
  title: "Merchants",
270
- description: `${K.all} merchants on the platform · ${K.pending} awaiting review`,
312
+ description: `${G.all} merchants on the platform · ${G.byStatus.DRAFT} awaiting review`,
271
313
  children: [
272
- /* @__PURE__ */ v(oe, {
314
+ /* @__PURE__ */ m(de, {
273
315
  className: "mb-6",
274
316
  children: "Onboard and oversee every merchant (cart) on Kadaikodi. Approve and verify legitimate businesses, suspend ones that break the rules, and keep an eye on ratings and performance — so customers only ever see trustworthy, active merchants."
275
317
  }),
276
- w && /* @__PURE__ */ y("div", {
277
- className: e("mb-6 flex items-center gap-2 rounded-lg border p-3", w.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
278
- children: [w.type === "success" ? /* @__PURE__ */ v(d, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ v(l, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ v("span", {
279
- className: e("text-sm font-medium", w.type === "success" ? "text-status-success-text" : "text-status-error-text"),
280
- children: w.text
318
+ C && /* @__PURE__ */ h("div", {
319
+ className: e("mb-6 flex items-center gap-2 rounded-lg border p-3", C.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
320
+ children: [C.type === "success" ? /* @__PURE__ */ m(l, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ m(c, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ m("span", {
321
+ className: e("text-sm font-medium", C.type === "success" ? "text-status-success-text" : "text-status-error-text"),
322
+ children: C.text
281
323
  })]
282
324
  }),
283
- /* @__PURE__ */ y("div", {
284
- className: "mb-6 grid grid-cols-2 gap-4 lg:grid-cols-4",
325
+ /* @__PURE__ */ h("div", {
326
+ className: "mb-6 grid grid-cols-2 gap-4 lg:grid-cols-5",
285
327
  children: [
286
- /* @__PURE__ */ v(i, {
328
+ /* @__PURE__ */ m(r, {
287
329
  label: "Total Merchants",
288
- value: K.all.toLocaleString("en-IN"),
289
- icon: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
330
+ value: G.all.toLocaleString("en-IN"),
331
+ icon: /* @__PURE__ */ m(p, { className: "h-4 w-4" })
290
332
  }),
291
- /* @__PURE__ */ v(i, {
333
+ /* @__PURE__ */ m(r, {
292
334
  label: "Pending Review",
293
- value: K.pending.toLocaleString("en-IN"),
294
- icon: /* @__PURE__ */ v(l, { className: "h-4 w-4" })
335
+ value: G.byStatus.DRAFT.toLocaleString("en-IN"),
336
+ icon: /* @__PURE__ */ m(c, { className: "h-4 w-4" })
295
337
  }),
296
- /* @__PURE__ */ v(i, {
338
+ /* @__PURE__ */ m(r, {
297
339
  label: "Verified",
298
- value: K.verified.toLocaleString("en-IN"),
299
- icon: /* @__PURE__ */ v(d, { className: "h-4 w-4" })
340
+ value: G.byStatus.VERIFIED.toLocaleString("en-IN"),
341
+ icon: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
342
+ }),
343
+ /* @__PURE__ */ m(r, {
344
+ label: "Suspended",
345
+ value: G.byStatus.SUSPENDED.toLocaleString("en-IN"),
346
+ icon: /* @__PURE__ */ m(re, { className: "h-4 w-4" })
300
347
  }),
301
- /* @__PURE__ */ v(i, {
348
+ /* @__PURE__ */ m(r, {
302
349
  label: "Avg Rating",
303
- value: q > 0 ? q.toFixed(1) : "—",
304
- icon: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
350
+ value: K > 0 ? K.toFixed(1) : "—",
351
+ icon: /* @__PURE__ */ m(f, { className: "h-4 w-4" })
305
352
  })
306
353
  ]
307
354
  }),
308
- /* @__PURE__ */ y("div", {
355
+ /* @__PURE__ */ h("div", {
309
356
  className: "mb-6 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
310
- children: [/* @__PURE__ */ v("div", {
357
+ children: [/* @__PURE__ */ m("div", {
311
358
  className: "overflow-x-auto",
312
- children: /* @__PURE__ */ v(a, {
359
+ children: /* @__PURE__ */ m(i, {
313
360
  "aria-label": "Filter merchants by status",
314
- value: D,
315
- onChange: (e) => O(e),
316
- tabs: [
317
- {
318
- id: "all",
319
- label: "All",
320
- count: K.all
321
- },
322
- {
323
- id: "pending",
324
- label: "Pending",
325
- count: K.pending
326
- },
327
- {
328
- id: "verified",
329
- label: "Verified",
330
- count: K.verified
331
- },
332
- {
333
- id: "inactive",
334
- label: "Inactive",
335
- count: K.inactive
336
- }
337
- ]
361
+ value: E,
362
+ onChange: (e) => D(e),
363
+ tabs: [{
364
+ id: "all",
365
+ label: "All",
366
+ count: G.all
367
+ }, ...y.map((e) => ({
368
+ id: e,
369
+ label: v[e].label,
370
+ count: G.byStatus[e]
371
+ }))]
338
372
  })
339
- }), /* @__PURE__ */ y("div", {
373
+ }), /* @__PURE__ */ h("div", {
340
374
  className: "flex flex-col gap-3 sm:flex-row",
341
375
  children: [
342
- /* @__PURE__ */ y("div", {
376
+ /* @__PURE__ */ h("div", {
343
377
  className: "relative",
344
- children: [/* @__PURE__ */ v(m, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ v("input", {
378
+ children: [/* @__PURE__ */ m(ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ m("input", {
345
379
  type: "text",
346
380
  placeholder: "Search merchants...",
347
- value: k,
348
- onChange: (e) => A(e.target.value),
381
+ value: O,
382
+ onChange: (e) => k(e.target.value),
349
383
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-10 pr-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] sm:w-64"
350
384
  })]
351
385
  }),
352
- /* @__PURE__ */ y("select", {
353
- value: j,
354
- onChange: (e) => M(e.target.value),
386
+ /* @__PURE__ */ h("select", {
387
+ value: A,
388
+ onChange: (e) => j(e.target.value),
355
389
  className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
356
- children: [/* @__PURE__ */ v("option", {
390
+ children: [/* @__PURE__ */ m("option", {
357
391
  value: "",
358
392
  children: "All Categories"
359
- }), le.map((e) => /* @__PURE__ */ v("option", {
393
+ }), pe.map((e) => /* @__PURE__ */ m("option", {
360
394
  value: e,
361
- children: b(e)
395
+ children: g(e)
362
396
  }, e))]
363
397
  }),
364
- /* @__PURE__ */ y("select", {
365
- value: N,
366
- onChange: (e) => P(e.target.value),
398
+ /* @__PURE__ */ h("select", {
399
+ value: M,
400
+ onChange: (e) => N(e.target.value),
367
401
  className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
368
402
  children: [
369
- /* @__PURE__ */ v("option", {
403
+ /* @__PURE__ */ m("option", {
370
404
  value: "recent",
371
405
  children: "Most Recent"
372
406
  }),
373
- /* @__PURE__ */ v("option", {
407
+ /* @__PURE__ */ m("option", {
374
408
  value: "name",
375
409
  children: "Name A–Z"
376
410
  }),
377
- /* @__PURE__ */ v("option", {
411
+ /* @__PURE__ */ m("option", {
378
412
  value: "rating",
379
413
  children: "Highest Rated"
380
414
  }),
381
- /* @__PURE__ */ v("option", {
415
+ /* @__PURE__ */ m("option", {
382
416
  value: "value",
383
417
  children: "Highest Avg Order"
384
418
  })
@@ -387,78 +421,78 @@ function S() {
387
421
  ]
388
422
  })]
389
423
  }),
390
- J.length === 0 ? /* @__PURE__ */ v(n, {
424
+ q.length === 0 ? /* @__PURE__ */ m(n, {
391
425
  illustration: "empty-search",
392
426
  title: "No merchants found",
393
427
  description: "No merchants match your current filters. Try clearing the search or switching tabs.",
394
- action: /* @__PURE__ */ v("button", {
428
+ action: /* @__PURE__ */ m("button", {
395
429
  type: "button",
396
430
  onClick: () => {
397
- A(""), M(""), O("all");
431
+ k(""), j(""), D("all");
398
432
  },
399
433
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
400
434
  children: "Clear filters"
401
435
  })
402
- }) : /* @__PURE__ */ y(ae, {
436
+ }) : /* @__PURE__ */ h(ue, {
403
437
  treatment: "plain",
404
438
  className: "overflow-hidden",
405
- children: [/* @__PURE__ */ v("div", {
439
+ children: [/* @__PURE__ */ m("div", {
406
440
  className: "hidden overflow-x-auto md:block",
407
- children: /* @__PURE__ */ y("table", {
441
+ children: /* @__PURE__ */ h("table", {
408
442
  className: "w-full",
409
- children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
443
+ children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", {
410
444
  className: "border-b border-border-subtle bg-bg-sunken/50",
411
445
  children: [
412
- /* @__PURE__ */ v("th", {
446
+ /* @__PURE__ */ m("th", {
413
447
  className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
414
448
  children: "Merchant"
415
449
  }),
416
- /* @__PURE__ */ v("th", {
450
+ /* @__PURE__ */ m("th", {
417
451
  className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
418
452
  children: "Category"
419
453
  }),
420
- /* @__PURE__ */ v("th", {
454
+ /* @__PURE__ */ m("th", {
421
455
  className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
422
456
  children: "Status"
423
457
  }),
424
- /* @__PURE__ */ v("th", {
458
+ /* @__PURE__ */ m("th", {
425
459
  className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
426
460
  children: "Rating"
427
461
  }),
428
- /* @__PURE__ */ v("th", {
462
+ /* @__PURE__ */ m("th", {
429
463
  className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
430
464
  children: "Avg Order"
431
465
  }),
432
- /* @__PURE__ */ v("th", {
466
+ /* @__PURE__ */ m("th", {
433
467
  className: "px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-text-secondary",
434
468
  children: "Actions"
435
469
  })
436
470
  ]
437
- }) }), /* @__PURE__ */ v("tbody", {
471
+ }) }), /* @__PURE__ */ m("tbody", {
438
472
  className: "divide-y divide-border",
439
- children: J.map((t) => {
440
- let n = F === t.id;
441
- return /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y("tr", {
473
+ children: q.map((t) => {
474
+ let n = P === t.id;
475
+ return /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ h("tr", {
442
476
  className: "transition-colors hover:bg-accent/50",
443
477
  children: [
444
- /* @__PURE__ */ v("td", {
478
+ /* @__PURE__ */ m("td", {
445
479
  className: "px-4 py-3",
446
- children: /* @__PURE__ */ y("button", {
480
+ children: /* @__PURE__ */ h("button", {
447
481
  type: "button",
448
- onClick: () => I(n ? null : t.id),
482
+ onClick: () => F(n ? null : t.id),
449
483
  className: "flex items-center gap-3 text-left",
450
484
  children: [
451
- /* @__PURE__ */ v(f, { className: e("h-4 w-4 shrink-0 text-text-secondary transition-transform", n && "rotate-180") }),
452
- /* @__PURE__ */ v("div", {
485
+ /* @__PURE__ */ m(u, { className: e("h-4 w-4 shrink-0 text-text-secondary transition-transform", n && "rotate-180") }),
486
+ /* @__PURE__ */ m("div", {
453
487
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
454
- children: /* @__PURE__ */ v(g, { className: "h-5 w-5" })
488
+ children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
455
489
  }),
456
- /* @__PURE__ */ y("div", {
490
+ /* @__PURE__ */ h("div", {
457
491
  className: "min-w-0",
458
- children: [/* @__PURE__ */ v("p", {
492
+ children: [/* @__PURE__ */ m("p", {
459
493
  className: "truncate text-sm font-medium text-text-primary",
460
494
  children: t.name
461
- }), t.address && /* @__PURE__ */ v("p", {
495
+ }), t.address && /* @__PURE__ */ m("p", {
462
496
  className: "truncate text-xs text-text-secondary",
463
497
  children: t.address
464
498
  })]
@@ -466,22 +500,22 @@ function S() {
466
500
  ]
467
501
  })
468
502
  }),
469
- /* @__PURE__ */ v("td", {
503
+ /* @__PURE__ */ m("td", {
470
504
  className: "px-4 py-3 text-sm text-text-secondary",
471
- children: b(t.category)
505
+ children: g(t.category)
472
506
  }),
473
- /* @__PURE__ */ v("td", {
507
+ /* @__PURE__ */ m("td", {
474
508
  className: "px-4 py-3",
475
- children: /* @__PURE__ */ v(Z, { status: t.status })
509
+ children: /* @__PURE__ */ m(Z, { status: t.status })
476
510
  }),
477
- /* @__PURE__ */ v("td", {
511
+ /* @__PURE__ */ m("td", {
478
512
  className: "px-4 py-3 text-sm",
479
- children: t.rating > 0 ? /* @__PURE__ */ y("span", {
513
+ children: t.rating > 0 ? /* @__PURE__ */ h("span", {
480
514
  className: "flex items-center gap-1 text-text-primary",
481
515
  children: [
482
- /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }),
516
+ /* @__PURE__ */ m(f, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }),
483
517
  t.rating.toFixed(1),
484
- /* @__PURE__ */ y("span", {
518
+ /* @__PURE__ */ h("span", {
485
519
  className: "text-text-secondary",
486
520
  children: [
487
521
  "(",
@@ -490,174 +524,181 @@ function S() {
490
524
  ]
491
525
  })
492
526
  ]
493
- }) : /* @__PURE__ */ v("span", {
527
+ }) : /* @__PURE__ */ m("span", {
494
528
  className: "text-text-secondary",
495
529
  children: "—"
496
530
  })
497
531
  }),
498
- /* @__PURE__ */ v("td", {
532
+ /* @__PURE__ */ m("td", {
499
533
  className: "px-4 py-3 text-sm text-text-primary",
500
- children: t.avgOrderValue > 0 ? Y(t.avgOrderValue) : "—"
534
+ children: t.avgOrderValue > 0 ? J(t.avgOrderValue) : "—"
501
535
  }),
502
- /* @__PURE__ */ v("td", {
536
+ /* @__PURE__ */ m("td", {
503
537
  className: "px-4 py-3",
504
- children: /* @__PURE__ */ v(Q, { m: t })
538
+ children: /* @__PURE__ */ m(Q, { m: t })
505
539
  })
506
540
  ]
507
- }), n && /* @__PURE__ */ v("tr", {
541
+ }), n && /* @__PURE__ */ m("tr", {
508
542
  className: "bg-bg-sunken/20",
509
- children: /* @__PURE__ */ v("td", {
543
+ children: /* @__PURE__ */ m("td", {
510
544
  colSpan: 6,
511
545
  className: "px-4 py-4",
512
- children: /* @__PURE__ */ v($, { m: t })
546
+ children: /* @__PURE__ */ m($, { m: t })
513
547
  })
514
548
  })] }, t.id);
515
549
  })
516
550
  })]
517
551
  })
518
- }), /* @__PURE__ */ v("div", {
552
+ }), /* @__PURE__ */ m("div", {
519
553
  className: "space-y-4 p-4 md:hidden",
520
- children: J.map((t) => {
521
- let n = F === t.id;
522
- return /* @__PURE__ */ y("div", {
554
+ children: q.map((t) => {
555
+ let n = P === t.id;
556
+ return /* @__PURE__ */ h("div", {
523
557
  className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4",
524
558
  children: [
525
- /* @__PURE__ */ y("div", {
559
+ /* @__PURE__ */ h("div", {
526
560
  className: "mb-3 flex items-start gap-3",
527
- children: [/* @__PURE__ */ v("div", {
561
+ children: [/* @__PURE__ */ m("div", {
528
562
  className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
529
- children: /* @__PURE__ */ v(g, { className: "h-6 w-6" })
530
- }), /* @__PURE__ */ y("div", {
563
+ children: /* @__PURE__ */ m(p, { className: "h-6 w-6" })
564
+ }), /* @__PURE__ */ h("div", {
531
565
  className: "min-w-0 flex-1",
532
566
  children: [
533
- /* @__PURE__ */ v("h3", {
567
+ /* @__PURE__ */ m("h3", {
534
568
  className: "truncate font-medium text-text-primary",
535
569
  children: t.name
536
570
  }),
537
- /* @__PURE__ */ v("p", {
571
+ /* @__PURE__ */ m("p", {
538
572
  className: "truncate text-sm text-text-secondary",
539
- children: b(t.category)
573
+ children: g(t.category)
540
574
  }),
541
- t.address && /* @__PURE__ */ v("p", {
575
+ t.address && /* @__PURE__ */ m("p", {
542
576
  className: "truncate text-xs text-text-secondary",
543
577
  children: t.address
544
578
  })
545
579
  ]
546
580
  })]
547
581
  }),
548
- /* @__PURE__ */ y("div", {
582
+ /* @__PURE__ */ h("div", {
549
583
  className: "mb-3 flex flex-wrap items-center gap-2",
550
584
  children: [
551
- /* @__PURE__ */ v(Z, { status: t.status }),
552
- t.rating > 0 && /* @__PURE__ */ y("span", {
585
+ /* @__PURE__ */ m(Z, { status: t.status }),
586
+ t.rating > 0 && /* @__PURE__ */ h("span", {
553
587
  className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-warning-text",
554
588
  children: [
555
- /* @__PURE__ */ v(h, { className: "h-3 w-3 fill-current" }),
589
+ /* @__PURE__ */ m(f, { className: "h-3 w-3 fill-current" }),
556
590
  t.rating.toFixed(1),
557
591
  " (",
558
592
  t.reviewCount,
559
593
  ")"
560
594
  ]
561
595
  }),
562
- t.avgOrderValue > 0 && /* @__PURE__ */ y("span", {
596
+ t.avgOrderValue > 0 && /* @__PURE__ */ h("span", {
563
597
  className: "text-xs text-text-secondary",
564
- children: ["Avg ", Y(t.avgOrderValue)]
598
+ children: ["Avg ", J(t.avgOrderValue)]
565
599
  })
566
600
  ]
567
601
  }),
568
- /* @__PURE__ */ v("div", {
602
+ /* @__PURE__ */ m("div", {
569
603
  className: "mb-3",
570
- children: /* @__PURE__ */ v(Q, {
604
+ children: /* @__PURE__ */ m(Q, {
571
605
  m: t,
572
606
  compact: !0
573
607
  })
574
608
  }),
575
- /* @__PURE__ */ y("button", {
609
+ /* @__PURE__ */ h("button", {
576
610
  type: "button",
577
- onClick: () => I(n ? null : t.id),
611
+ onClick: () => F(n ? null : t.id),
578
612
  className: "flex w-full items-center justify-center gap-1 rounded-lg border border-border-subtle py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
579
- children: [n ? "Hide details" : "View details", /* @__PURE__ */ v(f, { className: e("h-4 w-4 transition-transform", n && "rotate-180") })]
613
+ children: [n ? "Hide details" : "View details", /* @__PURE__ */ m(u, { className: e("h-4 w-4 transition-transform", n && "rotate-180") })]
580
614
  }),
581
- n && /* @__PURE__ */ v("div", {
615
+ n && /* @__PURE__ */ m("div", {
582
616
  className: "mt-3",
583
- children: /* @__PURE__ */ v($, { m: t })
617
+ children: /* @__PURE__ */ m($, { m: t })
584
618
  })
585
619
  ]
586
620
  }, t.id);
587
621
  })
588
622
  })]
589
623
  }),
590
- V && L && /* @__PURE__ */ v("div", {
624
+ B && I && /* @__PURE__ */ m("div", {
591
625
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
592
- children: /* @__PURE__ */ y("div", {
626
+ children: /* @__PURE__ */ h("div", {
593
627
  className: "max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
594
- children: [/* @__PURE__ */ y("div", {
628
+ children: [/* @__PURE__ */ h("div", {
595
629
  className: "flex items-center justify-between border-b border-border-subtle p-4",
596
- children: [/* @__PURE__ */ v("h3", {
630
+ children: [/* @__PURE__ */ m("h3", {
597
631
  className: "text-lg font-semibold text-text-primary",
598
- children: z === "approve" ? "Approve Merchant" : z === "reject" ? "Reject Merchant" : "Suspend Merchant"
599
- }), /* @__PURE__ */ v("button", {
632
+ children: R === "approve" ? "Approve Merchant" : R === "reject" ? "Reject Merchant" : R === "reinstate" ? "Reinstate Merchant" : "Suspend Merchant"
633
+ }), /* @__PURE__ */ m("button", {
600
634
  type: "button",
601
- onClick: () => H(!1),
635
+ onClick: () => V(!1),
602
636
  className: "rounded p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
603
- children: /* @__PURE__ */ v(_, { className: "h-5 w-5" })
637
+ children: /* @__PURE__ */ m(le, { className: "h-5 w-5" })
604
638
  })]
605
- }), /* @__PURE__ */ y("div", {
639
+ }), /* @__PURE__ */ h("div", {
606
640
  className: "space-y-4 p-4",
607
641
  children: [
608
- /* @__PURE__ */ y("div", {
642
+ /* @__PURE__ */ h("div", {
609
643
  className: "flex items-center gap-3 rounded-lg bg-bg-sunken/50 p-3",
610
- children: [/* @__PURE__ */ v("div", {
644
+ children: [/* @__PURE__ */ m("div", {
611
645
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
612
- children: /* @__PURE__ */ v(g, { className: "h-5 w-5" })
613
- }), /* @__PURE__ */ y("div", {
646
+ children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
647
+ }), /* @__PURE__ */ h("div", {
614
648
  className: "min-w-0",
615
- children: [/* @__PURE__ */ v("p", {
649
+ children: [/* @__PURE__ */ m("p", {
616
650
  className: "truncate font-medium text-text-primary",
617
- children: L.name
618
- }), /* @__PURE__ */ v("p", {
651
+ children: I.name
652
+ }), /* @__PURE__ */ m("p", {
619
653
  className: "truncate text-sm text-text-secondary",
620
- children: b(L.category)
654
+ children: g(I.category)
621
655
  })]
622
656
  })]
623
657
  }),
624
- z === "approve" && /* @__PURE__ */ v("div", {
658
+ R === "approve" && /* @__PURE__ */ m("div", {
625
659
  className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
626
- children: /* @__PURE__ */ v("p", {
660
+ children: /* @__PURE__ */ m("p", {
627
661
  className: "text-sm text-status-success-text",
628
662
  children: "This marks the merchant as verified and active, so customers can start ordering from it."
629
663
  })
630
664
  }),
631
- z === "suspend" && /* @__PURE__ */ v("div", {
665
+ R === "suspend" && /* @__PURE__ */ m("div", {
632
666
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle p-3",
633
- children: /* @__PURE__ */ v("p", {
667
+ children: /* @__PURE__ */ m("p", {
634
668
  className: "text-sm text-status-error-text",
635
669
  children: "This suspends the merchant. It will be hidden from customers until reinstated."
636
670
  })
637
671
  }),
638
- z === "reject" && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
672
+ R === "reinstate" && /* @__PURE__ */ m("div", {
673
+ className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
674
+ children: /* @__PURE__ */ m("p", {
675
+ className: "text-sm text-status-success-text",
676
+ children: "This returns the merchant to active trading. Re-approve it afterwards if it should also carry the verified badge."
677
+ })
678
+ }),
679
+ R === "reject" && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
639
680
  className: "mb-2 block text-sm font-medium text-text-primary",
640
681
  children: "Rejection Reason *"
641
- }), /* @__PURE__ */ v("textarea", {
682
+ }), /* @__PURE__ */ m("textarea", {
642
683
  className: "min-h-[100px] w-full rounded-lg border border-border-subtle bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
643
684
  rows: 4,
644
- value: U,
645
- onChange: (e) => W(e.target.value),
685
+ value: H,
686
+ onChange: (e) => U(e.target.value),
646
687
  placeholder: "Explain why this application is being rejected..."
647
688
  })] }),
648
- /* @__PURE__ */ y("div", {
689
+ /* @__PURE__ */ h("div", {
649
690
  className: "flex gap-3 pt-2",
650
- children: [/* @__PURE__ */ v("button", {
691
+ children: [/* @__PURE__ */ m("button", {
651
692
  type: "button",
652
- onClick: () => H(!1),
693
+ onClick: () => V(!1),
653
694
  className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
654
695
  children: "Cancel"
655
- }), /* @__PURE__ */ v("button", {
696
+ }), /* @__PURE__ */ m("button", {
656
697
  type: "button",
657
- onClick: de,
658
- disabled: C.isPending || z === "reject" && !U.trim(),
698
+ onClick: me,
699
+ disabled: S.isPending || R === "reject" && !H.trim(),
659
700
  className: "flex-1 rounded-lg bg-action-primary-bg py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:opacity-50",
660
- children: C.isPending ? "Working…" : z === "approve" ? "Approve Merchant" : z === "reject" ? "Reject Merchant" : "Suspend Merchant"
701
+ children: S.isPending ? "Working…" : R === "approve" ? "Approve Merchant" : R === "reject" ? "Reject Merchant" : R === "reinstate" ? "Reinstate Merchant" : "Suspend Merchant"
661
702
  })]
662
703
  })
663
704
  ]
@@ -668,6 +709,6 @@ function S() {
668
709
  });
669
710
  }
670
711
  //#endregion
671
- export { S as CartManagementPage };
712
+ export { x as CartManagementPage };
672
713
 
673
714
  //# sourceMappingURL=CartManagementPage.js.map