@instockng/storefront-ui 1.0.23 → 1.0.24
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.
- package/dist/components/Checkout.d.ts.map +1 -1
- package/dist/components/ShoppingCart.d.ts.map +1 -1
- package/dist/index10.mjs +57 -47
- package/dist/index100.mjs +3 -3
- package/dist/index101.mjs +1 -1
- package/dist/index102.mjs +1 -1
- package/dist/index103.mjs +1 -1
- package/dist/index104.mjs +2 -2
- package/dist/index105.mjs +2 -2
- package/dist/index106.mjs +3 -3
- package/dist/index107.mjs +1 -1
- package/dist/index108.mjs +3 -3
- package/dist/index109.mjs +2 -2
- package/dist/index110.mjs +2 -2
- package/dist/index111.mjs +1 -1
- package/dist/index112.mjs +3 -3
- package/dist/index113.mjs +1 -1
- package/dist/index114.mjs +1 -1
- package/dist/index115.mjs +3 -3
- package/dist/index116.mjs +2 -2
- package/dist/index117.mjs +4 -4
- package/dist/index118.mjs +1 -1
- package/dist/index119.mjs +3 -3
- package/dist/index12.mjs +285 -282
- package/dist/index120.mjs +4 -4
- package/dist/index121.mjs +1 -1
- package/dist/index122.mjs +1 -1
- package/dist/index123.mjs +1 -1
- package/dist/index124.mjs +1 -1
- package/dist/index125.mjs +1 -1
- package/dist/index126.mjs +1 -1
- package/dist/index127.mjs +1 -1
- package/dist/index128.mjs +2 -2
- package/dist/index129.mjs +3 -3
- package/dist/index135.mjs +21 -2
- package/dist/index136.mjs +56 -2
- package/dist/index137.mjs +29 -2
- package/dist/index138.mjs +6 -17
- package/dist/index139.mjs +50 -30
- package/dist/index140.mjs +6 -38
- package/dist/index141.mjs +11 -17
- package/dist/index142.mjs +7 -18
- package/dist/index143.mjs +28 -2
- package/dist/index144.mjs +2 -20
- package/dist/index145.mjs +68 -44
- package/dist/index146.mjs +167 -2
- package/dist/index147.mjs +2 -30
- package/dist/index148.mjs +2 -18
- package/dist/index149.mjs +2 -2
- package/dist/index150.mjs +18 -2
- package/dist/index151.mjs +32 -2
- package/dist/index152.mjs +38 -2
- package/dist/index153.mjs +13 -67
- package/dist/index154.mjs +18 -2
- package/dist/index155.mjs +2 -53
- package/dist/index156.mjs +20 -2
- package/dist/index157.mjs +39 -29
- package/dist/index158.mjs +2 -152
- package/dist/index159.mjs +30 -2
- package/dist/index160.mjs +18 -2
- package/dist/index161.mjs +2 -19
- package/dist/index162.mjs +2 -2
- package/dist/index163.mjs +2 -2
- package/dist/index164.mjs +2 -26
- package/dist/index165.mjs +72 -2
- package/dist/index166.mjs +2 -2
- package/dist/index167.mjs +49 -20
- package/dist/index168.mjs +2 -23
- package/dist/index169.mjs +36 -2
- package/dist/index170.mjs +152 -2
- package/dist/index171.mjs +2 -2
- package/dist/index172.mjs +2 -23
- package/dist/index173.mjs +19 -2
- package/dist/index174.mjs +2 -23
- package/dist/index176.mjs +26 -2
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +2 -23
- package/dist/index179.mjs +24 -2
- package/dist/index180.mjs +15 -15
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +2 -2
- package/dist/index183.mjs +2 -2
- package/dist/index184.mjs +23 -2
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +23 -2
- package/dist/index187.mjs +2 -2
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +2 -127
- package/dist/index190.mjs +23 -2
- package/dist/index191.mjs +2 -74
- package/dist/index192.mjs +20 -71
- package/dist/index193.mjs +2 -21
- package/dist/index194.mjs +2 -56
- package/dist/index195.mjs +2 -29
- package/dist/index196.mjs +2 -7
- package/dist/index197.mjs +2 -52
- package/dist/index198.mjs +2 -6
- package/dist/index199.mjs +2 -12
- package/dist/index200.mjs +2 -7
- package/dist/index201.mjs +127 -28
- package/dist/index202.mjs +2 -2
- package/dist/index203.mjs +73 -69
- package/dist/index204.mjs +71 -164
- package/dist/index211.mjs +1 -1
- package/dist/index213.mjs +2 -2
- package/dist/index214.mjs +244 -2
- package/dist/index215.mjs +2 -2
- package/dist/index216.mjs +32 -243
- package/dist/index217.mjs +65 -2
- package/dist/index218.mjs +16 -24
- package/dist/index219.mjs +2 -65
- package/dist/index220.mjs +2 -25
- package/dist/index221.mjs +2 -2
- package/dist/index222.mjs +2 -37
- package/dist/index223.mjs +37 -2
- package/dist/index224.mjs +2 -2
- package/dist/index245.mjs +3 -3
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +2 -2
- package/dist/index250.mjs +2 -18
- package/dist/index251.mjs +2 -47
- package/dist/index252.mjs +91 -2
- package/dist/index253.mjs +2 -2
- package/dist/index254.mjs +2 -2
- package/dist/index255.mjs +18 -2
- package/dist/index256.mjs +43 -87
- package/dist/index263.mjs +1 -1
- package/dist/index264.mjs +1 -1
- package/dist/index265.mjs +2 -2
- package/dist/index267.mjs +2 -2
- package/dist/index78.mjs +5 -5
- package/dist/index80.mjs +3 -3
- package/dist/index90.mjs +1 -1
- package/dist/index91.mjs +3 -3
- package/dist/index96.mjs +1 -1
- package/dist/index97.mjs +1 -1
- package/dist/index98.mjs +6 -6
- package/dist/index99.mjs +4 -4
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/Checkout.tsx +52 -51
- package/src/components/ShoppingCart.tsx +11 -1
package/dist/index12.mjs
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { object as W, string as
|
|
2
|
+
import { jsxs as a, jsx as e, Fragment as ge } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g, useEffect as I, useMemo as R, useCallback as xe } from "react";
|
|
4
|
+
import { object as W, string as p, ValidationError as we } from "./index39.mjs";
|
|
5
5
|
import "./index20.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { useGetDeliveryZones as
|
|
8
|
-
import { useCart as
|
|
9
|
-
import { Modal as
|
|
10
|
-
import { FormInput as
|
|
11
|
-
import { FormSelect as
|
|
7
|
+
import { useGetDeliveryZones as Ce } from "./index35.mjs";
|
|
8
|
+
import { useCart as Pe } from "./index3.mjs";
|
|
9
|
+
import { Modal as le } from "./index16.mjs";
|
|
10
|
+
import { FormInput as k } from "./index17.mjs";
|
|
11
|
+
import { FormSelect as ne } from "./index18.mjs";
|
|
12
12
|
import { Button as B } from "./index13.mjs";
|
|
13
|
-
import { Loader2 as
|
|
14
|
-
import { formatCurrency as
|
|
15
|
-
import
|
|
16
|
-
import { usePaystackPayment as
|
|
17
|
-
const
|
|
18
|
-
firstName:
|
|
19
|
-
lastName:
|
|
20
|
-
email:
|
|
21
|
-
phone:
|
|
13
|
+
import { Loader2 as $, ChevronLeft as ke, ChevronRight as Me, CheckCircle as qe, Package as de, Banknote as ie, Mail as Ie, Phone as je, ChevronDown as Ze, Zap as Se } from "lucide-react";
|
|
14
|
+
import { formatCurrency as M, cn as C } from "./index19.mjs";
|
|
15
|
+
import ze from "./index40.mjs";
|
|
16
|
+
import { usePaystackPayment as Fe } from "./index41.mjs";
|
|
17
|
+
const Le = (d) => d.replace(/\D/g, ""), Be = W({
|
|
18
|
+
firstName: p().required("First name is required").min(2, "First name must be at least 2 characters").max(50, "First name must be less than 50 characters"),
|
|
19
|
+
lastName: p().required("Last name is required").min(2, "Last name must be at least 2 characters").max(50, "Last name must be less than 50 characters"),
|
|
20
|
+
email: p().required("Email is required").email("Please enter a valid email address"),
|
|
21
|
+
phone: p().required("Phone number is required").test("nigerian-phone", "Please enter a valid Nigerian phone number (e.g. 0812 564 8668)", (d) => {
|
|
22
22
|
if (!d) return !1;
|
|
23
|
-
const
|
|
23
|
+
const q = Le(d);
|
|
24
24
|
return [
|
|
25
25
|
/^0[789]\d{9}$/
|
|
26
26
|
// 0xxxxxxxxx (11 digits total)
|
|
27
|
-
].some((
|
|
27
|
+
].some((v) => v.test(q));
|
|
28
28
|
})
|
|
29
|
-
}), Be = W({
|
|
30
|
-
address: f().required("Street address is required").min(10, "Please provide a complete address"),
|
|
31
|
-
city: f().required("City is required").min(3, "City name must be at least 3 characters"),
|
|
32
|
-
state: f().required("State is required").test("not-empty", "State is required", (d) => !!d && d.trim() !== ""),
|
|
33
|
-
deliveryZoneId: f().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (d) => !!d && d.trim() !== "")
|
|
34
29
|
}), Te = W({
|
|
35
|
-
|
|
30
|
+
address: p().required("Street address is required").min(10, "Please provide a complete address"),
|
|
31
|
+
city: p().required("City is required").min(3, "City name must be at least 3 characters"),
|
|
32
|
+
state: p().required("State is required").test("not-empty", "State is required", (d) => !!d && d.trim() !== ""),
|
|
33
|
+
deliveryZoneId: p().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (d) => !!d && d.trim() !== "")
|
|
34
|
+
}), _e = W({
|
|
35
|
+
paymentMethod: p().oneOf(["cod", "online"], "Please select a payment method").required("Payment method is required")
|
|
36
36
|
});
|
|
37
|
-
function
|
|
37
|
+
function et({
|
|
38
38
|
isOpen: d,
|
|
39
|
-
onClose:
|
|
39
|
+
onClose: q,
|
|
40
40
|
initialData: n,
|
|
41
|
-
onSuccess:
|
|
41
|
+
onSuccess: v,
|
|
42
42
|
onError: o,
|
|
43
|
-
submitButtonText:
|
|
43
|
+
submitButtonText: ce = "Place Order",
|
|
44
44
|
refundPolicy: j
|
|
45
45
|
}) {
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
publicKey:
|
|
46
|
+
var X, E, D, ee, te, ae, re, se;
|
|
47
|
+
const oe = "pk_live_dfb74efb5f74d2acbc253d5ca396ab9015ef0fa7", [c, N] = g("customer"), [Z, me] = g(void 0), [h, G] = g(void 0), [y, T] = g(null), { refetch: K, isLoading: Y, cart: s, updateCartMutation: _, checkoutMutation: ue, clearAndCreateNewCart: V } = Pe(), H = Fe({
|
|
48
|
+
publicKey: oe,
|
|
49
49
|
onSuccess: async (t) => {
|
|
50
50
|
try {
|
|
51
|
-
const l = await
|
|
52
|
-
firstName:
|
|
53
|
-
lastName:
|
|
54
|
-
email:
|
|
55
|
-
phone:
|
|
56
|
-
address:
|
|
57
|
-
city:
|
|
58
|
-
deliveryZoneId: h ||
|
|
59
|
-
paymentMethod:
|
|
51
|
+
const l = await P.mutateAsync({
|
|
52
|
+
firstName: r.firstName,
|
|
53
|
+
lastName: r.lastName,
|
|
54
|
+
email: r.email,
|
|
55
|
+
phone: r.phone,
|
|
56
|
+
address: r.address,
|
|
57
|
+
city: r.city,
|
|
58
|
+
deliveryZoneId: h || r.deliveryZoneId,
|
|
59
|
+
paymentMethod: r.paymentMethod,
|
|
60
60
|
paystackReference: t.reference
|
|
61
61
|
});
|
|
62
62
|
if ("error" in l) {
|
|
@@ -64,7 +64,7 @@ function De({
|
|
|
64
64
|
o == null || o(new Error((i == null ? void 0 : i.message) || "Checkout failed"));
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
T(l), V(),
|
|
67
|
+
T(l), V(), v == null || v(l.id);
|
|
68
68
|
} catch (l) {
|
|
69
69
|
o == null || o(l);
|
|
70
70
|
}
|
|
@@ -76,13 +76,13 @@ function De({
|
|
|
76
76
|
I(() => {
|
|
77
77
|
d && K();
|
|
78
78
|
}, [d, K]);
|
|
79
|
-
const { data:
|
|
80
|
-
enabled: !!((
|
|
81
|
-
}), m =
|
|
79
|
+
const { data: x } = Ce(((X = s == null ? void 0 : s.brand) == null ? void 0 : X.id) || "", {
|
|
80
|
+
enabled: !!((E = s == null ? void 0 : s.brand) != null && E.id)
|
|
81
|
+
}), m = R(() => x == null ? void 0 : x.find((t) => t.id === Z), [x, Z]), f = R(() => m == null ? void 0 : m.zones.find((t) => t.id === h), [m, h]), P = ue;
|
|
82
82
|
I(() => {
|
|
83
|
-
d || (T(null),
|
|
83
|
+
d || (T(null), N("customer"), P.reset());
|
|
84
84
|
}, [d]);
|
|
85
|
-
const [
|
|
85
|
+
const [r, A] = g({
|
|
86
86
|
firstName: (n == null ? void 0 : n.firstName) || "",
|
|
87
87
|
lastName: (n == null ? void 0 : n.lastName) || "",
|
|
88
88
|
email: (n == null ? void 0 : n.email) || "",
|
|
@@ -94,9 +94,9 @@ function De({
|
|
|
94
94
|
notes: (n == null ? void 0 : n.notes) || ""
|
|
95
95
|
});
|
|
96
96
|
I(() => {
|
|
97
|
-
d &&
|
|
97
|
+
d && N("customer");
|
|
98
98
|
}, [d]);
|
|
99
|
-
const [U, J] =
|
|
99
|
+
const [U, J] = g(!1);
|
|
100
100
|
I(() => {
|
|
101
101
|
d && s && !n && !U && (A((t) => {
|
|
102
102
|
var l;
|
|
@@ -118,59 +118,59 @@ function De({
|
|
|
118
118
|
}));
|
|
119
119
|
}
|
|
120
120
|
}, [h, m]);
|
|
121
|
-
const [u, S] =
|
|
121
|
+
const [u, S] = g({}), [O, he] = g(!1), b = (t) => {
|
|
122
122
|
const { name: l, value: i } = t.target;
|
|
123
|
-
A((
|
|
124
|
-
}, z =
|
|
123
|
+
A((w) => ({ ...w, [l]: i })), u[l] && S((w) => ({ ...w, [l]: void 0 }));
|
|
124
|
+
}, z = xe(
|
|
125
125
|
(t) => {
|
|
126
|
-
const l =
|
|
126
|
+
const l = r[t];
|
|
127
127
|
if (!l) return;
|
|
128
128
|
const i = {};
|
|
129
129
|
t === "firstName" ? i.customerFirstName = l : t === "lastName" ? i.customerLastName = l : t === "email" ? i.customerEmail = l : t === "phone" && (i.customerPhone = l), _.mutate(i);
|
|
130
130
|
},
|
|
131
|
-
[
|
|
131
|
+
[r, _]
|
|
132
132
|
), F = (t) => {
|
|
133
133
|
const l = {};
|
|
134
134
|
try {
|
|
135
135
|
if (t === "customer")
|
|
136
|
-
|
|
136
|
+
Be.validateSync(r, { abortEarly: !1 });
|
|
137
137
|
else if (t === "delivery") {
|
|
138
138
|
const i = {
|
|
139
|
-
address:
|
|
140
|
-
city:
|
|
141
|
-
state: Z ||
|
|
142
|
-
deliveryZoneId: h ||
|
|
139
|
+
address: r.address,
|
|
140
|
+
city: r.city,
|
|
141
|
+
state: Z || r.state || "",
|
|
142
|
+
deliveryZoneId: h || r.deliveryZoneId || ""
|
|
143
143
|
};
|
|
144
|
-
|
|
145
|
-
} else t === "payment" &&
|
|
144
|
+
Te.validateSync(i, { abortEarly: !1 });
|
|
145
|
+
} else t === "payment" && _e.validateSync(r, { abortEarly: !1 });
|
|
146
146
|
} catch (i) {
|
|
147
|
-
i instanceof
|
|
148
|
-
|
|
147
|
+
i instanceof we && i.inner.forEach((w) => {
|
|
148
|
+
w.path && (l[w.path] = w.message);
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
return S(l), Object.keys(l).length === 0;
|
|
152
|
-
}, he = () => {
|
|
153
|
-
F(c) && (c === "customer" ? v("delivery") : c === "delivery" && v("payment"));
|
|
154
152
|
}, ye = () => {
|
|
155
|
-
c === "
|
|
156
|
-
}, fe =
|
|
153
|
+
F(c) && (c === "customer" ? N("delivery") : c === "delivery" && N("payment"));
|
|
154
|
+
}, fe = () => {
|
|
155
|
+
c === "payment" ? N("delivery") : c === "delivery" && N("customer");
|
|
156
|
+
}, pe = async () => {
|
|
157
157
|
if (!F("customer")) {
|
|
158
|
-
|
|
158
|
+
N("customer");
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
if (!F("delivery")) {
|
|
162
|
-
|
|
162
|
+
N("delivery");
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
if (F("payment")) {
|
|
166
|
-
if (
|
|
166
|
+
if (r.paymentMethod === "online") {
|
|
167
167
|
if (!H.isLoaded) {
|
|
168
168
|
o == null || o(new Error("Payment system is loading. Please try again."));
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
const t = Math.round(s.pricing.total * 100);
|
|
172
172
|
H.initializePayment({
|
|
173
|
-
email:
|
|
173
|
+
email: r.email || (s == null ? void 0 : s.customerEmail) || "customer@example.com",
|
|
174
174
|
amount: t,
|
|
175
175
|
currency: "NGN",
|
|
176
176
|
metadata: {
|
|
@@ -179,12 +179,12 @@ function De({
|
|
|
179
179
|
{
|
|
180
180
|
display_name: "Customer Name",
|
|
181
181
|
variable_name: "customer_name",
|
|
182
|
-
value: `${
|
|
182
|
+
value: `${r.firstName} ${r.lastName}`
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
display_name: "Phone Number",
|
|
186
186
|
variable_name: "phone_number",
|
|
187
|
-
value:
|
|
187
|
+
value: r.phone
|
|
188
188
|
}
|
|
189
189
|
]
|
|
190
190
|
}
|
|
@@ -192,208 +192,211 @@ function De({
|
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
try {
|
|
195
|
-
const t = await
|
|
196
|
-
firstName:
|
|
197
|
-
lastName:
|
|
198
|
-
email:
|
|
199
|
-
phone:
|
|
200
|
-
address:
|
|
201
|
-
city:
|
|
202
|
-
deliveryZoneId: h ||
|
|
203
|
-
paymentMethod:
|
|
195
|
+
const t = await P.mutateAsync({
|
|
196
|
+
firstName: r.firstName,
|
|
197
|
+
lastName: r.lastName,
|
|
198
|
+
email: r.email,
|
|
199
|
+
phone: r.phone,
|
|
200
|
+
address: r.address,
|
|
201
|
+
city: r.city,
|
|
202
|
+
deliveryZoneId: h || r.deliveryZoneId,
|
|
203
|
+
paymentMethod: r.paymentMethod
|
|
204
204
|
});
|
|
205
205
|
if ("error" in t) {
|
|
206
206
|
const l = t.error;
|
|
207
207
|
o == null || o(new Error((l == null ? void 0 : l.message) || "Checkout failed"));
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
T(t), V(),
|
|
210
|
+
T(t), V(), v == null || v(t.id);
|
|
211
211
|
} catch (t) {
|
|
212
212
|
o == null || o(t);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
},
|
|
215
|
+
}, ve = {
|
|
216
216
|
customer: "Customer Information",
|
|
217
217
|
delivery: "Delivery Address",
|
|
218
218
|
payment: "Payment Method"
|
|
219
|
-
},
|
|
220
|
-
(c === "payment" || c === "delivery") && ((
|
|
221
|
-
Y && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e(
|
|
222
|
-
/* @__PURE__ */
|
|
219
|
+
}, Ne = R(() => ve[c], [c]), be = /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
220
|
+
(c === "payment" || c === "delivery") && ((D = s == null ? void 0 : s.pricing) == null ? void 0 : D.total) && /* @__PURE__ */ a("div", { className: "text-sm text-black relative", children: [
|
|
221
|
+
Y && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e($, { className: "animate-spin text-accent-500" }) }),
|
|
222
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
223
223
|
/* @__PURE__ */ e("span", { children: "Subtotal" }),
|
|
224
|
-
/* @__PURE__ */ e("span", { children:
|
|
224
|
+
/* @__PURE__ */ e("span", { children: M(((ee = s == null ? void 0 : s.pricing) == null ? void 0 : ee.subtotal) ?? 0) })
|
|
225
225
|
] }),
|
|
226
|
-
s.pricing.discount && /* @__PURE__ */
|
|
226
|
+
s.pricing.discount && /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
227
227
|
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ a("span", { className: "text-green-600", children: [
|
|
229
229
|
"-",
|
|
230
|
-
|
|
230
|
+
M(((ae = (te = s == null ? void 0 : s.pricing) == null ? void 0 : te.discount) == null ? void 0 : ae.amount) ?? 0)
|
|
231
231
|
] })
|
|
232
232
|
] }),
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
234
234
|
/* @__PURE__ */ e("span", { children: "Delivery Fee" }),
|
|
235
|
-
/* @__PURE__ */ e("span", { children:
|
|
235
|
+
/* @__PURE__ */ e("span", { children: M(((re = s == null ? void 0 : s.pricing) == null ? void 0 : re.deliveryCharge) ?? 0) })
|
|
236
236
|
] }),
|
|
237
237
|
/* @__PURE__ */ e("hr", { className: "border-gray-200 my-2" }),
|
|
238
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
239
239
|
/* @__PURE__ */ e("span", { children: "Total" }),
|
|
240
|
-
/* @__PURE__ */ e("span", { children:
|
|
240
|
+
/* @__PURE__ */ e("span", { children: M(((se = s == null ? void 0 : s.pricing) == null ? void 0 : se.total) ?? 0) })
|
|
241
241
|
] })
|
|
242
242
|
] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
c !== "customer" && /* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ a("div", { className: "flex gap-3", children: [
|
|
244
|
+
c !== "customer" && /* @__PURE__ */ a(
|
|
245
245
|
B,
|
|
246
246
|
{
|
|
247
247
|
type: "button",
|
|
248
248
|
variant: "outline",
|
|
249
|
-
onClick:
|
|
249
|
+
onClick: fe,
|
|
250
250
|
className: "flex-1 border-gray-400",
|
|
251
251
|
size: "lg",
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(
|
|
253
|
+
/* @__PURE__ */ e(ke, { className: "mr-2 h-4 w-4" }),
|
|
254
254
|
"Back"
|
|
255
255
|
]
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
|
-
c !== "payment" ? /* @__PURE__ */
|
|
258
|
+
c !== "payment" ? /* @__PURE__ */ a(
|
|
259
259
|
B,
|
|
260
260
|
{
|
|
261
261
|
type: "button",
|
|
262
|
-
onClick:
|
|
262
|
+
onClick: ye,
|
|
263
263
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
264
264
|
size: "lg",
|
|
265
265
|
children: [
|
|
266
266
|
"Next",
|
|
267
|
-
/* @__PURE__ */ e(
|
|
267
|
+
/* @__PURE__ */ e(Me, { className: "ml-2 h-4 w-4" })
|
|
268
268
|
]
|
|
269
269
|
}
|
|
270
270
|
) : /* @__PURE__ */ e(
|
|
271
271
|
B,
|
|
272
272
|
{
|
|
273
273
|
type: "button",
|
|
274
|
-
onClick:
|
|
275
|
-
disabled:
|
|
274
|
+
onClick: pe,
|
|
275
|
+
disabled: P.isPending,
|
|
276
276
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
277
277
|
size: "lg",
|
|
278
|
-
children:
|
|
279
|
-
/* @__PURE__ */ e(
|
|
278
|
+
children: P.isPending ? /* @__PURE__ */ a(ge, { children: [
|
|
279
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
280
280
|
"Processing..."
|
|
281
|
-
] }) :
|
|
281
|
+
] }) : ce
|
|
282
282
|
}
|
|
283
283
|
)
|
|
284
284
|
] }),
|
|
285
|
-
|
|
285
|
+
P.isError && /* @__PURE__ */ e("div", { className: "rounded-lg bg-red-50 p-3 text-sm text-red-600", children: "Failed to place order. Please check your information and try again." })
|
|
286
286
|
] }), L = (t) => !(s != null && s.availablePaymentMethods.includes(t));
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
/* @__PURE__ */ r("div", { className: "bg-gray-50 rounded-lg p-6 space-y-4", children: [
|
|
311
|
-
/* @__PURE__ */ r("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
|
|
312
|
-
/* @__PURE__ */ e(ne, { className: "h-5 w-5" }),
|
|
313
|
-
/* @__PURE__ */ r("span", { className: "font-medium", children: [
|
|
314
|
-
"Order #",
|
|
315
|
-
y.orderNumber
|
|
316
|
-
] })
|
|
287
|
+
if (y)
|
|
288
|
+
return /* @__PURE__ */ e(
|
|
289
|
+
le,
|
|
290
|
+
{
|
|
291
|
+
isOpen: d,
|
|
292
|
+
onClose: q,
|
|
293
|
+
title: "Order Placed Successfully!",
|
|
294
|
+
footer: /* @__PURE__ */ e(
|
|
295
|
+
B,
|
|
296
|
+
{
|
|
297
|
+
onClick: q,
|
|
298
|
+
className: "w-full bg-accent-500 text-white hover:bg-accent-600",
|
|
299
|
+
size: "lg",
|
|
300
|
+
children: "Close"
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
size: "lg",
|
|
304
|
+
contentClassName: "p-6",
|
|
305
|
+
children: /* @__PURE__ */ a("div", { className: "text-center space-y-6", children: [
|
|
306
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(qe, { className: "h-12 w-12 text-green-600" }) }) }),
|
|
307
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
308
|
+
/* @__PURE__ */ e("h3", { className: "text-2xl font-bold text-gray-900", children: "Thank You!" }),
|
|
309
|
+
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Your order has been placed successfully." })
|
|
317
310
|
] }),
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */ e(
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
y.lastName
|
|
311
|
+
/* @__PURE__ */ a("div", { className: "bg-gray-50 rounded-lg p-6 space-y-4", children: [
|
|
312
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
|
|
313
|
+
/* @__PURE__ */ e(de, { className: "h-5 w-5" }),
|
|
314
|
+
/* @__PURE__ */ a("span", { className: "font-medium", children: [
|
|
315
|
+
"Order #",
|
|
316
|
+
y.orderNumber
|
|
325
317
|
] })
|
|
326
318
|
] }),
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
|
|
319
|
+
/* @__PURE__ */ a("div", { className: "border-t border-gray-200 pt-4 space-y-3", children: [
|
|
320
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
321
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Customer" }),
|
|
322
|
+
/* @__PURE__ */ a("span", { className: "font-medium text-gray-900", children: [
|
|
323
|
+
y.firstName,
|
|
324
|
+
" ",
|
|
325
|
+
y.lastName
|
|
326
|
+
] })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
329
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Phone" }),
|
|
330
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.phone })
|
|
331
|
+
] }),
|
|
332
|
+
y.email && /* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
333
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Email" }),
|
|
334
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.email })
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
337
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Payment Method" }),
|
|
338
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.paymentMethod === "cod" ? "Cash on Delivery" : "Online Payment" })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
341
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Total" }),
|
|
342
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: M(y.totalPrice) })
|
|
343
|
+
] })
|
|
342
344
|
] })
|
|
343
|
-
] })
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
] })
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
)
|
|
353
|
-
|
|
345
|
+
] }),
|
|
346
|
+
/* @__PURE__ */ e("div", { className: "bg-blue-50 rounded-lg p-4", children: /* @__PURE__ */ a("p", { className: "text-sm text-blue-900", children: [
|
|
347
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: "We'll be in touch shortly!" }),
|
|
348
|
+
/* @__PURE__ */ e("br", {}),
|
|
349
|
+
"Our team will contact you soon to arrange delivery and confirm your order details."
|
|
350
|
+
] }) })
|
|
351
|
+
] })
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
const Q = f && (c === "delivery" || c === "payment") && (f.waybillOnly || !(f != null && f.allowCOD));
|
|
355
|
+
return /* @__PURE__ */ e(
|
|
356
|
+
le,
|
|
354
357
|
{
|
|
355
358
|
isOpen: d,
|
|
356
|
-
onClose:
|
|
357
|
-
title:
|
|
358
|
-
footer:
|
|
359
|
+
onClose: q,
|
|
360
|
+
title: Ne,
|
|
361
|
+
footer: be,
|
|
359
362
|
size: "lg",
|
|
360
363
|
contentClassName: "p-0",
|
|
361
|
-
children: Y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
/* @__PURE__ */ e(
|
|
365
|
-
/* @__PURE__ */
|
|
364
|
+
children: Y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e($, { className: "h-8 w-8 animate-spin text-gray-600" }) }) : /* @__PURE__ */ e("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
365
|
+
Q && /* @__PURE__ */ a("div", { className: "space-y-3 p-4 pb-0", children: [
|
|
366
|
+
f.waybillOnly && /* @__PURE__ */ e("div", { className: "bg-amber-50 border border-amber-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
367
|
+
/* @__PURE__ */ e(de, { className: "h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5" }),
|
|
368
|
+
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
366
369
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900", children: "Waybill Delivery" }),
|
|
367
370
|
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800", children: "We deliver orders to this location using waybill service. You'll need to pick up your order at a motor park near you." })
|
|
368
371
|
] })
|
|
369
372
|
] }) }),
|
|
370
|
-
!(
|
|
371
|
-
/* @__PURE__ */ e(
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
+
!(f != null && f.allowCOD) && /* @__PURE__ */ e("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
374
|
+
/* @__PURE__ */ e(ie, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
375
|
+
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
373
376
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-blue-900", children: "Cash on Delivery Unavailable" }),
|
|
374
377
|
/* @__PURE__ */ e("p", { className: "text-sm text-blue-800", children: "We're unable to offer cash on delivery to this location. Please use online payment to complete your order." })
|
|
375
378
|
] })
|
|
376
379
|
] }) })
|
|
377
380
|
] }),
|
|
378
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ a(
|
|
379
382
|
"div",
|
|
380
383
|
{
|
|
381
|
-
className:
|
|
384
|
+
className: C(
|
|
382
385
|
"flex transition-transform duration-300 ease-in-out w-full",
|
|
383
386
|
c === "customer" && "translate-x-0",
|
|
384
387
|
c === "delivery" && "-translate-x-full",
|
|
385
388
|
c === "payment" && "-translate-x-[200%]"
|
|
386
389
|
),
|
|
387
390
|
children: [
|
|
388
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
389
392
|
/* @__PURE__ */ e(
|
|
390
|
-
|
|
393
|
+
k,
|
|
391
394
|
{
|
|
392
395
|
label: "First Name",
|
|
393
396
|
type: "text",
|
|
394
397
|
name: "firstName",
|
|
395
|
-
value:
|
|
396
|
-
onChange:
|
|
398
|
+
value: r.firstName,
|
|
399
|
+
onChange: b,
|
|
397
400
|
onBlur: () => z("firstName"),
|
|
398
401
|
error: u.firstName,
|
|
399
402
|
autoCorrect: "off",
|
|
@@ -401,13 +404,13 @@ function De({
|
|
|
401
404
|
}
|
|
402
405
|
),
|
|
403
406
|
/* @__PURE__ */ e(
|
|
404
|
-
|
|
407
|
+
k,
|
|
405
408
|
{
|
|
406
409
|
label: "Last Name",
|
|
407
410
|
type: "text",
|
|
408
411
|
name: "lastName",
|
|
409
|
-
value:
|
|
410
|
-
onChange:
|
|
412
|
+
value: r.lastName,
|
|
413
|
+
onChange: b,
|
|
411
414
|
onBlur: () => z("lastName"),
|
|
412
415
|
error: u.lastName,
|
|
413
416
|
autoCorrect: "off",
|
|
@@ -415,69 +418,69 @@ function De({
|
|
|
415
418
|
}
|
|
416
419
|
),
|
|
417
420
|
/* @__PURE__ */ e(
|
|
418
|
-
|
|
421
|
+
k,
|
|
419
422
|
{
|
|
420
423
|
label: "Email",
|
|
421
424
|
type: "email",
|
|
422
425
|
name: "email",
|
|
423
|
-
value:
|
|
424
|
-
onChange:
|
|
426
|
+
value: r.email,
|
|
427
|
+
onChange: b,
|
|
425
428
|
onBlur: () => z("email"),
|
|
426
429
|
error: u.email,
|
|
427
|
-
icon: /* @__PURE__ */ e(
|
|
430
|
+
icon: /* @__PURE__ */ e(Ie, { size: 16 }),
|
|
428
431
|
autoCorrect: "off",
|
|
429
432
|
required: !0
|
|
430
433
|
}
|
|
431
434
|
),
|
|
432
435
|
/* @__PURE__ */ e(
|
|
433
|
-
|
|
436
|
+
k,
|
|
434
437
|
{
|
|
435
438
|
label: "Phone Number",
|
|
436
439
|
type: "tel",
|
|
437
440
|
name: "phone",
|
|
438
|
-
value:
|
|
439
|
-
onChange:
|
|
441
|
+
value: r.phone,
|
|
442
|
+
onChange: b,
|
|
440
443
|
onBlur: () => z("phone"),
|
|
441
444
|
placeholder: "e.g. 08012345678",
|
|
442
445
|
maxLength: 18,
|
|
443
446
|
error: u.phone,
|
|
444
|
-
icon: /* @__PURE__ */ e(
|
|
447
|
+
icon: /* @__PURE__ */ e(je, { size: 16 }),
|
|
445
448
|
autoCorrect: "off",
|
|
446
449
|
required: !0,
|
|
447
450
|
className: "font-semibold"
|
|
448
451
|
}
|
|
449
452
|
)
|
|
450
453
|
] }) }) }),
|
|
451
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
452
455
|
/* @__PURE__ */ e(
|
|
453
|
-
|
|
456
|
+
k,
|
|
454
457
|
{
|
|
455
458
|
label: "Street Address",
|
|
456
459
|
type: "text",
|
|
457
460
|
name: "address",
|
|
458
|
-
value:
|
|
459
|
-
onChange:
|
|
461
|
+
value: r.address,
|
|
462
|
+
onChange: b,
|
|
460
463
|
error: u.address,
|
|
461
464
|
autoCorrect: "off",
|
|
462
465
|
required: !0
|
|
463
466
|
}
|
|
464
467
|
),
|
|
465
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
466
469
|
/* @__PURE__ */ e(
|
|
467
|
-
|
|
470
|
+
k,
|
|
468
471
|
{
|
|
469
472
|
label: "Area",
|
|
470
473
|
type: "text",
|
|
471
474
|
name: "city",
|
|
472
|
-
value:
|
|
473
|
-
onChange:
|
|
475
|
+
value: r.city,
|
|
476
|
+
onChange: b,
|
|
474
477
|
error: u.city,
|
|
475
478
|
autoCorrect: "off",
|
|
476
479
|
required: !0
|
|
477
480
|
}
|
|
478
481
|
),
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
|
|
482
|
+
/* @__PURE__ */ a(
|
|
483
|
+
ne,
|
|
481
484
|
{
|
|
482
485
|
label: "State",
|
|
483
486
|
name: "state",
|
|
@@ -485,18 +488,18 @@ function De({
|
|
|
485
488
|
onChange: (t) => {
|
|
486
489
|
G("");
|
|
487
490
|
const l = t.target.value;
|
|
488
|
-
|
|
491
|
+
me(l || void 0), u.state && S((i) => ({ ...i, state: void 0 }));
|
|
489
492
|
},
|
|
490
493
|
error: u.state,
|
|
491
494
|
required: !0,
|
|
492
495
|
children: [
|
|
493
496
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: "Select State" }),
|
|
494
|
-
|
|
497
|
+
x == null ? void 0 : x.map((t) => /* @__PURE__ */ e("option", { value: t.id, children: t.name }, t.id))
|
|
495
498
|
]
|
|
496
499
|
}
|
|
497
500
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
501
|
+
/* @__PURE__ */ a(
|
|
502
|
+
ne,
|
|
500
503
|
{
|
|
501
504
|
label: "Delivery Zone",
|
|
502
505
|
value: h || "",
|
|
@@ -509,10 +512,10 @@ function De({
|
|
|
509
512
|
required: !0,
|
|
510
513
|
children: [
|
|
511
514
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: m ? "Select Delivery Zone" : "Select State First" }),
|
|
512
|
-
m == null ? void 0 : m.zones.map((t) => /* @__PURE__ */
|
|
515
|
+
m == null ? void 0 : m.zones.map((t) => /* @__PURE__ */ a("option", { value: t.id, children: [
|
|
513
516
|
t.name,
|
|
514
517
|
" (",
|
|
515
|
-
|
|
518
|
+
M(t.deliveryCost),
|
|
516
519
|
")"
|
|
517
520
|
] }, t.id))
|
|
518
521
|
]
|
|
@@ -520,14 +523,53 @@ function De({
|
|
|
520
523
|
)
|
|
521
524
|
] })
|
|
522
525
|
] }) }),
|
|
523
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ a("div", { className: "space-y-6", children: [
|
|
527
|
+
j && /* @__PURE__ */ a("div", { className: `border border-gray-200 rounded-lg ${Q ? "mt-4" : ""}`, children: [
|
|
528
|
+
/* @__PURE__ */ a(
|
|
529
|
+
"button",
|
|
530
|
+
{
|
|
531
|
+
type: "button",
|
|
532
|
+
onClick: () => he(!O),
|
|
533
|
+
className: "overflow-hidden w-full flex items-center overflow-hidden rounded-lg rounded-b-none justify-between p-4 text-left hover:bg-gray-50 transition-colors",
|
|
534
|
+
children: [
|
|
535
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children: j.title || "🤔 Curious about Refunds?" }),
|
|
536
|
+
/* @__PURE__ */ e(
|
|
537
|
+
Ze,
|
|
538
|
+
{
|
|
539
|
+
size: 16,
|
|
540
|
+
className: C(
|
|
541
|
+
"transform transition-transform duration-200 text-gray-500",
|
|
542
|
+
O && "rotate-180"
|
|
543
|
+
)
|
|
544
|
+
}
|
|
545
|
+
)
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
/* @__PURE__ */ e(
|
|
550
|
+
"div",
|
|
551
|
+
{
|
|
552
|
+
className: C(
|
|
553
|
+
"overflow-hidden transition-all duration-300 ease-in-out",
|
|
554
|
+
O ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
|
|
555
|
+
),
|
|
556
|
+
children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-gray-100", children: /* @__PURE__ */ e("div", { className: "text-sm text-gray-600 space-y-3 pt-4", children: j.policies && /* @__PURE__ */ a("div", { children: [
|
|
557
|
+
/* @__PURE__ */ e("h4", { className: "font-bold text-gray-800 mb-2", children: "Our Refund Policy" }),
|
|
558
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1", children: j.policies.map((t, l) => /* @__PURE__ */ a("li", { className: "flex items-start", children: [
|
|
559
|
+
/* @__PURE__ */ e("span", { className: "text-green-600 mr-2", children: "✓" }),
|
|
560
|
+
/* @__PURE__ */ e("span", { children: t })
|
|
561
|
+
] }, l)) })
|
|
562
|
+
] }) }) })
|
|
563
|
+
}
|
|
564
|
+
)
|
|
565
|
+
] }),
|
|
566
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
567
|
+
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ a(
|
|
526
568
|
"label",
|
|
527
569
|
{
|
|
528
|
-
className:
|
|
570
|
+
className: C(
|
|
529
571
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
530
|
-
|
|
572
|
+
r.paymentMethod === "online" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
531
573
|
L("online") && "opacity-50 cursor-not-allowed"
|
|
532
574
|
),
|
|
533
575
|
children: [
|
|
@@ -538,45 +580,45 @@ function De({
|
|
|
538
580
|
name: "paymentMethod",
|
|
539
581
|
value: "online",
|
|
540
582
|
disabled: L("online"),
|
|
541
|
-
checked:
|
|
542
|
-
onChange:
|
|
583
|
+
checked: r.paymentMethod === "online",
|
|
584
|
+
onChange: b,
|
|
543
585
|
className: "sr-only"
|
|
544
586
|
}
|
|
545
587
|
),
|
|
546
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col items-center text-center space-y-3", children: [
|
|
547
589
|
/* @__PURE__ */ e(
|
|
548
590
|
"div",
|
|
549
591
|
{
|
|
550
|
-
className:
|
|
592
|
+
className: C(
|
|
551
593
|
"p-3 rounded-full",
|
|
552
|
-
|
|
594
|
+
r.paymentMethod === "online" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
553
595
|
),
|
|
554
|
-
children: /* @__PURE__ */ e(
|
|
596
|
+
children: /* @__PURE__ */ e(Se, { size: 24 })
|
|
555
597
|
}
|
|
556
598
|
),
|
|
557
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ a("div", { children: [
|
|
558
600
|
/* @__PURE__ */ e("div", { className: "font-semibold text-gray-900", children: "Pay Online" }),
|
|
559
601
|
/* @__PURE__ */ e("div", { className: "text-sm text-gray-500 mt-1", children: "Bank transfer" }),
|
|
560
602
|
/* @__PURE__ */ e(
|
|
561
603
|
"img",
|
|
562
604
|
{
|
|
563
|
-
src:
|
|
605
|
+
src: ze,
|
|
564
606
|
alt: "Paystack",
|
|
565
607
|
className: "h-4 w-auto mt-2 mx-auto"
|
|
566
608
|
}
|
|
567
609
|
)
|
|
568
610
|
] })
|
|
569
611
|
] }),
|
|
570
|
-
|
|
612
|
+
r.paymentMethod === "online" && /* @__PURE__ */ e("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ e("div", { className: "w-5 h-5 bg-accent-600 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-2 h-2 bg-white rounded-full" }) }) })
|
|
571
613
|
]
|
|
572
614
|
}
|
|
573
615
|
) }),
|
|
574
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ a(
|
|
575
617
|
"label",
|
|
576
618
|
{
|
|
577
|
-
className:
|
|
619
|
+
className: C(
|
|
578
620
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
579
|
-
|
|
621
|
+
r.paymentMethod === "cod" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
580
622
|
L("cod") && "opacity-50 cursor-not-allowed"
|
|
581
623
|
),
|
|
582
624
|
children: [
|
|
@@ -587,72 +629,33 @@ function De({
|
|
|
587
629
|
name: "paymentMethod",
|
|
588
630
|
value: "cod",
|
|
589
631
|
disabled: L("cod"),
|
|
590
|
-
checked:
|
|
591
|
-
onChange:
|
|
632
|
+
checked: r.paymentMethod === "cod",
|
|
633
|
+
onChange: b,
|
|
592
634
|
className: "sr-only"
|
|
593
635
|
}
|
|
594
636
|
),
|
|
595
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col items-center text-center space-y-3", children: [
|
|
596
638
|
/* @__PURE__ */ e(
|
|
597
639
|
"div",
|
|
598
640
|
{
|
|
599
|
-
className:
|
|
641
|
+
className: C(
|
|
600
642
|
"p-3 rounded-full",
|
|
601
|
-
|
|
643
|
+
r.paymentMethod === "cod" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
602
644
|
),
|
|
603
|
-
children: /* @__PURE__ */ e(
|
|
645
|
+
children: /* @__PURE__ */ e(ie, { size: 24 })
|
|
604
646
|
}
|
|
605
647
|
),
|
|
606
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ a("div", { children: [
|
|
607
649
|
/* @__PURE__ */ e("div", { className: "font-semibold text-gray-900", children: "Pay on Delivery" }),
|
|
608
650
|
/* @__PURE__ */ e("div", { className: "text-sm text-gray-500 mt-1", children: "Cash when item arrives" })
|
|
609
651
|
] })
|
|
610
652
|
] }),
|
|
611
|
-
|
|
653
|
+
r.paymentMethod === "cod" && /* @__PURE__ */ e("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ e("div", { className: "w-5 h-5 bg-accent-600 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-2 h-2 bg-white rounded-full" }) }) })
|
|
612
654
|
]
|
|
613
655
|
}
|
|
614
656
|
)
|
|
615
657
|
] }),
|
|
616
|
-
u.paymentMethod && /* @__PURE__ */ e("p", { className: "text-red-600 text-sm", children: u.paymentMethod })
|
|
617
|
-
j && /* @__PURE__ */ r("div", { className: "border border-gray-200 rounded-lg", children: [
|
|
618
|
-
/* @__PURE__ */ r(
|
|
619
|
-
"button",
|
|
620
|
-
{
|
|
621
|
-
type: "button",
|
|
622
|
-
onClick: () => ue(!R),
|
|
623
|
-
className: "overflow-hidden w-full flex items-center overflow-hidden rounded-lg rounded-b-none justify-between p-4 text-left hover:bg-gray-50 transition-colors",
|
|
624
|
-
children: [
|
|
625
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-gray-700", children: j.title || "🤔 Curious about Refunds?" }),
|
|
626
|
-
/* @__PURE__ */ e(
|
|
627
|
-
Ze,
|
|
628
|
-
{
|
|
629
|
-
size: 16,
|
|
630
|
-
className: w(
|
|
631
|
-
"transform transition-transform duration-200 text-gray-500",
|
|
632
|
-
R && "rotate-180"
|
|
633
|
-
)
|
|
634
|
-
}
|
|
635
|
-
)
|
|
636
|
-
]
|
|
637
|
-
}
|
|
638
|
-
),
|
|
639
|
-
/* @__PURE__ */ e(
|
|
640
|
-
"div",
|
|
641
|
-
{
|
|
642
|
-
className: w(
|
|
643
|
-
"overflow-hidden transition-all duration-300 ease-in-out",
|
|
644
|
-
R ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
|
|
645
|
-
),
|
|
646
|
-
children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-gray-100", children: /* @__PURE__ */ e("div", { className: "text-sm text-gray-600 space-y-3 pt-4", children: j.policies && /* @__PURE__ */ r("div", { children: [
|
|
647
|
-
/* @__PURE__ */ e("h4", { className: "font-bold text-gray-800 mb-2", children: "Our Refund Policy" }),
|
|
648
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1 ml-4", children: j.policies.map((t, l) => /* @__PURE__ */ r("li", { className: "flex items-start", children: [
|
|
649
|
-
/* @__PURE__ */ e("span", { className: "text-green-600 mr-2", children: "✓" }),
|
|
650
|
-
/* @__PURE__ */ e("span", { children: t })
|
|
651
|
-
] }, l)) })
|
|
652
|
-
] }) }) })
|
|
653
|
-
}
|
|
654
|
-
)
|
|
655
|
-
] })
|
|
658
|
+
u.paymentMethod && /* @__PURE__ */ e("p", { className: "text-red-600 text-sm", children: u.paymentMethod })
|
|
656
659
|
] }) })
|
|
657
660
|
]
|
|
658
661
|
}
|
|
@@ -662,5 +665,5 @@ function De({
|
|
|
662
665
|
);
|
|
663
666
|
}
|
|
664
667
|
export {
|
|
665
|
-
|
|
668
|
+
et as Checkout
|
|
666
669
|
};
|