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