@burdenoff/microfe-kadaikodi 2026.719.4 → 2026.730.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 (37) hide show
  1. package/dist/kadaikodi/KadaikodiRoutes.d.ts.map +1 -1
  2. package/dist/kadaikodi/KadaikodiRoutes.js +33 -29
  3. package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
  4. package/dist/kadaikodi/components/InvestmentMarketplaceGate.d.ts +13 -0
  5. package/dist/kadaikodi/components/InvestmentMarketplaceGate.d.ts.map +1 -0
  6. package/dist/kadaikodi/components/InvestmentMarketplaceGate.js +23 -0
  7. package/dist/kadaikodi/components/InvestmentMarketplaceGate.js.map +1 -0
  8. package/dist/kadaikodi/components/index.d.ts +1 -0
  9. package/dist/kadaikodi/components/index.d.ts.map +1 -1
  10. package/dist/kadaikodi/constants/featureFlags.d.ts +23 -0
  11. package/dist/kadaikodi/constants/featureFlags.d.ts.map +1 -0
  12. package/dist/kadaikodi/constants/featureFlags.js +6 -0
  13. package/dist/kadaikodi/constants/featureFlags.js.map +1 -0
  14. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +42 -0
  15. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
  16. package/dist/kadaikodi/hooks/useKadaikodiApi.js +133 -65
  17. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  18. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.d.ts.map +1 -1
  19. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +180 -162
  20. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  21. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.d.ts.map +1 -1
  22. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +135 -126
  23. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -1
  24. package/dist/kadaikodi/pages/cart-owner/LoyaltyManagementPage.d.ts +12 -0
  25. package/dist/kadaikodi/pages/cart-owner/LoyaltyManagementPage.d.ts.map +1 -0
  26. package/dist/kadaikodi/pages/cart-owner/LoyaltyManagementPage.js +198 -0
  27. package/dist/kadaikodi/pages/cart-owner/LoyaltyManagementPage.js.map +1 -0
  28. package/dist/kadaikodi/pages/customer/CustomerProfilePage.d.ts.map +1 -1
  29. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +256 -97
  30. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  31. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.d.ts.map +1 -1
  32. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +171 -166
  33. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  34. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.d.ts.map +1 -1
  35. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +220 -217
  36. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  37. package/package.json +1 -1
@@ -1,21 +1,21 @@
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 { useOrders as r } from "../../hooks/useKadaikodiApi.js";
5
- import { formatCurrency as i } from "../../utils/formatters.js";
6
- import { useState as a } from "react";
7
- import { AlertTriangle as o, BarChart3 as s, Bell as c, CheckCircle2 as l, ChevronRight as u, Heart as d, IndianRupee as f, MapPin as p, Save as m, Settings as h, Shield as g, ShoppingBag as _, User as v, UserCircle as y } from "lucide-react";
8
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
4
+ import { useMyLoyaltyAccount as r, useMyLoyaltyTransactions as i, useOrders as a, useRedeemLoyaltyPoints as o } from "../../hooks/useKadaikodiApi.js";
5
+ import { formatCurrency as s } from "../../utils/formatters.js";
6
+ import { useState as c } from "react";
7
+ import { AlertTriangle as l, BarChart3 as u, Bell as ee, CheckCircle2 as d, ChevronRight as f, Gift as p, Heart as m, IndianRupee as h, Loader2 as g, MapPin as _, Save as v, Settings as te, Shield as y, ShoppingBag as ne, Sparkles as re, User as ie, UserCircle as ae } from "lucide-react";
8
+ import { Fragment as oe, jsx as b, jsxs as x } from "react/jsx-runtime";
9
9
  import { GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
10
10
  //#region src/kadaikodi/pages/customer/CustomerProfilePage.tsx
11
- var w = [
11
+ var w = 100, se = [
12
12
  "vegetarian",
13
13
  "vegan",
14
14
  "jain",
15
15
  "keto",
16
16
  "gluten-free",
17
17
  "low-carb"
18
- ], T = [
18
+ ], ce = [
19
19
  "nuts",
20
20
  "dairy",
21
21
  "eggs",
@@ -23,20 +23,20 @@ var w = [
23
23
  "shellfish",
24
24
  "gluten"
25
25
  ];
26
- function E() {
27
- let { navigateTo: E, currentUser: D } = e(), { data: O = [], isLoading: k } = r({ customerId: D?.id }), [A, j] = a("profile"), [M, N] = a(null), P = (e) => {
28
- N(e), setTimeout(() => N(null), 3e3);
29
- }, F = {
30
- firstName: D?.firstName || D?.name?.split(" ")[0] || "Customer",
31
- lastName: D?.lastName || D?.name?.split(" ").slice(1).join(" ") || "",
32
- email: D?.email || "",
33
- phone: D?.phone || "",
34
- profilePicture: D?.avatar
35
- }, [I, L] = a({
36
- firstName: F.firstName,
37
- lastName: F.lastName,
38
- email: F.email,
39
- phone: F.phone,
26
+ function T() {
27
+ let { navigateTo: T, currentUser: E } = e(), { data: D = [], isLoading: O } = a({ customerId: E?.id }), { data: k, isLoading: A } = r(), { data: j = [], isLoading: le } = i(), M = o(), [N, P] = c(String(w)), [F, I] = c(null), [L, R] = c(null), [z, B] = c("profile"), [V, H] = c(null), U = (e) => {
28
+ H(e), setTimeout(() => H(null), 3e3);
29
+ }, W = {
30
+ firstName: E?.firstName || E?.name?.split(" ")[0] || "Customer",
31
+ lastName: E?.lastName || E?.name?.split(" ").slice(1).join(" ") || "",
32
+ email: E?.email || "",
33
+ phone: E?.phone || "",
34
+ profilePicture: E?.avatar
35
+ }, [G, ue] = c({
36
+ firstName: W.firstName,
37
+ lastName: W.lastName,
38
+ email: W.email,
39
+ phone: W.phone,
40
40
  emergencyContact: {
41
41
  name: "",
42
42
  phone: "",
@@ -50,54 +50,75 @@ function E() {
50
50
  newsletter: !1,
51
51
  sms: !0
52
52
  }
53
- }), [R, z] = a({ ...I }), B = O.reduce((e, t) => e + t.total, 0), V = {
54
- totalOrders: O.length,
55
- totalSpent: B,
56
- avgOrderValue: O.length > 0 ? Math.floor(B / O.length) : 0
57
- }, H = k, U = () => E("/auth/security"), W = () => {
58
- L({ ...R }), P("Preferences applied for this session. Saved profiles are coming soon.");
59
- }, G = (e, t) => {
60
- z((n) => ({
53
+ }), [K, q] = c({ ...G }), J = D.reduce((e, t) => e + t.total, 0), Y = {
54
+ totalOrders: D.length,
55
+ totalSpent: J,
56
+ avgOrderValue: D.length > 0 ? Math.floor(J / D.length) : 0
57
+ }, de = O, X = () => T("/auth/security"), Z = () => {
58
+ ue({ ...K }), U("Preferences applied for this session. Saved profiles are coming soon.");
59
+ }, Q = (e, t) => {
60
+ q((n) => ({
61
61
  ...n,
62
62
  emergencyContact: {
63
63
  ...n.emergencyContact,
64
64
  [e]: t
65
65
  }
66
66
  }));
67
- }, K = (e, t) => {
68
- z((n) => ({
67
+ }, fe = (e, t) => {
68
+ q((n) => ({
69
69
  ...n,
70
70
  notifications: {
71
71
  ...n.notifications,
72
72
  [e]: t
73
73
  }
74
74
  }));
75
- }, q = (e, t, n) => {
76
- z((r) => {
75
+ }, $ = (e, t, n) => {
76
+ q((r) => {
77
77
  let i = r[e], a = n ? [...i, t] : i.filter((e) => e !== t);
78
78
  return {
79
79
  ...r,
80
80
  [e]: a
81
81
  };
82
82
  });
83
- }, J = [
83
+ }, pe = async () => {
84
+ R(null), I(null);
85
+ let e = parseInt(N, 10);
86
+ if (!Number.isFinite(e) || e < w) {
87
+ R(`Enter at least ${w} points.`);
88
+ return;
89
+ }
90
+ try {
91
+ let t = await M.mutateAsync(e);
92
+ I({
93
+ discountAmount: t.discountAmount,
94
+ pointsRedeemed: t.pointsRedeemed
95
+ }), P(String(w));
96
+ } catch (e) {
97
+ R(e instanceof Error ? e.message : "Failed to redeem points. Please try again.");
98
+ }
99
+ }, me = [
84
100
  {
85
101
  key: "profile",
86
102
  label: "Profile Info",
87
- icon: y
103
+ icon: ae
88
104
  },
89
105
  {
90
106
  key: "preferences",
91
107
  label: "Preferences",
92
- icon: h
108
+ icon: te
93
109
  },
94
110
  {
95
111
  key: "stats",
96
112
  label: "My Stats",
97
- icon: s
113
+ icon: u
114
+ },
115
+ {
116
+ key: "rewards",
117
+ label: "Rewards",
118
+ icon: p
98
119
  }
99
120
  ];
100
- return H ? /* @__PURE__ */ b(n, {
121
+ return de ? /* @__PURE__ */ b(n, {
101
122
  title: "My Profile",
102
123
  children: /* @__PURE__ */ x("div", {
103
124
  className: "flex flex-col items-center justify-center py-16 text-center",
@@ -114,11 +135,11 @@ function E() {
114
135
  className: "mb-6",
115
136
  children: "Your account, your way — keep your contact details, delivery address and preferences up to date, and manage how Kadaikodi reaches you. Accurate details mean smoother orders and deliveries."
116
137
  }),
117
- M && /* @__PURE__ */ x("div", {
138
+ V && /* @__PURE__ */ x("div", {
118
139
  className: "mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
119
- children: [/* @__PURE__ */ b(l, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ b("p", {
140
+ children: [/* @__PURE__ */ b(d, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ b("p", {
120
141
  className: "text-sm text-status-success-text",
121
- children: M
142
+ children: V
122
143
  })]
123
144
  }),
124
145
  /* @__PURE__ */ x(S, {
@@ -129,20 +150,20 @@ function E() {
129
150
  className: "relative",
130
151
  children: [/* @__PURE__ */ b("div", {
131
152
  className: "h-24 w-24 rounded-full bg-bg-sunken overflow-hidden",
132
- children: F.profilePicture ? /* @__PURE__ */ b("img", {
133
- src: F.profilePicture,
134
- alt: `${F.firstName} ${F.lastName}`,
153
+ children: W.profilePicture ? /* @__PURE__ */ b("img", {
154
+ src: W.profilePicture,
155
+ alt: `${W.firstName} ${W.lastName}`,
135
156
  className: "h-full w-full object-cover"
136
157
  }) : /* @__PURE__ */ b("div", {
137
158
  className: "flex h-full w-full items-center justify-center text-text-secondary",
138
- children: /* @__PURE__ */ b(v, { className: "h-10 w-10" })
159
+ children: /* @__PURE__ */ b(ie, { className: "h-10 w-10" })
139
160
  })
140
161
  }), /* @__PURE__ */ b("button", {
141
162
  type: "button",
142
- onClick: U,
163
+ onClick: X,
143
164
  title: "Manage your photo in Account Security",
144
165
  className: "absolute bottom-0 right-0 flex h-8 w-8 items-center justify-center rounded-full bg-foreground text-background shadow-sm hover:opacity-90 transition-opacity",
145
- children: /* @__PURE__ */ b(g, { className: "h-4 w-4" })
166
+ children: /* @__PURE__ */ b(y, { className: "h-4 w-4" })
146
167
  })]
147
168
  }), /* @__PURE__ */ x("div", {
148
169
  className: "flex-1 text-center sm:text-left",
@@ -150,18 +171,18 @@ function E() {
150
171
  /* @__PURE__ */ x("h2", {
151
172
  className: "text-xl font-semibold text-text-primary",
152
173
  children: [
153
- I.firstName,
174
+ G.firstName,
154
175
  " ",
155
- I.lastName
176
+ G.lastName
156
177
  ]
157
178
  }),
158
- I.email && /* @__PURE__ */ b("p", {
179
+ G.email && /* @__PURE__ */ b("p", {
159
180
  className: "mt-1 text-sm text-text-secondary",
160
- children: I.email
181
+ children: G.email
161
182
  }),
162
- I.phone && /* @__PURE__ */ b("p", {
183
+ G.phone && /* @__PURE__ */ b("p", {
163
184
  className: "mt-0.5 text-sm text-text-secondary",
164
- children: I.phone
185
+ children: G.phone
165
186
  })
166
187
  ]
167
188
  })]
@@ -172,12 +193,12 @@ function E() {
172
193
  className: "border-b border-border-subtle",
173
194
  children: /* @__PURE__ */ b("nav", {
174
195
  className: "flex -mb-px overflow-x-auto",
175
- children: J.map((e) => {
196
+ children: me.map((e) => {
176
197
  let n = e.icon;
177
198
  return /* @__PURE__ */ x("button", {
178
199
  type: "button",
179
- className: t("flex items-center gap-2 py-3.5 px-5 text-sm font-medium whitespace-nowrap transition-colors", A === e.key ? "border-b-2 border-foreground text-text-primary" : "text-text-secondary hover:text-text-primary"),
180
- onClick: () => j(e.key),
200
+ className: t("flex items-center gap-2 py-3.5 px-5 text-sm font-medium whitespace-nowrap transition-colors", z === e.key ? "border-b-2 border-foreground text-text-primary" : "text-text-secondary hover:text-text-primary"),
201
+ onClick: () => B(e.key),
181
202
  children: [/* @__PURE__ */ b(n, { className: "h-4 w-4" }), e.label]
182
203
  }, e.key);
183
204
  })
@@ -185,7 +206,7 @@ function E() {
185
206
  }), /* @__PURE__ */ x("div", {
186
207
  className: "p-5 md:p-6",
187
208
  children: [
188
- A === "profile" && /* @__PURE__ */ x("div", {
209
+ z === "profile" && /* @__PURE__ */ x("div", {
189
210
  className: "space-y-6",
190
211
  children: [
191
212
  /* @__PURE__ */ x("div", {
@@ -195,9 +216,9 @@ function E() {
195
216
  children: "Personal Information"
196
217
  }), /* @__PURE__ */ x("button", {
197
218
  type: "button",
198
- onClick: U,
219
+ onClick: X,
199
220
  className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
200
- children: [/* @__PURE__ */ b(g, { className: "h-3 w-3" }), "Manage in Account Security"]
221
+ children: [/* @__PURE__ */ b(y, { className: "h-3 w-3" }), "Manage in Account Security"]
201
222
  })]
202
223
  }),
203
224
  /* @__PURE__ */ b("p", {
@@ -212,7 +233,7 @@ function E() {
212
233
  children: "First Name"
213
234
  }), /* @__PURE__ */ b("input", {
214
235
  type: "text",
215
- value: I.firstName,
236
+ value: G.firstName,
216
237
  disabled: !0,
217
238
  readOnly: !0,
218
239
  className: "w-full rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2.5 text-sm text-text-primary cursor-not-allowed"
@@ -222,7 +243,7 @@ function E() {
222
243
  children: "Last Name"
223
244
  }), /* @__PURE__ */ b("input", {
224
245
  type: "text",
225
- value: I.lastName,
246
+ value: G.lastName,
226
247
  disabled: !0,
227
248
  readOnly: !0,
228
249
  className: "w-full rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2.5 text-sm text-text-primary cursor-not-allowed"
@@ -232,7 +253,7 @@ function E() {
232
253
  children: "Email"
233
254
  }), /* @__PURE__ */ b("input", {
234
255
  type: "email",
235
- value: I.email,
256
+ value: G.email,
236
257
  disabled: !0,
237
258
  readOnly: !0,
238
259
  className: "w-full rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2.5 text-sm text-text-primary cursor-not-allowed"
@@ -242,7 +263,7 @@ function E() {
242
263
  children: "Phone"
243
264
  }), /* @__PURE__ */ b("input", {
244
265
  type: "tel",
245
- value: I.phone,
266
+ value: G.phone,
246
267
  disabled: !0,
247
268
  readOnly: !0,
248
269
  className: "w-full rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2.5 text-sm text-text-primary cursor-not-allowed"
@@ -259,19 +280,19 @@ function E() {
259
280
  children: "You haven't saved a delivery address yet. Add one to speed up checkout."
260
281
  }), /* @__PURE__ */ x("button", {
261
282
  type: "button",
262
- onClick: () => E("/customer/addresses"),
283
+ onClick: () => T("/customer/addresses"),
263
284
  className: "mt-2 flex items-center gap-1 text-xs font-medium text-text-secondary hover:text-text-primary transition-colors",
264
285
  children: [
265
- /* @__PURE__ */ b(p, { className: "h-3 w-3" }),
286
+ /* @__PURE__ */ b(_, { className: "h-3 w-3" }),
266
287
  "Manage Addresses",
267
- /* @__PURE__ */ b(u, { className: "h-3 w-3" })
288
+ /* @__PURE__ */ b(f, { className: "h-3 w-3" })
268
289
  ]
269
290
  })]
270
291
  })] }),
271
292
  /* @__PURE__ */ x("div", { children: [
272
293
  /* @__PURE__ */ x("h4", {
273
294
  className: "text-base font-semibold text-text-primary mb-1 flex items-center gap-2",
274
- children: [/* @__PURE__ */ b(o, { className: "h-4 w-4 text-text-secondary" }), "Emergency Contact"]
295
+ children: [/* @__PURE__ */ b(l, { className: "h-4 w-4 text-text-secondary" }), "Emergency Contact"]
275
296
  }),
276
297
  /* @__PURE__ */ b("p", {
277
298
  className: "mb-3 text-xs text-text-secondary",
@@ -285,8 +306,8 @@ function E() {
285
306
  children: "Name"
286
307
  }), /* @__PURE__ */ b("input", {
287
308
  type: "text",
288
- value: R.emergencyContact.name,
289
- onChange: (e) => G("name", e.target.value),
309
+ value: K.emergencyContact.name,
310
+ onChange: (e) => Q("name", e.target.value),
290
311
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
291
312
  })] }),
292
313
  /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
@@ -294,8 +315,8 @@ function E() {
294
315
  children: "Phone"
295
316
  }), /* @__PURE__ */ b("input", {
296
317
  type: "tel",
297
- value: R.emergencyContact.phone,
298
- onChange: (e) => G("phone", e.target.value),
318
+ value: K.emergencyContact.phone,
319
+ onChange: (e) => Q("phone", e.target.value),
299
320
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
300
321
  })] }),
301
322
  /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
@@ -303,8 +324,8 @@ function E() {
303
324
  children: "Relationship"
304
325
  }), /* @__PURE__ */ b("input", {
305
326
  type: "text",
306
- value: R.emergencyContact.relationship,
307
- onChange: (e) => G("relationship", e.target.value),
327
+ value: K.emergencyContact.relationship,
328
+ onChange: (e) => Q("relationship", e.target.value),
308
329
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
309
330
  })] })
310
331
  ]
@@ -314,19 +335,19 @@ function E() {
314
335
  className: "flex gap-3 pt-4 border-t border-border-subtle",
315
336
  children: /* @__PURE__ */ x("button", {
316
337
  type: "button",
317
- onClick: W,
338
+ onClick: Z,
318
339
  className: "flex items-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:opacity-90 transition-opacity",
319
- children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), "Save for this session"]
340
+ children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), "Save for this session"]
320
341
  })
321
342
  })
322
343
  ]
323
344
  }),
324
- A === "preferences" && /* @__PURE__ */ x("div", {
345
+ z === "preferences" && /* @__PURE__ */ x("div", {
325
346
  className: "space-y-8",
326
347
  children: [
327
348
  /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("h3", {
328
349
  className: "text-lg font-semibold text-text-primary mb-4 flex items-center gap-2",
329
- children: [/* @__PURE__ */ b(c, { className: "h-4 w-4 text-text-secondary" }), "Notification Preferences"]
350
+ children: [/* @__PURE__ */ b(ee, { className: "h-4 w-4 text-text-secondary" }), "Notification Preferences"]
330
351
  }), /* @__PURE__ */ b("div", {
331
352
  className: "space-y-3",
332
353
  children: [
@@ -350,8 +371,8 @@ function E() {
350
371
  className: "flex items-center gap-3 cursor-pointer",
351
372
  children: [/* @__PURE__ */ b("input", {
352
373
  type: "checkbox",
353
- checked: R.notifications[e.key],
354
- onChange: (t) => K(e.key, t.target.checked),
374
+ checked: K.notifications[e.key],
375
+ onChange: (t) => fe(e.key, t.target.checked),
355
376
  className: "h-4 w-4 rounded border-border-subtle text-text-primary focus:ring-[var(--color-focus-ring)]"
356
377
  }), /* @__PURE__ */ b("span", {
357
378
  className: "text-sm text-text-primary",
@@ -361,15 +382,15 @@ function E() {
361
382
  })] }),
362
383
  /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("h3", {
363
384
  className: "text-lg font-semibold text-text-primary mb-4 flex items-center gap-2",
364
- children: [/* @__PURE__ */ b(d, { className: "h-4 w-4 text-text-secondary" }), "Dietary Preferences"]
385
+ children: [/* @__PURE__ */ b(m, { className: "h-4 w-4 text-text-secondary" }), "Dietary Preferences"]
365
386
  }), /* @__PURE__ */ b("div", {
366
387
  className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",
367
- children: w.map((e) => /* @__PURE__ */ x("label", {
388
+ children: se.map((e) => /* @__PURE__ */ x("label", {
368
389
  className: "flex items-center gap-2 cursor-pointer",
369
390
  children: [/* @__PURE__ */ b("input", {
370
391
  type: "checkbox",
371
- checked: R.dietary.includes(e),
372
- onChange: (t) => q("dietary", e, t.target.checked),
392
+ checked: K.dietary.includes(e),
393
+ onChange: (t) => $("dietary", e, t.target.checked),
373
394
  className: "h-4 w-4 rounded border-border-subtle text-text-primary focus:ring-[var(--color-focus-ring)]"
374
395
  }), /* @__PURE__ */ b("span", {
375
396
  className: "text-sm text-text-primary capitalize",
@@ -379,15 +400,15 @@ function E() {
379
400
  })] }),
380
401
  /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("h3", {
381
402
  className: "text-lg font-semibold text-text-primary mb-4 flex items-center gap-2",
382
- children: [/* @__PURE__ */ b(o, { className: "h-4 w-4 text-status-error-text" }), "Food Allergies"]
403
+ children: [/* @__PURE__ */ b(l, { className: "h-4 w-4 text-status-error-text" }), "Food Allergies"]
383
404
  }), /* @__PURE__ */ b("div", {
384
405
  className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",
385
- children: T.map((e) => /* @__PURE__ */ x("label", {
406
+ children: ce.map((e) => /* @__PURE__ */ x("label", {
386
407
  className: "flex items-center gap-2 cursor-pointer",
387
408
  children: [/* @__PURE__ */ b("input", {
388
409
  type: "checkbox",
389
- checked: R.allergies.includes(e),
390
- onChange: (t) => q("allergies", e, t.target.checked),
410
+ checked: K.allergies.includes(e),
411
+ onChange: (t) => $("allergies", e, t.target.checked),
391
412
  className: "h-4 w-4 rounded border-border-subtle text-status-error-text focus:ring-destructive"
392
413
  }), /* @__PURE__ */ b("span", {
393
414
  className: "text-sm text-text-primary capitalize",
@@ -399,14 +420,14 @@ function E() {
399
420
  className: "pt-4 border-t border-border-subtle",
400
421
  children: /* @__PURE__ */ x("button", {
401
422
  type: "button",
402
- onClick: W,
423
+ onClick: Z,
403
424
  className: "flex items-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:opacity-90 transition-opacity",
404
- children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), "Save Preferences"]
425
+ children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), "Save Preferences"]
405
426
  })
406
427
  })
407
428
  ]
408
429
  }),
409
- A === "stats" && /* @__PURE__ */ b("div", {
430
+ z === "stats" && /* @__PURE__ */ b("div", {
410
431
  className: "space-y-8",
411
432
  children: /* @__PURE__ */ x("div", {
412
433
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
@@ -415,43 +436,181 @@ function E() {
415
436
  className: "rounded-lg bg-[var(--color-accent-soft)] p-5 border border-border-focus/20",
416
437
  children: [/* @__PURE__ */ x("div", {
417
438
  className: "flex items-center gap-2 mb-2",
418
- children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
439
+ children: [/* @__PURE__ */ b(ne, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
419
440
  className: "text-sm font-medium text-text-primary",
420
441
  children: "Total Orders"
421
442
  })]
422
443
  }), /* @__PURE__ */ b("p", {
423
444
  className: "text-3xl font-bold text-text-primary",
424
- children: V.totalOrders
445
+ children: Y.totalOrders
425
446
  })]
426
447
  }),
427
448
  /* @__PURE__ */ x("div", {
428
449
  className: "rounded-lg bg-status-success-bg-subtle p-5 border border-status-success-text/20",
429
450
  children: [/* @__PURE__ */ x("div", {
430
451
  className: "flex items-center gap-2 mb-2",
431
- children: [/* @__PURE__ */ b(f, { className: "h-4 w-4 text-status-success-text" }), /* @__PURE__ */ b("h4", {
452
+ children: [/* @__PURE__ */ b(h, { className: "h-4 w-4 text-status-success-text" }), /* @__PURE__ */ b("h4", {
432
453
  className: "text-sm font-medium text-status-success-text",
433
454
  children: "Total Spent"
434
455
  })]
435
456
  }), /* @__PURE__ */ b("p", {
436
457
  className: "text-3xl font-bold text-status-success-text",
437
- children: i(V.totalSpent, { minimumFractionDigits: 0 })
458
+ children: s(Y.totalSpent, { minimumFractionDigits: 0 })
438
459
  })]
439
460
  }),
440
461
  /* @__PURE__ */ x("div", {
441
462
  className: "rounded-lg bg-bg-surface p-5 border border-border-subtle",
442
463
  children: [/* @__PURE__ */ x("div", {
443
464
  className: "flex items-center gap-2 mb-2",
444
- children: [/* @__PURE__ */ b(s, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
465
+ children: [/* @__PURE__ */ b(u, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
445
466
  className: "text-sm font-medium text-text-primary",
446
467
  children: "Avg Order Value"
447
468
  })]
448
469
  }), /* @__PURE__ */ b("p", {
449
470
  className: "text-3xl font-bold text-text-primary",
450
- children: i(V.avgOrderValue, { minimumFractionDigits: 0 })
471
+ children: s(Y.avgOrderValue, { minimumFractionDigits: 0 })
451
472
  })]
452
473
  })
453
474
  ]
454
475
  })
476
+ }),
477
+ z === "rewards" && /* @__PURE__ */ b("div", {
478
+ className: "space-y-8",
479
+ children: A ? /* @__PURE__ */ b("div", {
480
+ className: "flex h-32 items-center justify-center",
481
+ children: /* @__PURE__ */ b(g, { className: "h-6 w-6 animate-spin text-text-secondary" })
482
+ }) : /* @__PURE__ */ x(oe, { children: [
483
+ /* @__PURE__ */ x("div", {
484
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
485
+ children: [
486
+ /* @__PURE__ */ x("div", {
487
+ className: "rounded-lg bg-[var(--color-accent-soft)] p-5 border border-border-focus/20",
488
+ children: [/* @__PURE__ */ x("div", {
489
+ className: "flex items-center gap-2 mb-2",
490
+ children: [/* @__PURE__ */ b(p, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
491
+ className: "text-sm font-medium text-text-primary",
492
+ children: "Points Balance"
493
+ })]
494
+ }), /* @__PURE__ */ b("p", {
495
+ className: "text-3xl font-bold text-text-primary",
496
+ children: k?.pointsBalance ?? 0
497
+ })]
498
+ }),
499
+ /* @__PURE__ */ x("div", {
500
+ className: "rounded-lg bg-status-success-bg-subtle p-5 border border-status-success-text/20",
501
+ children: [/* @__PURE__ */ x("div", {
502
+ className: "flex items-center gap-2 mb-2",
503
+ children: [/* @__PURE__ */ b(re, { className: "h-4 w-4 text-status-success-text" }), /* @__PURE__ */ b("h4", {
504
+ className: "text-sm font-medium text-status-success-text",
505
+ children: "Lifetime Earned"
506
+ })]
507
+ }), /* @__PURE__ */ b("p", {
508
+ className: "text-3xl font-bold text-status-success-text",
509
+ children: k?.lifetimePointsEarned ?? 0
510
+ })]
511
+ }),
512
+ /* @__PURE__ */ x("div", {
513
+ className: "rounded-lg bg-bg-surface p-5 border border-border-subtle",
514
+ children: [/* @__PURE__ */ x("div", {
515
+ className: "flex items-center gap-2 mb-2",
516
+ children: [/* @__PURE__ */ b(h, { className: "h-4 w-4 text-text-primary" }), /* @__PURE__ */ b("h4", {
517
+ className: "text-sm font-medium text-text-primary",
518
+ children: "Lifetime Redeemed"
519
+ })]
520
+ }), /* @__PURE__ */ b("p", {
521
+ className: "text-3xl font-bold text-text-primary",
522
+ children: k?.lifetimePointsRedeemed ?? 0
523
+ })]
524
+ })
525
+ ]
526
+ }),
527
+ /* @__PURE__ */ x("div", {
528
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
529
+ children: [
530
+ /* @__PURE__ */ b("h3", {
531
+ className: "text-base font-semibold text-text-primary mb-1",
532
+ children: "Redeem Points for a Discount"
533
+ }),
534
+ /* @__PURE__ */ x("p", {
535
+ className: "text-xs text-text-secondary mb-4",
536
+ children: [
537
+ "1 point = ₹0.50 discount. Minimum redemption is",
538
+ " ",
539
+ w,
540
+ " points. Redeeming debits your balance immediately — apply the resulting discount amount at checkout on your next order."
541
+ ]
542
+ }),
543
+ /* @__PURE__ */ x("div", {
544
+ className: "flex flex-col sm:flex-row gap-3",
545
+ children: [/* @__PURE__ */ b("input", {
546
+ type: "number",
547
+ min: w,
548
+ step: 1,
549
+ value: N,
550
+ onChange: (e) => P(e.target.value),
551
+ className: "w-full sm:w-40 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
552
+ }), /* @__PURE__ */ x("button", {
553
+ type: "button",
554
+ onClick: pe,
555
+ disabled: M.isPending || (k?.pointsBalance ?? 0) < w,
556
+ className: "flex items-center justify-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",
557
+ children: [M.isPending ? /* @__PURE__ */ b(g, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(p, { className: "h-4 w-4" }), "Redeem"]
558
+ })]
559
+ }),
560
+ L && /* @__PURE__ */ b("p", {
561
+ className: "mt-3 text-sm text-status-error-text",
562
+ children: L
563
+ }),
564
+ F && /* @__PURE__ */ x("div", {
565
+ className: "mt-3 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
566
+ children: [/* @__PURE__ */ b(d, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ x("p", {
567
+ className: "text-sm text-status-success-text",
568
+ children: [
569
+ "Redeemed ",
570
+ F.pointsRedeemed,
571
+ " points for a",
572
+ " ",
573
+ s(F.discountAmount, { minimumFractionDigits: 0 }),
574
+ " ",
575
+ "discount — enter this amount at checkout."
576
+ ]
577
+ })]
578
+ })
579
+ ]
580
+ }),
581
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h3", {
582
+ className: "text-base font-semibold text-text-primary mb-3",
583
+ children: "Points History"
584
+ }), le ? /* @__PURE__ */ b("div", {
585
+ className: "flex h-24 items-center justify-center",
586
+ children: /* @__PURE__ */ b(g, { className: "h-5 w-5 animate-spin text-text-secondary" })
587
+ }) : j.length > 0 ? /* @__PURE__ */ b("div", {
588
+ className: "space-y-2",
589
+ children: j.map((e) => /* @__PURE__ */ x("div", {
590
+ className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface p-3",
591
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
592
+ className: "text-sm font-medium text-text-primary",
593
+ children: e.description || e.type
594
+ }), /* @__PURE__ */ b("p", {
595
+ className: "text-xs text-text-secondary",
596
+ children: new Date(e.createdAt).toLocaleDateString()
597
+ })] }), /* @__PURE__ */ x("p", {
598
+ className: t("text-sm font-semibold", e.points >= 0 ? "text-status-success-text" : "text-status-error-text"),
599
+ children: [
600
+ e.points >= 0 ? "+" : "",
601
+ e.points,
602
+ " pts"
603
+ ]
604
+ })]
605
+ }, e.id))
606
+ }) : /* @__PURE__ */ b("div", {
607
+ className: "rounded-lg bg-bg-sunken/50 p-4",
608
+ children: /* @__PURE__ */ b("p", {
609
+ className: "text-sm text-text-secondary",
610
+ children: "No points activity yet — complete an order to start earning rewards."
611
+ })
612
+ })] })
613
+ ] })
455
614
  })
456
615
  ]
457
616
  })]
@@ -460,6 +619,6 @@ function E() {
460
619
  });
461
620
  }
462
621
  //#endregion
463
- export { E as CustomerProfilePage };
622
+ export { T as CustomerProfilePage };
464
623
 
465
624
  //# sourceMappingURL=CustomerProfilePage.js.map