@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,101 +1,101 @@
|
|
|
1
1
|
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as p, useState as
|
|
3
|
-
import { useParams as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { ArrowLeft as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { apiPost as
|
|
8
|
-
import { getProductVariantAttributeValue as
|
|
9
|
-
import { getStorefrontCheckoutProductId as
|
|
10
|
-
import { ROUTE as
|
|
11
|
-
import { getLocalizedValue as
|
|
12
|
-
import { Badge as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { Card as
|
|
15
|
-
import { RadioGroup as
|
|
16
|
-
import { createBookingPeriodConfigFromStorefrontConfiguration as
|
|
17
|
-
import { createStorefrontTimeSlotsFetcher as
|
|
18
|
-
import { useStorefrontCart as
|
|
19
|
-
import { buildStorefrontCartSummary as
|
|
20
|
-
import { resolveProductImageContainerStyle as
|
|
21
|
-
import { BookingFlowSteps as
|
|
22
|
-
import { StepSectionTitle as
|
|
23
|
-
import { BookingPeriodSelector as
|
|
24
|
-
import { BikeProductCard as
|
|
25
|
-
import { StorefrontCartPanel as
|
|
26
|
-
import { BookingBikeVariantDialog as
|
|
27
|
-
import { FulfillmentSection as
|
|
28
|
-
import { ProductPriceBadge as
|
|
29
|
-
import { ProductWarningNotice as
|
|
30
|
-
import { useStorefront as
|
|
31
|
-
const
|
|
2
|
+
import { useMemo as p, useState as A, useEffect as B } from "react";
|
|
3
|
+
import { useParams as ee, useLocation as ae, useSearchParams as ie, Link as Q } from "@rpcbase/router";
|
|
4
|
+
import { cn as tt } from "@rpcbase/ui";
|
|
5
|
+
import { ArrowLeft as ne, ShoppingCart as re, Bike as oe, ArrowRight as At } from "lucide-react";
|
|
6
|
+
import { useTranslation as Bt } from "react-i18next";
|
|
7
|
+
import { apiPost as _t } from "../lib/apiCall.js";
|
|
8
|
+
import { getProductVariantAttributeValue as se, getStorefrontProductVariantDisplay as le } from "../lib/productVariants.js";
|
|
9
|
+
import { getStorefrontCheckoutProductId as K } from "../lib/products.js";
|
|
10
|
+
import { getValidStorefrontAvailabilitySchedule as vt, ROUTE as yt, responseSchema as St, buildStorefrontAvailabilityKey as h, getStorefrontAvailabilityStatus as Y, getStorefrontAvailabilityIssue as Tt, isStorefrontAvailabilityInsufficient as de } from "../lib/storefrontAvailability.js";
|
|
11
|
+
import { getLocalizedValue as H } from "../localization.js";
|
|
12
|
+
import { Badge as Ot } from "../ui/badge.js";
|
|
13
|
+
import { Button as F } from "../ui/button.js";
|
|
14
|
+
import { Card as ce } from "../ui/card.js";
|
|
15
|
+
import { RadioGroup as me, RadioGroupItem as ue } from "../ui/radio-group.js";
|
|
16
|
+
import { createBookingPeriodConfigFromStorefrontConfiguration as pe, getDefaultBookingParamsForStorefrontConfiguration as fe, resolveBookingSearchParamsFromSessionStorage as ge, getBookingParamsFromSearch as kt, applyBookingParamsToSearch as xt, writeBookingSearchParamsToSessionStorage as he } from "../lib/booking.js";
|
|
17
|
+
import { createStorefrontTimeSlotsFetcher as be } from "../lib/fetchStorefrontTimeSlots.js";
|
|
18
|
+
import { useStorefrontCart as _e } from "../lib/cart.js";
|
|
19
|
+
import { buildStorefrontCartSummary as ve } from "../lib/cartSummary.js";
|
|
20
|
+
import { resolveProductImageContainerStyle as ye } from "../lib/productImageStyles.js";
|
|
21
|
+
import { BookingFlowSteps as Se } from "../components/BookingFlowSteps/index.js";
|
|
22
|
+
import { StepSectionTitle as J } from "../components/StepSectionTitle/index.js";
|
|
23
|
+
import { BookingPeriodSelector as ke } from "../components/BookingPeriodSelector/index.js";
|
|
24
|
+
import { BikeProductCard as xe } from "../components/BikeProductCard/index.js";
|
|
25
|
+
import { StorefrontCartPanel as Ne } from "../components/StorefrontCartPanel/index.js";
|
|
26
|
+
import { BookingBikeVariantDialog as Ve } from "../components/BookingBikeVariantDialog/index.js";
|
|
27
|
+
import { FulfillmentSection as Ie } from "../components/FulfillmentSection/index.js";
|
|
28
|
+
import { ProductPriceBadge as Ce } from "../components/ProductPriceBadge/index.js";
|
|
29
|
+
import { ProductWarningNotice as Pe } from "../components/ProductWarningNotice/index.js";
|
|
30
|
+
import { useStorefront as we, useStorefrontProducts as Ae, useStorefrontBookingProducts as Be } from "../StorefrontProvider.js";
|
|
31
|
+
const Nt = (e) => String(e).padStart(2, "0"), X = "product_modal", Vt = (e) => `${e.getFullYear()}-${Nt(e.getMonth() + 1)}-${Nt(e.getDate())}`, Z = (e) => {
|
|
32
32
|
if (!e) return;
|
|
33
33
|
const n = e.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
34
34
|
if (!n) return;
|
|
35
|
-
const o = Number(n[1]), d = Number(n[2]),
|
|
36
|
-
if (!(Number.isNaN(m.getTime()) || m.getFullYear() !== o || m.getMonth() !== d - 1 || m.getDate() !==
|
|
35
|
+
const o = Number(n[1]), d = Number(n[2]), s = Number(n[3]), m = new Date(o, d - 1, s);
|
|
36
|
+
if (!(Number.isNaN(m.getTime()) || m.getFullYear() !== o || m.getMonth() !== d - 1 || m.getDate() !== s))
|
|
37
37
|
return m;
|
|
38
|
-
},
|
|
38
|
+
}, It = (e, n) => e.fulfillment === n.fulfillment && e.start_date === n.start_date && e.start_time === n.start_time && e.end_date === n.end_date && e.end_time === n.end_time && e.start_address === n.start_address && e.end_address === n.end_address, x = (e, n = () => !0) => {
|
|
39
39
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
40
|
-
const o = e.productVariants ?? [],
|
|
41
|
-
return typeof
|
|
42
|
-
},
|
|
43
|
-
const o =
|
|
40
|
+
const o = e.productVariants ?? [], s = o.find((m) => n(m.id))?.id ?? o[0]?.id;
|
|
41
|
+
return typeof s == "string" && s.trim().length > 0 ? s : null;
|
|
42
|
+
}, Ct = (e, n) => e.fulfillment === "delivery" && !n ? { ...e, fulfillment: "pickup" } : e, Pt = (e, n) => {
|
|
43
|
+
const o = K(e), d = e.representedVariantId?.trim();
|
|
44
44
|
if (d) {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const s = n.get(h(o, d));
|
|
46
|
+
if (s) return s;
|
|
47
47
|
}
|
|
48
48
|
return n.get(h(o));
|
|
49
|
-
},
|
|
50
|
-
const d =
|
|
49
|
+
}, wt = (e, n, o) => o.get(h(K(e), n)), Te = (e, n, o) => {
|
|
50
|
+
const d = Tt(n);
|
|
51
51
|
return d === "quantity_unavailable" ? e("availability_quantity_unavailable") : d === "unavailable" || o === "OUT_OF_STOCK" ? e("availability_out_of_stock") : n?.remaining !== void 0 ? e("availability_remaining_count", { count: n.remaining }) : n?.fewRemaining || o === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock");
|
|
52
|
-
},
|
|
52
|
+
}, Oe = (e) => {
|
|
53
53
|
const n = /* @__PURE__ */ new Map();
|
|
54
54
|
for (const o of e) {
|
|
55
|
-
const d =
|
|
55
|
+
const d = K(o);
|
|
56
56
|
n.set(h(d), { productId: d });
|
|
57
57
|
for (const m of o.productVariants ?? [])
|
|
58
58
|
n.set(h(d, m.id), {
|
|
59
59
|
productId: d,
|
|
60
60
|
productVariantId: m.id
|
|
61
61
|
});
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const s = o.representedVariantId?.trim();
|
|
63
|
+
s && n.set(h(d, s), {
|
|
64
64
|
productId: d,
|
|
65
|
-
productVariantId:
|
|
65
|
+
productVariantId: s
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
return Array.from(n.values());
|
|
69
69
|
};
|
|
70
|
-
function
|
|
70
|
+
function De({
|
|
71
71
|
product: e,
|
|
72
72
|
selectedVariantId: n,
|
|
73
73
|
onSelect: o,
|
|
74
74
|
onConfirm: d,
|
|
75
|
-
onCancel:
|
|
75
|
+
onCancel: s,
|
|
76
76
|
getVariantAvailabilityLabel: m,
|
|
77
|
-
isVariantOutOfCapacity:
|
|
77
|
+
isVariantOutOfCapacity: T
|
|
78
78
|
}) {
|
|
79
|
-
const { t:
|
|
79
|
+
const { t: v } = Bt(), y = e.productVariants ?? [], N = y.some((u) => !!se(u, "size")), f = v(N ? "product_size_label" : "product_variant_label");
|
|
80
80
|
return /* @__PURE__ */ c("div", { className: "grid gap-3 rounded-xl border border-slate-200 bg-slate-50 p-3", children: [
|
|
81
|
-
/* @__PURE__ */ i("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ i("span", { children:
|
|
82
|
-
/* @__PURE__ */ i(
|
|
83
|
-
const
|
|
81
|
+
/* @__PURE__ */ i("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ i("span", { children: f }) }),
|
|
82
|
+
/* @__PURE__ */ i(me, { value: n, onValueChange: o, className: "grid gap-2", children: y.map((u) => {
|
|
83
|
+
const V = `booking-variant-${e.id}-${u.id}`.toLowerCase(), I = `storefront-booking-variant-option-${e.id}-${u.id}`.toLowerCase(), { label: E, description: O } = le(u), z = T(u.id), D = m(u.id);
|
|
84
84
|
return /* @__PURE__ */ c(
|
|
85
85
|
"label",
|
|
86
86
|
{
|
|
87
|
-
htmlFor:
|
|
88
|
-
"data-testid":
|
|
89
|
-
className:
|
|
87
|
+
htmlFor: V,
|
|
88
|
+
"data-testid": I,
|
|
89
|
+
className: tt(
|
|
90
90
|
"flex items-start gap-3 rounded-xl border p-3 transition",
|
|
91
91
|
n === u.id ? "border-slate-900 bg-white" : "border-slate-200 bg-white"
|
|
92
92
|
),
|
|
93
93
|
children: [
|
|
94
|
-
/* @__PURE__ */ i(
|
|
94
|
+
/* @__PURE__ */ i(ue, { id: V, value: u.id, className: "mt-1" }),
|
|
95
95
|
/* @__PURE__ */ c("span", { className: "flex flex-1 flex-col gap-0.5", children: [
|
|
96
|
-
/* @__PURE__ */ i("span", { className: "text-sm font-medium text-slate-950", children:
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
/* @__PURE__ */ i("span", { className: "text-sm font-medium text-slate-950", children: E }),
|
|
97
|
+
O ? /* @__PURE__ */ i("span", { className: "text-xs text-slate-600", children: O }) : null,
|
|
98
|
+
D ? /* @__PURE__ */ i("span", { className: "pt-1", children: /* @__PURE__ */ i(Ot, { variant: z ? "destructive" : "outline", children: /* @__PURE__ */ i("span", { children: D }) }) }) : null
|
|
99
99
|
] })
|
|
100
100
|
]
|
|
101
101
|
},
|
|
@@ -104,113 +104,109 @@ function Oe({
|
|
|
104
104
|
}) }),
|
|
105
105
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
106
106
|
/* @__PURE__ */ c(
|
|
107
|
-
|
|
107
|
+
F,
|
|
108
108
|
{
|
|
109
109
|
type: "button",
|
|
110
110
|
size: "sm",
|
|
111
111
|
className: "rounded-full gap-2",
|
|
112
112
|
onClick: d,
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */ i("span", { children:
|
|
115
|
-
/* @__PURE__ */ i(
|
|
114
|
+
/* @__PURE__ */ i("span", { children: v("add_to_cart") }),
|
|
115
|
+
/* @__PURE__ */ i(At, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
116
116
|
]
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
/* @__PURE__ */ i(
|
|
119
|
+
/* @__PURE__ */ i(F, { type: "button", size: "sm", variant: "outline", className: "rounded-full", onClick: s, children: /* @__PURE__ */ i("span", { children: v("booking_select_variant_cancel") }) })
|
|
120
120
|
] })
|
|
121
121
|
] });
|
|
122
122
|
}
|
|
123
123
|
function ua() {
|
|
124
|
-
const { t: e, i18n: n } =
|
|
125
|
-
() =>
|
|
126
|
-
[
|
|
127
|
-
),
|
|
128
|
-
() =>
|
|
129
|
-
[
|
|
130
|
-
),
|
|
131
|
-
() =>
|
|
132
|
-
[
|
|
133
|
-
), [
|
|
134
|
-
() =>
|
|
124
|
+
const { t: e, i18n: n } = Bt(), { storeSlug: o } = ee(), d = ae(), { storefrontConfiguration: s } = we(), m = s.workspace?.workspaceLanguage, { bikes: T, accessories: v } = Ae(), { bikes: y, accessories: N } = Be(), [f, u] = ie(), { items: V, itemCount: I, addItem: E, clear: O, removeItem: z, setQuantity: D } = _e(), Dt = p(
|
|
125
|
+
() => pe(s),
|
|
126
|
+
[s]
|
|
127
|
+
), C = p(
|
|
128
|
+
() => fe(s),
|
|
129
|
+
[s]
|
|
130
|
+
), L = s.settings.fulfillmentModes.includes("delivery"), Lt = s.settings.deliveryDisabledReason.trim(), $t = s.shop.address?.trim() ?? "", M = p(
|
|
131
|
+
() => ge(f, o),
|
|
132
|
+
[f, o]
|
|
133
|
+
), [l, et] = A(
|
|
134
|
+
() => Ct(kt(M, C), L)
|
|
135
135
|
);
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
B(() => {
|
|
137
|
+
et((t) => {
|
|
138
138
|
const a = {
|
|
139
|
-
...
|
|
139
|
+
...C,
|
|
140
140
|
...t,
|
|
141
|
-
start_time: t.start_time.trim() ? t.start_time :
|
|
142
|
-
end_time: t.end_time.trim() ? t.end_time :
|
|
143
|
-
}, r =
|
|
144
|
-
return
|
|
141
|
+
start_time: t.start_time.trim() ? t.start_time : C.start_time,
|
|
142
|
+
end_time: t.end_time.trim() ? t.end_time : C.end_time
|
|
143
|
+
}, r = Ct(kt(M, a), L);
|
|
144
|
+
return It(t, r) ? t : r;
|
|
145
145
|
});
|
|
146
|
-
}, [
|
|
147
|
-
const t =
|
|
148
|
-
t.toString() !==
|
|
149
|
-
}, [
|
|
150
|
-
|
|
151
|
-
}, [
|
|
152
|
-
const
|
|
153
|
-
() =>
|
|
154
|
-
[
|
|
155
|
-
), [
|
|
156
|
-
|
|
157
|
-
if (!o ||
|
|
158
|
-
|
|
146
|
+
}, [M, C, L]), B(() => {
|
|
147
|
+
const t = xt(f, l);
|
|
148
|
+
t.toString() !== f.toString() && u(t, { replace: !0 });
|
|
149
|
+
}, [l, f, u]), B(() => {
|
|
150
|
+
he(o, l);
|
|
151
|
+
}, [l, o]);
|
|
152
|
+
const U = p(
|
|
153
|
+
() => Oe([...y, ...N]),
|
|
154
|
+
[N, y]
|
|
155
|
+
), [at, it] = A([]);
|
|
156
|
+
B(() => {
|
|
157
|
+
if (!o || U.length === 0) {
|
|
158
|
+
it([]);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
const t = vt(l);
|
|
162
|
+
if (!t)
|
|
163
|
+
return;
|
|
164
|
+
let a = !1;
|
|
165
|
+
return (async () => {
|
|
163
166
|
try {
|
|
164
|
-
const
|
|
165
|
-
|
|
167
|
+
const r = await _t(
|
|
168
|
+
yt,
|
|
166
169
|
{
|
|
167
170
|
storeSlug: o,
|
|
168
|
-
schedule:
|
|
169
|
-
|
|
170
|
-
endDate: s.end_date,
|
|
171
|
-
startTime: s.start_time,
|
|
172
|
-
endTime: s.end_time
|
|
173
|
-
},
|
|
174
|
-
products: W
|
|
171
|
+
schedule: t,
|
|
172
|
+
products: U
|
|
175
173
|
}
|
|
176
|
-
),
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
} catch (
|
|
180
|
-
if (
|
|
181
|
-
console.error("Failed to load storefront availability",
|
|
182
|
-
} finally {
|
|
183
|
-
t || q(!1);
|
|
174
|
+
), g = St.parse(r);
|
|
175
|
+
if (a) return;
|
|
176
|
+
it(g.success ? g.availability ?? [] : []);
|
|
177
|
+
} catch (r) {
|
|
178
|
+
if (a) return;
|
|
179
|
+
console.error("Failed to load storefront availability", r);
|
|
184
180
|
}
|
|
185
181
|
})(), () => {
|
|
186
|
-
|
|
182
|
+
a = !0;
|
|
187
183
|
};
|
|
188
184
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
U,
|
|
186
|
+
l.end_date,
|
|
187
|
+
l.end_time,
|
|
188
|
+
l.start_date,
|
|
189
|
+
l.start_time,
|
|
194
190
|
o
|
|
195
191
|
]);
|
|
196
|
-
const
|
|
197
|
-
|
|
192
|
+
const P = p(() => new Map(
|
|
193
|
+
at.map((t) => [
|
|
198
194
|
h(t.productId, t.productVariantId),
|
|
199
195
|
t
|
|
200
196
|
])
|
|
201
|
-
), [
|
|
202
|
-
const a =
|
|
197
|
+
), [at]), nt = p(() => y.map((t) => {
|
|
198
|
+
const a = Pt(t, P);
|
|
203
199
|
return {
|
|
204
200
|
...t,
|
|
205
|
-
availabilityStatus: a ?
|
|
201
|
+
availabilityStatus: a ? Y(a) : t.availabilityStatus ?? "AVAILABLE"
|
|
206
202
|
};
|
|
207
|
-
}), [
|
|
208
|
-
const r =
|
|
209
|
-
return r ?
|
|
210
|
-
},
|
|
211
|
-
const r =
|
|
212
|
-
return r ?
|
|
213
|
-
},
|
|
203
|
+
}), [P, y]), rt = (t, a) => {
|
|
204
|
+
const r = wt(t, a, P);
|
|
205
|
+
return r ? de(r) : t.availabilityStatus === "OUT_OF_STOCK";
|
|
206
|
+
}, ot = (t) => (t.productVariants ?? []).length > 0, st = (t, a) => {
|
|
207
|
+
const r = wt(t, a, P);
|
|
208
|
+
return r ? Te(e, r, Y(r)) : t.availabilityStatus === "OUT_OF_STOCK" ? e("availability_out_of_stock") : null;
|
|
209
|
+
}, Rt = be(o), Ft = p(
|
|
214
210
|
() => ({
|
|
215
211
|
startDate: e("booking_start_date"),
|
|
216
212
|
pickStartDate: e("booking_start_date"),
|
|
@@ -221,267 +217,272 @@ function ua() {
|
|
|
221
217
|
selectedDaysTooltip: ({ count: t }) => e("booking_selected_days_tooltip", { count: t })
|
|
222
218
|
}),
|
|
223
219
|
[n.language, e]
|
|
224
|
-
),
|
|
225
|
-
|
|
220
|
+
), S = (t) => {
|
|
221
|
+
et((a) => {
|
|
226
222
|
const r = { ...a, ...t };
|
|
227
|
-
return
|
|
223
|
+
return It(a, r) ? a : r;
|
|
228
224
|
});
|
|
229
|
-
},
|
|
230
|
-
startDate:
|
|
225
|
+
}, Kt = {
|
|
226
|
+
startDate: Z(l.start_date),
|
|
231
227
|
onStartDateChange: (t) => {
|
|
232
|
-
t &&
|
|
228
|
+
t && S({ start_date: Vt(t) });
|
|
233
229
|
},
|
|
234
|
-
startTime:
|
|
235
|
-
onStartTimeChange: (t) =>
|
|
236
|
-
endDate:
|
|
230
|
+
startTime: l.start_time,
|
|
231
|
+
onStartTimeChange: (t) => S({ start_time: t }),
|
|
232
|
+
endDate: Z(l.end_date) ?? Z(l.start_date),
|
|
237
233
|
onEndDateChange: (t) => {
|
|
238
|
-
t &&
|
|
234
|
+
t && S({ end_date: Vt(t) });
|
|
239
235
|
},
|
|
240
|
-
endTime:
|
|
241
|
-
onEndTimeChange: (t) =>
|
|
242
|
-
bookingPeriodConfig:
|
|
243
|
-
fetchTimeSlots:
|
|
244
|
-
labels:
|
|
236
|
+
endTime: l.end_time,
|
|
237
|
+
onEndTimeChange: (t) => S({ end_time: t }),
|
|
238
|
+
bookingPeriodConfig: Dt,
|
|
239
|
+
fetchTimeSlots: Rt,
|
|
240
|
+
labels: Ft,
|
|
245
241
|
localeCode: n.language
|
|
246
|
-
},
|
|
247
|
-
() =>
|
|
248
|
-
items:
|
|
242
|
+
}, w = p(
|
|
243
|
+
() => ve({
|
|
244
|
+
items: V,
|
|
249
245
|
language: n.language,
|
|
250
246
|
fallbackLanguage: m,
|
|
251
|
-
products: { bikes:
|
|
247
|
+
products: { bikes: T, accessories: v }
|
|
252
248
|
}),
|
|
253
|
-
[
|
|
254
|
-
),
|
|
255
|
-
() =>
|
|
249
|
+
[v, T, n.language, V, m]
|
|
250
|
+
), j = p(
|
|
251
|
+
() => w.lines.map((t) => ({
|
|
256
252
|
productId: t.checkoutProductId,
|
|
257
253
|
productVariantId: t.productVariantId,
|
|
258
254
|
quantity: t.quantity
|
|
259
255
|
})),
|
|
260
|
-
[
|
|
261
|
-
), [
|
|
262
|
-
|
|
263
|
-
if (!o ||
|
|
264
|
-
|
|
256
|
+
[w.lines]
|
|
257
|
+
), [lt, dt] = A([]);
|
|
258
|
+
B(() => {
|
|
259
|
+
if (!o || j.length === 0) {
|
|
260
|
+
dt([]);
|
|
265
261
|
return;
|
|
266
262
|
}
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
const t = vt(l);
|
|
264
|
+
if (!t)
|
|
265
|
+
return;
|
|
266
|
+
let a = !1;
|
|
267
|
+
return (async () => {
|
|
269
268
|
try {
|
|
270
|
-
const
|
|
271
|
-
|
|
269
|
+
const r = await _t(
|
|
270
|
+
yt,
|
|
272
271
|
{
|
|
273
272
|
storeSlug: o,
|
|
274
|
-
schedule:
|
|
275
|
-
|
|
276
|
-
endDate: s.end_date,
|
|
277
|
-
startTime: s.start_time,
|
|
278
|
-
endTime: s.end_time
|
|
279
|
-
},
|
|
280
|
-
products: G
|
|
273
|
+
schedule: t,
|
|
274
|
+
products: j
|
|
281
275
|
}
|
|
282
|
-
),
|
|
283
|
-
if (
|
|
284
|
-
|
|
285
|
-
} catch (
|
|
286
|
-
if (
|
|
287
|
-
console.error("Failed to load storefront cart availability",
|
|
288
|
-
} finally {
|
|
289
|
-
t || Y(!1);
|
|
276
|
+
), g = St.parse(r);
|
|
277
|
+
if (a) return;
|
|
278
|
+
dt(g.success ? g.availability ?? [] : []);
|
|
279
|
+
} catch (r) {
|
|
280
|
+
if (a) return;
|
|
281
|
+
console.error("Failed to load storefront cart availability", r);
|
|
290
282
|
}
|
|
291
283
|
})(), () => {
|
|
292
|
-
|
|
284
|
+
a = !0;
|
|
293
285
|
};
|
|
294
286
|
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
287
|
+
l.end_date,
|
|
288
|
+
l.end_time,
|
|
289
|
+
l.start_date,
|
|
290
|
+
l.start_time,
|
|
291
|
+
j,
|
|
300
292
|
o
|
|
301
293
|
]);
|
|
302
|
-
const
|
|
303
|
-
|
|
294
|
+
const ct = p(() => new Map(
|
|
295
|
+
lt.map((t) => [
|
|
304
296
|
h(t.productId, t.productVariantId),
|
|
305
297
|
t
|
|
306
298
|
])
|
|
307
|
-
), [
|
|
299
|
+
), [lt]), mt = p(
|
|
308
300
|
() => ({
|
|
309
|
-
...
|
|
310
|
-
lines:
|
|
311
|
-
const a =
|
|
301
|
+
...w,
|
|
302
|
+
lines: w.lines.map((t) => {
|
|
303
|
+
const a = ct.get(h(t.checkoutProductId, t.productVariantId)), r = a ? Tt(a) : t.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
312
304
|
return {
|
|
313
305
|
...t,
|
|
314
|
-
insufficientCapacity:
|
|
315
|
-
availabilityIssue:
|
|
306
|
+
insufficientCapacity: r !== void 0,
|
|
307
|
+
availabilityIssue: r
|
|
316
308
|
};
|
|
317
309
|
})
|
|
318
310
|
}),
|
|
319
|
-
[
|
|
320
|
-
),
|
|
311
|
+
[ct, w]
|
|
312
|
+
), k = xt(new URLSearchParams(), l).toString(), Et = `/${o ?? ""}${k ? `?${k}` : ""}`, zt = `/${o ?? ""}/booking${k ? `?${k}` : ""}`, q = `/${o ?? ""}/checkout${k ? `?${k}` : ""}`, ut = {
|
|
321
313
|
backTo: `${d.pathname}${d.search}${d.hash}`
|
|
322
|
-
}, [
|
|
323
|
-
const a =
|
|
324
|
-
return a && t.productVariants?.some((r) => r.id === a) ? a :
|
|
325
|
-
},
|
|
326
|
-
const a = new URLSearchParams(
|
|
327
|
-
t?.trim() ? a.set(
|
|
328
|
-
},
|
|
329
|
-
const a =
|
|
330
|
-
a && (
|
|
331
|
-
},
|
|
332
|
-
|
|
314
|
+
}, [Mt, $] = A(null), [Ut, pt] = A({}), G = (t) => {
|
|
315
|
+
const a = Ut[t.id];
|
|
316
|
+
return a && t.productVariants?.some((r) => r.id === a) ? a : x(t);
|
|
317
|
+
}, ft = f.get(X)?.trim() ?? "", b = ft ? nt.find((t) => t.id === ft) ?? null : null, W = (t) => {
|
|
318
|
+
const a = new URLSearchParams(f);
|
|
319
|
+
t?.trim() ? a.set(X, t) : a.delete(X), u(a, { replace: !0 });
|
|
320
|
+
}, jt = (t) => {
|
|
321
|
+
const a = x(t);
|
|
322
|
+
a && (pt((r) => r[t.id] ? r : { ...r, [t.id]: a }), $(t.id));
|
|
323
|
+
}, qt = (t) => {
|
|
324
|
+
x(t) && ($(null), W(t.id));
|
|
333
325
|
}, R = (t, a, r = 1) => {
|
|
334
|
-
|
|
326
|
+
E({
|
|
335
327
|
kind: t.kind,
|
|
336
|
-
productId: t
|
|
328
|
+
productId: K(t),
|
|
337
329
|
...a ? { productVariantId: a } : {},
|
|
338
330
|
quantity: r
|
|
339
331
|
});
|
|
340
|
-
},
|
|
341
|
-
const a =
|
|
332
|
+
}, Gt = (t) => {
|
|
333
|
+
const a = x(t), r = t.productVariants ?? [];
|
|
342
334
|
if (a && r.length <= 1) {
|
|
343
335
|
R(t, a);
|
|
344
336
|
return;
|
|
345
337
|
}
|
|
346
|
-
|
|
347
|
-
},
|
|
348
|
-
const a = t.productVariants ?? [], r =
|
|
338
|
+
qt(t);
|
|
339
|
+
}, Wt = (t) => {
|
|
340
|
+
const a = t.productVariants ?? [], r = G(t);
|
|
349
341
|
if (r) {
|
|
350
342
|
if (a.length > 1) {
|
|
351
|
-
|
|
343
|
+
jt(t);
|
|
352
344
|
return;
|
|
353
345
|
}
|
|
354
346
|
R(t, r);
|
|
355
347
|
}
|
|
356
|
-
},
|
|
357
|
-
const a =
|
|
348
|
+
}, Qt = (t) => {
|
|
349
|
+
const a = G(t);
|
|
358
350
|
a && (R(t, a), $((r) => r === t.id ? null : r));
|
|
359
351
|
};
|
|
360
352
|
return /* @__PURE__ */ c("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: [
|
|
361
353
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-4", children: [
|
|
362
|
-
/* @__PURE__ */ i(
|
|
354
|
+
/* @__PURE__ */ i(Se, { currentStep: "booking", bookingPath: zt, checkoutPath: q, checkoutEnabled: I > 0 }),
|
|
363
355
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-3", children: [
|
|
364
|
-
/* @__PURE__ */ c(
|
|
365
|
-
/* @__PURE__ */ i(
|
|
356
|
+
/* @__PURE__ */ c(Q, { to: Et, className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950", children: [
|
|
357
|
+
/* @__PURE__ */ i(ne, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
366
358
|
/* @__PURE__ */ i("span", { children: e("back_to_home") })
|
|
367
359
|
] }),
|
|
368
|
-
/* @__PURE__ */ i(
|
|
369
|
-
/* @__PURE__ */ i(
|
|
360
|
+
/* @__PURE__ */ i(Q, { to: q, className: tt(I > 0 ? "inline-flex" : "hidden"), children: /* @__PURE__ */ c(F, { size: "sm", className: "gap-2", children: [
|
|
361
|
+
/* @__PURE__ */ i(re, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
370
362
|
/* @__PURE__ */ i("span", { children: e("checkout_button") })
|
|
371
363
|
] }) })
|
|
372
364
|
] }),
|
|
373
365
|
/* @__PURE__ */ c("div", { className: "grid gap-6 lg:grid-cols-12", children: [
|
|
374
366
|
/* @__PURE__ */ i("div", { className: "lg:col-span-8", children: /* @__PURE__ */ c("div", { className: "space-y-6", children: [
|
|
375
367
|
/* @__PURE__ */ c("div", { className: "space-y-3", children: [
|
|
376
|
-
/* @__PURE__ */ i(
|
|
368
|
+
/* @__PURE__ */ i(J, { stepNumber: 1, title: e("booking_summary_title") }),
|
|
377
369
|
/* @__PURE__ */ i(
|
|
378
|
-
|
|
370
|
+
ke,
|
|
379
371
|
{
|
|
380
|
-
...
|
|
372
|
+
...Kt,
|
|
381
373
|
className: "gap-3",
|
|
382
374
|
labelClassName: "text-xs font-medium text-slate-700",
|
|
383
375
|
inputClassName: "h-10"
|
|
384
376
|
}
|
|
385
377
|
),
|
|
386
378
|
/* @__PURE__ */ i(
|
|
387
|
-
|
|
379
|
+
Ie,
|
|
388
380
|
{
|
|
389
|
-
value:
|
|
390
|
-
onValueChange: (t) =>
|
|
391
|
-
pickupAddress:
|
|
392
|
-
deliveryEnabled:
|
|
393
|
-
deliveryDisabledReason:
|
|
394
|
-
startAddress:
|
|
395
|
-
onStartAddressChange: (t) =>
|
|
396
|
-
endAddress:
|
|
397
|
-
onEndAddressChange: (t) =>
|
|
381
|
+
value: l.fulfillment,
|
|
382
|
+
onValueChange: (t) => S({ fulfillment: t }),
|
|
383
|
+
pickupAddress: $t,
|
|
384
|
+
deliveryEnabled: L,
|
|
385
|
+
deliveryDisabledReason: Lt,
|
|
386
|
+
startAddress: l.start_address,
|
|
387
|
+
onStartAddressChange: (t) => S({ start_address: t }),
|
|
388
|
+
endAddress: l.end_address,
|
|
389
|
+
onEndAddressChange: (t) => S({ end_address: t }),
|
|
398
390
|
testIdPrefix: "storefront-booking-fulfillment"
|
|
399
391
|
}
|
|
400
392
|
)
|
|
401
393
|
] }),
|
|
402
394
|
/* @__PURE__ */ c("div", { id: "booking-products", className: "space-y-2 scroll-mt-32", children: [
|
|
403
|
-
/* @__PURE__ */ i(
|
|
395
|
+
/* @__PURE__ */ i(J, { stepNumber: 2, title: e("products_title") }),
|
|
404
396
|
/* @__PURE__ */ i("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ i("span", { children: e("products_description") }) })
|
|
405
397
|
] }),
|
|
406
|
-
/* @__PURE__ */ i("div", { className: "grid gap-4 md:grid-cols-2", children:
|
|
407
|
-
const a =
|
|
398
|
+
/* @__PURE__ */ i("div", { className: "grid gap-4 md:grid-cols-2", children: nt.map((t) => {
|
|
399
|
+
const a = `/${o ?? ""}/products/${t.slug}`, g = !!x(t) || ot(t);
|
|
408
400
|
return /* @__PURE__ */ i(
|
|
409
|
-
|
|
401
|
+
xe,
|
|
410
402
|
{
|
|
411
403
|
bike: t,
|
|
412
|
-
detailsPath:
|
|
413
|
-
productDetailsLinkState:
|
|
404
|
+
detailsPath: a,
|
|
405
|
+
productDetailsLinkState: ut,
|
|
414
406
|
actionLabelKey: "add_to_cart",
|
|
415
|
-
onAction: () =>
|
|
416
|
-
actionDisabled: !
|
|
417
|
-
availabilityLabel: et,
|
|
407
|
+
onAction: () => Gt(t),
|
|
408
|
+
actionDisabled: !g,
|
|
418
409
|
fallbackLanguage: m,
|
|
410
|
+
variant: "booking",
|
|
419
411
|
testId: `storefront-booking-bike-card-${t.id}`.toLowerCase()
|
|
420
412
|
},
|
|
421
413
|
t.id
|
|
422
414
|
);
|
|
423
415
|
}) }),
|
|
424
416
|
/* @__PURE__ */ c("div", { className: "space-y-2 pt-4", children: [
|
|
425
|
-
/* @__PURE__ */ i(
|
|
417
|
+
/* @__PURE__ */ i(J, { stepNumber: 3, title: e("accessories_title") }),
|
|
426
418
|
/* @__PURE__ */ i("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ i("span", { children: e("accessories_description") }) })
|
|
427
419
|
] }),
|
|
428
|
-
/* @__PURE__ */ i("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children:
|
|
429
|
-
const a =
|
|
420
|
+
/* @__PURE__ */ i("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: N.map((t) => {
|
|
421
|
+
const a = H(t.name, n.language, m), r = H(t.description, n.language, m), g = H(t.warning, n.language, m), gt = typeof t.images?.[0] == "string" ? t.images[0].trim() : "", ht = ye(t.primaryImageStyle), Yt = `/${o ?? ""}/products/${t.slug}`, Ht = x(t), bt = G(t), Jt = Pt(t, P), Xt = Y(Jt) === "OUT_OF_STOCK", Zt = !!Ht || ot(t);
|
|
430
422
|
return /* @__PURE__ */ i(
|
|
431
|
-
|
|
423
|
+
ce,
|
|
432
424
|
{
|
|
433
|
-
className: "border-slate-200 bg-white shadow-sm",
|
|
434
|
-
children: /* @__PURE__ */ c("div", { className: "flex flex-col gap-2 p-3", children: [
|
|
435
|
-
/* @__PURE__ */
|
|
425
|
+
className: "h-full border-slate-200 bg-white shadow-sm",
|
|
426
|
+
children: /* @__PURE__ */ c("div", { className: "flex h-full flex-col gap-2 p-3", children: [
|
|
427
|
+
/* @__PURE__ */ c(
|
|
436
428
|
"div",
|
|
437
429
|
{
|
|
438
|
-
className:
|
|
439
|
-
style:
|
|
440
|
-
children:
|
|
430
|
+
className: tt("relative aspect-[1618/1000] overflow-hidden rounded-xl", ht.className),
|
|
431
|
+
style: ht.style,
|
|
432
|
+
children: [
|
|
433
|
+
gt ? /* @__PURE__ */ i("img", { src: gt, alt: a, className: "absolute inset-0 h-full w-full object-contain p-1", loading: "lazy" }) : /* @__PURE__ */ i("div", { className: "absolute inset-0 flex items-center justify-center text-slate-400", children: /* @__PURE__ */ i(oe, { className: "h-8 w-8", "aria-hidden": "true" }) }),
|
|
434
|
+
Xt ? /* @__PURE__ */ i(
|
|
435
|
+
Ot,
|
|
436
|
+
{
|
|
437
|
+
variant: "destructive",
|
|
438
|
+
className: "pointer-events-none absolute right-2 top-2 shadow-sm",
|
|
439
|
+
children: /* @__PURE__ */ i("span", { children: e("availability_out_of_stock") })
|
|
440
|
+
}
|
|
441
|
+
) : null
|
|
442
|
+
]
|
|
441
443
|
}
|
|
442
444
|
),
|
|
443
445
|
/* @__PURE__ */ c("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
444
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
|
|
447
|
+
/* @__PURE__ */ i("p", { className: "min-w-0 text-sm font-semibold text-slate-950", children: /* @__PURE__ */ i("span", { children: a }) }),
|
|
448
|
+
/* @__PURE__ */ i(Ce, { prices: t.prices, className: "shrink-0" })
|
|
449
|
+
] }),
|
|
445
450
|
/* @__PURE__ */ i("p", { className: "line-clamp-2 text-xs text-slate-600", children: /* @__PURE__ */ i("span", { children: r }) }),
|
|
446
|
-
/* @__PURE__ */ i(
|
|
447
|
-
] }),
|
|
448
|
-
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
449
|
-
/* @__PURE__ */ i(Kt, { variant: at === "OUT_OF_STOCK" ? "destructive" : at === "LOW_STOCK" ? "outline" : "secondary", children: /* @__PURE__ */ i("span", { children: ae }) }),
|
|
450
|
-
/* @__PURE__ */ i(we, { prices: t.prices })
|
|
451
|
+
/* @__PURE__ */ i(Pe, { warning: g, className: "mt-1" })
|
|
451
452
|
] }),
|
|
452
|
-
t.productVariants?.length && t.productVariants.length > 1 &&
|
|
453
|
-
|
|
453
|
+
t.productVariants?.length && t.productVariants.length > 1 && Mt === t.id && bt ? /* @__PURE__ */ i(
|
|
454
|
+
De,
|
|
454
455
|
{
|
|
455
456
|
product: t,
|
|
456
|
-
selectedVariantId:
|
|
457
|
-
onSelect: (
|
|
458
|
-
onConfirm: () =>
|
|
459
|
-
onCancel: () => $((
|
|
460
|
-
getVariantAvailabilityLabel: (
|
|
461
|
-
isVariantOutOfCapacity: (
|
|
457
|
+
selectedVariantId: bt,
|
|
458
|
+
onSelect: (_) => pt((te) => ({ ...te, [t.id]: _ })),
|
|
459
|
+
onConfirm: () => Qt(t),
|
|
460
|
+
onCancel: () => $((_) => _ === t.id ? null : _),
|
|
461
|
+
getVariantAvailabilityLabel: (_) => st(t, _),
|
|
462
|
+
isVariantOutOfCapacity: (_) => rt(t, _)
|
|
462
463
|
}
|
|
463
464
|
) : null,
|
|
464
|
-
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
465
|
+
/* @__PURE__ */ c("div", { className: "mt-auto flex items-center gap-2", children: [
|
|
465
466
|
/* @__PURE__ */ i(
|
|
466
|
-
|
|
467
|
+
Q,
|
|
467
468
|
{
|
|
468
|
-
to:
|
|
469
|
-
state:
|
|
469
|
+
to: Yt,
|
|
470
|
+
state: ut,
|
|
470
471
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
471
472
|
children: /* @__PURE__ */ i("span", { children: e("product_details_link") })
|
|
472
473
|
}
|
|
473
474
|
),
|
|
474
475
|
/* @__PURE__ */ c(
|
|
475
|
-
|
|
476
|
+
F,
|
|
476
477
|
{
|
|
477
478
|
type: "button",
|
|
478
479
|
size: "sm",
|
|
479
480
|
className: "ml-auto rounded-full gap-2",
|
|
480
|
-
onClick: () =>
|
|
481
|
-
disabled: !
|
|
481
|
+
onClick: () => Wt(t),
|
|
482
|
+
disabled: !Zt,
|
|
482
483
|
children: [
|
|
483
484
|
/* @__PURE__ */ i("span", { children: e("add_to_cart") }),
|
|
484
|
-
/* @__PURE__ */ i(
|
|
485
|
+
/* @__PURE__ */ i(At, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
485
486
|
]
|
|
486
487
|
}
|
|
487
488
|
)
|
|
@@ -493,35 +494,35 @@ function ua() {
|
|
|
493
494
|
}) })
|
|
494
495
|
] }) }),
|
|
495
496
|
/* @__PURE__ */ i("div", { className: "lg:col-span-4", children: /* @__PURE__ */ i(
|
|
496
|
-
|
|
497
|
+
Ne,
|
|
497
498
|
{
|
|
498
|
-
lines:
|
|
499
|
-
itemCount:
|
|
500
|
-
totalPerDayMinor:
|
|
501
|
-
checkoutPath:
|
|
499
|
+
lines: mt.lines,
|
|
500
|
+
itemCount: I,
|
|
501
|
+
totalPerDayMinor: mt.totalPerDayMinor,
|
|
502
|
+
checkoutPath: q,
|
|
502
503
|
showCheckoutAction: !0,
|
|
503
504
|
showClearAction: !0,
|
|
504
505
|
editable: !0,
|
|
505
506
|
stickyTopClassName: "top-32",
|
|
506
|
-
onQuantityChange:
|
|
507
|
-
onRemove:
|
|
508
|
-
onClear:
|
|
507
|
+
onQuantityChange: D,
|
|
508
|
+
onRemove: z,
|
|
509
|
+
onClear: O
|
|
509
510
|
}
|
|
510
511
|
) })
|
|
511
512
|
] })
|
|
512
513
|
] }),
|
|
513
514
|
/* @__PURE__ */ i(
|
|
514
|
-
|
|
515
|
+
Ve,
|
|
515
516
|
{
|
|
516
|
-
open: !!
|
|
517
|
-
product:
|
|
517
|
+
open: !!b,
|
|
518
|
+
product: b,
|
|
518
519
|
onOpenChange: (t) => {
|
|
519
|
-
t ||
|
|
520
|
+
t || W(null);
|
|
520
521
|
},
|
|
521
|
-
getVariantAvailabilityLabel: (t) =>
|
|
522
|
-
isVariantOutOfCapacity: (t) =>
|
|
522
|
+
getVariantAvailabilityLabel: (t) => b ? st(b, t) : null,
|
|
523
|
+
isVariantOutOfCapacity: (t) => b ? rt(b, t) : !1,
|
|
523
524
|
onAddVariant: (t, a) => {
|
|
524
|
-
|
|
525
|
+
b && (R(b, t, a), W(null));
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
)
|