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