@loczer/storefront-sdk 0.160.0 → 0.162.0
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/chunks/booking-engine/dist/utils/{pricing-DcnUXaeI.js → pricing-CYLeWtmu.js} +6 -6
- package/dist/components/BikeProductCard/index.js +1 -1
- package/dist/components/ContactSection/index.js +2 -2
- package/dist/components/StorefrontCartPanel/index.d.ts +3 -1
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +25 -23
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/lib/checkoutSubmit.d.ts +2 -2
- package/dist/lib/checkoutSubmit.js +1 -1
- package/dist/lib/fetchStorefrontTimeSlots.d.ts +4 -0
- package/dist/lib/fetchStorefrontTimeSlots.d.ts.map +1 -0
- package/dist/lib/fetchStorefrontTimeSlots.js +22 -0
- package/dist/lib/pricing.js +3 -3
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +98 -101
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +71 -75
- package/dist/pages/CheckoutPaymentPage.js +5 -5
- package/dist/pages/CheckoutSuccessPage.js +6 -6
- package/dist/pages/ContractSaleDocumentPage.js +1 -1
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +134 -137
- package/dist/pages/PaymentLinkPage.js +3 -3
- package/dist/pages/PaymentLinkSuccessPage.js +1 -1
- package/dist/pages/ProductPage.js +3 -3
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts +2 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.js +37 -36
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +2 -2
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +21 -21
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +6 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +26 -23
- package/dist/pages/checkout/types.d.ts +1 -1
- package/dist/pages/checkout/types.js +3 -3
- package/dist/storefront.css +1 -1
- package/dist/ui/card.js +26 -26
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import { useState as c, useMemo as u, useEffect as E } from "react";
|
|
3
3
|
import { toast as Z } from "@rpcbase/client";
|
|
4
4
|
import { useForm as Ye, zodResolver as et } from "@rpcbase/form";
|
|
@@ -17,12 +17,11 @@ import { useStorefront as kt, useStorefrontProducts as Ct } from "../StorefrontP
|
|
|
17
17
|
import { BookingFlowSteps as vt } from "../components/BookingFlowSteps/index.js";
|
|
18
18
|
import { Button as xe } from "../ui/button.js";
|
|
19
19
|
import { CheckoutDetailsCard as St } from "./checkout/components/CheckoutDetailsCard.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (o, r, p) => {
|
|
20
|
+
import { CheckoutPaymentSummaryCard as Mt } from "./checkout/components/CheckoutPaymentSummaryCard.js";
|
|
21
|
+
import { CheckoutSummaryColumn as xt } from "./checkout/components/CheckoutSummaryColumn.js";
|
|
22
|
+
import { FulfillmentSection as Pt } from "../components/FulfillmentSection/index.js";
|
|
23
|
+
import { checkoutFormSchema as Tt } from "./checkout/types.js";
|
|
24
|
+
const Pe = 0.2, At = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (o, r, p) => {
|
|
26
25
|
try {
|
|
27
26
|
return new Intl.NumberFormat(p, {
|
|
28
27
|
style: "currency",
|
|
@@ -41,7 +40,7 @@ const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
|
|
|
41
40
|
} catch {
|
|
42
41
|
return `${Math.round(o * 100)}%`;
|
|
43
42
|
}
|
|
44
|
-
},
|
|
43
|
+
}, Dt = (o, r, p) => {
|
|
45
44
|
const S = {
|
|
46
45
|
dateStyle: "medium",
|
|
47
46
|
timeStyle: "short"
|
|
@@ -53,14 +52,14 @@ const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
|
|
|
53
52
|
}
|
|
54
53
|
return new Intl.DateTimeFormat(r, S).format(o);
|
|
55
54
|
};
|
|
56
|
-
function
|
|
55
|
+
function Yt() {
|
|
57
56
|
const { t: o, i18n: r } = at(), { storefrontConfiguration: p } = kt(), S = p.workspace?.workspaceLanguage, { bikes: G, accessories: J } = Ct(), { storeSlug: s } = tt(), [M, Ae] = ot(), De = nt(), { items: X, itemCount: we, setQuantity: Ie, removeItem: Le, clear: Re } = bt(), [U, Y] = c(!1), [l, T] = c(null), [ee, $] = c(!1), [te, A] = c(null), oe = M.get("coupon") ?? M.get("code") ?? "", [ne, B] = c(oe), [ae, re] = c(oe.trim()), [f, x] = c(null), [se, D] = c(null), [ie, O] = c(!1), [Ne, b] = c(null), [le, k] = c(null), [V, ce] = c(!1), ue = u(
|
|
58
57
|
() => ht(M, s),
|
|
59
58
|
[M, s]
|
|
60
59
|
), w = p.settings.fulfillmentModes.includes("delivery"), de = p.settings.deliveryDisabledReason.trim(), Ee = w || de.length > 0, Fe = p.shop.address?.trim() ?? "", t = u(() => {
|
|
61
60
|
const e = ft(ue);
|
|
62
61
|
return e.fulfillment === "delivery" && !w ? { ...e, fulfillment: "pickup" } : e;
|
|
63
|
-
}, [ue, w]), Ue = u(() => gt(t), [t]), me = u(() => yt(t), [t]), pe = u(() =>
|
|
62
|
+
}, [ue, w]), Ue = u(() => gt(t), [t]), me = u(() => yt(t), [t]), pe = u(() => At(me), [me]), d = u(
|
|
64
63
|
() => _t({
|
|
65
64
|
items: X,
|
|
66
65
|
language: r.language,
|
|
@@ -97,9 +96,9 @@ function to() {
|
|
|
97
96
|
},
|
|
98
97
|
products: q
|
|
99
98
|
}
|
|
100
|
-
),
|
|
99
|
+
), n = mt.parse(i);
|
|
101
100
|
if (e) return;
|
|
102
|
-
I(
|
|
101
|
+
I(n.success ? n.availability ?? [] : []);
|
|
103
102
|
} catch (i) {
|
|
104
103
|
if (e) return;
|
|
105
104
|
console.error("Failed to load checkout cart availability", i), I([]);
|
|
@@ -126,11 +125,11 @@ function to() {
|
|
|
126
125
|
() => ({
|
|
127
126
|
...d,
|
|
128
127
|
lines: d.lines.map((e) => {
|
|
129
|
-
const i = fe.get(ve(e.checkoutProductId, e.productVariantId)),
|
|
128
|
+
const i = fe.get(ve(e.checkoutProductId, e.productVariantId)), n = i ? pt(i) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
130
129
|
return {
|
|
131
130
|
...e,
|
|
132
|
-
insufficientCapacity: !K &&
|
|
133
|
-
availabilityIssue: K ? void 0 :
|
|
131
|
+
insufficientCapacity: !K && n !== void 0,
|
|
132
|
+
availabilityIssue: K ? void 0 : n
|
|
134
133
|
};
|
|
135
134
|
})
|
|
136
135
|
}),
|
|
@@ -144,15 +143,15 @@ function to() {
|
|
|
144
143
|
})),
|
|
145
144
|
[d.lines]
|
|
146
145
|
), $e = d.estimatedTotalMinor ?? d.totalPerDayMinor, v = se?.totalMinor ?? $e, P = f?.discountAmountMinor ?? 0, R = Se(new URLSearchParams(), t).toString(), j = `/${s ?? ""}/booking${R ? `?${R}` : ""}`, Be = `/${s ?? ""}/checkout${R ? `?${R}` : ""}`, ge = Ye({
|
|
147
|
-
resolver: et(
|
|
146
|
+
resolver: et(Tt),
|
|
148
147
|
defaultValues: { full_name: "", email: "", phone: "", notes: "" }
|
|
149
148
|
});
|
|
150
149
|
E(() => {
|
|
151
150
|
Me(s, t);
|
|
152
151
|
}, [t, s]);
|
|
153
152
|
const H = (e) => {
|
|
154
|
-
const i = { ...t, ...e },
|
|
155
|
-
Ae(
|
|
153
|
+
const i = { ...t, ...e }, n = Se(M, i);
|
|
154
|
+
Ae(n, { replace: !0 }), Me(s, n);
|
|
156
155
|
};
|
|
157
156
|
E(() => {
|
|
158
157
|
if (!s || C.length === 0) {
|
|
@@ -160,7 +159,7 @@ function to() {
|
|
|
160
159
|
return;
|
|
161
160
|
}
|
|
162
161
|
const e = ae.trim(), i = e.length === 0 && !V;
|
|
163
|
-
let
|
|
162
|
+
let n = !1;
|
|
164
163
|
return O(!0), k(null), b(null), (async () => {
|
|
165
164
|
try {
|
|
166
165
|
const W = await F(
|
|
@@ -178,7 +177,7 @@ function to() {
|
|
|
178
177
|
includeAutoApply: i
|
|
179
178
|
}
|
|
180
179
|
), m = lt.parse(W);
|
|
181
|
-
if (
|
|
180
|
+
if (n) return;
|
|
182
181
|
if (D(
|
|
183
182
|
typeof m.subtotalMinor == "number" && typeof m.totalMinor == "number" ? {
|
|
184
183
|
subtotalMinor: m.subtotalMinor,
|
|
@@ -191,13 +190,13 @@ function to() {
|
|
|
191
190
|
}
|
|
192
191
|
x(m.coupon ?? null), m.coupon && (m.coupon.autoApplied && e.length === 0 ? (B(m.coupon.code), b(o("checkout_coupon_auto_applied", { code: m.coupon.code }))) : b(o("checkout_coupon_manual_applied")));
|
|
193
192
|
} catch (W) {
|
|
194
|
-
if (
|
|
193
|
+
if (n) return;
|
|
195
194
|
console.error("Failed to verify checkout coupon", W), x(null), D(null), k(o("checkout_coupon_error"));
|
|
196
195
|
} finally {
|
|
197
|
-
|
|
196
|
+
n || O(!1);
|
|
198
197
|
}
|
|
199
198
|
})(), () => {
|
|
200
|
-
|
|
199
|
+
n = !0;
|
|
201
200
|
};
|
|
202
201
|
}, [
|
|
203
202
|
V,
|
|
@@ -229,13 +228,13 @@ function to() {
|
|
|
229
228
|
},
|
|
230
229
|
estimatedTotalMinor: v
|
|
231
230
|
}
|
|
232
|
-
),
|
|
231
|
+
), n = st.parse(i);
|
|
233
232
|
if (e) return;
|
|
234
|
-
if (!
|
|
235
|
-
T(null), A(
|
|
233
|
+
if (!n.success || !n.decision) {
|
|
234
|
+
T(null), A(n.message || o("checkout_payment_error"));
|
|
236
235
|
return;
|
|
237
236
|
}
|
|
238
|
-
T(
|
|
237
|
+
T(n.decision);
|
|
239
238
|
} catch (i) {
|
|
240
239
|
if (e) return;
|
|
241
240
|
console.error("Failed to load checkout payment decision", i), T(null), A(o("checkout_payment_error"));
|
|
@@ -262,7 +261,7 @@ function to() {
|
|
|
262
261
|
}, [r.language, l]), Q = u(() => {
|
|
263
262
|
if (!l?.depositRefundableUntilIso) return null;
|
|
264
263
|
const e = new Date(l.depositRefundableUntilIso);
|
|
265
|
-
return Number.isNaN(e.getTime()) ? null :
|
|
264
|
+
return Number.isNaN(e.getTime()) ? null : Dt(e, r.language, _e);
|
|
266
265
|
}, [r.language, l?.depositRefundableUntilIso, _e]), Ze = u(() => l ? l.paymentMode === "deposit" && h > 0 && N ? Q ? o("checkout_payment_due_now_helper_deposit_refundable_until", {
|
|
267
266
|
percent: N,
|
|
268
267
|
date: Q
|
|
@@ -301,12 +300,12 @@ function to() {
|
|
|
301
300
|
},
|
|
302
301
|
items: C
|
|
303
302
|
}
|
|
304
|
-
),
|
|
305
|
-
if (!
|
|
306
|
-
Z.error(
|
|
303
|
+
), n = ut.parse(i);
|
|
304
|
+
if (!n.success || !n.checkout) {
|
|
305
|
+
Z.error(n.message || o("checkout_payment_error"));
|
|
307
306
|
return;
|
|
308
307
|
}
|
|
309
|
-
|
|
308
|
+
n.checkout.requiresPayment || Z.success(o("checkout_success_toast")), await De(n.checkout.nextPath), Re();
|
|
310
309
|
} catch (i) {
|
|
311
310
|
console.error("Failed to submit storefront checkout", i), Z.error(o("checkout_payment_error"));
|
|
312
311
|
} finally {
|
|
@@ -314,25 +313,25 @@ function to() {
|
|
|
314
313
|
}
|
|
315
314
|
}
|
|
316
315
|
}), Je = o(We ? "checkout_continue_to_payment" : "checkout_submit"), be = t.fulfillment === "delivery" && t.start_address.trim().length === 0, Xe = !U && !ee && !te && !ie && !le && !!l && !be && C.length > 0;
|
|
317
|
-
return d.lines.length === 0 ? /* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
316
|
+
return d.lines.length === 0 ? /* @__PURE__ */ a("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ y("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: [
|
|
317
|
+
/* @__PURE__ */ a("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ a("span", { children: o("cart_empty_title") }) }),
|
|
318
|
+
/* @__PURE__ */ a("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ a("span", { children: o("cart_empty_description") }) }),
|
|
319
|
+
/* @__PURE__ */ a("div", { className: "mt-6", children: /* @__PURE__ */ a(ke, { to: j, children: /* @__PURE__ */ y(xe, { className: "gap-2", children: [
|
|
320
|
+
/* @__PURE__ */ a(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
321
|
+
/* @__PURE__ */ a("span", { children: o("back_to_booking") })
|
|
323
322
|
] }) }) })
|
|
324
|
-
] }) }) : /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
323
|
+
] }) }) : /* @__PURE__ */ a("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-6", children: [
|
|
324
|
+
/* @__PURE__ */ a(vt, { currentStep: "checkout", bookingPath: j, checkoutPath: Be }),
|
|
326
325
|
/* @__PURE__ */ y(ke, { to: j, className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950", children: [
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ a(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
327
|
+
/* @__PURE__ */ a("span", { children: o("back_to_booking") })
|
|
329
328
|
] }),
|
|
330
329
|
/* @__PURE__ */ y("div", { className: "grid gap-6 lg:grid-cols-12", children: [
|
|
331
330
|
/* @__PURE__ */ y("div", { className: "lg:col-span-7", children: [
|
|
332
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ a("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ a("span", { children: o("checkout_title") }) }),
|
|
333
332
|
/* @__PURE__ */ y("div", { className: "mt-5 grid gap-4", children: [
|
|
334
|
-
Ee ? /* @__PURE__ */
|
|
335
|
-
|
|
333
|
+
Ee ? /* @__PURE__ */ a("div", { className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm", children: /* @__PURE__ */ a(
|
|
334
|
+
Pt,
|
|
336
335
|
{
|
|
337
336
|
value: t.fulfillment,
|
|
338
337
|
onValueChange: (e) => H({ fulfillment: e }),
|
|
@@ -347,30 +346,9 @@ function to() {
|
|
|
347
346
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
348
347
|
}
|
|
349
348
|
) }) : null,
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ a(St, { form: ge }),
|
|
350
|
+
/* @__PURE__ */ a(
|
|
352
351
|
Mt,
|
|
353
|
-
{
|
|
354
|
-
code: ne,
|
|
355
|
-
appliedCode: f?.code,
|
|
356
|
-
discountLabel: f && P > 0 ? _(P, g, r.language) : null,
|
|
357
|
-
message: Ne,
|
|
358
|
-
error: le,
|
|
359
|
-
loading: ie,
|
|
360
|
-
disabled: U,
|
|
361
|
-
onCodeChange: (e) => {
|
|
362
|
-
B(e), k(null), b(null);
|
|
363
|
-
},
|
|
364
|
-
onApply: () => {
|
|
365
|
-
ce(!1), re(ne.trim());
|
|
366
|
-
},
|
|
367
|
-
onRemove: () => {
|
|
368
|
-
B(""), re(""), x(null), D(null), k(null), b(null), ce(!0);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
),
|
|
372
|
-
/* @__PURE__ */ n(
|
|
373
|
-
xt,
|
|
374
352
|
{
|
|
375
353
|
estimatedTotalLabel: Oe,
|
|
376
354
|
couponCode: f?.code,
|
|
@@ -392,7 +370,7 @@ function to() {
|
|
|
392
370
|
}
|
|
393
371
|
}
|
|
394
372
|
),
|
|
395
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ a(
|
|
396
374
|
xe,
|
|
397
375
|
{
|
|
398
376
|
type: "button",
|
|
@@ -402,14 +380,14 @@ function to() {
|
|
|
402
380
|
},
|
|
403
381
|
disabled: !Xe,
|
|
404
382
|
className: "mt-4 w-fit",
|
|
405
|
-
children: /* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ a("span", { children: Je })
|
|
406
384
|
}
|
|
407
385
|
),
|
|
408
|
-
be ? /* @__PURE__ */
|
|
386
|
+
be ? /* @__PURE__ */ a("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ a("span", { children: o("checkout_delivery_address_required") }) }) : null
|
|
409
387
|
] })
|
|
410
388
|
] }),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
|
|
389
|
+
/* @__PURE__ */ a(
|
|
390
|
+
xt,
|
|
413
391
|
{
|
|
414
392
|
lines: L.lines,
|
|
415
393
|
itemCount: we,
|
|
@@ -422,12 +400,30 @@ function to() {
|
|
|
422
400
|
couponCode: f?.code,
|
|
423
401
|
durationLabel: Ue.label,
|
|
424
402
|
onQuantityChange: Ie,
|
|
425
|
-
onRemove: Le
|
|
403
|
+
onRemove: Le,
|
|
404
|
+
coupon: {
|
|
405
|
+
code: ne,
|
|
406
|
+
appliedCode: f?.code,
|
|
407
|
+
discountLabel: f && P > 0 ? _(P, g, r.language) : null,
|
|
408
|
+
message: Ne,
|
|
409
|
+
error: le,
|
|
410
|
+
loading: ie,
|
|
411
|
+
disabled: U,
|
|
412
|
+
onCodeChange: (e) => {
|
|
413
|
+
B(e), k(null), b(null);
|
|
414
|
+
},
|
|
415
|
+
onApply: () => {
|
|
416
|
+
ce(!1), re(ne.trim());
|
|
417
|
+
},
|
|
418
|
+
onRemove: () => {
|
|
419
|
+
B(""), re(""), x(null), D(null), k(null), b(null), ce(!0);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
426
422
|
}
|
|
427
423
|
)
|
|
428
424
|
] })
|
|
429
425
|
] }) });
|
|
430
426
|
}
|
|
431
427
|
export {
|
|
432
|
-
|
|
428
|
+
Yt as default
|
|
433
429
|
};
|
|
@@ -131,7 +131,7 @@ function Be() {
|
|
|
131
131
|
};
|
|
132
132
|
}, [r?.clientSecret]);
|
|
133
133
|
if (!m)
|
|
134
|
-
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-
|
|
134
|
+
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
135
135
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
|
|
136
136
|
/* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
|
|
137
137
|
/* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_missing_session") }) })
|
|
@@ -139,9 +139,9 @@ function Be() {
|
|
|
139
139
|
/* @__PURE__ */ e(b, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
|
|
140
140
|
] }) }) });
|
|
141
141
|
if (h && !r)
|
|
142
|
-
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-
|
|
142
|
+
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ e(q, {}) }) });
|
|
143
143
|
if (A || !r)
|
|
144
|
-
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-
|
|
144
|
+
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
145
145
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
|
|
146
146
|
/* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
|
|
147
147
|
/* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: A ?? t("checkout_payment_return_status_error") }) })
|
|
@@ -150,7 +150,7 @@ function Be() {
|
|
|
150
150
|
] }) }) });
|
|
151
151
|
const F = typeof r.amountMinor == "number" && r.currency ? xe(r.amountMinor, r.currency, i.language) : null, w = o === "authorized" || o === "succeeded", L = o === "failed" || o === "cancelled", H = w ? se : L ? ne : ae, X = w ? "text-emerald-600" : L ? "text-red-600" : "text-amber-600";
|
|
152
152
|
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-5xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ n("div", { className: "grid gap-6 lg:grid-cols-[1fr_1fr]", children: [
|
|
153
|
-
/* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-
|
|
153
|
+
/* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-5", children: [
|
|
154
154
|
/* @__PURE__ */ n("div", { className: "inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1 text-xs font-medium text-emerald-700", children: [
|
|
155
155
|
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
156
156
|
/* @__PURE__ */ e("span", { children: t("secure_payment_link.secured_badge") })
|
|
@@ -174,7 +174,7 @@ function Be() {
|
|
|
174
174
|
/* @__PURE__ */ e("span", { children: t("checkout_payment_return_loading") })
|
|
175
175
|
] }) : null
|
|
176
176
|
] }) }),
|
|
177
|
-
/* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-
|
|
177
|
+
/* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: [
|
|
178
178
|
w || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
|
|
179
179
|
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(H, { className: `h-6 w-6 ${X}`, "aria-hidden": "true" }) }),
|
|
180
180
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
@@ -5,15 +5,15 @@ import { useTranslation as x } from "react-i18next";
|
|
|
5
5
|
import { resolveBookingSearchParamsFromSessionStorage as p } from "../lib/booking.js";
|
|
6
6
|
import { Button as o } from "../ui/button.js";
|
|
7
7
|
function b() {
|
|
8
|
-
const { t } = x(), { storeSlug: r } = m(), [l] = h(),
|
|
9
|
-
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ c("div", { className: "rounded-
|
|
8
|
+
const { t: s } = x(), { storeSlug: r } = m(), [l] = h(), t = p(l, r).toString(), i = `/${r ?? ""}/booking${t ? `?${t}` : ""}`, n = `/${r ?? ""}${t ? `?${t}` : ""}`;
|
|
9
|
+
return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ c("div", { className: "rounded-xl border border-slate-200 bg-white p-5 shadow-sm sm:p-6", children: [
|
|
10
10
|
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-600", children: /* @__PURE__ */ e(d, { className: "h-6 w-6", "aria-hidden": "true" }) }),
|
|
11
|
-
/* @__PURE__ */ e("h1", { className: "mt-6 text-center text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ e("span", { children:
|
|
12
|
-
/* @__PURE__ */ e("p", { className: "mt-2 text-center text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children:
|
|
11
|
+
/* @__PURE__ */ e("h1", { className: "mt-6 text-center text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ e("span", { children: s("checkout_success_title") }) }),
|
|
12
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-center text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: s("checkout_success_description") }) }),
|
|
13
13
|
/* @__PURE__ */ c("div", { className: "mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center", children: [
|
|
14
|
-
/* @__PURE__ */ e(a, { to: i, children: /* @__PURE__ */ e(o, { variant: "outline", className: "w-full sm:w-auto", children: /* @__PURE__ */ e("span", { children:
|
|
14
|
+
/* @__PURE__ */ e(a, { to: i, children: /* @__PURE__ */ e(o, { variant: "outline", className: "w-full sm:w-auto", children: /* @__PURE__ */ e("span", { children: s("checkout_success_back_to_products") }) }) }),
|
|
15
15
|
/* @__PURE__ */ e(a, { to: n, children: /* @__PURE__ */ c(o, { className: "w-full gap-2 sm:w-auto", children: [
|
|
16
|
-
/* @__PURE__ */ e("span", { children:
|
|
16
|
+
/* @__PURE__ */ e("span", { children: s("checkout_success_back_home") }),
|
|
17
17
|
/* @__PURE__ */ e(u, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
18
18
|
] }) })
|
|
19
19
|
] })
|
|
@@ -205,7 +205,7 @@ function Ce() {
|
|
|
205
205
|
s(`${a.pathname}${m ? `?${m}` : ""}${a.hash || ""}`, { replace: !0 });
|
|
206
206
|
};
|
|
207
207
|
if (!w)
|
|
208
|
-
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ t(ae, { className: "border-slate-200 bg-white p-
|
|
208
|
+
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ t(ae, { className: "border-slate-200 bg-white p-5 shadow-sm sm:p-6", children: /* @__PURE__ */ g("div", { className: "space-y-4", children: [
|
|
209
209
|
/* @__PURE__ */ t("h1", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: e("docs_contract_sale_not_found_title") }) }),
|
|
210
210
|
/* @__PURE__ */ t("p", { className: "text-sm text-red-600", children: /* @__PURE__ */ t("span", { children: y ?? e("docs_contract_sale_load_error") }) }),
|
|
211
211
|
/* @__PURE__ */ t(I, { to: `/${c ?? ""}`, children: /* @__PURE__ */ g(P, { className: "gap-2", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AAyGA,MAAM,CAAC,OAAO,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AAyGA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAspB/B"}
|