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