@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.
Files changed (63) hide show
  1. package/dist/StorefrontContext.d.ts +483 -0
  2. package/dist/StorefrontContext.d.ts.map +1 -0
  3. package/dist/StorefrontContext.js +39 -0
  4. package/dist/StorefrontProvider.d.ts +6 -486
  5. package/dist/StorefrontProvider.d.ts.map +1 -1
  6. package/dist/StorefrontProvider.js +34 -67
  7. package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-DOH1GYVR.js} +1 -0
  8. package/dist/components/AboutSection/index.js +5 -5
  9. package/dist/components/BikeProductCard/index.d.ts +2 -1
  10. package/dist/components/BikeProductCard/index.d.ts.map +1 -1
  11. package/dist/components/BikeProductCard/index.js +28 -28
  12. package/dist/components/BookingBikeQuickAddCard/index.d.ts +19 -0
  13. package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -0
  14. package/dist/components/BookingBikeQuickAddCard/index.js +174 -0
  15. package/dist/components/BookingBikeVariantDialog/index.d.ts +5 -2
  16. package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
  17. package/dist/components/BookingBikeVariantDialog/index.js +85 -93
  18. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  19. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  20. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  21. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  22. package/dist/components/ContactSection/index.js +107 -107
  23. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  24. package/dist/components/ContractSaleDocument/Invoice.js +117 -111
  25. package/dist/components/Header/index.js +4 -4
  26. package/dist/components/Layout/index.d.ts.map +1 -1
  27. package/dist/components/Layout/index.js +47 -40
  28. package/dist/components/PlatformFooter/index.js +1 -1
  29. package/dist/components/ProductPriceBadge/index.d.ts +2 -1
  30. package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
  31. package/dist/components/ProductPriceBadge/index.js +72 -70
  32. package/dist/components/TestimonialsSection/index.js +1 -1
  33. package/dist/i18n/en.d.ts +3 -0
  34. package/dist/i18n/en.d.ts.map +1 -1
  35. package/dist/i18n/en.js +3 -0
  36. package/dist/i18n/fr.d.ts +3 -0
  37. package/dist/i18n/fr.d.ts.map +1 -1
  38. package/dist/i18n/fr.js +3 -0
  39. package/dist/index.d.ts +19 -2
  40. package/dist/index.js +59 -58
  41. package/dist/lib/cartSummary.js +7 -7
  42. package/dist/lib/products.d.ts +6 -0
  43. package/dist/lib/products.d.ts.map +1 -1
  44. package/dist/lib/products.js +36 -32
  45. package/dist/lib/toast.d.ts +9 -0
  46. package/dist/lib/toast.d.ts.map +1 -0
  47. package/dist/lib/toast.js +13 -0
  48. package/dist/pages/BookingPage.d.ts.map +1 -1
  49. package/dist/pages/BookingPage.js +323 -396
  50. package/dist/pages/CheckoutPage.js +217 -217
  51. package/dist/pages/CheckoutPaymentPage.js +124 -124
  52. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  53. package/dist/pages/ContractSaleDocumentPage.js +83 -83
  54. package/dist/pages/ErrorPage.d.ts.map +1 -1
  55. package/dist/pages/ErrorPage.js +13 -13
  56. package/dist/pages/HomePage.js +6 -3
  57. package/dist/pages/NotFoundPage.js +1 -1
  58. package/dist/pages/ProductPage.d.ts.map +1 -1
  59. package/dist/pages/ProductPage.js +177 -165
  60. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
  61. package/dist/storefront.css +1 -1
  62. package/dist/ui/button.js +3 -3
  63. 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 { 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 { 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 D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e.getFullYear()}-${D(e.getMonth() + 1)}-${D(e.getDate())}`, Oe = (e) => {
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
- }, 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) => {
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
- }, Ae = (e, t) => e.fulfillment === "delivery" && !t ? {
44
+ }, ze = (e, t) => e.fulfillment === "delivery" && !t ? {
43
45
  ...e,
44
46
  fulfillment: "pickup"
45
- } : e, je = (e, t) => {
46
- let n = c(e), r = e.representedVariantId?.trim();
47
+ } : e, Be = (e, t) => {
48
+ let n = s(e), r = e.representedVariantId?.trim();
47
49
  if (r) {
48
- let e = t.get(p(n, r));
50
+ let e = t.get(c(n, r));
49
51
  if (e) return e;
50
52
  }
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);
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
- }, Pe = (e) => {
57
+ }, Ue = (e) => {
56
58
  let t = /* @__PURE__ */ new Map();
57
59
  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), {
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(p(e, r), {
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 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) => {
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
- ...I,
88
+ ...M,
153
89
  ...e
154
- }, r = Ae(n(R, t), L);
155
- return ke(e, r) ? e : r;
90
+ }, r = ze(n(P, t), N);
91
+ return Re(e, r) ? e : r;
156
92
  });
157
93
  }, [
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
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() !== N.toString() && P(t, { replace: !0 });
104
+ t.toString() !== k.toString() && A(t, { replace: !0 });
169
105
  }, [
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
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
- z,
184
- H,
185
- V,
186
- v
119
+ F,
120
+ R,
121
+ L,
122
+ C
187
123
  ]);
188
- let U = x(() => Pe([...j, ...M]), [M, j]), [Ze, W] = S([]);
189
- b(() => {
190
- if (!v || U.length === 0) {
191
- W([]);
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 = B ? h(z) : null;
130
+ let e = I ? u(F) : null;
195
131
  if (!e) {
196
- W([]);
132
+ B([]);
197
133
  return;
198
134
  }
199
135
  let t = !1;
200
136
  return (async () => {
201
137
  try {
202
- let n = await he(f, {
203
- storeSlug: v,
138
+ let n = await be(re, {
139
+ storeSlug: C,
204
140
  schedule: e,
205
- products: U
206
- }), r = ne.parse(n);
141
+ products: z
142
+ }), r = oe.parse(n);
207
143
  if (t) return;
208
- W(r.success ? r.availability ?? [] : []);
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
- U,
218
- z.end_date,
219
- z.end_time,
220
- z.start_date,
221
- z.start_time,
222
- B,
223
- v
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 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);
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 ? m(t) : e.availabilityStatus ?? "AVAILABLE"
171
+ availabilityStatus: t ? l(t) : "AVAILABLE"
230
172
  };
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) => {
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 ke(t, n) ? t : n;
197
+ return Re(t, n) ? t : n;
256
198
  });
257
- }, it = {
258
- startDate: Oe(z.start_date),
199
+ }, ft = {
200
+ startDate: b(F.start_date),
259
201
  onStartDateChange: (e) => {
260
- e && K({ start_date: De(e) });
202
+ e && U({ start_date: Le(e) });
261
203
  },
262
- startTime: z.start_time,
263
- onStartTimeChange: (e) => K({ start_time: e }),
264
- endDate: Oe(z.end_date) ?? Oe(z.start_date),
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 && K({ end_date: De(e) });
208
+ e && U({ end_date: Le(e) });
267
209
  },
268
- endTime: z.end_time,
269
- onEndTimeChange: (e) => K({ end_time: e }),
270
- bookingPeriodConfig: Ue,
271
- fetchTimeSlots: nt,
210
+ endTime: F.end_time,
211
+ onEndTimeChange: (e) => U({ end_time: e }),
212
+ bookingPeriodConfig: Ze,
213
+ fetchTimeSlots: ut,
272
214
  onTimeSlotsConfirmationChange: (e) => {
273
- Je(e ? Ye : void 0);
215
+ nt(e ? rt : void 0);
274
216
  },
275
- labels: rt,
276
- localeCode: s.language
277
- }, q = x(() => d({
278
- items: Re,
279
- language: s.language,
280
- fallbackLanguage: A,
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: Ie,
283
- accessories: Le
224
+ bikes: Ge,
225
+ accessories: Ke
284
226
  }
285
227
  }), [
286
- Le,
287
- Ie,
288
- s.language,
289
- Re,
290
- A
291
- ]), J = x(() => q.lines.map((e) => ({
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
- })), [q.lines]), [at, ot] = S([]);
296
- b(() => {
297
- if (!v || J.length === 0) {
298
- ot([]);
237
+ })), [W.lines]), [pt, K] = m([]);
238
+ f(() => {
239
+ if (!C || G.length === 0) {
240
+ K([]);
299
241
  return;
300
242
  }
301
- let e = B ? h(z) : null;
243
+ let e = I ? u(F) : null;
302
244
  if (!e) {
303
- ot([]);
245
+ K([]);
304
246
  return;
305
247
  }
306
248
  let t = !1;
307
249
  return (async () => {
308
250
  try {
309
- let n = await he(f, {
310
- storeSlug: v,
251
+ let n = await be(re, {
252
+ storeSlug: C,
311
253
  schedule: e,
312
- products: J
313
- }), r = ne.parse(n);
254
+ products: G
255
+ }), r = oe.parse(n);
314
256
  if (t) return;
315
- ot(r.success ? r.availability ?? [] : []);
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
- z.end_date,
325
- z.end_time,
326
- z.start_date,
327
- z.start_time,
328
- B,
329
- J,
330
- v
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 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;
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
- }), [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));
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
- X && ze({
294
+ if (!J) return;
295
+ let r = Math.max(1, Math.floor(n));
296
+ Je({
362
297
  kind: e.kind,
363
- productId: c(e),
298
+ productId: s(e),
364
299
  ...t ? { productVariantId: t } : {},
365
- quantity: n
366
- });
367
- }, xt = (e) => {
368
- let t = k(e), n = e.productVariants ?? [];
369
- if (t && n.length <= 1) {
370
- $(e, t);
371
- return;
372
- }
373
- bt(e);
374
- }, St = (e) => {
375
- let t = e.productVariants ?? [], n = gt(e);
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
- yt(e);
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__ */ w("div", {
322
+ return /* @__PURE__ */ g("div", {
388
323
  className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
389
- children: [/* @__PURE__ */ w("div", {
324
+ children: [/* @__PURE__ */ g("div", {
390
325
  className: "flex flex-col gap-4",
391
326
  children: [
392
- /* @__PURE__ */ C(ae, {
327
+ /* @__PURE__ */ h(de, {
393
328
  currentStep: "booking",
394
- bookingPath: ut,
395
- checkoutPath: dt,
396
- checkoutEnabled: F > 0 && X
329
+ bookingPath: _t,
330
+ checkoutPath: Y,
331
+ checkoutEnabled: j > 0 && J
397
332
  }),
398
- /* @__PURE__ */ w("div", {
333
+ /* @__PURE__ */ g("div", {
399
334
  className: "flex items-center justify-between gap-3",
400
- children: [/* @__PURE__ */ w(T, {
401
- to: lt,
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__ */ C(Ce, {
338
+ children: [/* @__PURE__ */ h(Me, {
404
339
  className: "h-4 w-4",
405
340
  "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, {
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__ */ C(Ee, {
348
+ children: [/* @__PURE__ */ h(Fe, {
414
349
  className: "h-4 w-4",
415
350
  "aria-hidden": "true"
416
- }), /* @__PURE__ */ C("span", { children: o("checkout_button") })]
351
+ }), /* @__PURE__ */ h("span", { children: v("checkout_button") })]
417
352
  })
418
353
  })]
419
354
  }),
420
- /* @__PURE__ */ w("div", {
355
+ /* @__PURE__ */ g("div", {
421
356
  className: "grid gap-6 lg:grid-cols-12",
422
- children: [/* @__PURE__ */ C("div", {
357
+ children: [/* @__PURE__ */ h("div", {
423
358
  className: "lg:col-span-8",
424
- children: /* @__PURE__ */ w("div", {
359
+ children: /* @__PURE__ */ g("div", {
425
360
  className: "space-y-6",
426
361
  children: [
427
- /* @__PURE__ */ w("div", {
362
+ /* @__PURE__ */ g("div", {
428
363
  className: "space-y-3",
429
364
  children: [
430
- /* @__PURE__ */ C(_, {
365
+ /* @__PURE__ */ h(d, {
431
366
  stepNumber: 1,
432
- title: o("booking_summary_title")
367
+ title: v("booking_summary_title")
433
368
  }),
434
- /* @__PURE__ */ C(ie, {
435
- ...it,
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__ */ 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 }),
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__ */ w("div", {
389
+ /* @__PURE__ */ g("div", {
390
+ ref: We,
455
391
  id: "booking-products",
456
392
  className: "space-y-2 scroll-mt-32",
457
- children: [/* @__PURE__ */ C(_, {
393
+ children: [/* @__PURE__ */ h(d, {
458
394
  stepNumber: 2,
459
- title: o("products_title")
460
- }), /* @__PURE__ */ C("p", {
395
+ title: v("products_title")
396
+ }), /* @__PURE__ */ h("p", {
461
397
  className: "text-sm text-slate-600",
462
- children: /* @__PURE__ */ C("span", { children: o("products_description") })
398
+ children: /* @__PURE__ */ h("span", { children: v("products_description") })
463
399
  })]
464
400
  }),
465
- /* @__PURE__ */ C("div", {
401
+ /* @__PURE__ */ h("div", {
466
402
  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, {
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: t,
472
- productDetailsLinkState: ft,
473
- actionLabelKey: "add_to_cart",
474
- onAction: () => xt(e),
475
- actionDisabled: !n || !X,
476
- fallbackLanguage: A,
477
- variant: "booking",
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__ */ w("div", {
422
+ /* @__PURE__ */ g("div", {
483
423
  className: "space-y-2 pt-4",
484
- children: [/* @__PURE__ */ C(_, {
424
+ children: [/* @__PURE__ */ h(d, {
485
425
  stepNumber: 3,
486
- title: o("accessories_title")
487
- }), /* @__PURE__ */ C("p", {
426
+ title: v("accessories_title")
427
+ }), /* @__PURE__ */ h("p", {
488
428
  className: "text-sm text-slate-600",
489
- children: /* @__PURE__ */ C("span", { children: o("accessories_description") })
429
+ children: /* @__PURE__ */ h("span", { children: v("accessories_description") })
490
430
  })]
491
431
  }),
492
- /* @__PURE__ */ C("div", {
432
+ /* @__PURE__ */ h("div", {
493
433
  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", {
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__ */ w("div", {
502
- className: E("relative aspect-[1618/1000] overflow-hidden rounded-xl", a.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__ */ C("img", {
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__ */ C("div", {
450
+ }) : /* @__PURE__ */ h("div", {
510
451
  className: "absolute inset-0 flex items-center justify-center text-slate-400",
511
- children: /* @__PURE__ */ C(Te, {
452
+ children: /* @__PURE__ */ h(Ne, {
512
453
  className: "h-8 w-8",
513
454
  "aria-hidden": "true"
514
455
  })
515
- }), f ? /* @__PURE__ */ C(re, {
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__ */ C("span", { children: o("availability_out_of_stock") })
459
+ children: /* @__PURE__ */ h("span", { children: v("availability_out_of_stock") })
519
460
  }) : null]
520
461
  }),
521
- /* @__PURE__ */ w("div", {
462
+ /* @__PURE__ */ g("div", {
522
463
  className: "flex flex-1 flex-col gap-1",
523
464
  children: [
524
- /* @__PURE__ */ w("div", {
465
+ /* @__PURE__ */ g("div", {
525
466
  className: "flex items-start justify-between gap-2",
526
- children: [/* @__PURE__ */ C("p", {
467
+ children: [/* @__PURE__ */ h("p", {
527
468
  className: "min-w-0 text-sm font-semibold text-slate-950",
528
- children: /* @__PURE__ */ C("span", { children: t })
529
- }), /* @__PURE__ */ C(fe, {
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__ */ C("p", {
476
+ /* @__PURE__ */ h("p", {
535
477
  className: "line-clamp-2 text-xs text-slate-600",
536
- children: /* @__PURE__ */ C("span", { children: n })
478
+ children: /* @__PURE__ */ h("span", { children: n })
537
479
  }),
538
- /* @__PURE__ */ C(ue, {
480
+ /* @__PURE__ */ h(ge, {
539
481
  warning: r,
540
482
  className: "mt-1"
541
483
  })
542
484
  ]
543
485
  }),
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", {
486
+ /* @__PURE__ */ g("div", {
558
487
  className: "mt-auto flex items-center gap-2",
559
- children: [/* @__PURE__ */ C(T, {
560
- to: c,
561
- state: ft,
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__ */ C("span", { children: o("product_details_link") })
564
- }), /* @__PURE__ */ w(g, {
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-full gap-2",
568
- onClick: () => St(e),
569
- disabled: !p || !X,
570
- children: [/* @__PURE__ */ C("span", { children: o("add_to_cart") }), /* @__PURE__ */ C(we, {
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__ */ C("div", {
512
+ }), /* @__PURE__ */ h("div", {
584
513
  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,
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: He,
595
- onRemove: Ve,
596
- onClear: Be
522
+ onQuantityChange: Xe,
523
+ onRemove: Ye
597
524
  })
598
525
  })]
599
526
  })
600
527
  ]
601
- }), /* @__PURE__ */ C(ve, {
602
- open: !!Q,
603
- product: Q,
528
+ }), /* @__PURE__ */ h(we, {
529
+ open: !!Z,
530
+ product: Z,
604
531
  onOpenChange: (e) => {
605
- e || vt(null);
532
+ e || Q(null);
606
533
  },
607
- getVariantAvailabilityLabel: (e) => Q ? tt(Q, e) : null,
608
- isVariantOutOfCapacity: (e) => Q ? $e(Q, e) : !1,
609
- addDisabled: !X,
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
- Q && ($(Q, e, t), vt(null));
538
+ Z && ($(Z, e, t), Q(null));
612
539
  }
613
540
  })]
614
541
  });
615
542
  }
616
543
  //#endregion
617
- export { A as default };
544
+ export { S as default };