@burdenoff/microfe-healthybowl 2026.819.1 → 2026.819.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,60 +9,60 @@ import { Breadcrumbs as o } from "../../components/Breadcrumbs.js";
|
|
|
9
9
|
import { Modal as ne } from "../../components/Modal.js";
|
|
10
10
|
import { useToast as s } from "../../hooks/useToast.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import { useHealthyBowlData as
|
|
13
|
-
import { useHealthyBowlStore as
|
|
14
|
-
import { useCreateSharedMarketOrders as
|
|
15
|
-
import { useState as
|
|
16
|
-
import { useI18n as
|
|
17
|
-
import { ArrowLeft as
|
|
18
|
-
import { useNavigate as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { Button as
|
|
12
|
+
import { useHealthyBowlData as c } from "../../hooks/useHealthyBowlData.js";
|
|
13
|
+
import { useHealthyBowlStore as l } from "../../store/healthybowlStore.js";
|
|
14
|
+
import { useCreateSharedMarketOrders as u } from "../../hooks/useSharedMarket.js";
|
|
15
|
+
import { useState as d } from "react";
|
|
16
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { ArrowLeft as p, CreditCard as re, Info as m, MapPin as ie, Minus as ae, Package as h, Plus as oe, ShieldCheck as g, ShoppingCart as se, Tag as _, Trash2 as v, Truck as ce } from "lucide-react";
|
|
18
|
+
import { useNavigate as le } from "react-router";
|
|
19
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
20
|
+
import { Button as S } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
//#region src/healthybowl/pages/marketplace/CartPage.tsx
|
|
22
|
-
var
|
|
23
|
-
let { t:
|
|
22
|
+
var C = () => {
|
|
23
|
+
let { t: C } = f(), { marketplaceProducts: ue, farm: w } = c(), { currentUser: T } = e(), E = le(), { buildPath: D } = n(), { cart: O, updateCartQuantity: k, removeFromCart: de, clearCart: A, deliveryAddress: j, setDeliveryAddress: M } = l(), { placeSharedOrders: fe } = u(), { toasts: N, toast: P, dismiss: F } = s(), [I, L] = d(!1), [R, z] = d(!1), [B, V] = d(""), [H, U] = d(null), W = O.reduce((e, t) => e + t.price * t.quantity, 0), G = W * .08, K = O.length === 0 || W >= 100 ? 0 : 15, q = W + G + K, pe = () => {
|
|
24
24
|
let e = B.trim();
|
|
25
25
|
e && U(e.toUpperCase());
|
|
26
26
|
}, me = () => {
|
|
27
27
|
U(null), V("");
|
|
28
|
-
}, J =
|
|
29
|
-
|
|
30
|
-
title:
|
|
31
|
-
description:
|
|
28
|
+
}, J = O.reduce((e, t) => e + t.quantity, 0), Y = ee(O), X = new Set(O.map((e) => e.seller)).size, Z = [w.name, w.location].filter(Boolean).join(", "), Q = (j || Z).trim(), he = (e, t) => {
|
|
29
|
+
de(e), P({
|
|
30
|
+
title: C("healthybowl.marketplace.cart.toast.itemRemoved.title", "Item removed"),
|
|
31
|
+
description: C("healthybowl.marketplace.cart.toast.itemRemoved.description", "{{name}} removed from cart", { name: t }),
|
|
32
32
|
variant: "info"
|
|
33
33
|
});
|
|
34
34
|
}, ge = () => {
|
|
35
|
-
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
35
|
+
A(), P({
|
|
36
|
+
title: C("healthybowl.marketplace.cart.toast.cartCleared.title", "Cart cleared"),
|
|
37
|
+
description: C("healthybowl.marketplace.cart.toast.cartCleared.description", "All items have been removed"),
|
|
38
38
|
variant: "info"
|
|
39
39
|
});
|
|
40
40
|
}, _e = () => {
|
|
41
41
|
L(!0);
|
|
42
42
|
}, ve = async () => {
|
|
43
|
-
if (
|
|
44
|
-
let e =
|
|
43
|
+
if (O.length === 0) return;
|
|
44
|
+
let e = T?.id;
|
|
45
45
|
if (!e) {
|
|
46
46
|
P({
|
|
47
|
-
title:
|
|
48
|
-
description:
|
|
47
|
+
title: C("healthybowl.marketplace.cart.toast.signInRequired.title", "Sign in required"),
|
|
48
|
+
description: C("healthybowl.marketplace.cart.toast.signInRequired.description", "We could not identify your account, so the order was not placed."),
|
|
49
49
|
variant: "error"
|
|
50
50
|
});
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
if (!Q) {
|
|
54
54
|
P({
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
55
|
+
title: C("healthybowl.marketplace.cart.toast.addressRequired.title", "Delivery address required"),
|
|
56
|
+
description: C("healthybowl.marketplace.cart.toast.addressRequired.description", "Enter where this order should be delivered before placing it."),
|
|
57
57
|
variant: "error"
|
|
58
58
|
});
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
z(!0);
|
|
62
62
|
try {
|
|
63
|
-
let t = await
|
|
63
|
+
let t = await fe({
|
|
64
64
|
buyerId: e,
|
|
65
|
-
items:
|
|
65
|
+
items: O.map((e) => ({
|
|
66
66
|
productId: e.productId,
|
|
67
67
|
productName: e.name,
|
|
68
68
|
quantity: e.quantity,
|
|
@@ -75,62 +75,62 @@ var S = () => {
|
|
|
75
75
|
...H ? { promoCode: H } : {},
|
|
76
76
|
shippingAddress: Q
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
A(), M(""), L(!1), V(""), U(null), E(D("marketplace/orders"), { state: {
|
|
79
79
|
orderPlaced: !0,
|
|
80
80
|
orderCount: t.length,
|
|
81
81
|
discountApplied: t.some((e) => e.discountAmount > 0)
|
|
82
82
|
} });
|
|
83
83
|
} catch (e) {
|
|
84
84
|
P({
|
|
85
|
-
title:
|
|
86
|
-
description: e instanceof Error ? e.message :
|
|
85
|
+
title: C("healthybowl.marketplace.cart.toast.orderFailed.title", "Could not place order"),
|
|
86
|
+
description: e instanceof Error ? e.message : C("healthybowl.marketplace.cart.toast.orderFailed.description", "Failed to place order"),
|
|
87
87
|
variant: "error"
|
|
88
88
|
});
|
|
89
89
|
} finally {
|
|
90
90
|
z(!1);
|
|
91
91
|
}
|
|
92
|
-
}, ye = new Set(
|
|
93
|
-
return
|
|
94
|
-
title:
|
|
92
|
+
}, ye = new Set(O.map((e) => e.productId)), $ = ue.filter((e) => !ye.has(e.id)).slice(0, 3);
|
|
93
|
+
return O.length === 0 ? /* @__PURE__ */ x(r, {
|
|
94
|
+
title: C("healthybowl.marketplace.cart.title", "Shopping Cart"),
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
label:
|
|
96
|
+
/* @__PURE__ */ b(o, { items: [{
|
|
97
|
+
label: C("healthybowl.marketplace.cart.breadcrumbs.marketplace", "Marketplace"),
|
|
98
98
|
href: "/marketplace"
|
|
99
|
-
}, { label:
|
|
100
|
-
/* @__PURE__ */
|
|
99
|
+
}, { label: C("healthybowl.marketplace.cart.breadcrumbs.cart", "Cart") }] }),
|
|
100
|
+
/* @__PURE__ */ b(te, {
|
|
101
101
|
illustration: "empty-files",
|
|
102
|
-
title:
|
|
103
|
-
description:
|
|
104
|
-
action: /* @__PURE__ */
|
|
105
|
-
onClick: () =>
|
|
102
|
+
title: C("healthybowl.marketplace.cart.emptyState.title", "Your Cart is Empty"),
|
|
103
|
+
description: C("healthybowl.marketplace.cart.emptyState.description", "Looks like you haven't added any products yet. Browse the marketplace to find great organic products."),
|
|
104
|
+
action: /* @__PURE__ */ x(S, {
|
|
105
|
+
onClick: () => E(D("marketplace")),
|
|
106
106
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ b(p, { className: "h-4 w-4" }),
|
|
108
108
|
" ",
|
|
109
|
-
|
|
109
|
+
C("healthybowl.marketplace.cart.actions.browseMarketplace", "Browse Marketplace")
|
|
110
110
|
]
|
|
111
111
|
})
|
|
112
112
|
}),
|
|
113
|
-
$.length > 0 && /* @__PURE__ */
|
|
113
|
+
$.length > 0 && /* @__PURE__ */ x("div", {
|
|
114
114
|
className: "mt-6",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
116
116
|
className: "text-sm font-semibold text-text-primary",
|
|
117
|
-
children:
|
|
118
|
-
}), /* @__PURE__ */
|
|
117
|
+
children: C("healthybowl.marketplace.cart.recommendations.interestedHeading", "You might be interested in")
|
|
118
|
+
}), /* @__PURE__ */ b("div", {
|
|
119
119
|
className: "mt-3 grid gap-3 sm:grid-cols-3",
|
|
120
|
-
children: $.map((e) => /* @__PURE__ */
|
|
120
|
+
children: $.map((e) => /* @__PURE__ */ x(S, {
|
|
121
121
|
variant: "outline",
|
|
122
|
-
onClick: () =>
|
|
122
|
+
onClick: () => E(D(`marketplace/${e.id}`)),
|
|
123
123
|
className: "h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ b(h, { className: "h-8 w-8 shrink-0 text-text-secondary" }), /* @__PURE__ */ x("div", { children: [
|
|
125
|
+
/* @__PURE__ */ b("p", {
|
|
126
126
|
className: "text-sm font-medium text-text-primary",
|
|
127
127
|
children: e.name
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ b("p", {
|
|
130
130
|
className: "text-xs text-text-secondary",
|
|
131
131
|
children: e.seller
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ b("p", {
|
|
134
134
|
className: "mt-0.5 text-sm font-semibold text-text-primary",
|
|
135
135
|
children: t(e.price, "INR")
|
|
136
136
|
})
|
|
@@ -138,293 +138,293 @@ var S = () => {
|
|
|
138
138
|
}, e.id))
|
|
139
139
|
})]
|
|
140
140
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ b(a, {
|
|
142
142
|
toasts: N,
|
|
143
143
|
onDismiss: F
|
|
144
144
|
})
|
|
145
145
|
]
|
|
146
|
-
}) : /* @__PURE__ */
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
146
|
+
}) : /* @__PURE__ */ x(r, {
|
|
147
|
+
title: C("healthybowl.marketplace.cart.title", "Shopping Cart"),
|
|
148
|
+
description: C("healthybowl.marketplace.cart.itemCount", "{{count}} item(s) in your cart", { count: J }),
|
|
149
149
|
purpose: "The items you're about to buy. Review quantities, double-check the total, and adjust anything before you check out — nothing is ordered until you confirm.",
|
|
150
|
-
actions: /* @__PURE__ */
|
|
150
|
+
actions: /* @__PURE__ */ x(S, {
|
|
151
151
|
variant: "outline",
|
|
152
152
|
size: "sm",
|
|
153
153
|
onClick: ge,
|
|
154
154
|
className: "text-text-secondary hover:border-status-error-border hover:text-status-error-text",
|
|
155
155
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ b(v, { className: "h-3 w-3" }),
|
|
157
157
|
" ",
|
|
158
|
-
|
|
158
|
+
C("healthybowl.marketplace.cart.actions.clearCart", "Clear Cart")
|
|
159
159
|
]
|
|
160
160
|
}),
|
|
161
161
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
label:
|
|
162
|
+
/* @__PURE__ */ b(o, { items: [{
|
|
163
|
+
label: C("healthybowl.marketplace.cart.breadcrumbs.marketplace", "Marketplace"),
|
|
164
164
|
href: "/marketplace"
|
|
165
|
-
}, { label:
|
|
166
|
-
/* @__PURE__ */
|
|
165
|
+
}, { label: C("healthybowl.marketplace.cart.breadcrumbs.cart", "Cart") }] }),
|
|
166
|
+
/* @__PURE__ */ x("div", {
|
|
167
167
|
className: "flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ b(m, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("p", { children: C("healthybowl.marketplace.cart.sessionNotice", "This cart is kept only for the current browser session — it isn't saved yet and resets on refresh. Placing an order records it under your account; payment is collected separately and isn't taken here.") })]
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ x("div", {
|
|
171
171
|
className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
|
|
172
172
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ b(i, {
|
|
174
174
|
hero: !0,
|
|
175
|
-
label:
|
|
175
|
+
label: C("healthybowl.marketplace.cart.stats.itemsInCart.label", "Items in Cart"),
|
|
176
176
|
value: J,
|
|
177
|
-
icon: /* @__PURE__ */
|
|
177
|
+
icon: /* @__PURE__ */ b(se, { className: "h-5 w-5" })
|
|
178
178
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
label:
|
|
181
|
-
value:
|
|
182
|
-
icon: /* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b(i, {
|
|
180
|
+
label: C("healthybowl.marketplace.cart.stats.uniqueProducts.label", "Unique Products"),
|
|
181
|
+
value: O.length,
|
|
182
|
+
icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" })
|
|
183
183
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
label:
|
|
184
|
+
/* @__PURE__ */ b(i, {
|
|
185
|
+
label: C("healthybowl.marketplace.cart.stats.sellers.label", "Sellers"),
|
|
186
186
|
value: X,
|
|
187
|
-
icon: /* @__PURE__ */
|
|
187
|
+
icon: /* @__PURE__ */ b(_, { className: "h-5 w-5" })
|
|
188
188
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
label:
|
|
189
|
+
/* @__PURE__ */ b(i, {
|
|
190
|
+
label: C("healthybowl.marketplace.cart.stats.subtotal.label", "Subtotal"),
|
|
191
191
|
value: t(W, Y),
|
|
192
|
-
icon: /* @__PURE__ */
|
|
192
|
+
icon: /* @__PURE__ */ b(re, { className: "h-5 w-5" })
|
|
193
193
|
})
|
|
194
194
|
]
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ x("div", {
|
|
197
197
|
className: "grid gap-6 lg:grid-cols-3",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ b("div", {
|
|
199
199
|
className: "space-y-3 lg:col-span-2",
|
|
200
|
-
children:
|
|
200
|
+
children: O.map((e) => /* @__PURE__ */ x("div", {
|
|
201
201
|
className: "flex items-center gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
202
202
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ b("div", {
|
|
204
204
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-bg-sunken",
|
|
205
|
-
children: /* @__PURE__ */
|
|
205
|
+
children: /* @__PURE__ */ b(h, { className: "h-5 w-5 text-text-secondary" })
|
|
206
206
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ x("div", {
|
|
208
208
|
className: "min-w-0 flex-1",
|
|
209
209
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ b(S, {
|
|
211
211
|
variant: "ghost",
|
|
212
212
|
size: "sm",
|
|
213
|
-
onClick: () =>
|
|
213
|
+
onClick: () => E(D(`marketplace/${e.productId}`)),
|
|
214
214
|
className: "h-auto justify-start p-0 text-sm font-semibold text-text-primary hover:bg-transparent hover:underline",
|
|
215
215
|
children: e.name
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ b("p", {
|
|
218
218
|
className: "text-xs text-text-secondary",
|
|
219
219
|
children: e.seller
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ x("p", {
|
|
222
222
|
className: "mt-0.5 text-sm text-text-primary",
|
|
223
|
-
children: [t(e.price, e.currency ?? Y), /* @__PURE__ */
|
|
223
|
+
children: [t(e.price, e.currency ?? Y), /* @__PURE__ */ x("span", {
|
|
224
224
|
className: "text-xs text-text-secondary",
|
|
225
225
|
children: [" / ", e.unit]
|
|
226
226
|
})]
|
|
227
227
|
})
|
|
228
228
|
]
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ x("div", {
|
|
231
231
|
className: "flex items-center gap-1.5",
|
|
232
232
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ b(S, {
|
|
234
234
|
variant: "outline",
|
|
235
235
|
size: "icon-sm",
|
|
236
|
-
"aria-label":
|
|
237
|
-
onClick: () =>
|
|
236
|
+
"aria-label": C("healthybowl.marketplace.cart.actions.decreaseQuantity", "Decrease quantity"),
|
|
237
|
+
onClick: () => k(e.productId, e.quantity - 1),
|
|
238
238
|
className: "text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary",
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ b(ae, { className: "h-3 w-3" })
|
|
240
240
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ b("span", {
|
|
242
242
|
className: "min-w-[2.5rem] text-center text-sm font-semibold text-text-primary",
|
|
243
243
|
children: e.quantity
|
|
244
244
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ b(S, {
|
|
246
246
|
variant: "outline",
|
|
247
247
|
size: "icon-sm",
|
|
248
|
-
"aria-label":
|
|
249
|
-
onClick: () =>
|
|
248
|
+
"aria-label": C("healthybowl.marketplace.cart.actions.increaseQuantity", "Increase quantity"),
|
|
249
|
+
onClick: () => k(e.productId, e.quantity + 1),
|
|
250
250
|
className: "text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary",
|
|
251
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ b(oe, { className: "h-3 w-3" })
|
|
252
252
|
})
|
|
253
253
|
]
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ b("p", {
|
|
256
256
|
className: "w-24 text-end text-sm font-bold text-text-primary",
|
|
257
257
|
children: t(e.price * e.quantity, e.currency ?? Y)
|
|
258
258
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ b(S, {
|
|
260
260
|
variant: "ghost",
|
|
261
261
|
size: "icon-sm",
|
|
262
|
-
"aria-label":
|
|
262
|
+
"aria-label": C("healthybowl.marketplace.cart.actions.removeItem", "Remove item"),
|
|
263
263
|
onClick: () => he(e.productId, e.name),
|
|
264
264
|
className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
265
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ b(v, { className: "h-4 w-4" })
|
|
266
266
|
})
|
|
267
267
|
]
|
|
268
268
|
}, e.id))
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ x("div", {
|
|
270
270
|
className: "space-y-4",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ x("div", {
|
|
272
272
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
273
273
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ b("h3", {
|
|
275
275
|
className: "text-sm font-semibold text-text-primary",
|
|
276
|
-
children:
|
|
276
|
+
children: C("healthybowl.marketplace.cart.summary.heading", "Order Summary")
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ x("div", {
|
|
279
279
|
className: "mt-4 space-y-2.5 text-sm",
|
|
280
280
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ x("div", {
|
|
282
282
|
className: "flex justify-between text-text-secondary",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.summary.subtotalWithCount", "Subtotal ({{count}} items)", { count: J }) }), /* @__PURE__ */ b("span", {
|
|
284
284
|
className: "text-text-primary",
|
|
285
285
|
children: t(W, Y)
|
|
286
286
|
})]
|
|
287
287
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ x("div", {
|
|
289
289
|
className: "flex justify-between text-text-secondary",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.summary.tax", "Tax (8%)") }), /* @__PURE__ */ b("span", {
|
|
291
291
|
className: "text-text-primary",
|
|
292
292
|
children: t(G, Y)
|
|
293
293
|
})]
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ x("div", {
|
|
296
296
|
className: "flex justify-between text-text-secondary",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ x("span", {
|
|
298
298
|
className: "flex items-center gap-1",
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ b(ce, { className: "h-3 w-3" }),
|
|
301
301
|
" ",
|
|
302
|
-
|
|
302
|
+
C("healthybowl.marketplace.cart.summary.shipping", "Shipping")
|
|
303
303
|
]
|
|
304
|
-
}), /* @__PURE__ */
|
|
304
|
+
}), /* @__PURE__ */ b("span", {
|
|
305
305
|
className: "text-text-primary",
|
|
306
|
-
children: K === 0 ? /* @__PURE__ */
|
|
306
|
+
children: K === 0 ? /* @__PURE__ */ b("span", {
|
|
307
307
|
className: "font-medium text-success",
|
|
308
|
-
children:
|
|
308
|
+
children: C("healthybowl.marketplace.cart.summary.free", "Free")
|
|
309
309
|
}) : t(K, Y)
|
|
310
310
|
})]
|
|
311
311
|
}),
|
|
312
|
-
K > 0 && /* @__PURE__ */
|
|
312
|
+
K > 0 && /* @__PURE__ */ b("p", {
|
|
313
313
|
className: "text-xs text-text-secondary",
|
|
314
|
-
children:
|
|
314
|
+
children: C("healthybowl.marketplace.cart.summary.freeShippingNote", "Free shipping on orders over $100")
|
|
315
315
|
}),
|
|
316
|
-
H ? /* @__PURE__ */
|
|
316
|
+
H ? /* @__PURE__ */ x("div", {
|
|
317
317
|
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 px-2.5 py-2",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ x("span", {
|
|
319
319
|
className: "flex items-center gap-1.5 text-text-secondary",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
321
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ b(_, { className: "h-3 w-3" }), C("healthybowl.marketplace.cart.summary.promoApplied", "Code \"{{code}}\" applied", { code: H })]
|
|
321
|
+
}), /* @__PURE__ */ b(S, {
|
|
322
322
|
variant: "ghost",
|
|
323
323
|
size: "sm",
|
|
324
324
|
onClick: me,
|
|
325
325
|
className: "h-auto p-0 text-xs text-text-secondary hover:text-status-error-text hover:bg-transparent",
|
|
326
|
-
children:
|
|
326
|
+
children: C("healthybowl.marketplace.cart.actions.removePromoCode", "Remove")
|
|
327
327
|
})]
|
|
328
|
-
}) : /* @__PURE__ */
|
|
328
|
+
}) : /* @__PURE__ */ x("div", {
|
|
329
329
|
className: "flex items-center gap-1.5",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ b("input", {
|
|
331
331
|
type: "text",
|
|
332
332
|
value: B,
|
|
333
333
|
onChange: (e) => V(e.target.value),
|
|
334
|
-
placeholder:
|
|
335
|
-
"aria-label":
|
|
334
|
+
placeholder: C("healthybowl.marketplace.cart.summary.promoPlaceholder", "Promo code"),
|
|
335
|
+
"aria-label": C("healthybowl.marketplace.cart.summary.promoPlaceholder", "Promo code"),
|
|
336
336
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
337
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ b(S, {
|
|
338
338
|
variant: "outline",
|
|
339
339
|
size: "sm",
|
|
340
340
|
onClick: pe,
|
|
341
341
|
disabled: !B.trim(),
|
|
342
342
|
className: "shrink-0",
|
|
343
|
-
children:
|
|
343
|
+
children: C("healthybowl.marketplace.cart.actions.applyPromoCode", "Apply")
|
|
344
344
|
})]
|
|
345
345
|
}),
|
|
346
|
-
H && /* @__PURE__ */
|
|
346
|
+
H && /* @__PURE__ */ x("div", {
|
|
347
347
|
className: "flex justify-between text-text-secondary",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.summary.discount", "Discount") }), /* @__PURE__ */ b("span", {
|
|
349
349
|
className: "text-xs italic text-text-secondary",
|
|
350
|
-
children: X > 1 ?
|
|
350
|
+
children: X > 1 ? C("healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning", "Not applied — cart spans multiple farms") : C("healthybowl.marketplace.cart.summary.discountPending", "Confirmed at checkout")
|
|
351
351
|
})]
|
|
352
352
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ b("div", {
|
|
354
354
|
className: "border-t border-border-subtle pt-2.5",
|
|
355
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ x("div", {
|
|
356
356
|
className: "flex justify-between text-base font-bold text-text-primary",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.summary.total", "Total") }), /* @__PURE__ */ b("span", { children: t(q, Y) })]
|
|
358
358
|
})
|
|
359
359
|
})
|
|
360
360
|
]
|
|
361
361
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ b(S, {
|
|
363
363
|
onClick: _e,
|
|
364
364
|
className: "mt-4 w-full",
|
|
365
|
-
children:
|
|
365
|
+
children: C("healthybowl.marketplace.cart.actions.checkout", "Checkout")
|
|
366
366
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ b("p", {
|
|
368
368
|
className: "mt-1.5 text-center text-xs text-text-secondary",
|
|
369
|
-
children:
|
|
369
|
+
children: C("healthybowl.marketplace.cart.summary.checkoutNote", "Placing an order records it; payment is collected separately.")
|
|
370
370
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ x(S, {
|
|
372
372
|
variant: "outline",
|
|
373
373
|
size: "sm",
|
|
374
|
-
onClick: () =>
|
|
374
|
+
onClick: () => E(D("marketplace")),
|
|
375
375
|
className: "mt-2 w-full text-text-secondary hover:text-text-primary",
|
|
376
376
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ b(p, { className: "h-3 w-3" }),
|
|
378
378
|
" ",
|
|
379
|
-
|
|
379
|
+
C("healthybowl.marketplace.cart.actions.continueShopping", "Continue Shopping")
|
|
380
380
|
]
|
|
381
381
|
})
|
|
382
382
|
]
|
|
383
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ b("div", {
|
|
384
384
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
385
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ x("div", {
|
|
386
386
|
className: "space-y-2.5 text-xs text-text-secondary",
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ x("div", {
|
|
389
389
|
className: "flex items-center gap-2",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ b(m, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.notices.sessionOnly", "Cart isn't saved yet — it resets on refresh.") })]
|
|
391
391
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ x("div", {
|
|
393
393
|
className: "flex items-center gap-2",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ b(g, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.notices.noPayment", "Placing an order records it under your account; no payment is taken here.") })]
|
|
395
395
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ x("div", {
|
|
397
397
|
className: "flex items-center gap-2",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ b(h, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.notices.coordinate", "Coordinate payment and delivery with sellers using their listing details.") })]
|
|
399
399
|
})
|
|
400
400
|
]
|
|
401
401
|
})
|
|
402
402
|
})]
|
|
403
403
|
})]
|
|
404
404
|
}),
|
|
405
|
-
$.length > 0 && /* @__PURE__ */
|
|
405
|
+
$.length > 0 && /* @__PURE__ */ x("div", {
|
|
406
406
|
className: "mt-2",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
408
408
|
className: "text-sm font-semibold text-text-primary",
|
|
409
|
-
children:
|
|
410
|
-
}), /* @__PURE__ */
|
|
409
|
+
children: C("healthybowl.marketplace.cart.recommendations.alsoLikeHeading", "You might also like")
|
|
410
|
+
}), /* @__PURE__ */ b("div", {
|
|
411
411
|
className: "mt-3 grid gap-3 sm:grid-cols-3",
|
|
412
|
-
children: $.map((e) => /* @__PURE__ */
|
|
412
|
+
children: $.map((e) => /* @__PURE__ */ x(S, {
|
|
413
413
|
variant: "outline",
|
|
414
|
-
onClick: () =>
|
|
414
|
+
onClick: () => E(D(`marketplace/${e.id}`)),
|
|
415
415
|
className: "h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ b(h, { className: "h-8 w-8 shrink-0 text-text-secondary" }), /* @__PURE__ */ x("div", { children: [
|
|
417
|
+
/* @__PURE__ */ b("p", {
|
|
418
418
|
className: "text-sm font-medium text-text-primary",
|
|
419
419
|
children: e.name
|
|
420
420
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ b("p", {
|
|
422
422
|
className: "text-xs text-text-secondary",
|
|
423
423
|
children: e.seller
|
|
424
424
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ x("p", {
|
|
426
426
|
className: "mt-0.5 text-sm font-semibold text-text-primary",
|
|
427
|
-
children: [t(e.price, "INR"), /* @__PURE__ */
|
|
427
|
+
children: [t(e.price, "INR"), /* @__PURE__ */ x("span", {
|
|
428
428
|
className: "text-xs font-normal text-text-secondary",
|
|
429
429
|
children: [" / ", e.unit]
|
|
430
430
|
})]
|
|
@@ -433,127 +433,127 @@ var S = () => {
|
|
|
433
433
|
}, e.id))
|
|
434
434
|
})]
|
|
435
435
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ b(ne, {
|
|
437
437
|
open: I,
|
|
438
438
|
onClose: () => L(!1),
|
|
439
|
-
title:
|
|
440
|
-
description:
|
|
439
|
+
title: C("healthybowl.marketplace.cart.checkoutModal.title", "Place your order"),
|
|
440
|
+
description: C("healthybowl.marketplace.cart.checkoutModal.description", "Your order will be recorded; payment is collected separately"),
|
|
441
441
|
size: "md",
|
|
442
|
-
footer: /* @__PURE__ */
|
|
442
|
+
footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(S, {
|
|
443
443
|
variant: "outline",
|
|
444
444
|
onClick: () => L(!1),
|
|
445
445
|
className: "text-text-secondary hover:text-text-primary",
|
|
446
|
-
children:
|
|
447
|
-
}), /* @__PURE__ */
|
|
446
|
+
children: C("healthybowl.common.cancel", "Cancel")
|
|
447
|
+
}), /* @__PURE__ */ b(S, {
|
|
448
448
|
onClick: ve,
|
|
449
|
-
disabled: R ||
|
|
450
|
-
children: R ?
|
|
449
|
+
disabled: R || O.length === 0 || !Q,
|
|
450
|
+
children: R ? C("healthybowl.marketplace.cart.checkoutModal.placing", "Placing...") : C("healthybowl.marketplace.cart.checkoutModal.placeOrder", "Place Order")
|
|
451
451
|
})] }),
|
|
452
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ x("div", {
|
|
453
453
|
className: "space-y-4",
|
|
454
454
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ x("div", {
|
|
456
456
|
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ b(m, { className: "mt-0.5 h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
458
458
|
className: "text-sm font-medium text-text-primary",
|
|
459
|
-
children:
|
|
460
|
-
}), /* @__PURE__ */
|
|
459
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.noPaymentHeading", "No payment is taken here.")
|
|
460
|
+
}), /* @__PURE__ */ b("p", {
|
|
461
461
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
462
|
-
children:
|
|
462
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.noPaymentDetail", "Placing this order records it under your account with a status of \"placed\". Payment is collected separately — coordinate it and delivery directly with each seller using their listing details. Your cart is kept only for this browser session and is cleared once the order is placed.")
|
|
463
463
|
})] })]
|
|
464
464
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ x("div", { children: [
|
|
466
|
+
/* @__PURE__ */ x("label", {
|
|
467
467
|
htmlFor: "cart-delivery-address",
|
|
468
468
|
className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-text-secondary",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ b(ie, { className: "h-3.5 w-3.5" }), C("healthybowl.marketplace.cart.checkoutModal.deliverTo", "Deliver to")]
|
|
470
470
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ b("textarea", {
|
|
472
472
|
id: "cart-delivery-address",
|
|
473
473
|
rows: 2,
|
|
474
|
-
value:
|
|
475
|
-
onChange: (e) =>
|
|
476
|
-
placeholder:
|
|
474
|
+
value: j || Z,
|
|
475
|
+
onChange: (e) => M(e.target.value),
|
|
476
|
+
placeholder: C("healthybowl.marketplace.cart.checkoutModal.addressPlaceholder", "Delivery address (defaults to your farm location)"),
|
|
477
477
|
className: "w-full resize-none rounded-md border border-border-subtle bg-bg-surface p-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
478
478
|
}),
|
|
479
|
-
Q ? /* @__PURE__ */
|
|
479
|
+
Q ? /* @__PURE__ */ b("p", {
|
|
480
480
|
className: "mt-1 text-[10px] text-text-secondary",
|
|
481
|
-
children:
|
|
482
|
-
}) : /* @__PURE__ */
|
|
481
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.addressHint", "Defaults to your farm location — edit if needed.")
|
|
482
|
+
}) : /* @__PURE__ */ b("p", {
|
|
483
483
|
className: "mt-1 text-[10px] text-destructive",
|
|
484
|
-
children:
|
|
484
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.addressRequired", "A delivery address is required to place this order.")
|
|
485
485
|
})
|
|
486
486
|
] }),
|
|
487
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ x("div", {
|
|
488
488
|
className: "rounded-lg border border-border-subtle p-3 space-y-2 text-sm",
|
|
489
489
|
children: [
|
|
490
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ b("p", {
|
|
491
491
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wide",
|
|
492
|
-
children:
|
|
492
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.summaryHeading", "Order summary")
|
|
493
493
|
}),
|
|
494
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ x("div", {
|
|
495
495
|
className: "flex justify-between",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ b("span", {
|
|
497
497
|
className: "text-text-secondary",
|
|
498
|
-
children:
|
|
499
|
-
}), /* @__PURE__ */
|
|
498
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.items", "Items")
|
|
499
|
+
}), /* @__PURE__ */ b("span", {
|
|
500
500
|
className: "text-text-primary",
|
|
501
|
-
children:
|
|
501
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.itemsFromSellers", "{{count}} from {{sellers}} seller(s)", {
|
|
502
502
|
count: J,
|
|
503
503
|
sellers: X
|
|
504
504
|
})
|
|
505
505
|
})]
|
|
506
506
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ x("div", {
|
|
508
508
|
className: "flex justify-between",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ b("span", {
|
|
510
510
|
className: "text-text-secondary",
|
|
511
|
-
children:
|
|
512
|
-
}), /* @__PURE__ */
|
|
511
|
+
children: C("healthybowl.marketplace.cart.summary.subtotal", "Subtotal")
|
|
512
|
+
}), /* @__PURE__ */ b("span", {
|
|
513
513
|
className: "text-text-primary",
|
|
514
514
|
children: t(W, Y)
|
|
515
515
|
})]
|
|
516
516
|
}),
|
|
517
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ x("div", {
|
|
518
518
|
className: "flex justify-between",
|
|
519
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ b("span", {
|
|
520
520
|
className: "text-text-secondary",
|
|
521
|
-
children:
|
|
522
|
-
}), /* @__PURE__ */
|
|
521
|
+
children: C("healthybowl.marketplace.cart.checkoutModal.tax", "Tax")
|
|
522
|
+
}), /* @__PURE__ */ b("span", {
|
|
523
523
|
className: "text-text-primary",
|
|
524
524
|
children: t(G, Y)
|
|
525
525
|
})]
|
|
526
526
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ x("div", {
|
|
528
528
|
className: "flex justify-between",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ b("span", {
|
|
530
530
|
className: "text-text-secondary",
|
|
531
|
-
children:
|
|
532
|
-
}), /* @__PURE__ */
|
|
531
|
+
children: C("healthybowl.marketplace.cart.summary.shipping", "Shipping")
|
|
532
|
+
}), /* @__PURE__ */ b("span", {
|
|
533
533
|
className: "text-text-primary",
|
|
534
|
-
children: K === 0 ?
|
|
534
|
+
children: K === 0 ? C("healthybowl.marketplace.cart.summary.free", "Free") : t(K, Y)
|
|
535
535
|
})]
|
|
536
536
|
}),
|
|
537
|
-
H && /* @__PURE__ */
|
|
537
|
+
H && /* @__PURE__ */ x("div", {
|
|
538
538
|
className: "flex justify-between",
|
|
539
|
-
children: [/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ b("span", {
|
|
540
540
|
className: "text-text-secondary",
|
|
541
|
-
children:
|
|
542
|
-
}), /* @__PURE__ */
|
|
541
|
+
children: C("healthybowl.marketplace.cart.summary.discount", "Discount")
|
|
542
|
+
}), /* @__PURE__ */ b("span", {
|
|
543
543
|
className: "text-xs italic text-text-secondary",
|
|
544
|
-
children: X > 1 ?
|
|
544
|
+
children: X > 1 ? C("healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning", "Not applied — cart spans multiple farms") : C("healthybowl.marketplace.cart.summary.discountPending", "Confirmed at checkout")
|
|
545
545
|
})]
|
|
546
546
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ x("div", {
|
|
548
548
|
className: "flex justify-between border-t border-border-subtle pt-2 font-bold text-text-primary",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ b("span", { children: C("healthybowl.marketplace.cart.checkoutModal.estimatedTotal", "Estimated Total") }), /* @__PURE__ */ b("span", { children: t(q, Y) })]
|
|
550
550
|
})
|
|
551
551
|
]
|
|
552
552
|
})
|
|
553
553
|
]
|
|
554
554
|
})
|
|
555
555
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ b(a, {
|
|
557
557
|
toasts: N,
|
|
558
558
|
onDismiss: F
|
|
559
559
|
})
|
|
@@ -561,6 +561,6 @@ var S = () => {
|
|
|
561
561
|
});
|
|
562
562
|
};
|
|
563
563
|
//#endregion
|
|
564
|
-
export {
|
|
564
|
+
export { C as CartPage };
|
|
565
565
|
|
|
566
566
|
//# sourceMappingURL=CartPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartPage.js","names":[],"sources":["../../../../src/healthybowl/pages/marketplace/CartPage.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n ShoppingCart,\n Trash2,\n Plus,\n Minus,\n ArrowLeft,\n Tag,\n Package,\n Truck,\n CreditCard,\n ShieldCheck,\n Info,\n MapPin,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, StatCard, EmptyState, Breadcrumbs, Modal } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useHealthyBowl } from '../../context/HealthyBowlContext';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { formatCurrency, HB_DEFAULT_CURRENCY, resolveLineCurrency } from '../../utils/helpers';\nimport { useHealthyBowlStore } from '../../store/healthybowlStore';\nimport { useCreateSharedMarketOrders } from '../../hooks/useSharedMarket';\n\nexport const CartPage: FC = () => {\n const { t } = useI18n();\n const { marketplaceProducts, farm } = useHealthyBowlData();\n const { currentUser } = useHealthyBowl();\n\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { cart, updateCartQuantity, removeFromCart, clearCart, deliveryAddress, setDeliveryAddress } =\n useHealthyBowlStore();\n const { placeSharedOrders } = useCreateSharedMarketOrders();\n const { toasts, toast, dismiss } = useToast();\n const [showCheckoutConfirm, setShowCheckoutConfirm] = useState(false);\n const [placing, setPlacing] = useState(false);\n // BOFF-6090 — promo code, applied at checkout. `promoCodeInput` is what the buyer is typing;\n // `appliedPromoCode` is what gets sent to placeSharedOrders once they hit \"Apply\". The server\n // (not this page) is the only thing that knows whether a code is valid and what it's worth — see\n // the note above the Discount row for why no amount is estimated here.\n const [promoCodeInput, setPromoCodeInput] = useState('');\n const [appliedPromoCode, setAppliedPromoCode] = useState<string | null>(null);\n\n const subtotal = cart.reduce((sum, item) => sum + item.price * item.quantity, 0);\n const tax = subtotal * 0.08;\n const shipping = cart.length === 0 ? 0 : subtotal >= 100 ? 0 : 15;\n // The service derives subtotal/tax/shipping/discount server-side and returns the authoritative\n // total on the order it creates. A code's actual discount is only known once the server has\n // validated it (there is no client-side preview), so this pre-checkout total never includes an\n // estimated discount — showing a number the server hasn't confirmed would misrepresent what's\n // charged. The real discount appears on the order confirmation and on the Orders page.\n const total = subtotal + tax + shipping;\n\n const handleApplyPromoCode = () => {\n const code = promoCodeInput.trim();\n if (!code) return;\n setAppliedPromoCode(code.toUpperCase());\n };\n\n const handleRemovePromoCode = () => {\n setAppliedPromoCode(null);\n setPromoCodeInput('');\n };\n const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);\n // Lines added from the platform store carry their own currency; HealthyBowl's\n // own produce does not, so a mixed or bare cart falls back to the default.\n const cartCurrency = resolveLineCurrency(cart);\n const uniqueSellers = new Set(cart.map((item) => item.seller)).size;\n // BOFF-6127 — same \"carried from agri-inputs, or the farm default\" rule as AgriInputsStorePage's\n // own textarea; the two pages share the one store field so a value typed on either page survives\n // the navigation between them. Trimmed here so a whitespace-only value is refused, not silently\n // sent as a \"real\" address.\n const defaultDeliveryAddress = [farm.name, farm.location].filter(Boolean).join(', ');\n const effectiveDeliveryAddress = (deliveryAddress || defaultDeliveryAddress).trim();\n\n const handleRemoveItem = (productId: string, name: string) => {\n removeFromCart(productId);\n toast({\n title: t('healthybowl.marketplace.cart.toast.itemRemoved.title', 'Item removed'),\n description: t('healthybowl.marketplace.cart.toast.itemRemoved.description', '{{name}} removed from cart', {\n name,\n }),\n variant: 'info',\n });\n };\n\n const handleClearCart = () => {\n clearCart();\n toast({\n title: t('healthybowl.marketplace.cart.toast.cartCleared.title', 'Cart cleared'),\n description: t('healthybowl.marketplace.cart.toast.cartCleared.description', 'All items have been removed'),\n variant: 'info',\n });\n };\n\n const handleCheckout = () => {\n setShowCheckoutConfirm(true);\n };\n\n // Place a real order (status \"placed\", payment deferred — no payment is taken).\n const handlePlaceOrder = async () => {\n if (cart.length === 0) return;\n const buyerId = currentUser?.id;\n if (!buyerId) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.signInRequired.title', 'Sign in required'),\n description: t(\n 'healthybowl.marketplace.cart.toast.signInRequired.description',\n 'We could not identify your account, so the order was not placed.'\n ),\n variant: 'error',\n });\n return;\n }\n // BOFF-6127 — refuse a blank/whitespace-only delivery address in the UI. The server itself\n // accepts and stores null for a blank value (a direct API call is not gated this way), but the\n // checkout flow always has a farm to fall back to, so reaching this with nothing to send means\n // the field was actively cleared.\n if (!effectiveDeliveryAddress) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.addressRequired.title', 'Delivery address required'),\n description: t(\n 'healthybowl.marketplace.cart.toast.addressRequired.description',\n 'Enter where this order should be delivered before placing it.'\n ),\n variant: 'error',\n });\n return;\n }\n setPlacing(true);\n try {\n // BOFF-6205 — always go through the fan-out. The server resolves each line to the farm that\n // published it: lines from other farms become one order EACH, own-farm lines stay a single\n // ordinary order. Sending the cart total would charge one farm for another's produce, so the\n // per-order totals are recomputed server-side from each farm's own lines.\n const placed = await placeSharedOrders({\n buyerId,\n items: cart.map((item) => ({\n // No id: the cart entry's local id is ephemeral; the server assigns the line-item id.\n productId: item.productId,\n productName: item.name,\n quantity: item.quantity,\n price: item.price,\n unit: item.unit,\n seller: item.seller,\n })),\n tax,\n shipping,\n // BOFF-6090 — a CODE, never an amount: the server validates it and computes the discount\n // itself. Refused server-side (BAD_USER_INPUT) if the cart spans more than one farm.\n ...(appliedPromoCode ? { promoCode: appliedPromoCode } : {}),\n // BOFF-6127 — one address, fanned out server-side to every per-farm order this checkout\n // creates (createSharedMarketOrders spreads it into each createOrder call).\n shippingAddress: effectiveDeliveryAddress,\n });\n clearCart();\n // BOFF-6127 — the address belongs to the checkout that just completed, not the next one.\n setDeliveryAddress('');\n setShowCheckoutConfirm(false);\n setPromoCodeInput('');\n setAppliedPromoCode(null);\n // Surface the confirmation on the Orders page; this page unmounts on navigate,\n // so a local toast here would be lost before it renders. discountApplied reflects the\n // SERVER's own discountAmount on the created order(s) — never something guessed here.\n navigate(buildPath('marketplace/orders'), {\n state: {\n orderPlaced: true,\n orderCount: placed.length,\n discountApplied: placed.some((o) => o.discountAmount > 0),\n },\n });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.orderFailed.title', 'Could not place order'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.marketplace.cart.toast.orderFailed.description', 'Failed to place order'),\n variant: 'error',\n });\n } finally {\n setPlacing(false);\n }\n };\n\n // Recently viewed: pick 3 random marketplace products not in cart\n const cartProductIds = new Set(cart.map((c) => c.productId));\n const recentlyViewed = marketplaceProducts.filter((p) => !cartProductIds.has(p.id)).slice(0, 3);\n\n if (cart.length === 0) {\n return (\n <PageLayout title={t('healthybowl.marketplace.cart.title', 'Shopping Cart')}>\n <Breadcrumbs\n items={[\n { label: t('healthybowl.marketplace.cart.breadcrumbs.marketplace', 'Marketplace'), href: '/marketplace' },\n { label: t('healthybowl.marketplace.cart.breadcrumbs.cart', 'Cart') },\n ]}\n />\n <EmptyState\n illustration=\"empty-files\"\n title={t('healthybowl.marketplace.cart.emptyState.title', 'Your Cart is Empty')}\n description={t(\n 'healthybowl.marketplace.cart.emptyState.description',\n \"Looks like you haven't added any products yet. Browse the marketplace to find great organic products.\"\n )}\n action={\n <Button onClick={() => navigate('/marketplace')}>\n <ArrowLeft className=\"h-4 w-4\" />{' '}\n {t('healthybowl.marketplace.cart.actions.browseMarketplace', 'Browse Marketplace')}\n </Button>\n }\n />\n\n {/* Recently viewed even when cart is empty */}\n {recentlyViewed.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.recommendations.interestedHeading', 'You might be interested in')}\n </h3>\n <div className=\"mt-3 grid gap-3 sm:grid-cols-3\">\n {recentlyViewed.map((p) => (\n <Button\n key={p.id}\n variant=\"outline\"\n onClick={() => navigate(`/marketplace/${p.id}`)}\n className=\"h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50\"\n >\n <Package className=\"h-8 w-8 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{p.name}</p>\n <p className=\"text-xs text-text-secondary\">{p.seller}</p>\n <p className=\"mt-0.5 text-sm font-semibold text-text-primary\">\n {formatCurrency(p.price, HB_DEFAULT_CURRENCY)}\n </p>\n </div>\n </Button>\n ))}\n </div>\n </div>\n )}\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={t('healthybowl.marketplace.cart.title', 'Shopping Cart')}\n description={t('healthybowl.marketplace.cart.itemCount', '{{count}} item(s) in your cart', { count: totalItems })}\n purpose=\"The items you're about to buy. Review quantities, double-check the total, and adjust anything before you check out — nothing is ordered until you confirm.\"\n actions={\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleClearCart}\n className=\"text-text-secondary hover:border-status-error-border hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3 w-3\" /> {t('healthybowl.marketplace.cart.actions.clearCart', 'Clear Cart')}\n </Button>\n }\n >\n <Breadcrumbs\n items={[\n { label: t('healthybowl.marketplace.cart.breadcrumbs.marketplace', 'Marketplace'), href: '/marketplace' },\n { label: t('healthybowl.marketplace.cart.breadcrumbs.cart', 'Cart') },\n ]}\n />\n\n {/* Honest notice: cart is session-only; placing an order persists it, but payment is deferred */}\n <div className=\"flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary\">\n <Info className=\"mt-0.5 h-4 w-4 shrink-0 text-text-secondary\" />\n <p>\n {t(\n 'healthybowl.marketplace.cart.sessionNotice',\n \"This cart is kept only for the current browser session — it isn't saved yet and resets on refresh. Placing an order records it under your account; payment is collected separately and isn't taken here.\"\n )}\n </p>\n </div>\n\n {/* Stats */}\n <div className=\"grid grid-cols-2 gap-4 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.marketplace.cart.stats.itemsInCart.label', 'Items in Cart')}\n value={totalItems}\n icon={<ShoppingCart className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.uniqueProducts.label', 'Unique Products')}\n value={cart.length}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.sellers.label', 'Sellers')}\n value={uniqueSellers}\n icon={<Tag className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.subtotal.label', 'Subtotal')}\n value={formatCurrency(subtotal, cartCurrency)}\n icon={<CreditCard className=\"h-5 w-5\" />}\n />\n </div>\n\n <div className=\"grid gap-6 lg:grid-cols-3\">\n {/* Cart Items */}\n <div className=\"space-y-3 lg:col-span-2\">\n {cart.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm\"\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-bg-sunken\">\n <Package className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(`/marketplace/${item.productId}`)}\n className=\"h-auto justify-start p-0 text-sm font-semibold text-text-primary hover:bg-transparent hover:underline\"\n >\n {item.name}\n </Button>\n <p className=\"text-xs text-text-secondary\">{item.seller}</p>\n <p className=\"mt-0.5 text-sm text-text-primary\">\n {formatCurrency(item.price, item.currency ?? cartCurrency)}\n <span className=\"text-xs text-text-secondary\"> / {item.unit}</span>\n </p>\n </div>\n\n {/* Quantity controls */}\n <div className=\"flex items-center gap-1.5\">\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.decreaseQuantity', 'Decrease quantity')}\n onClick={() => updateCartQuantity(item.productId, item.quantity - 1)}\n className=\"text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary\"\n >\n <Minus className=\"h-3 w-3\" />\n </Button>\n <span className=\"min-w-[2.5rem] text-center text-sm font-semibold text-text-primary\">\n {item.quantity}\n </span>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.increaseQuantity', 'Increase quantity')}\n onClick={() => updateCartQuantity(item.productId, item.quantity + 1)}\n className=\"text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary\"\n >\n <Plus className=\"h-3 w-3\" />\n </Button>\n </div>\n\n {/* Line total */}\n <p className=\"w-24 text-end text-sm font-bold text-text-primary\">\n {formatCurrency(item.price * item.quantity, item.currency ?? cartCurrency)}\n </p>\n\n {/* Remove */}\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.removeItem', 'Remove item')}\n onClick={() => handleRemoveItem(item.productId, item.name)}\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n </div>\n ))}\n </div>\n\n {/* Order Summary Sidebar */}\n <div className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.summary.heading', 'Order Summary')}\n </h3>\n\n <div className=\"mt-4 space-y-2.5 text-sm\">\n <div className=\"flex justify-between text-text-secondary\">\n <span>\n {t('healthybowl.marketplace.cart.summary.subtotalWithCount', 'Subtotal ({{count}} items)', {\n count: totalItems,\n })}\n </span>\n <span className=\"text-text-primary\">{formatCurrency(subtotal, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between text-text-secondary\">\n <span>{t('healthybowl.marketplace.cart.summary.tax', 'Tax (8%)')}</span>\n <span className=\"text-text-primary\">{formatCurrency(tax, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Truck className=\"h-3 w-3\" /> {t('healthybowl.marketplace.cart.summary.shipping', 'Shipping')}\n </span>\n <span className=\"text-text-primary\">\n {shipping === 0 ? (\n <span className=\"font-medium text-success\">\n {t('healthybowl.marketplace.cart.summary.free', 'Free')}\n </span>\n ) : (\n formatCurrency(shipping, cartCurrency)\n )}\n </span>\n </div>\n {shipping > 0 && (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.freeShippingNote', 'Free shipping on orders over $100')}\n </p>\n )}\n\n {/* BOFF-6090 — the server validates the code and computes the discount at checkout;\n there is no preview here, so this never shows a discount amount the server hasn't\n actually confirmed. The real figure appears on the order confirmation and Orders page. */}\n {appliedPromoCode ? (\n <div className=\"flex items-center justify-between gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 px-2.5 py-2\">\n <span className=\"flex items-center gap-1.5 text-text-secondary\">\n <Tag className=\"h-3 w-3\" />\n {t('healthybowl.marketplace.cart.summary.promoApplied', 'Code \"{{code}}\" applied', {\n code: appliedPromoCode,\n })}\n </span>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleRemovePromoCode}\n className=\"h-auto p-0 text-xs text-text-secondary hover:text-status-error-text hover:bg-transparent\"\n >\n {t('healthybowl.marketplace.cart.actions.removePromoCode', 'Remove')}\n </Button>\n </div>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n <input\n type=\"text\"\n value={promoCodeInput}\n onChange={(e) => setPromoCodeInput(e.target.value)}\n placeholder={t('healthybowl.marketplace.cart.summary.promoPlaceholder', 'Promo code')}\n aria-label={t('healthybowl.marketplace.cart.summary.promoPlaceholder', 'Promo code')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleApplyPromoCode}\n disabled={!promoCodeInput.trim()}\n className=\"shrink-0\"\n >\n {t('healthybowl.marketplace.cart.actions.applyPromoCode', 'Apply')}\n </Button>\n </div>\n )}\n {appliedPromoCode && (\n <div className=\"flex justify-between text-text-secondary\">\n <span>{t('healthybowl.marketplace.cart.summary.discount', 'Discount')}</span>\n <span className=\"text-xs italic text-text-secondary\">\n {uniqueSellers > 1\n ? t(\n 'healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning',\n 'Not applied — cart spans multiple farms'\n )\n : t('healthybowl.marketplace.cart.summary.discountPending', 'Confirmed at checkout')}\n </span>\n </div>\n )}\n\n <div className=\"border-t border-border-subtle pt-2.5\">\n <div className=\"flex justify-between text-base font-bold text-text-primary\">\n <span>{t('healthybowl.marketplace.cart.summary.total', 'Total')}</span>\n <span>{formatCurrency(total, cartCurrency)}</span>\n </div>\n </div>\n </div>\n\n {/* Checkout — opens a confirm modal that places a real order (payment deferred) */}\n <Button onClick={handleCheckout} className=\"mt-4 w-full\">\n {t('healthybowl.marketplace.cart.actions.checkout', 'Checkout')}\n </Button>\n <p className=\"mt-1.5 text-center text-xs text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.summary.checkoutNote',\n 'Placing an order records it; payment is collected separately.'\n )}\n </p>\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate('/marketplace')}\n className=\"mt-2 w-full text-text-secondary hover:text-text-primary\"\n >\n <ArrowLeft className=\"h-3 w-3\" />{' '}\n {t('healthybowl.marketplace.cart.actions.continueShopping', 'Continue Shopping')}\n </Button>\n </div>\n\n {/* Honest notice: cart is session-only; orders persist but payment is handled separately */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"space-y-2.5 text-xs text-text-secondary\">\n <div className=\"flex items-center gap-2\">\n <Info className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.sessionOnly',\n \"Cart isn't saved yet — it resets on refresh.\"\n )}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.noPayment',\n 'Placing an order records it under your account; no payment is taken here.'\n )}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Package className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.coordinate',\n 'Coordinate payment and delivery with sellers using their listing details.'\n )}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Recently Viewed */}\n {recentlyViewed.length > 0 && (\n <div className=\"mt-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.recommendations.alsoLikeHeading', 'You might also like')}\n </h3>\n <div className=\"mt-3 grid gap-3 sm:grid-cols-3\">\n {recentlyViewed.map((p) => (\n <Button\n key={p.id}\n variant=\"outline\"\n onClick={() => navigate(`/marketplace/${p.id}`)}\n className=\"h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50\"\n >\n <Package className=\"h-8 w-8 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{p.name}</p>\n <p className=\"text-xs text-text-secondary\">{p.seller}</p>\n <p className=\"mt-0.5 text-sm font-semibold text-text-primary\">\n {formatCurrency(p.price, HB_DEFAULT_CURRENCY)}\n <span className=\"text-xs font-normal text-text-secondary\"> / {p.unit}</span>\n </p>\n </div>\n </Button>\n ))}\n </div>\n </div>\n )}\n\n {/* Checkout Modal — places a real order (status \"placed\"); payment is deferred */}\n <Modal\n open={showCheckoutConfirm}\n onClose={() => setShowCheckoutConfirm(false)}\n title={t('healthybowl.marketplace.cart.checkoutModal.title', 'Place your order')}\n description={t(\n 'healthybowl.marketplace.cart.checkoutModal.description',\n 'Your order will be recorded; payment is collected separately'\n )}\n size=\"md\"\n footer={\n <>\n <Button\n variant=\"outline\"\n onClick={() => setShowCheckoutConfirm(false)}\n className=\"text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handlePlaceOrder} disabled={placing || cart.length === 0 || !effectiveDeliveryAddress}>\n {placing\n ? t('healthybowl.marketplace.cart.checkoutModal.placing', 'Placing...')\n : t('healthybowl.marketplace.cart.checkoutModal.placeOrder', 'Place Order')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3\">\n <Info className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.cart.checkoutModal.noPaymentHeading', 'No payment is taken here.')}\n </p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.noPaymentDetail',\n 'Placing this order records it under your account with a status of \"placed\". Payment is collected separately — coordinate it and delivery directly with each seller using their listing details. Your cart is kept only for this browser session and is cleared once the order is placed.'\n )}\n </p>\n </div>\n </div>\n <div>\n <label\n htmlFor=\"cart-delivery-address\"\n className=\"mb-1 flex items-center gap-1.5 text-xs font-medium text-text-secondary\"\n >\n <MapPin className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.cart.checkoutModal.deliverTo', 'Deliver to')}\n </label>\n <textarea\n id=\"cart-delivery-address\"\n rows={2}\n value={deliveryAddress || defaultDeliveryAddress}\n onChange={(e) => setDeliveryAddress(e.target.value)}\n placeholder={t(\n 'healthybowl.marketplace.cart.checkoutModal.addressPlaceholder',\n 'Delivery address (defaults to your farm location)'\n )}\n className=\"w-full resize-none rounded-md border border-border-subtle bg-bg-surface p-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n {effectiveDeliveryAddress ? (\n <p className=\"mt-1 text-[10px] text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.addressHint',\n 'Defaults to your farm location — edit if needed.'\n )}\n </p>\n ) : (\n <p className=\"mt-1 text-[10px] text-destructive\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.addressRequired',\n 'A delivery address is required to place this order.'\n )}\n </p>\n )}\n </div>\n <div className=\"rounded-lg border border-border-subtle p-3 space-y-2 text-sm\">\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wide\">\n {t('healthybowl.marketplace.cart.checkoutModal.summaryHeading', 'Order summary')}\n </p>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.checkoutModal.items', 'Items')}\n </span>\n <span className=\"text-text-primary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.itemsFromSellers',\n '{{count}} from {{sellers}} seller(s)',\n {\n count: totalItems,\n sellers: uniqueSellers,\n }\n )}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.subtotal', 'Subtotal')}\n </span>\n <span className=\"text-text-primary\">{formatCurrency(subtotal, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">{t('healthybowl.marketplace.cart.checkoutModal.tax', 'Tax')}</span>\n <span className=\"text-text-primary\">{formatCurrency(tax, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.shipping', 'Shipping')}\n </span>\n <span className=\"text-text-primary\">\n {shipping === 0\n ? t('healthybowl.marketplace.cart.summary.free', 'Free')\n : formatCurrency(shipping, cartCurrency)}\n </span>\n </div>\n {appliedPromoCode && (\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.discount', 'Discount')}\n </span>\n <span className=\"text-xs italic text-text-secondary\">\n {uniqueSellers > 1\n ? t(\n 'healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning',\n 'Not applied — cart spans multiple farms'\n )\n : t('healthybowl.marketplace.cart.summary.discountPending', 'Confirmed at checkout')}\n </span>\n </div>\n )}\n <div className=\"flex justify-between border-t border-border-subtle pt-2 font-bold text-text-primary\">\n <span>{t('healthybowl.marketplace.cart.checkoutModal.estimatedTotal', 'Estimated Total')}</span>\n <span>{formatCurrency(total, cartCurrency)}</span>\n </div>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,UAAqB;CAChC,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,yBAAqB,YAAS,IAAoB,EACpD,EAAE,mBAAgB,GAAgB,EAElC,IAAW,GAAa,EACxB,EAAE,iBAAc,GAAa,EAC7B,EAAE,SAAM,uBAAoB,oBAAgB,cAAW,oBAAiB,0BAC5E,IAAqB,EACjB,EAAE,yBAAsB,GAA6B,EACrD,EAAE,WAAQ,UAAO,eAAY,GAAU,EACvC,CAAC,GAAqB,KAA0B,EAAS,GAAM,EAC/D,CAAC,GAAS,KAAc,EAAS,GAAM,EAK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M,WAAU;oBAAqB,EAAe,GAAU,EAAa;UAAQ,CAAA,CAC/E;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD;UAAM,WAAU;oBAAuB,EAAE,kDAAkD,MAAM;UAAQ,CAAA,EACzG,kBAAC,QAAD;UAAM,WAAU;oBAAqB,EAAe,GAAK,EAAa;UAAQ,CAAA,CAC1E;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAE,iDAAiD,WAAW;UAC1D,CAAA,EACP,kBAAC,QAAD;UAAM,WAAU;oBACb,MAAa,IACV,EAAE,6CAA6C,OAAO,GACtD,EAAe,GAAU,EAAa;UACrC,CAAA,CACH;;QACL,KACC,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAE,iDAAiD,WAAW;UAC1D,CAAA,EACP,kBAAC,QAAD;UAAM,WAAU;oBACb,IAAgB,IACb,EACE,uEACA,0CACD,GACD,EAAE,wDAAwD,wBAAwB;UACjF,CAAA,CACH;;QAER,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD,EAAA,UAAO,EAAE,6DAA6D,kBAAkB,EAAQ,CAAA,EAChG,kBAAC,QAAD,EAAA,UAAO,EAAe,GAAO,EAAa,EAAQ,CAAA,CAC9C;;QACF;;MACF;;IACA,CAAA;GAER,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
1
|
+
{"version":3,"file":"CartPage.js","names":[],"sources":["../../../../src/healthybowl/pages/marketplace/CartPage.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n ShoppingCart,\n Trash2,\n Plus,\n Minus,\n ArrowLeft,\n Tag,\n Package,\n Truck,\n CreditCard,\n ShieldCheck,\n Info,\n MapPin,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PageLayout, StatCard, EmptyState, Breadcrumbs, Modal } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useHealthyBowl } from '../../context/HealthyBowlContext';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { formatCurrency, HB_DEFAULT_CURRENCY, resolveLineCurrency } from '../../utils/helpers';\nimport { useHealthyBowlStore } from '../../store/healthybowlStore';\nimport { useCreateSharedMarketOrders } from '../../hooks/useSharedMarket';\n\nexport const CartPage: FC = () => {\n const { t } = useI18n();\n const { marketplaceProducts, farm } = useHealthyBowlData();\n const { currentUser } = useHealthyBowl();\n\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { cart, updateCartQuantity, removeFromCart, clearCart, deliveryAddress, setDeliveryAddress } =\n useHealthyBowlStore();\n const { placeSharedOrders } = useCreateSharedMarketOrders();\n const { toasts, toast, dismiss } = useToast();\n const [showCheckoutConfirm, setShowCheckoutConfirm] = useState(false);\n const [placing, setPlacing] = useState(false);\n // BOFF-6090 — promo code, applied at checkout. `promoCodeInput` is what the buyer is typing;\n // `appliedPromoCode` is what gets sent to placeSharedOrders once they hit \"Apply\". The server\n // (not this page) is the only thing that knows whether a code is valid and what it's worth — see\n // the note above the Discount row for why no amount is estimated here.\n const [promoCodeInput, setPromoCodeInput] = useState('');\n const [appliedPromoCode, setAppliedPromoCode] = useState<string | null>(null);\n\n const subtotal = cart.reduce((sum, item) => sum + item.price * item.quantity, 0);\n const tax = subtotal * 0.08;\n const shipping = cart.length === 0 ? 0 : subtotal >= 100 ? 0 : 15;\n // The service derives subtotal/tax/shipping/discount server-side and returns the authoritative\n // total on the order it creates. A code's actual discount is only known once the server has\n // validated it (there is no client-side preview), so this pre-checkout total never includes an\n // estimated discount — showing a number the server hasn't confirmed would misrepresent what's\n // charged. The real discount appears on the order confirmation and on the Orders page.\n const total = subtotal + tax + shipping;\n\n const handleApplyPromoCode = () => {\n const code = promoCodeInput.trim();\n if (!code) return;\n setAppliedPromoCode(code.toUpperCase());\n };\n\n const handleRemovePromoCode = () => {\n setAppliedPromoCode(null);\n setPromoCodeInput('');\n };\n const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);\n // Lines added from the platform store carry their own currency; HealthyBowl's\n // own produce does not, so a mixed or bare cart falls back to the default.\n const cartCurrency = resolveLineCurrency(cart);\n const uniqueSellers = new Set(cart.map((item) => item.seller)).size;\n // BOFF-6127 — same \"carried from agri-inputs, or the farm default\" rule as AgriInputsStorePage's\n // own textarea; the two pages share the one store field so a value typed on either page survives\n // the navigation between them. Trimmed here so a whitespace-only value is refused, not silently\n // sent as a \"real\" address.\n const defaultDeliveryAddress = [farm.name, farm.location].filter(Boolean).join(', ');\n const effectiveDeliveryAddress = (deliveryAddress || defaultDeliveryAddress).trim();\n\n const handleRemoveItem = (productId: string, name: string) => {\n removeFromCart(productId);\n toast({\n title: t('healthybowl.marketplace.cart.toast.itemRemoved.title', 'Item removed'),\n description: t('healthybowl.marketplace.cart.toast.itemRemoved.description', '{{name}} removed from cart', {\n name,\n }),\n variant: 'info',\n });\n };\n\n const handleClearCart = () => {\n clearCart();\n toast({\n title: t('healthybowl.marketplace.cart.toast.cartCleared.title', 'Cart cleared'),\n description: t('healthybowl.marketplace.cart.toast.cartCleared.description', 'All items have been removed'),\n variant: 'info',\n });\n };\n\n const handleCheckout = () => {\n setShowCheckoutConfirm(true);\n };\n\n // Place a real order (status \"placed\", payment deferred — no payment is taken).\n const handlePlaceOrder = async () => {\n if (cart.length === 0) return;\n const buyerId = currentUser?.id;\n if (!buyerId) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.signInRequired.title', 'Sign in required'),\n description: t(\n 'healthybowl.marketplace.cart.toast.signInRequired.description',\n 'We could not identify your account, so the order was not placed.'\n ),\n variant: 'error',\n });\n return;\n }\n // BOFF-6127 — refuse a blank/whitespace-only delivery address in the UI. The server itself\n // accepts and stores null for a blank value (a direct API call is not gated this way), but the\n // checkout flow always has a farm to fall back to, so reaching this with nothing to send means\n // the field was actively cleared.\n if (!effectiveDeliveryAddress) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.addressRequired.title', 'Delivery address required'),\n description: t(\n 'healthybowl.marketplace.cart.toast.addressRequired.description',\n 'Enter where this order should be delivered before placing it.'\n ),\n variant: 'error',\n });\n return;\n }\n setPlacing(true);\n try {\n // BOFF-6205 — always go through the fan-out. The server resolves each line to the farm that\n // published it: lines from other farms become one order EACH, own-farm lines stay a single\n // ordinary order. Sending the cart total would charge one farm for another's produce, so the\n // per-order totals are recomputed server-side from each farm's own lines.\n const placed = await placeSharedOrders({\n buyerId,\n items: cart.map((item) => ({\n // No id: the cart entry's local id is ephemeral; the server assigns the line-item id.\n productId: item.productId,\n productName: item.name,\n quantity: item.quantity,\n price: item.price,\n unit: item.unit,\n seller: item.seller,\n })),\n tax,\n shipping,\n // BOFF-6090 — a CODE, never an amount: the server validates it and computes the discount\n // itself. Refused server-side (BAD_USER_INPUT) if the cart spans more than one farm.\n ...(appliedPromoCode ? { promoCode: appliedPromoCode } : {}),\n // BOFF-6127 — one address, fanned out server-side to every per-farm order this checkout\n // creates (createSharedMarketOrders spreads it into each createOrder call).\n shippingAddress: effectiveDeliveryAddress,\n });\n clearCart();\n // BOFF-6127 — the address belongs to the checkout that just completed, not the next one.\n setDeliveryAddress('');\n setShowCheckoutConfirm(false);\n setPromoCodeInput('');\n setAppliedPromoCode(null);\n // Surface the confirmation on the Orders page; this page unmounts on navigate,\n // so a local toast here would be lost before it renders. discountApplied reflects the\n // SERVER's own discountAmount on the created order(s) — never something guessed here.\n navigate(buildPath('marketplace/orders'), {\n state: {\n orderPlaced: true,\n orderCount: placed.length,\n discountApplied: placed.some((o) => o.discountAmount > 0),\n },\n });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.cart.toast.orderFailed.title', 'Could not place order'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.marketplace.cart.toast.orderFailed.description', 'Failed to place order'),\n variant: 'error',\n });\n } finally {\n setPlacing(false);\n }\n };\n\n // Recently viewed: pick 3 random marketplace products not in cart\n const cartProductIds = new Set(cart.map((c) => c.productId));\n const recentlyViewed = marketplaceProducts.filter((p) => !cartProductIds.has(p.id)).slice(0, 3);\n\n if (cart.length === 0) {\n return (\n <PageLayout title={t('healthybowl.marketplace.cart.title', 'Shopping Cart')}>\n <Breadcrumbs\n items={[\n { label: t('healthybowl.marketplace.cart.breadcrumbs.marketplace', 'Marketplace'), href: '/marketplace' },\n { label: t('healthybowl.marketplace.cart.breadcrumbs.cart', 'Cart') },\n ]}\n />\n <EmptyState\n illustration=\"empty-files\"\n title={t('healthybowl.marketplace.cart.emptyState.title', 'Your Cart is Empty')}\n description={t(\n 'healthybowl.marketplace.cart.emptyState.description',\n \"Looks like you haven't added any products yet. Browse the marketplace to find great organic products.\"\n )}\n action={\n <Button onClick={() => navigate(buildPath('marketplace'))}>\n <ArrowLeft className=\"h-4 w-4\" />{' '}\n {t('healthybowl.marketplace.cart.actions.browseMarketplace', 'Browse Marketplace')}\n </Button>\n }\n />\n\n {/* Recently viewed even when cart is empty */}\n {recentlyViewed.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.recommendations.interestedHeading', 'You might be interested in')}\n </h3>\n <div className=\"mt-3 grid gap-3 sm:grid-cols-3\">\n {recentlyViewed.map((p) => (\n <Button\n key={p.id}\n variant=\"outline\"\n onClick={() => navigate(buildPath(`marketplace/${p.id}`))}\n className=\"h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50\"\n >\n <Package className=\"h-8 w-8 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{p.name}</p>\n <p className=\"text-xs text-text-secondary\">{p.seller}</p>\n <p className=\"mt-0.5 text-sm font-semibold text-text-primary\">\n {formatCurrency(p.price, HB_DEFAULT_CURRENCY)}\n </p>\n </div>\n </Button>\n ))}\n </div>\n </div>\n )}\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={t('healthybowl.marketplace.cart.title', 'Shopping Cart')}\n description={t('healthybowl.marketplace.cart.itemCount', '{{count}} item(s) in your cart', { count: totalItems })}\n purpose=\"The items you're about to buy. Review quantities, double-check the total, and adjust anything before you check out — nothing is ordered until you confirm.\"\n actions={\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleClearCart}\n className=\"text-text-secondary hover:border-status-error-border hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3 w-3\" /> {t('healthybowl.marketplace.cart.actions.clearCart', 'Clear Cart')}\n </Button>\n }\n >\n <Breadcrumbs\n items={[\n { label: t('healthybowl.marketplace.cart.breadcrumbs.marketplace', 'Marketplace'), href: '/marketplace' },\n { label: t('healthybowl.marketplace.cart.breadcrumbs.cart', 'Cart') },\n ]}\n />\n\n {/* Honest notice: cart is session-only; placing an order persists it, but payment is deferred */}\n <div className=\"flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary\">\n <Info className=\"mt-0.5 h-4 w-4 shrink-0 text-text-secondary\" />\n <p>\n {t(\n 'healthybowl.marketplace.cart.sessionNotice',\n \"This cart is kept only for the current browser session — it isn't saved yet and resets on refresh. Placing an order records it under your account; payment is collected separately and isn't taken here.\"\n )}\n </p>\n </div>\n\n {/* Stats */}\n <div className=\"grid grid-cols-2 gap-4 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.marketplace.cart.stats.itemsInCart.label', 'Items in Cart')}\n value={totalItems}\n icon={<ShoppingCart className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.uniqueProducts.label', 'Unique Products')}\n value={cart.length}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.sellers.label', 'Sellers')}\n value={uniqueSellers}\n icon={<Tag className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.cart.stats.subtotal.label', 'Subtotal')}\n value={formatCurrency(subtotal, cartCurrency)}\n icon={<CreditCard className=\"h-5 w-5\" />}\n />\n </div>\n\n <div className=\"grid gap-6 lg:grid-cols-3\">\n {/* Cart Items */}\n <div className=\"space-y-3 lg:col-span-2\">\n {cart.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm\"\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-bg-sunken\">\n <Package className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath(`marketplace/${item.productId}`))}\n className=\"h-auto justify-start p-0 text-sm font-semibold text-text-primary hover:bg-transparent hover:underline\"\n >\n {item.name}\n </Button>\n <p className=\"text-xs text-text-secondary\">{item.seller}</p>\n <p className=\"mt-0.5 text-sm text-text-primary\">\n {formatCurrency(item.price, item.currency ?? cartCurrency)}\n <span className=\"text-xs text-text-secondary\"> / {item.unit}</span>\n </p>\n </div>\n\n {/* Quantity controls */}\n <div className=\"flex items-center gap-1.5\">\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.decreaseQuantity', 'Decrease quantity')}\n onClick={() => updateCartQuantity(item.productId, item.quantity - 1)}\n className=\"text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary\"\n >\n <Minus className=\"h-3 w-3\" />\n </Button>\n <span className=\"min-w-[2.5rem] text-center text-sm font-semibold text-text-primary\">\n {item.quantity}\n </span>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.increaseQuantity', 'Increase quantity')}\n onClick={() => updateCartQuantity(item.productId, item.quantity + 1)}\n className=\"text-text-secondary hover:bg-bg-sunken/50 hover:text-text-primary\"\n >\n <Plus className=\"h-3 w-3\" />\n </Button>\n </div>\n\n {/* Line total */}\n <p className=\"w-24 text-end text-sm font-bold text-text-primary\">\n {formatCurrency(item.price * item.quantity, item.currency ?? cartCurrency)}\n </p>\n\n {/* Remove */}\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('healthybowl.marketplace.cart.actions.removeItem', 'Remove item')}\n onClick={() => handleRemoveItem(item.productId, item.name)}\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n </div>\n ))}\n </div>\n\n {/* Order Summary Sidebar */}\n <div className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.summary.heading', 'Order Summary')}\n </h3>\n\n <div className=\"mt-4 space-y-2.5 text-sm\">\n <div className=\"flex justify-between text-text-secondary\">\n <span>\n {t('healthybowl.marketplace.cart.summary.subtotalWithCount', 'Subtotal ({{count}} items)', {\n count: totalItems,\n })}\n </span>\n <span className=\"text-text-primary\">{formatCurrency(subtotal, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between text-text-secondary\">\n <span>{t('healthybowl.marketplace.cart.summary.tax', 'Tax (8%)')}</span>\n <span className=\"text-text-primary\">{formatCurrency(tax, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Truck className=\"h-3 w-3\" /> {t('healthybowl.marketplace.cart.summary.shipping', 'Shipping')}\n </span>\n <span className=\"text-text-primary\">\n {shipping === 0 ? (\n <span className=\"font-medium text-success\">\n {t('healthybowl.marketplace.cart.summary.free', 'Free')}\n </span>\n ) : (\n formatCurrency(shipping, cartCurrency)\n )}\n </span>\n </div>\n {shipping > 0 && (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.freeShippingNote', 'Free shipping on orders over $100')}\n </p>\n )}\n\n {/* BOFF-6090 — the server validates the code and computes the discount at checkout;\n there is no preview here, so this never shows a discount amount the server hasn't\n actually confirmed. The real figure appears on the order confirmation and Orders page. */}\n {appliedPromoCode ? (\n <div className=\"flex items-center justify-between gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 px-2.5 py-2\">\n <span className=\"flex items-center gap-1.5 text-text-secondary\">\n <Tag className=\"h-3 w-3\" />\n {t('healthybowl.marketplace.cart.summary.promoApplied', 'Code \"{{code}}\" applied', {\n code: appliedPromoCode,\n })}\n </span>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleRemovePromoCode}\n className=\"h-auto p-0 text-xs text-text-secondary hover:text-status-error-text hover:bg-transparent\"\n >\n {t('healthybowl.marketplace.cart.actions.removePromoCode', 'Remove')}\n </Button>\n </div>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n <input\n type=\"text\"\n value={promoCodeInput}\n onChange={(e) => setPromoCodeInput(e.target.value)}\n placeholder={t('healthybowl.marketplace.cart.summary.promoPlaceholder', 'Promo code')}\n aria-label={t('healthybowl.marketplace.cart.summary.promoPlaceholder', 'Promo code')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleApplyPromoCode}\n disabled={!promoCodeInput.trim()}\n className=\"shrink-0\"\n >\n {t('healthybowl.marketplace.cart.actions.applyPromoCode', 'Apply')}\n </Button>\n </div>\n )}\n {appliedPromoCode && (\n <div className=\"flex justify-between text-text-secondary\">\n <span>{t('healthybowl.marketplace.cart.summary.discount', 'Discount')}</span>\n <span className=\"text-xs italic text-text-secondary\">\n {uniqueSellers > 1\n ? t(\n 'healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning',\n 'Not applied — cart spans multiple farms'\n )\n : t('healthybowl.marketplace.cart.summary.discountPending', 'Confirmed at checkout')}\n </span>\n </div>\n )}\n\n <div className=\"border-t border-border-subtle pt-2.5\">\n <div className=\"flex justify-between text-base font-bold text-text-primary\">\n <span>{t('healthybowl.marketplace.cart.summary.total', 'Total')}</span>\n <span>{formatCurrency(total, cartCurrency)}</span>\n </div>\n </div>\n </div>\n\n {/* Checkout — opens a confirm modal that places a real order (payment deferred) */}\n <Button onClick={handleCheckout} className=\"mt-4 w-full\">\n {t('healthybowl.marketplace.cart.actions.checkout', 'Checkout')}\n </Button>\n <p className=\"mt-1.5 text-center text-xs text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.summary.checkoutNote',\n 'Placing an order records it; payment is collected separately.'\n )}\n </p>\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate(buildPath('marketplace'))}\n className=\"mt-2 w-full text-text-secondary hover:text-text-primary\"\n >\n <ArrowLeft className=\"h-3 w-3\" />{' '}\n {t('healthybowl.marketplace.cart.actions.continueShopping', 'Continue Shopping')}\n </Button>\n </div>\n\n {/* Honest notice: cart is session-only; orders persist but payment is handled separately */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"space-y-2.5 text-xs text-text-secondary\">\n <div className=\"flex items-center gap-2\">\n <Info className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.sessionOnly',\n \"Cart isn't saved yet — it resets on refresh.\"\n )}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.noPayment',\n 'Placing an order records it under your account; no payment is taken here.'\n )}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Package className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <span>\n {t(\n 'healthybowl.marketplace.cart.notices.coordinate',\n 'Coordinate payment and delivery with sellers using their listing details.'\n )}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Recently Viewed */}\n {recentlyViewed.length > 0 && (\n <div className=\"mt-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.marketplace.cart.recommendations.alsoLikeHeading', 'You might also like')}\n </h3>\n <div className=\"mt-3 grid gap-3 sm:grid-cols-3\">\n {recentlyViewed.map((p) => (\n <Button\n key={p.id}\n variant=\"outline\"\n onClick={() => navigate(buildPath(`marketplace/${p.id}`))}\n className=\"h-auto justify-start gap-3 rounded-lg bg-bg-surface p-3 text-start hover:bg-bg-sunken/50\"\n >\n <Package className=\"h-8 w-8 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{p.name}</p>\n <p className=\"text-xs text-text-secondary\">{p.seller}</p>\n <p className=\"mt-0.5 text-sm font-semibold text-text-primary\">\n {formatCurrency(p.price, HB_DEFAULT_CURRENCY)}\n <span className=\"text-xs font-normal text-text-secondary\"> / {p.unit}</span>\n </p>\n </div>\n </Button>\n ))}\n </div>\n </div>\n )}\n\n {/* Checkout Modal — places a real order (status \"placed\"); payment is deferred */}\n <Modal\n open={showCheckoutConfirm}\n onClose={() => setShowCheckoutConfirm(false)}\n title={t('healthybowl.marketplace.cart.checkoutModal.title', 'Place your order')}\n description={t(\n 'healthybowl.marketplace.cart.checkoutModal.description',\n 'Your order will be recorded; payment is collected separately'\n )}\n size=\"md\"\n footer={\n <>\n <Button\n variant=\"outline\"\n onClick={() => setShowCheckoutConfirm(false)}\n className=\"text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handlePlaceOrder} disabled={placing || cart.length === 0 || !effectiveDeliveryAddress}>\n {placing\n ? t('healthybowl.marketplace.cart.checkoutModal.placing', 'Placing...')\n : t('healthybowl.marketplace.cart.checkoutModal.placeOrder', 'Place Order')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3\">\n <Info className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.cart.checkoutModal.noPaymentHeading', 'No payment is taken here.')}\n </p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.noPaymentDetail',\n 'Placing this order records it under your account with a status of \"placed\". Payment is collected separately — coordinate it and delivery directly with each seller using their listing details. Your cart is kept only for this browser session and is cleared once the order is placed.'\n )}\n </p>\n </div>\n </div>\n <div>\n <label\n htmlFor=\"cart-delivery-address\"\n className=\"mb-1 flex items-center gap-1.5 text-xs font-medium text-text-secondary\"\n >\n <MapPin className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.cart.checkoutModal.deliverTo', 'Deliver to')}\n </label>\n <textarea\n id=\"cart-delivery-address\"\n rows={2}\n value={deliveryAddress || defaultDeliveryAddress}\n onChange={(e) => setDeliveryAddress(e.target.value)}\n placeholder={t(\n 'healthybowl.marketplace.cart.checkoutModal.addressPlaceholder',\n 'Delivery address (defaults to your farm location)'\n )}\n className=\"w-full resize-none rounded-md border border-border-subtle bg-bg-surface p-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n {effectiveDeliveryAddress ? (\n <p className=\"mt-1 text-[10px] text-text-secondary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.addressHint',\n 'Defaults to your farm location — edit if needed.'\n )}\n </p>\n ) : (\n <p className=\"mt-1 text-[10px] text-destructive\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.addressRequired',\n 'A delivery address is required to place this order.'\n )}\n </p>\n )}\n </div>\n <div className=\"rounded-lg border border-border-subtle p-3 space-y-2 text-sm\">\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wide\">\n {t('healthybowl.marketplace.cart.checkoutModal.summaryHeading', 'Order summary')}\n </p>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.checkoutModal.items', 'Items')}\n </span>\n <span className=\"text-text-primary\">\n {t(\n 'healthybowl.marketplace.cart.checkoutModal.itemsFromSellers',\n '{{count}} from {{sellers}} seller(s)',\n {\n count: totalItems,\n sellers: uniqueSellers,\n }\n )}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.subtotal', 'Subtotal')}\n </span>\n <span className=\"text-text-primary\">{formatCurrency(subtotal, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">{t('healthybowl.marketplace.cart.checkoutModal.tax', 'Tax')}</span>\n <span className=\"text-text-primary\">{formatCurrency(tax, cartCurrency)}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.shipping', 'Shipping')}\n </span>\n <span className=\"text-text-primary\">\n {shipping === 0\n ? t('healthybowl.marketplace.cart.summary.free', 'Free')\n : formatCurrency(shipping, cartCurrency)}\n </span>\n </div>\n {appliedPromoCode && (\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.cart.summary.discount', 'Discount')}\n </span>\n <span className=\"text-xs italic text-text-secondary\">\n {uniqueSellers > 1\n ? t(\n 'healthybowl.marketplace.cart.checkoutModal.discountMultiFarmWarning',\n 'Not applied — cart spans multiple farms'\n )\n : t('healthybowl.marketplace.cart.summary.discountPending', 'Confirmed at checkout')}\n </span>\n </div>\n )}\n <div className=\"flex justify-between border-t border-border-subtle pt-2 font-bold text-text-primary\">\n <span>{t('healthybowl.marketplace.cart.checkoutModal.estimatedTotal', 'Estimated Total')}</span>\n <span>{formatCurrency(total, cartCurrency)}</span>\n </div>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismi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