@loczer/storefront-sdk 0.214.0 → 0.216.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 (28) hide show
  1. package/dist/components/BookingBikeQuickAddCard/index.js +1 -1
  2. package/dist/components/BookingBikeVariantDialog/index.js +1 -1
  3. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
  4. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +82 -83
  5. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts +5 -1
  6. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts.map +1 -1
  7. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +135 -149
  8. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
  9. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +34 -35
  10. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  11. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +233 -228
  12. package/dist/components/ContactSection/index.js +1 -1
  13. package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -1
  14. package/dist/components/payment/StripeCardFieldsForm.js +43 -33
  15. package/dist/index.d.ts +5 -1
  16. package/dist/pages/BookingPage.d.ts.map +1 -1
  17. package/dist/pages/BookingPage.js +244 -216
  18. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  19. package/dist/pages/CheckoutPage.js +219 -219
  20. package/dist/pages/HomePage.d.ts.map +1 -1
  21. package/dist/pages/HomePage.js +268 -264
  22. package/dist/pages/ProductPage.d.ts.map +1 -1
  23. package/dist/pages/ProductPage.js +182 -182
  24. package/dist/storefront.css +1 -1
  25. package/dist/ui/drawer.d.ts +1 -0
  26. package/dist/ui/drawer.d.ts.map +1 -1
  27. package/dist/ui/drawer.js +58 -47
  28. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ProductPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductPage.tsx"],"names":[],"mappings":"AA+HA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAqXlC"}
1
+ {"version":3,"file":"ProductPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductPage.tsx"],"names":[],"mappings":"AAgIA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAyXlC"}
@@ -1,293 +1,293 @@
1
- import { getBookingParamsFromSearch as e, resolveBookingSearchParamsFromSessionStorage as t, writeBookingSearchParamsToSessionStorage as n } from "../lib/booking.js";
2
- import { getProductVariantAttributeValue as r, getStorefrontProductVariantDisplay as i } from "../lib/productVariants.js";
1
+ import { getBookingParamsFromSearch as e, pickBookingSearchParams as t, resolveBookingSearchParamsFromSessionStorage as n, writeBookingSearchParamsToSessionStorage as r } from "../lib/booking.js";
2
+ import { getProductVariantAttributeValue as i, getStorefrontProductVariantDisplay as ee } from "../lib/productVariants.js";
3
3
  import { getLocalizedValue as a } from "../localization.js";
4
- import { findStorefrontProductBySlug as o, getStorefrontCheckoutProductId as s, getStorefrontProductSelectionDisplayName as c } from "../lib/products.js";
5
- import { useStorefrontCart as ee } from "../lib/cart.js";
6
- import { getAvailabilityVariant as te } from "../lib/utils.js";
7
- import { ROUTE as ne, buildStorefrontAvailabilityKey as l, getStorefrontAvailabilityIssue as u, getStorefrontAvailabilityStatus as d, getValidStorefrontAvailabilitySchedule as re, isStorefrontAvailabilityInsufficient as ie, responseSchema as ae } from "../lib/storefrontAvailability.js";
8
- import { Badge as f } from "../ui/badge.js";
9
- import { Button as p } from "../ui/button.js";
10
- import { useStorefront as oe, useStorefrontProducts as se } from "../StorefrontContext.js";
11
- import { toast as ce } from "../lib/toast.js";
12
- import { Input as le } from "../ui/input.js";
13
- import { Card as ue } from "../ui/card.js";
14
- import { ProductWarningNotice as de } from "../components/ProductWarningNotice/index.js";
15
- import { ProductPriceBadge as fe } from "../components/ProductPriceBadge/index.js";
16
- import { resolveProductImageContainerStyle as pe } from "../lib/productImageStyles.js";
17
- import { apiPost as me } from "../lib/apiCall.js";
18
- import { RadioGroup as he, RadioGroupItem as ge } from "../ui/radio-group.js";
19
- import { useEffect as m, useMemo as h, useState as g } from "react";
20
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
21
- import { Link as y, useLocation as _e, useNavigate as ve, useParams as ye, useSearchParams as be } from "@rpcbase/router";
22
- import { useTranslation as xe } from "react-i18next";
23
- import { cn as b } from "@rpcbase/ui";
24
- import { ArrowLeft as x, ArrowRight as S, Bike as Se, CheckCircle2 as Ce, Plus as we } from "lucide-react";
4
+ import { findStorefrontProductBySlug as o, getStorefrontCheckoutProductId as s, getStorefrontProductSelectionDisplayName as te } from "../lib/products.js";
5
+ import { useStorefrontCart as ne } from "../lib/cart.js";
6
+ import { getAvailabilityVariant as re } from "../lib/utils.js";
7
+ import { ROUTE as ie, buildStorefrontAvailabilityKey as c, getStorefrontAvailabilityIssue as l, getStorefrontAvailabilityStatus as ae, getValidStorefrontAvailabilitySchedule as oe, isStorefrontAvailabilityInsufficient as u, responseSchema as se } from "../lib/storefrontAvailability.js";
8
+ import { Badge as ce } from "../ui/badge.js";
9
+ import { Button as d } from "../ui/button.js";
10
+ import { useStorefront as le, useStorefrontProducts as ue } from "../StorefrontContext.js";
11
+ import { toast as de } from "../lib/toast.js";
12
+ import { Input as fe } from "../ui/input.js";
13
+ import { Card as pe } from "../ui/card.js";
14
+ import { ProductWarningNotice as me } from "../components/ProductWarningNotice/index.js";
15
+ import { ProductPriceBadge as he } from "../components/ProductPriceBadge/index.js";
16
+ import { resolveProductImageContainerStyle as ge } from "../lib/productImageStyles.js";
17
+ import { apiPost as _e } from "../lib/apiCall.js";
18
+ import { RadioGroup as ve, RadioGroupItem as ye } from "../ui/radio-group.js";
19
+ import { useEffect as f, useMemo as p, useState as m } from "react";
20
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
21
+ import { Link as be, useLocation as xe, useNavigate as Se, useParams as Ce, useSearchParams as we } from "@rpcbase/router";
22
+ import { useTranslation as Te } from "react-i18next";
23
+ import { cn as _ } from "@rpcbase/ui";
24
+ import { ArrowLeft as v, ArrowRight as y, Bike as Ee, CheckCircle2 as De, Plus as Oe } from "lucide-react";
25
25
  //#region src/pages/ProductPage.tsx
26
- var C = (e, t = () => !0) => {
26
+ var b = (e, t = () => !0) => {
27
27
  if (!e) return null;
28
28
  if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
29
29
  let n = e.productVariants ?? [];
30
30
  return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
31
- }, Te = (e, t) => {
31
+ }, ke = (e, t) => {
32
32
  if (!e) return [];
33
33
  let n = s(e), r = /* @__PURE__ */ new Map();
34
- r.set(l(n), {
34
+ r.set(c(n), {
35
35
  productId: n,
36
36
  quantity: t
37
37
  });
38
- for (let i of e.productVariants ?? []) r.set(l(n, i.id), {
38
+ for (let i of e.productVariants ?? []) r.set(c(n, i.id), {
39
39
  productId: n,
40
40
  productVariantId: i.id,
41
41
  quantity: t
42
42
  });
43
43
  let i = e.representedVariantId?.trim();
44
- return i && r.set(l(n, i), {
44
+ return i && r.set(c(n, i), {
45
45
  productId: n,
46
46
  productVariantId: i,
47
47
  quantity: t
48
48
  }), Array.from(r.values());
49
- }, Ee = (e, t) => {
49
+ }, Ae = (e, t) => {
50
50
  let n = s(e), r = e.representedVariantId?.trim();
51
51
  if (r) {
52
- let e = t.get(l(n, r));
52
+ let e = t.get(c(n, r));
53
53
  if (e) return e;
54
54
  }
55
- return t.get(l(n));
56
- }, De = (e, t, n) => n.get(l(s(e), t)), w = (e, t, n) => {
57
- let r = u(t);
55
+ return t.get(c(n));
56
+ }, je = (e, t, n) => n.get(c(s(e), t)), x = (e, t, n) => {
57
+ let r = l(t);
58
58
  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 });
59
- }, Oe = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
60
- function T() {
61
- let { t: u, i18n: T } = xe(), { storeSlug: E, productSlug: D } = ye(), [O] = be(), ke = _e(), Ae = ve(), { addItem: je, itemCount: k } = ee(), { storefrontConfiguration: Me } = oe(), A = Me.workspace?.workspaceLanguage, { bikes: j, accessories: M } = se(), N = h(() => D ? o(D, {
62
- bikes: j,
63
- accessories: M
59
+ }, Me = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
60
+ function S() {
61
+ let { t: l, i18n: S } = Te(), { storeSlug: C, productSlug: w } = Ce(), [Ne] = we(), Pe = xe(), Fe = Se(), { addItem: Ie, itemCount: T } = ne(), { storefrontConfiguration: Le } = le(), E = Le.workspace?.workspaceLanguage, { bikes: D, accessories: O } = ue(), k = p(() => w ? o(w, {
62
+ bikes: D,
63
+ accessories: O
64
64
  }) : null, [
65
- M,
66
- j,
67
- D
68
- ]), P = h(() => t(O, E), [O, E]), F = h(() => e(P, {
65
+ O,
66
+ D,
67
+ w
68
+ ]), A = t(Ne).toString(), j = p(() => n(new URLSearchParams(A), C), [A, C]), M = p(() => e(j, {
69
69
  start_time: "",
70
70
  end_time: ""
71
- }), [P]), I = h(() => re(F), [F]), L = P.toString(), R = `/${E ?? ""}/checkout${L ? `?${L}` : ""}`, z = `/${E ?? ""}`, Ne = z, B = ke.state, Pe = typeof B?.backTo == "string" && B.backTo.startsWith(z) ? B.backTo : Ne, [V, H] = g(1), [U, W] = g(() => C(N)), G = Number.isFinite(V) ? Math.max(1, Math.min(99, Math.floor(V))) : 1, K = h(() => Te(N, G), [G, N]), [q, J] = g([]), [Fe, Y] = g(!1);
72
- m(() => {
73
- if (H(1), !N) {
74
- W(null);
71
+ }), [j]), N = p(() => oe(M), [M]), P = j.toString(), F = `/${C ?? ""}/checkout${P ? `?${P}` : ""}`, I = `/${C ?? ""}`, Re = I, L = Pe.state, ze = typeof L?.backTo == "string" && L.backTo.startsWith(I) ? L.backTo : Re, [R, z] = m(1), [B, V] = m(() => b(k)), H = Number.isFinite(R) ? Math.max(1, Math.min(99, Math.floor(R))) : 1, U = p(() => ke(k, H), [H, k]), [W, G] = m([]), [Be, K] = m(!1);
72
+ f(() => {
73
+ if (z(1), !k) {
74
+ V(null);
75
75
  return;
76
76
  }
77
- W(C(N));
78
- }, [D, N]), m(() => {
79
- n(E, P);
80
- }, [P, E]), m(() => {
81
- if (!E || K.length === 0) {
82
- J([]), Y(!1);
77
+ V(b(k));
78
+ }, [w, k]), f(() => {
79
+ r(C, j);
80
+ }, [j, C]), f(() => {
81
+ if (!C || U.length === 0) {
82
+ G([]), K(!1);
83
83
  return;
84
84
  }
85
- if (!I) {
86
- J([]), Y(!1);
85
+ if (!N) {
86
+ G([]), K(!1);
87
87
  return;
88
88
  }
89
89
  let e = !1;
90
- return Y(!0), J([]), (async () => {
90
+ return K(!0), G([]), (async () => {
91
91
  try {
92
- let t = await me(ne, {
93
- storeSlug: E,
94
- schedule: I,
95
- products: K
96
- }), n = ae.parse(t);
92
+ let t = await _e(ie, {
93
+ storeSlug: C,
94
+ schedule: N,
95
+ products: U
96
+ }), n = se.parse(t);
97
97
  if (e) return;
98
- J(n.success ? n.availability ?? [] : []);
98
+ G(n.success ? n.availability ?? [] : []);
99
99
  } catch (t) {
100
100
  if (e) return;
101
- console.error("Failed to load storefront product availability", t), J([]);
101
+ console.error("Failed to load storefront product availability", t), G([]);
102
102
  } finally {
103
- e || Y(!1);
103
+ e || K(!1);
104
104
  }
105
105
  })(), () => {
106
106
  e = !0;
107
107
  };
108
108
  }, [
109
- K,
110
- I,
111
- F.end_date,
112
- F.end_time,
113
- F.start_date,
114
- F.start_time,
115
- E
109
+ U,
110
+ N,
111
+ M.end_date,
112
+ M.end_time,
113
+ M.start_date,
114
+ M.start_time,
115
+ C
116
116
  ]);
117
- let X = h(() => new Map(q.map((e) => [l(e.productId, e.productVariantId), e])), [q]), Ie = () => {
118
- Ae(Pe);
117
+ let q = p(() => new Map(W.map((e) => [c(e.productId, e.productVariantId), e])), [W]), J = () => {
118
+ Fe(ze);
119
119
  };
120
- if (!N) return /* @__PURE__ */ _("div", {
120
+ if (!k) return /* @__PURE__ */ h("div", {
121
121
  className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
122
- children: /* @__PURE__ */ v("div", {
122
+ children: /* @__PURE__ */ g("div", {
123
123
  className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
124
124
  children: [
125
- /* @__PURE__ */ _("h1", {
125
+ /* @__PURE__ */ h("h1", {
126
126
  className: "text-xl font-semibold tracking-tight text-slate-950",
127
- children: /* @__PURE__ */ _("span", { children: u("product_not_found_title") })
127
+ children: /* @__PURE__ */ h("span", { children: l("product_not_found_title") })
128
128
  }),
129
- /* @__PURE__ */ _("p", {
129
+ /* @__PURE__ */ h("p", {
130
130
  className: "mt-2 text-sm text-slate-600",
131
- children: /* @__PURE__ */ _("span", { children: u("product_not_found_description") })
131
+ children: /* @__PURE__ */ h("span", { children: l("product_not_found_description") })
132
132
  }),
133
- /* @__PURE__ */ _("div", {
133
+ /* @__PURE__ */ h("div", {
134
134
  className: "mt-6",
135
- children: /* @__PURE__ */ v(p, {
135
+ children: /* @__PURE__ */ g(d, {
136
136
  type: "button",
137
137
  className: "gap-2",
138
- onClick: Ie,
139
- children: [/* @__PURE__ */ _(x, {
138
+ onClick: J,
139
+ children: [/* @__PURE__ */ h(v, {
140
140
  className: "h-4 w-4",
141
141
  "aria-hidden": "true"
142
- }), /* @__PURE__ */ _("span", { children: u("go_back") })]
142
+ }), /* @__PURE__ */ h("span", { children: l("go_back") })]
143
143
  })
144
144
  })
145
145
  ]
146
146
  })
147
147
  });
148
- let Z = a(N.name, T.language, A), Le = a(N.description, T.language, A), Re = a(N.warning, T.language, A), ze = typeof N.images?.[0] == "string" ? N.images[0].trim() : "", Be = pe(N.primaryImageStyle), Q = Ee(N, X), Ve = Oe(N), He = Q ? d(Q) : Ve, Ue = te(He), We = Fe ? u("availability_checking") : w(u, Q, He), Ge = Q ? ie(Q) : Ve === "OUT_OF_STOCK", $ = N.productVariants ?? [], Ke = $.some((e) => !!r(e, "size")) ? u("product_size_label") : u("product_variant_label"), qe = !!U && I !== null;
149
- return /* @__PURE__ */ _("div", {
148
+ let Y = a(k.name, S.language, E), Ve = a(k.description, S.language, E), He = a(k.warning, S.language, E), X = typeof k.images?.[0] == "string" ? k.images[0].trim() : "", Z = ge(k.primaryImageStyle), Q = Ae(k, q), Ue = Me(k), We = Q ? ae(Q) : Ue, Ge = re(We), Ke = Be ? l("availability_checking") : x(l, Q, We), qe = Q ? u(Q) : Ue === "OUT_OF_STOCK", $ = k.productVariants ?? [], Je = $.some((e) => !!i(e, "size")) ? l("product_size_label") : l("product_variant_label"), Ye = !!B && N !== null;
149
+ return /* @__PURE__ */ h("div", {
150
150
  className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
151
- children: /* @__PURE__ */ v("div", {
151
+ children: /* @__PURE__ */ g("div", {
152
152
  className: "flex flex-col gap-6",
153
- children: [/* @__PURE__ */ v("div", {
153
+ children: [/* @__PURE__ */ g("div", {
154
154
  className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
155
- children: [/* @__PURE__ */ v(p, {
155
+ children: [/* @__PURE__ */ g(d, {
156
156
  type: "button",
157
157
  variant: "ghost",
158
158
  className: "h-auto justify-start gap-2 self-start px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
159
- onClick: Ie,
160
- children: [/* @__PURE__ */ _(x, {
159
+ onClick: J,
160
+ children: [/* @__PURE__ */ h(v, {
161
161
  className: "h-4 w-4",
162
162
  "aria-hidden": "true"
163
- }), /* @__PURE__ */ _("span", { children: u("go_back") })]
164
- }), /* @__PURE__ */ _(y, {
165
- to: R,
166
- className: b(k > 0 && I ? "inline-flex" : "hidden"),
167
- children: /* @__PURE__ */ v(p, {
163
+ }), /* @__PURE__ */ h("span", { children: l("go_back") })]
164
+ }), /* @__PURE__ */ h(be, {
165
+ to: F,
166
+ className: _(T > 0 && N ? "inline-flex" : "hidden"),
167
+ children: /* @__PURE__ */ g(d, {
168
168
  size: "sm",
169
169
  className: "gap-2",
170
- children: [/* @__PURE__ */ _("span", { children: u("checkout_button") }), /* @__PURE__ */ _(S, {
170
+ children: [/* @__PURE__ */ h("span", { children: l("checkout_button") }), /* @__PURE__ */ h(y, {
171
171
  className: "h-4 w-4",
172
172
  "aria-hidden": "true"
173
173
  })]
174
174
  })
175
175
  })]
176
- }), /* @__PURE__ */ v("div", {
176
+ }), /* @__PURE__ */ g("div", {
177
177
  className: "grid gap-6 lg:grid-cols-12",
178
- children: [/* @__PURE__ */ v("div", {
178
+ children: [/* @__PURE__ */ g("div", {
179
179
  className: "lg:col-span-7",
180
- children: [/* @__PURE__ */ _("div", {
181
- className: b("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Be.className),
182
- style: Be.style,
183
- children: ze ? /* @__PURE__ */ _("img", {
184
- src: ze,
185
- alt: Z,
180
+ children: [/* @__PURE__ */ h("div", {
181
+ className: _("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Z.className),
182
+ style: Z.style,
183
+ children: X ? /* @__PURE__ */ h("img", {
184
+ src: X,
185
+ alt: Y,
186
186
  className: "absolute inset-0 h-full w-full object-contain p-2",
187
187
  loading: "lazy"
188
- }) : /* @__PURE__ */ _("div", {
188
+ }) : /* @__PURE__ */ h("div", {
189
189
  className: "absolute inset-0 flex items-center justify-center text-slate-400",
190
- children: /* @__PURE__ */ _(Se, {
190
+ children: /* @__PURE__ */ h(Ee, {
191
191
  className: "h-12 w-12",
192
192
  "aria-hidden": "true"
193
193
  })
194
194
  })
195
- }), /* @__PURE__ */ v("div", {
195
+ }), /* @__PURE__ */ g("div", {
196
196
  className: "mt-5 flex flex-col gap-3",
197
197
  children: [
198
- /* @__PURE__ */ v("div", {
198
+ /* @__PURE__ */ g("div", {
199
199
  className: "flex flex-wrap items-center gap-2",
200
- children: [/* @__PURE__ */ _(f, {
201
- variant: Ue.variant,
202
- children: /* @__PURE__ */ _("span", { children: We })
203
- }), /* @__PURE__ */ _(fe, {
204
- prices: N.prices,
205
- openOnHover: N.kind !== "accessory"
200
+ children: [/* @__PURE__ */ h(ce, {
201
+ variant: Ge.variant,
202
+ children: /* @__PURE__ */ h("span", { children: Ke })
203
+ }), /* @__PURE__ */ h(he, {
204
+ prices: k.prices,
205
+ openOnHover: k.kind !== "accessory"
206
206
  })]
207
207
  }),
208
- /* @__PURE__ */ _("h1", {
208
+ /* @__PURE__ */ h("h1", {
209
209
  className: "text-2xl font-semibold tracking-tight text-slate-950",
210
- children: /* @__PURE__ */ _("span", { children: Z })
210
+ children: /* @__PURE__ */ h("span", { children: Y })
211
211
  }),
212
- /* @__PURE__ */ _("p", {
212
+ /* @__PURE__ */ h("p", {
213
213
  className: "text-sm text-slate-600",
214
- children: /* @__PURE__ */ _("span", { children: Le })
214
+ children: /* @__PURE__ */ h("span", { children: Ve })
215
215
  }),
216
- N.features?.length ? /* @__PURE__ */ v("div", {
216
+ k.features?.length ? /* @__PURE__ */ g("div", {
217
217
  className: "mt-2 space-y-2",
218
- children: [/* @__PURE__ */ _("p", {
218
+ children: [/* @__PURE__ */ h("p", {
219
219
  className: "text-sm font-semibold text-slate-950",
220
- children: /* @__PURE__ */ _("span", { children: u("product_features_title") })
221
- }), /* @__PURE__ */ _("ul", {
220
+ children: /* @__PURE__ */ h("span", { children: l("product_features_title") })
221
+ }), /* @__PURE__ */ h("ul", {
222
222
  className: "grid gap-1 text-sm text-slate-700",
223
- children: N.features.map((e, t) => /* @__PURE__ */ v("li", {
223
+ children: k.features.map((e, t) => /* @__PURE__ */ g("li", {
224
224
  className: "inline-flex items-start gap-2",
225
- children: [/* @__PURE__ */ _(Ce, {
225
+ children: [/* @__PURE__ */ h(De, {
226
226
  className: "mt-0.5 h-4 w-4 text-success",
227
227
  "aria-hidden": "true"
228
- }), /* @__PURE__ */ _("span", { children: a(e, T.language, A) })]
229
- }, `${N.id}-${t}`))
228
+ }), /* @__PURE__ */ h("span", { children: a(e, S.language, E) })]
229
+ }, `${k.id}-${t}`))
230
230
  })]
231
231
  }) : null,
232
- /* @__PURE__ */ _(de, { warning: Re })
232
+ /* @__PURE__ */ h(me, { warning: He })
233
233
  ]
234
234
  })]
235
- }), /* @__PURE__ */ _("div", {
235
+ }), /* @__PURE__ */ h("div", {
236
236
  className: "lg:col-span-5",
237
- children: /* @__PURE__ */ v(ue, {
237
+ children: /* @__PURE__ */ g(pe, {
238
238
  className: "border-slate-200 bg-white shadow-sm",
239
- children: [/* @__PURE__ */ v("div", {
239
+ children: [/* @__PURE__ */ g("div", {
240
240
  className: "border-b border-slate-200 px-4 py-4",
241
- children: [/* @__PURE__ */ _("p", {
241
+ children: [/* @__PURE__ */ h("p", {
242
242
  className: "text-sm font-semibold text-slate-950",
243
- children: /* @__PURE__ */ _("span", { children: u("add_to_cart_title") })
244
- }), /* @__PURE__ */ _("p", {
243
+ children: /* @__PURE__ */ h("span", { children: l("add_to_cart_title") })
244
+ }), /* @__PURE__ */ h("p", {
245
245
  className: "mt-1 text-xs text-slate-600",
246
- children: /* @__PURE__ */ _("span", { children: u("add_to_cart_description") })
246
+ children: /* @__PURE__ */ h("span", { children: l("add_to_cart_description") })
247
247
  })]
248
- }), /* @__PURE__ */ v("div", {
248
+ }), /* @__PURE__ */ g("div", {
249
249
  className: "grid gap-4 px-4 py-4",
250
250
  children: [
251
- I ? null : /* @__PURE__ */ _("p", {
251
+ N ? null : /* @__PURE__ */ h("p", {
252
252
  role: "alert",
253
253
  className: "text-sm text-destructive",
254
- children: /* @__PURE__ */ _("span", { children: u("booking_time_slots_required") })
254
+ children: /* @__PURE__ */ h("span", { children: l("booking_time_slots_required") })
255
255
  }),
256
- $.length > 1 ? /* @__PURE__ */ v("div", {
256
+ $.length > 1 ? /* @__PURE__ */ g("div", {
257
257
  className: "grid gap-2",
258
- children: [/* @__PURE__ */ _("p", {
258
+ children: [/* @__PURE__ */ h("p", {
259
259
  className: "text-xs font-medium text-slate-700",
260
- children: /* @__PURE__ */ _("span", { children: Ke })
261
- }), /* @__PURE__ */ _(he, {
262
- value: U ?? "",
263
- onValueChange: W,
260
+ children: /* @__PURE__ */ h("span", { children: Je })
261
+ }), /* @__PURE__ */ h(ve, {
262
+ value: B ?? "",
263
+ onValueChange: V,
264
264
  className: "grid gap-2",
265
265
  children: $.map((e) => {
266
- let t = `variant-${N.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${N.id}-${e.id}`.toLowerCase(), { label: r, description: a } = i(e), o = De(N, e.id, X), s = o ? ie(o) : Ge, c = o ? w(u, o, d(o)) : Ge ? u("availability_out_of_stock") : null;
267
- return /* @__PURE__ */ v("label", {
266
+ let t = `variant-${k.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${k.id}-${e.id}`.toLowerCase(), { label: r, description: i } = ee(e), a = je(k, e.id, q), o = a ? u(a) : qe, s = a ? x(l, a, ae(a)) : qe ? l("availability_out_of_stock") : null;
267
+ return /* @__PURE__ */ g("label", {
268
268
  htmlFor: t,
269
269
  "data-testid": n,
270
- className: b("flex items-start gap-3 rounded-xl border p-3 transition", U === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
271
- children: [/* @__PURE__ */ _(ge, {
270
+ className: _("flex items-start gap-3 rounded-xl border p-3 transition", B === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
271
+ children: [/* @__PURE__ */ h(ye, {
272
272
  id: t,
273
273
  value: e.id,
274
274
  className: "mt-1"
275
- }), /* @__PURE__ */ v("span", {
275
+ }), /* @__PURE__ */ g("span", {
276
276
  className: "flex flex-1 flex-col gap-0.5",
277
277
  children: [
278
- /* @__PURE__ */ _("span", {
278
+ /* @__PURE__ */ h("span", {
279
279
  className: "text-sm font-medium text-slate-950",
280
280
  children: r
281
281
  }),
282
- a ? /* @__PURE__ */ _("span", {
282
+ i ? /* @__PURE__ */ h("span", {
283
283
  className: "text-xs text-slate-600",
284
- children: a
284
+ children: i
285
285
  }) : null,
286
- c ? /* @__PURE__ */ _("span", {
286
+ s ? /* @__PURE__ */ h("span", {
287
287
  className: "pt-1",
288
- children: /* @__PURE__ */ _(f, {
289
- variant: s ? "destructive" : "outline",
290
- children: /* @__PURE__ */ _("span", { children: c })
288
+ children: /* @__PURE__ */ h(ce, {
289
+ variant: o ? "destructive" : "outline",
290
+ children: /* @__PURE__ */ h("span", { children: s })
291
291
  })
292
292
  }) : null
293
293
  ]
@@ -296,50 +296,50 @@ function T() {
296
296
  })
297
297
  })]
298
298
  }) : null,
299
- /* @__PURE__ */ v("div", {
299
+ /* @__PURE__ */ g("div", {
300
300
  className: "grid gap-2",
301
- children: [/* @__PURE__ */ _("p", {
301
+ children: [/* @__PURE__ */ h("p", {
302
302
  className: "text-xs font-medium text-slate-700",
303
- children: /* @__PURE__ */ _("span", { children: u("quantity_label") })
304
- }), /* @__PURE__ */ _(le, {
303
+ children: /* @__PURE__ */ h("span", { children: l("quantity_label") })
304
+ }), /* @__PURE__ */ h(fe, {
305
305
  type: "number",
306
306
  min: 1,
307
307
  max: 99,
308
- value: V,
309
- onChange: (e) => H(Number(e.target.value))
308
+ value: R,
309
+ onChange: (e) => z(Number(e.target.value))
310
310
  })]
311
311
  }),
312
- /* @__PURE__ */ v(p, {
312
+ /* @__PURE__ */ g(d, {
313
313
  className: "h-11 rounded-xl text-sm font-semibold gap-2",
314
314
  onClick: () => {
315
- !U || !I || (je({
316
- kind: N.kind,
317
- productId: s(N),
318
- ...U ? { productVariantId: U } : {},
319
- quantity: G
320
- }), ce.success(u("product_added_to_cart_successfully", {
321
- quantity: G,
322
- productName: c({
323
- product: N,
324
- productVariantId: U,
325
- language: T.language,
326
- fallbackLanguage: A
315
+ !B || !N || (Ie({
316
+ kind: k.kind,
317
+ productId: s(k),
318
+ ...B ? { productVariantId: B } : {},
319
+ quantity: H
320
+ }), de.success(l("product_added_to_cart_successfully", {
321
+ quantity: H,
322
+ productName: te({
323
+ product: k,
324
+ productVariantId: B,
325
+ language: S.language,
326
+ fallbackLanguage: E
327
327
  })
328
328
  })));
329
329
  },
330
- disabled: !qe,
331
- children: [/* @__PURE__ */ _("span", { children: u("add_to_cart") }), /* @__PURE__ */ _(we, {
330
+ disabled: !Ye,
331
+ children: [/* @__PURE__ */ h("span", { children: l("add_to_cart") }), /* @__PURE__ */ h(Oe, {
332
332
  className: "h-4 w-4",
333
333
  "aria-hidden": "true"
334
334
  })]
335
335
  }),
336
- /* @__PURE__ */ _(y, {
337
- to: R,
338
- className: b(k > 0 && I ? "block" : "hidden"),
339
- children: /* @__PURE__ */ v(p, {
336
+ /* @__PURE__ */ h(be, {
337
+ to: F,
338
+ className: _(T > 0 && N ? "block" : "hidden"),
339
+ children: /* @__PURE__ */ g(d, {
340
340
  variant: "outline",
341
341
  className: "h-11 w-full rounded-xl gap-2",
342
- children: [/* @__PURE__ */ _("span", { children: u("go_to_checkout") }), /* @__PURE__ */ _(S, {
342
+ children: [/* @__PURE__ */ h("span", { children: l("go_to_checkout") }), /* @__PURE__ */ h(y, {
343
343
  className: "h-4 w-4",
344
344
  "aria-hidden": "true"
345
345
  })]
@@ -354,4 +354,4 @@ function T() {
354
354
  });
355
355
  }
356
356
  //#endregion
357
- export { T as default };
357
+ export { S as default };