@loczer/storefront-sdk 0.164.0 → 0.165.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/StorefrontProvider.d.ts +29 -3
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +64 -55
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
- package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
- package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
- package/dist/components/AboutSection/index.js +1 -1
- package/dist/components/BikeProductCard/index.d.ts +2 -1
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +59 -41
- package/dist/components/BookingBikeVariantDialog/index.js +1 -1
- package/dist/components/BookingFlowSteps/index.js +8 -8
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
- package/dist/components/ContactSection/index.js +4 -4
- package/dist/components/Header/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.js +1 -1
- package/dist/components/ProductWarningNotice/index.js +10 -10
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +13 -13
- package/dist/i18n/en.d.ts +12 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/fr.d.ts +12 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +12 -0
- package/dist/index.d.ts +116 -7
- package/dist/index.js +312 -305
- package/dist/lib/cart.js +1 -1
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +28 -28
- package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +14 -6
- package/dist/lib/checkoutPaymentSession.d.ts +1 -0
- package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentSession.js +12 -11
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +34 -15
- package/dist/lib/products.d.ts +4 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +74 -39
- package/dist/lib/securePaymentLink.d.ts +1 -0
- package/dist/lib/securePaymentLink.d.ts.map +1 -1
- package/dist/lib/securePaymentLink.js +1 -0
- package/dist/lib/storefrontAvailability.d.ts +9 -0
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +28 -18
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +290 -289
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +224 -216
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +92 -92
- package/dist/pages/ContractSaleDocumentPage.js +3 -3
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +167 -161
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +62 -62
- package/dist/pages/PaymentLinkSuccessPage.js +7 -7
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +161 -161
- package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +4 -4
- package/dist/ui/day-picker.js +5 -5
- package/package.json +2 -2
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useParams as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { ArrowLeft as
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b, useState as k, useEffect as O } from "react";
|
|
3
|
+
import { useParams as _t, useSearchParams as St, useLocation as kt, useNavigate as wt, Link as tt } from "@rpcbase/router";
|
|
4
|
+
import { cn as w } from "@rpcbase/ui";
|
|
5
|
+
import { ArrowLeft as at, ArrowRight as R, Bike as It, CheckCircle2 as Pt } from "lucide-react";
|
|
6
6
|
import { useTranslation as Vt } from "react-i18next";
|
|
7
7
|
import { apiPost as At } from "../lib/apiCall.js";
|
|
8
8
|
import { getAvailabilityVariant as Ct } from "../lib/utils.js";
|
|
9
|
-
import { resolveBookingSearchParamsFromSessionStorage as Lt, getBookingParamsFromSearch as
|
|
10
|
-
import { getLocalizedValue as
|
|
9
|
+
import { resolveBookingSearchParamsFromSessionStorage as Lt, getBookingParamsFromSearch as Bt, writeBookingSearchParamsToSessionStorage as Tt } from "../lib/booking.js";
|
|
10
|
+
import { getLocalizedValue as I } from "../localization.js";
|
|
11
11
|
import { Badge as et } from "../ui/badge.js";
|
|
12
|
-
import { Button as
|
|
12
|
+
import { Button as v } from "../ui/button.js";
|
|
13
13
|
import { Card as Ot } from "../ui/card.js";
|
|
14
14
|
import { Input as Rt } from "../ui/input.js";
|
|
15
15
|
import { RadioGroup as $t, RadioGroupItem as Ft } from "../ui/radio-group.js";
|
|
16
16
|
import { useStorefrontCart as zt } from "../lib/cart.js";
|
|
17
|
-
import { findStorefrontProductBySlug as jt, getStorefrontCheckoutProductId as
|
|
18
|
-
import {
|
|
19
|
-
import { getProductVariantAttributeValue as
|
|
20
|
-
import { resolveProductImageContainerStyle as
|
|
21
|
-
import { useStorefront as
|
|
22
|
-
import { ProductPriceBadge as
|
|
23
|
-
import { ProductWarningNotice as
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
},
|
|
30
|
-
if (!
|
|
31
|
-
const
|
|
32
|
-
l.set(
|
|
33
|
-
for (const
|
|
34
|
-
l.set(
|
|
35
|
-
productId:
|
|
36
|
-
productVariantId:
|
|
37
|
-
quantity:
|
|
17
|
+
import { findStorefrontProductBySlug as jt, getStorefrontCheckoutProductId as P } from "../lib/products.js";
|
|
18
|
+
import { getValidStorefrontAvailabilitySchedule as Mt, ROUTE as Kt, responseSchema as Et, buildStorefrontAvailabilityKey as d, getStorefrontAvailabilityStatus as it, isStorefrontAvailabilityInsufficient as rt, getStorefrontAvailabilityIssue as qt } from "../lib/storefrontAvailability.js";
|
|
19
|
+
import { getProductVariantAttributeValue as Gt, getStorefrontProductVariantDisplay as Ut } from "../lib/productVariants.js";
|
|
20
|
+
import { resolveProductImageContainerStyle as Wt } from "../lib/productImageStyles.js";
|
|
21
|
+
import { useStorefront as Dt, useStorefrontProducts as Qt } from "../StorefrontProvider.js";
|
|
22
|
+
import { ProductPriceBadge as Ht } from "../components/ProductPriceBadge/index.js";
|
|
23
|
+
import { ProductWarningNotice as Jt } from "../components/ProductWarningNotice/index.js";
|
|
24
|
+
const st = (a, s = () => !0) => {
|
|
25
|
+
if (!a) return null;
|
|
26
|
+
if (a.representedVariantId?.trim()) return a.representedVariantId.trim();
|
|
27
|
+
const e = a.productVariants ?? [];
|
|
28
|
+
return e.find((o) => s(o.id))?.id ?? e[0]?.id ?? null;
|
|
29
|
+
}, Xt = (a, s) => {
|
|
30
|
+
if (!a) return [];
|
|
31
|
+
const e = P(a), l = /* @__PURE__ */ new Map();
|
|
32
|
+
l.set(d(e), { productId: e, quantity: s });
|
|
33
|
+
for (const x of a.productVariants ?? [])
|
|
34
|
+
l.set(d(e, x.id), {
|
|
35
|
+
productId: e,
|
|
36
|
+
productVariantId: x.id,
|
|
37
|
+
quantity: s
|
|
38
38
|
});
|
|
39
|
-
const o =
|
|
40
|
-
return o && l.set(
|
|
41
|
-
productId:
|
|
39
|
+
const o = a.representedVariantId?.trim();
|
|
40
|
+
return o && l.set(d(e, o), {
|
|
41
|
+
productId: e,
|
|
42
42
|
productVariantId: o,
|
|
43
|
-
quantity:
|
|
43
|
+
quantity: s
|
|
44
44
|
}), Array.from(l.values());
|
|
45
|
-
},
|
|
46
|
-
const
|
|
45
|
+
}, Yt = (a, s) => {
|
|
46
|
+
const e = P(a), l = a.representedVariantId?.trim();
|
|
47
47
|
if (l) {
|
|
48
|
-
const o =
|
|
48
|
+
const o = s.get(d(e, l));
|
|
49
49
|
if (o) return o;
|
|
50
50
|
}
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
const l =
|
|
54
|
-
return l === "quantity_unavailable" ?
|
|
55
|
-
},
|
|
56
|
-
function
|
|
57
|
-
const { t:
|
|
58
|
-
() => l ? jt(l, { bikes:
|
|
59
|
-
[F,
|
|
60
|
-
),
|
|
61
|
-
() => Lt(o,
|
|
62
|
-
[o,
|
|
63
|
-
),
|
|
64
|
-
() =>
|
|
65
|
-
[
|
|
66
|
-
), [
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
|
|
51
|
+
return s.get(d(e));
|
|
52
|
+
}, Zt = (a, s, e) => e.get(d(P(a), s)), nt = (a, s, e) => {
|
|
53
|
+
const l = qt(s);
|
|
54
|
+
return l === "quantity_unavailable" ? a("availability_quantity_unavailable") : l === "unavailable" || e === "OUT_OF_STOCK" ? a("availability_out_of_stock") : s?.remaining !== void 0 ? a("availability_remaining_count", { count: s.remaining }) : s?.fewRemaining || e === "LOW_STOCK" ? a("availability_low_stock") : a("availability_in_stock");
|
|
55
|
+
}, ta = (a) => "availabilityStatus" in a ? a.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
|
|
56
|
+
function ka() {
|
|
57
|
+
const { t: a, i18n: s } = Vt(), { storeSlug: e, productSlug: l } = _t(), [o] = St(), x = kt(), lt = wt(), { addItem: ot, itemCount: $ } = zt(), { storefrontConfiguration: ct } = Dt(), y = ct.workspace?.workspaceLanguage, { bikes: F, accessories: z } = Qt(), i = b(
|
|
58
|
+
() => l ? jt(l, { bikes: F, accessories: z }) : null,
|
|
59
|
+
[z, F, l]
|
|
60
|
+
), u = b(
|
|
61
|
+
() => Lt(o, e),
|
|
62
|
+
[o, e]
|
|
63
|
+
), p = b(() => Bt(u), [u]), j = u.toString(), M = `/${e ?? ""}/checkout${j ? `?${j}` : ""}`, K = `/${e ?? ""}`, dt = K, V = x.state, mt = typeof V?.backTo == "string" && V.backTo.startsWith(K) ? V.backTo : dt, [A, E] = k(1), [m, C] = k(() => st(i)), L = Number.isFinite(A) ? Math.max(1, Math.min(99, Math.floor(A))) : 1, B = b(
|
|
64
|
+
() => Xt(i, L),
|
|
65
|
+
[L, i]
|
|
66
|
+
), [q, N] = k([]), [ut, _] = k(!1);
|
|
67
|
+
O(() => {
|
|
68
|
+
if (E(1), !i) {
|
|
69
|
+
C(null);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
}, [l, i]),
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
if (!
|
|
77
|
-
|
|
72
|
+
C(st(i));
|
|
73
|
+
}, [l, i]), O(() => {
|
|
74
|
+
Tt(e, u);
|
|
75
|
+
}, [u, e]), O(() => {
|
|
76
|
+
if (!e || B.length === 0) {
|
|
77
|
+
N([]), _(!1);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const n = Mt(p);
|
|
81
|
+
if (!n) {
|
|
82
|
+
_(!1);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let c = !1;
|
|
86
|
+
return _(!0), N([]), (async () => {
|
|
82
87
|
try {
|
|
83
|
-
const
|
|
84
|
-
|
|
88
|
+
const f = await At(
|
|
89
|
+
Kt,
|
|
85
90
|
{
|
|
86
|
-
storeSlug:
|
|
87
|
-
schedule:
|
|
88
|
-
|
|
89
|
-
endDate: d.end_date,
|
|
90
|
-
startTime: d.start_time,
|
|
91
|
-
endTime: d.end_time
|
|
92
|
-
},
|
|
93
|
-
products: A
|
|
91
|
+
storeSlug: e,
|
|
92
|
+
schedule: n,
|
|
93
|
+
products: B
|
|
94
94
|
}
|
|
95
|
-
),
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
} catch (
|
|
99
|
-
if (
|
|
100
|
-
console.error("Failed to load storefront product availability",
|
|
95
|
+
), S = Et.parse(f);
|
|
96
|
+
if (c) return;
|
|
97
|
+
N(S.success ? S.availability ?? [] : []);
|
|
98
|
+
} catch (f) {
|
|
99
|
+
if (c) return;
|
|
100
|
+
console.error("Failed to load storefront product availability", f), N([]);
|
|
101
101
|
} finally {
|
|
102
|
-
|
|
102
|
+
c || _(!1);
|
|
103
103
|
}
|
|
104
104
|
})(), () => {
|
|
105
|
-
|
|
105
|
+
c = !0;
|
|
106
106
|
};
|
|
107
107
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
B,
|
|
109
|
+
p.end_date,
|
|
110
|
+
p.end_time,
|
|
111
|
+
p.start_date,
|
|
112
|
+
p.start_time,
|
|
113
|
+
e
|
|
114
114
|
]);
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const G = b(() => new Map(
|
|
116
|
+
q.map((n) => [
|
|
117
|
+
d(n.productId, n.productVariantId),
|
|
118
|
+
n
|
|
119
119
|
])
|
|
120
|
-
), [
|
|
121
|
-
|
|
120
|
+
), [q]), U = () => {
|
|
121
|
+
lt(mt);
|
|
122
122
|
};
|
|
123
123
|
if (!i)
|
|
124
|
-
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */ t("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children:
|
|
126
|
-
/* @__PURE__ */ t("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children:
|
|
127
|
-
/* @__PURE__ */ t("div", { className: "mt-6", children: /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */ t(
|
|
129
|
-
/* @__PURE__ */ t("span", { children:
|
|
124
|
+
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ r("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: [
|
|
125
|
+
/* @__PURE__ */ t("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: a("product_not_found_title") }) }),
|
|
126
|
+
/* @__PURE__ */ t("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: a("product_not_found_description") }) }),
|
|
127
|
+
/* @__PURE__ */ t("div", { className: "mt-6", children: /* @__PURE__ */ r(v, { type: "button", className: "gap-2", onClick: U, children: [
|
|
128
|
+
/* @__PURE__ */ t(at, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
129
|
+
/* @__PURE__ */ t("span", { children: a("go_back") })
|
|
130
130
|
] }) })
|
|
131
131
|
] }) });
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const W = I(i.name, s.language, y), pt = I(i.description, s.language, y), ht = I(i.warning, s.language, y), D = typeof i.images?.[0] == "string" ? i.images[0].trim() : "", Q = Wt(i.primaryImageStyle), h = Yt(i, G), H = ta(i), J = h ? it(h) : H, ft = Ct(J), gt = ut ? a("availability_checking") : nt(a, h, J), X = h ? rt(h) : H === "OUT_OF_STOCK", T = i.productVariants ?? [], bt = T.some((n) => !!Gt(n, "size")), vt = a(bt ? "product_size_label" : "product_variant_label"), xt = !!m, yt = () => {
|
|
133
|
+
m && ot({
|
|
134
134
|
kind: i.kind,
|
|
135
|
-
productId: i
|
|
136
|
-
...
|
|
137
|
-
quantity:
|
|
135
|
+
productId: P(i),
|
|
136
|
+
...m ? { productVariantId: m } : {},
|
|
137
|
+
quantity: L
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
|
-
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
140
|
+
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-6", children: [
|
|
141
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
142
|
+
/* @__PURE__ */ r(
|
|
143
|
+
v,
|
|
144
144
|
{
|
|
145
145
|
type: "button",
|
|
146
146
|
variant: "ghost",
|
|
147
147
|
className: "h-auto justify-start gap-2 self-start px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
|
|
148
|
-
onClick:
|
|
148
|
+
onClick: U,
|
|
149
149
|
children: [
|
|
150
|
-
/* @__PURE__ */ t(
|
|
151
|
-
/* @__PURE__ */ t("span", { children:
|
|
150
|
+
/* @__PURE__ */ t(at, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
151
|
+
/* @__PURE__ */ t("span", { children: a("go_back") })
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
),
|
|
155
|
-
/* @__PURE__ */ t(
|
|
156
|
-
/* @__PURE__ */ t("span", { children:
|
|
157
|
-
/* @__PURE__ */ t(
|
|
155
|
+
/* @__PURE__ */ t(tt, { to: M, className: w($ > 0 ? "inline-flex" : "hidden"), children: /* @__PURE__ */ r(v, { size: "sm", className: "gap-2", children: [
|
|
156
|
+
/* @__PURE__ */ t("span", { children: a("checkout_button") }),
|
|
157
|
+
/* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
158
158
|
] }) })
|
|
159
159
|
] }),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ r("div", { className: "grid gap-6 lg:grid-cols-12", children: [
|
|
161
|
+
/* @__PURE__ */ r("div", { className: "lg:col-span-7", children: [
|
|
162
162
|
/* @__PURE__ */ t(
|
|
163
163
|
"div",
|
|
164
164
|
{
|
|
165
|
-
className:
|
|
166
|
-
style:
|
|
167
|
-
children:
|
|
165
|
+
className: w("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Q.className),
|
|
166
|
+
style: Q.style,
|
|
167
|
+
children: D ? /* @__PURE__ */ t(
|
|
168
168
|
"img",
|
|
169
169
|
{
|
|
170
|
-
src:
|
|
171
|
-
alt:
|
|
170
|
+
src: D,
|
|
171
|
+
alt: W,
|
|
172
172
|
className: "absolute inset-0 h-full w-full object-contain p-2",
|
|
173
173
|
loading: "lazy"
|
|
174
174
|
}
|
|
175
175
|
) : /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center text-slate-400", children: /* @__PURE__ */ t(It, { className: "h-12 w-12", "aria-hidden": "true" }) })
|
|
176
176
|
}
|
|
177
177
|
),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */ t(et, { variant:
|
|
181
|
-
/* @__PURE__ */ t(
|
|
178
|
+
/* @__PURE__ */ r("div", { className: "mt-5 flex flex-col gap-3", children: [
|
|
179
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
180
|
+
/* @__PURE__ */ t(et, { variant: ft.variant, children: /* @__PURE__ */ t("span", { children: gt }) }),
|
|
181
|
+
/* @__PURE__ */ t(Ht, { prices: i.prices })
|
|
182
182
|
] }),
|
|
183
|
-
/* @__PURE__ */ t("h1", { className: "text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children:
|
|
184
|
-
/* @__PURE__ */ t("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children:
|
|
185
|
-
i.features?.length ? /* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children:
|
|
187
|
-
/* @__PURE__ */ t("ul", { className: "grid gap-1 text-sm text-slate-700", children: i.features.map((
|
|
183
|
+
/* @__PURE__ */ t("h1", { className: "text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: W }) }),
|
|
184
|
+
/* @__PURE__ */ t("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: pt }) }),
|
|
185
|
+
i.features?.length ? /* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
|
|
186
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: a("product_features_title") }) }),
|
|
187
|
+
/* @__PURE__ */ t("ul", { className: "grid gap-1 text-sm text-slate-700", children: i.features.map((n, c) => /* @__PURE__ */ r("li", { className: "inline-flex items-start gap-2", children: [
|
|
188
188
|
/* @__PURE__ */ t(Pt, { className: "mt-0.5 h-4 w-4 text-emerald-600", "aria-hidden": "true" }),
|
|
189
|
-
/* @__PURE__ */ t("span", { children:
|
|
189
|
+
/* @__PURE__ */ t("span", { children: I(n, s.language, y) })
|
|
190
190
|
] }, `${i.id}-${c}`)) })
|
|
191
191
|
] }) : null,
|
|
192
|
-
/* @__PURE__ */ t(
|
|
192
|
+
/* @__PURE__ */ t(Jt, { warning: ht })
|
|
193
193
|
] })
|
|
194
194
|
] }),
|
|
195
|
-
/* @__PURE__ */ t("div", { className: "lg:col-span-5", children: /* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children:
|
|
198
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-slate-600", children: /* @__PURE__ */ t("span", { children:
|
|
195
|
+
/* @__PURE__ */ t("div", { className: "lg:col-span-5", children: /* @__PURE__ */ r(Ot, { className: "border-slate-200 bg-white shadow-sm", children: [
|
|
196
|
+
/* @__PURE__ */ r("div", { className: "border-b border-slate-200 px-4 py-4", children: [
|
|
197
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: a("add_to_cart_title") }) }),
|
|
198
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-slate-600", children: /* @__PURE__ */ t("span", { children: a("add_to_cart_description") }) })
|
|
199
199
|
] }),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
|
|
202
|
-
/* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children:
|
|
203
|
-
/* @__PURE__ */ t($t, { value:
|
|
204
|
-
const c = `variant-${i.id}-${
|
|
205
|
-
return /* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ r("div", { className: "grid gap-4 px-4 py-4", children: [
|
|
201
|
+
T.length > 1 ? /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
202
|
+
/* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: vt }) }),
|
|
203
|
+
/* @__PURE__ */ t($t, { value: m ?? "", onValueChange: C, className: "grid gap-2", children: T.map((n) => {
|
|
204
|
+
const c = `variant-${i.id}-${n.id}`.toLowerCase(), f = `storefront-product-variant-option-${i.id}-${n.id}`.toLowerCase(), { label: S, description: Y } = Ut(n), g = Zt(i, n.id, G), Nt = g ? rt(g) : X, Z = g ? nt(a, g, it(g)) : X ? a("availability_out_of_stock") : null;
|
|
205
|
+
return /* @__PURE__ */ r(
|
|
206
206
|
"label",
|
|
207
207
|
{
|
|
208
208
|
htmlFor: c,
|
|
209
|
-
"data-testid":
|
|
210
|
-
className:
|
|
209
|
+
"data-testid": f,
|
|
210
|
+
className: w(
|
|
211
211
|
"flex items-start gap-3 rounded-xl border p-3 transition",
|
|
212
|
-
|
|
212
|
+
m === n.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"
|
|
213
213
|
),
|
|
214
214
|
children: [
|
|
215
|
-
/* @__PURE__ */ t(Ft, { id: c, value:
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-slate-950", children:
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
/* @__PURE__ */ t(Ft, { id: c, value: n.id, className: "mt-1" }),
|
|
216
|
+
/* @__PURE__ */ r("span", { className: "flex flex-1 flex-col gap-0.5", children: [
|
|
217
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-slate-950", children: S }),
|
|
218
|
+
Y ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: Y }) : null,
|
|
219
|
+
Z ? /* @__PURE__ */ t("span", { className: "pt-1", children: /* @__PURE__ */ t(et, { variant: Nt ? "destructive" : "outline", children: /* @__PURE__ */ t("span", { children: Z }) }) }) : null
|
|
220
220
|
] })
|
|
221
221
|
]
|
|
222
222
|
},
|
|
@@ -224,26 +224,26 @@ function ke() {
|
|
|
224
224
|
);
|
|
225
225
|
}) })
|
|
226
226
|
] }) : null,
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children:
|
|
227
|
+
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
228
|
+
/* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: a("quantity_label") }) }),
|
|
229
229
|
/* @__PURE__ */ t(
|
|
230
230
|
Rt,
|
|
231
231
|
{
|
|
232
232
|
type: "number",
|
|
233
233
|
min: 1,
|
|
234
234
|
max: 99,
|
|
235
|
-
value:
|
|
236
|
-
onChange: (
|
|
235
|
+
value: A,
|
|
236
|
+
onChange: (n) => E(Number(n.target.value))
|
|
237
237
|
}
|
|
238
238
|
)
|
|
239
239
|
] }),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */ t("span", { children:
|
|
242
|
-
/* @__PURE__ */ t(
|
|
240
|
+
/* @__PURE__ */ r(v, { className: "h-11 rounded-xl text-sm font-semibold gap-2", onClick: yt, disabled: !xt, children: [
|
|
241
|
+
/* @__PURE__ */ t("span", { children: a("add_to_cart") }),
|
|
242
|
+
/* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
243
243
|
] }),
|
|
244
|
-
/* @__PURE__ */ t(
|
|
245
|
-
/* @__PURE__ */ t("span", { children:
|
|
246
|
-
/* @__PURE__ */ t(
|
|
244
|
+
/* @__PURE__ */ t(tt, { to: M, className: w($ > 0 ? "block" : "hidden"), children: /* @__PURE__ */ r(v, { variant: "outline", className: "h-11 w-full rounded-xl gap-2", children: [
|
|
245
|
+
/* @__PURE__ */ t("span", { children: a("go_to_checkout") }),
|
|
246
|
+
/* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
247
247
|
] }) })
|
|
248
248
|
] })
|
|
249
249
|
] }) })
|
|
@@ -251,5 +251,5 @@ function ke() {
|
|
|
251
251
|
] }) });
|
|
252
252
|
}
|
|
253
253
|
export {
|
|
254
|
-
|
|
254
|
+
ka as default
|
|
255
255
|
};
|
|
@@ -8,8 +8,8 @@ function A({
|
|
|
8
8
|
className: p,
|
|
9
9
|
code: l,
|
|
10
10
|
appliedCode: o,
|
|
11
|
-
discountLabel:
|
|
12
|
-
message:
|
|
11
|
+
discountLabel: c,
|
|
12
|
+
message: n,
|
|
13
13
|
error: s,
|
|
14
14
|
loading: r,
|
|
15
15
|
disabled: i,
|
|
@@ -49,8 +49,8 @@ function A({
|
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
51
|
] }),
|
|
52
|
-
o &&
|
|
53
|
-
/* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code: o, amount:
|
|
52
|
+
o && c ? /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3 rounded-md border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm text-emerald-800", children: [
|
|
53
|
+
/* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code: o, amount: c }) }),
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
55
|
d,
|
|
56
56
|
{
|
|
@@ -64,8 +64,8 @@ function A({
|
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
] }) : null,
|
|
67
|
-
|
|
68
|
-
s ? /* @__PURE__ */ e("p", { className: "text-xs text-
|
|
67
|
+
n ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: n }) }) : null,
|
|
68
|
+
s ? /* @__PURE__ */ e("p", { className: "text-xs text-destructive", children: /* @__PURE__ */ e("span", { children: s }) }) : null
|
|
69
69
|
] });
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2 as
|
|
2
|
+
import { Loader2 as y, AlertTriangle as k } from "lucide-react";
|
|
3
3
|
import { useTranslation as w } from "react-i18next";
|
|
4
4
|
import { Button as C } from "../../../ui/button.js";
|
|
5
5
|
import { Card as j } from "../../../ui/card.js";
|
|
6
6
|
function F({
|
|
7
7
|
estimatedTotalLabel: m,
|
|
8
8
|
couponCode: o,
|
|
9
|
-
discountAmountLabel:
|
|
9
|
+
discountAmountLabel: d,
|
|
10
10
|
totalExcludingTaxLabel: h,
|
|
11
11
|
vatAmountLabel: p,
|
|
12
12
|
vatRateLabel: u,
|
|
13
13
|
depositAmountLabel: r,
|
|
14
14
|
amountToCollectMinor: x,
|
|
15
15
|
amountToCollectLabel: _,
|
|
16
|
-
paymentSummaryHelper:
|
|
17
|
-
paymentDecisionLoading:
|
|
18
|
-
paymentDecisionError:
|
|
16
|
+
paymentSummaryHelper: c,
|
|
17
|
+
paymentDecisionLoading: n,
|
|
18
|
+
paymentDecisionError: s,
|
|
19
19
|
canChoosePaymentMethod: i,
|
|
20
20
|
showAmountDueNowRow: g,
|
|
21
21
|
selectedPaymentMethod: b,
|
|
22
22
|
submitting: N,
|
|
23
23
|
onSelectPaymentMethod: f
|
|
24
24
|
}) {
|
|
25
|
-
const { t } = w(),
|
|
25
|
+
const { t } = w(), v = [
|
|
26
26
|
{ id: "card", label: t("checkout_payment_method_card") },
|
|
27
27
|
{ id: "apple_pay", label: t("checkout_payment_method_apple_pay") },
|
|
28
28
|
{ id: "other", label: t("checkout_payment_method_other") }
|
|
@@ -38,9 +38,9 @@ function F({
|
|
|
38
38
|
/* @__PURE__ */ e("dt", { className: "text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_estimated_total") }) }),
|
|
39
39
|
/* @__PURE__ */ e("dd", { className: "font-semibold tabular-nums text-slate-900", children: /* @__PURE__ */ e("span", { children: m }) })
|
|
40
40
|
] }),
|
|
41
|
-
|
|
41
|
+
d ? /* @__PURE__ */ a("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-slate-100 py-2.5", children: [
|
|
42
42
|
/* @__PURE__ */ e("dt", { className: "text-emerald-700", children: /* @__PURE__ */ e("span", { children: t("checkout_coupon_discount", { code: o ?? "" }) }) }),
|
|
43
|
-
/* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-emerald-700", children: /* @__PURE__ */ e("span", { children:
|
|
43
|
+
/* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-emerald-700", children: /* @__PURE__ */ e("span", { children: d }) })
|
|
44
44
|
] }) : null,
|
|
45
45
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-slate-100 py-2.5", children: [
|
|
46
46
|
/* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_total_excluding_tax") }) }),
|
|
@@ -59,16 +59,16 @@ function F({
|
|
|
59
59
|
/* @__PURE__ */ e("dd", { className: `text-base font-bold tabular-nums tracking-tight ${x > 0 ? "text-slate-950" : "text-slate-800"}`, children: /* @__PURE__ */ e("span", { children: _ }) })
|
|
60
60
|
] }) : null
|
|
61
61
|
] }),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ e(
|
|
62
|
+
c ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: c }) }) : null,
|
|
63
|
+
n ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-slate-600", children: [
|
|
64
|
+
/* @__PURE__ */ e(y, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
|
|
65
65
|
/* @__PURE__ */ e("span", { children: t("checkout_payment_loading") })
|
|
66
66
|
] }) : null,
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e("span", { children:
|
|
67
|
+
s ? /* @__PURE__ */ e("div", { className: "grid gap-3 rounded-xl border border-destructive/25 bg-destructive/5 p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-2 text-sm text-destructive", children: [
|
|
68
|
+
/* @__PURE__ */ e(k, { className: "mt-0.5 h-4 w-4", "aria-hidden": "true" }),
|
|
69
|
+
/* @__PURE__ */ e("span", { children: s })
|
|
70
70
|
] }) }) : null,
|
|
71
|
-
!
|
|
71
|
+
!n && !s && i ? /* @__PURE__ */ e("div", { className: "grid gap-2 sm:grid-cols-3", children: v.map((l) => /* @__PURE__ */ e(
|
|
72
72
|
C,
|
|
73
73
|
{
|
|
74
74
|
type: "button",
|