@loczer/storefront-sdk 0.164.0 → 0.166.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 (89) hide show
  1. package/dist/StorefrontProvider.d.ts +29 -3
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.js +64 -55
  4. package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
  5. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
  6. package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
  8. package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
  9. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
  10. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
  11. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
  12. package/dist/components/AboutSection/index.js +1 -1
  13. package/dist/components/BikeProductCard/index.d.ts +2 -1
  14. package/dist/components/BikeProductCard/index.d.ts.map +1 -1
  15. package/dist/components/BikeProductCard/index.js +59 -41
  16. package/dist/components/BookingBikeVariantDialog/index.js +1 -1
  17. package/dist/components/BookingFlowSteps/index.js +8 -8
  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/BookingMobileDateDrawer.js +28 -28
  21. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  22. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  23. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  24. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
  25. package/dist/components/ContactSection/index.js +4 -4
  26. package/dist/components/Header/index.js +1 -1
  27. package/dist/components/PoweredByLoczerBadge/index.js +1 -1
  28. package/dist/components/ProductPriceBadge/index.js +1 -1
  29. package/dist/components/ProductWarningNotice/index.js +10 -10
  30. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
  31. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
  32. package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
  33. package/dist/components/payment/MollieCardFieldsForm.js +1 -1
  34. package/dist/components/payment/StripeCardFieldsForm.js +13 -13
  35. package/dist/i18n/en.d.ts +12 -0
  36. package/dist/i18n/en.d.ts.map +1 -1
  37. package/dist/i18n/en.js +12 -0
  38. package/dist/i18n/fr.d.ts +12 -0
  39. package/dist/i18n/fr.d.ts.map +1 -1
  40. package/dist/i18n/fr.js +12 -0
  41. package/dist/index.d.ts +116 -7
  42. package/dist/index.js +312 -305
  43. package/dist/lib/cart.js +1 -1
  44. package/dist/lib/cartSummary.d.ts.map +1 -1
  45. package/dist/lib/cartSummary.js +28 -28
  46. package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
  47. package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
  48. package/dist/lib/checkoutPaymentDecision.js +14 -6
  49. package/dist/lib/checkoutPaymentSession.d.ts +1 -0
  50. package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
  51. package/dist/lib/checkoutPaymentSession.js +12 -11
  52. package/dist/lib/checkoutSubmit.js +4 -4
  53. package/dist/lib/productVariants.d.ts.map +1 -1
  54. package/dist/lib/productVariants.js +34 -15
  55. package/dist/lib/products.d.ts +4 -0
  56. package/dist/lib/products.d.ts.map +1 -1
  57. package/dist/lib/products.js +74 -39
  58. package/dist/lib/securePaymentLink.d.ts +1 -0
  59. package/dist/lib/securePaymentLink.d.ts.map +1 -1
  60. package/dist/lib/securePaymentLink.js +1 -0
  61. package/dist/lib/storefrontAvailability.d.ts +9 -0
  62. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  63. package/dist/lib/storefrontAvailability.js +28 -18
  64. package/dist/pages/BookingPage.d.ts.map +1 -1
  65. package/dist/pages/BookingPage.js +290 -289
  66. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  67. package/dist/pages/CheckoutPage.js +224 -216
  68. package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
  69. package/dist/pages/CheckoutPaymentPage.js +92 -92
  70. package/dist/pages/ContractSaleDocumentPage.js +3 -3
  71. package/dist/pages/HomePage.d.ts.map +1 -1
  72. package/dist/pages/HomePage.js +168 -162
  73. package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
  74. package/dist/pages/PaymentLinkPage.js +62 -62
  75. package/dist/pages/PaymentLinkSuccessPage.js +7 -7
  76. package/dist/pages/ProductPage.d.ts.map +1 -1
  77. package/dist/pages/ProductPage.js +161 -161
  78. package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
  79. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
  80. package/dist/storefront.css +1 -1
  81. package/dist/storefrontSchemas.d.ts +14 -2
  82. package/dist/storefrontSchemas.d.ts.map +1 -1
  83. package/dist/storefrontSchemas.js +4 -4
  84. package/dist/ui/day-picker.js +5 -5
  85. package/package.json +2 -2
  86. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
  87. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
  88. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
  89. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
@@ -1,222 +1,222 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { useMemo as g, useState as N, useEffect as T } from "react";
3
- import { useParams as Nt, useSearchParams as kt, useLocation as St, useNavigate as wt, Link as Z } from "@rpcbase/router";
4
- import { cn as k } from "@rpcbase/ui";
5
- import { ArrowLeft as tt, ArrowRight as B, Bike as It, CheckCircle2 as Pt } from "lucide-react";
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useMemo as b, useState as k, useEffect as O } from "react";
3
+ import { useParams as _t, useSearchParams as St, useLocation as kt, useNavigate as wt, Link as tt } from "@rpcbase/router";
4
+ import { cn as w } from "@rpcbase/ui";
5
+ import { ArrowLeft as at, ArrowRight as R, Bike as It, CheckCircle2 as Pt } from "lucide-react";
6
6
  import { useTranslation as Vt } from "react-i18next";
7
7
  import { apiPost as At } from "../lib/apiCall.js";
8
8
  import { getAvailabilityVariant as Ct } from "../lib/utils.js";
9
- import { resolveBookingSearchParamsFromSessionStorage as Lt, getBookingParamsFromSearch as Tt, writeBookingSearchParamsToSessionStorage as Bt } from "../lib/booking.js";
10
- import { getLocalizedValue as S } from "../localization.js";
9
+ import { resolveBookingSearchParamsFromSessionStorage as Lt, getBookingParamsFromSearch as Bt, writeBookingSearchParamsToSessionStorage as Tt } from "../lib/booking.js";
10
+ import { getLocalizedValue as I } from "../localization.js";
11
11
  import { Badge as et } from "../ui/badge.js";
12
- import { Button as b } from "../ui/button.js";
12
+ import { Button as v } from "../ui/button.js";
13
13
  import { Card as Ot } from "../ui/card.js";
14
14
  import { Input as Rt } from "../ui/input.js";
15
15
  import { RadioGroup as $t, RadioGroupItem as Ft } from "../ui/radio-group.js";
16
16
  import { useStorefrontCart as zt } from "../lib/cart.js";
17
- import { findStorefrontProductBySlug as jt, getStorefrontCheckoutProductId as O } from "../lib/products.js";
18
- import { ROUTE as Mt, responseSchema as Kt, buildStorefrontAvailabilityKey as m, getStorefrontAvailabilityStatus as at, isStorefrontAvailabilityInsufficient as it, getStorefrontAvailabilityIssue as Dt } from "../lib/storefrontAvailability.js";
19
- import { getProductVariantAttributeValue as Et, getStorefrontProductVariantDisplay as qt } from "../lib/productVariants.js";
20
- import { resolveProductImageContainerStyle as Gt } from "../lib/productImageStyles.js";
21
- import { useStorefront as Ut, useStorefrontProducts as Wt } from "../StorefrontProvider.js";
22
- import { ProductPriceBadge as Qt } from "../components/ProductPriceBadge/index.js";
23
- import { ProductWarningNotice as Ht } from "../components/ProductWarningNotice/index.js";
24
- const rt = (e, n = () => !0) => {
25
- if (!e) return null;
26
- if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
27
- const a = e.productVariants ?? [];
28
- return a.find((o) => n(o.id))?.id ?? a[0]?.id ?? null;
29
- }, Jt = (e, n) => {
30
- if (!e) return [];
31
- const a = O(e), l = /* @__PURE__ */ new Map();
32
- l.set(m(a), { productId: a, quantity: n });
33
- for (const v of e.productVariants ?? [])
34
- l.set(m(a, v.id), {
35
- productId: a,
36
- productVariantId: v.id,
37
- quantity: n
17
+ import { findStorefrontProductBySlug as jt, getStorefrontCheckoutProductId as P } from "../lib/products.js";
18
+ import { getValidStorefrontAvailabilitySchedule as Mt, ROUTE as Kt, responseSchema as Et, buildStorefrontAvailabilityKey as d, getStorefrontAvailabilityStatus as it, isStorefrontAvailabilityInsufficient as rt, getStorefrontAvailabilityIssue as qt } from "../lib/storefrontAvailability.js";
19
+ import { getProductVariantAttributeValue as Gt, getStorefrontProductVariantDisplay as Ut } from "../lib/productVariants.js";
20
+ import { resolveProductImageContainerStyle as Wt } from "../lib/productImageStyles.js";
21
+ import { useStorefront as Dt, useStorefrontProducts as Qt } from "../StorefrontProvider.js";
22
+ import { ProductPriceBadge as Ht } from "../components/ProductPriceBadge/index.js";
23
+ import { ProductWarningNotice as Jt } from "../components/ProductWarningNotice/index.js";
24
+ const st = (a, s = () => !0) => {
25
+ if (!a) return null;
26
+ if (a.representedVariantId?.trim()) return a.representedVariantId.trim();
27
+ const e = a.productVariants ?? [];
28
+ return e.find((o) => s(o.id))?.id ?? e[0]?.id ?? null;
29
+ }, Xt = (a, s) => {
30
+ if (!a) return [];
31
+ const e = P(a), l = /* @__PURE__ */ new Map();
32
+ l.set(d(e), { productId: e, quantity: s });
33
+ for (const x of a.productVariants ?? [])
34
+ l.set(d(e, x.id), {
35
+ productId: e,
36
+ productVariantId: x.id,
37
+ quantity: s
38
38
  });
39
- const o = e.representedVariantId?.trim();
40
- return o && l.set(m(a, o), {
41
- productId: a,
39
+ const o = a.representedVariantId?.trim();
40
+ return o && l.set(d(e, o), {
41
+ productId: e,
42
42
  productVariantId: o,
43
- quantity: n
43
+ quantity: s
44
44
  }), Array.from(l.values());
45
- }, Xt = (e, n) => {
46
- const a = O(e), l = e.representedVariantId?.trim();
45
+ }, Yt = (a, s) => {
46
+ const e = P(a), l = a.representedVariantId?.trim();
47
47
  if (l) {
48
- const o = n.get(m(a, l));
48
+ const o = s.get(d(e, l));
49
49
  if (o) return o;
50
50
  }
51
- return n.get(m(a));
52
- }, Yt = (e, n, a) => a.get(m(O(e), n)), st = (e, n, a) => {
53
- const l = Dt(n);
54
- return l === "quantity_unavailable" ? e("availability_quantity_unavailable") : l === "unavailable" || a === "OUT_OF_STOCK" ? e("availability_out_of_stock") : n?.remaining !== void 0 ? e("availability_remaining_count", { count: n.remaining }) : n?.fewRemaining || a === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock");
55
- }, Zt = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
56
- function ke() {
57
- const { t: e, i18n: n } = Vt(), { storeSlug: a, productSlug: l } = Nt(), [o] = kt(), v = St(), nt = wt(), { addItem: lt, itemCount: R } = zt(), { storefrontConfiguration: ot } = Ut(), x = ot.workspace?.workspaceLanguage, { bikes: $, accessories: F } = Wt(), i = g(
58
- () => l ? jt(l, { bikes: $, accessories: F }) : null,
59
- [F, $, l]
60
- ), p = g(
61
- () => Lt(o, a),
62
- [o, a]
63
- ), d = g(() => Tt(p), [p]), z = p.toString(), j = `/${a ?? ""}/checkout${z ? `?${z}` : ""}`, M = `/${a ?? ""}`, ct = M, w = v.state, dt = typeof w?.backTo == "string" && w.backTo.startsWith(M) ? w.backTo : ct, [I, K] = N(1), [u, P] = N(() => rt(i)), V = Number.isFinite(I) ? Math.max(1, Math.min(99, Math.floor(I))) : 1, A = g(
64
- () => Jt(i, V),
65
- [V, i]
66
- ), [D, y] = N([]), [mt, C] = N(!1);
67
- T(() => {
68
- if (K(1), !i) {
69
- P(null);
51
+ return s.get(d(e));
52
+ }, Zt = (a, s, e) => e.get(d(P(a), s)), nt = (a, s, e) => {
53
+ const l = qt(s);
54
+ return l === "quantity_unavailable" ? a("availability_quantity_unavailable") : l === "unavailable" || e === "OUT_OF_STOCK" ? a("availability_out_of_stock") : s?.remaining !== void 0 ? a("availability_remaining_count", { count: s.remaining }) : s?.fewRemaining || e === "LOW_STOCK" ? a("availability_low_stock") : a("availability_in_stock");
55
+ }, ta = (a) => "availabilityStatus" in a ? a.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
56
+ function ka() {
57
+ const { t: a, i18n: s } = Vt(), { storeSlug: e, productSlug: l } = _t(), [o] = St(), x = kt(), lt = wt(), { addItem: ot, itemCount: $ } = zt(), { storefrontConfiguration: ct } = Dt(), y = ct.workspace?.workspaceLanguage, { bikes: F, accessories: z } = Qt(), i = b(
58
+ () => l ? jt(l, { bikes: F, accessories: z }) : null,
59
+ [z, F, l]
60
+ ), u = b(
61
+ () => Lt(o, e),
62
+ [o, e]
63
+ ), p = b(() => Bt(u), [u]), j = u.toString(), M = `/${e ?? ""}/checkout${j ? `?${j}` : ""}`, K = `/${e ?? ""}`, dt = K, V = x.state, mt = typeof V?.backTo == "string" && V.backTo.startsWith(K) ? V.backTo : dt, [A, E] = k(1), [m, C] = k(() => st(i)), L = Number.isFinite(A) ? Math.max(1, Math.min(99, Math.floor(A))) : 1, B = b(
64
+ () => Xt(i, L),
65
+ [L, i]
66
+ ), [q, N] = k([]), [ut, _] = k(!1);
67
+ O(() => {
68
+ if (E(1), !i) {
69
+ C(null);
70
70
  return;
71
71
  }
72
- P(rt(i));
73
- }, [l, i]), T(() => {
74
- Bt(a, p);
75
- }, [p, a]), T(() => {
76
- if (!a || A.length === 0) {
77
- y([]), C(!1);
72
+ C(st(i));
73
+ }, [l, i]), O(() => {
74
+ Tt(e, u);
75
+ }, [u, e]), O(() => {
76
+ if (!e || B.length === 0) {
77
+ N([]), _(!1);
78
78
  return;
79
79
  }
80
- let r = !1;
81
- return C(!0), y([]), (async () => {
80
+ const n = Mt(p);
81
+ if (!n) {
82
+ _(!1);
83
+ return;
84
+ }
85
+ let c = !1;
86
+ return _(!0), N([]), (async () => {
82
87
  try {
83
- const c = await At(
84
- Mt,
88
+ const f = await At(
89
+ Kt,
85
90
  {
86
- storeSlug: a,
87
- schedule: {
88
- startDate: d.start_date,
89
- endDate: d.end_date,
90
- startTime: d.start_time,
91
- endTime: d.end_time
92
- },
93
- products: A
91
+ storeSlug: e,
92
+ schedule: n,
93
+ products: B
94
94
  }
95
- ), _ = Kt.parse(c);
96
- if (r) return;
97
- y(_.success ? _.availability ?? [] : []);
98
- } catch (c) {
99
- if (r) return;
100
- console.error("Failed to load storefront product availability", c), y([]);
95
+ ), S = Et.parse(f);
96
+ if (c) return;
97
+ N(S.success ? S.availability ?? [] : []);
98
+ } catch (f) {
99
+ if (c) return;
100
+ console.error("Failed to load storefront product availability", f), N([]);
101
101
  } finally {
102
- r || C(!1);
102
+ c || _(!1);
103
103
  }
104
104
  })(), () => {
105
- r = !0;
105
+ c = !0;
106
106
  };
107
107
  }, [
108
- A,
109
- d.end_date,
110
- d.end_time,
111
- d.start_date,
112
- d.start_time,
113
- a
108
+ B,
109
+ p.end_date,
110
+ p.end_time,
111
+ p.start_date,
112
+ p.start_time,
113
+ e
114
114
  ]);
115
- const E = g(() => new Map(
116
- D.map((r) => [
117
- m(r.productId, r.productVariantId),
118
- r
115
+ const G = b(() => new Map(
116
+ q.map((n) => [
117
+ d(n.productId, n.productVariantId),
118
+ n
119
119
  ])
120
- ), [D]), q = () => {
121
- nt(dt);
120
+ ), [q]), U = () => {
121
+ lt(mt);
122
122
  };
123
123
  if (!i)
124
- return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ s("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: [
125
- /* @__PURE__ */ t("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: e("product_not_found_title") }) }),
126
- /* @__PURE__ */ t("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: e("product_not_found_description") }) }),
127
- /* @__PURE__ */ t("div", { className: "mt-6", children: /* @__PURE__ */ s(b, { type: "button", className: "gap-2", onClick: q, children: [
128
- /* @__PURE__ */ t(tt, { className: "h-4 w-4", "aria-hidden": "true" }),
129
- /* @__PURE__ */ t("span", { children: e("go_back") })
124
+ return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ r("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: [
125
+ /* @__PURE__ */ t("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: a("product_not_found_title") }) }),
126
+ /* @__PURE__ */ t("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: a("product_not_found_description") }) }),
127
+ /* @__PURE__ */ t("div", { className: "mt-6", children: /* @__PURE__ */ r(v, { type: "button", className: "gap-2", onClick: U, children: [
128
+ /* @__PURE__ */ t(at, { className: "h-4 w-4", "aria-hidden": "true" }),
129
+ /* @__PURE__ */ t("span", { children: a("go_back") })
130
130
  ] }) })
131
131
  ] }) });
132
- const G = S(i.name, n.language, x), ut = S(i.description, n.language, x), pt = S(i.warning, n.language, x), U = typeof i.images?.[0] == "string" ? i.images[0].trim() : "", W = Gt(i.primaryImageStyle), h = Xt(i, E), Q = Zt(i), H = h ? at(h) : Q, ht = Ct(H), ft = mt ? e("availability_checking") : st(e, h, H), J = h ? it(h) : Q === "OUT_OF_STOCK", L = i.productVariants ?? [], gt = L.some((r) => !!Et(r, "size")), bt = e(gt ? "product_size_label" : "product_variant_label"), vt = !!u, xt = () => {
133
- u && lt({
132
+ const W = I(i.name, s.language, y), pt = I(i.description, s.language, y), ht = I(i.warning, s.language, y), D = typeof i.images?.[0] == "string" ? i.images[0].trim() : "", Q = Wt(i.primaryImageStyle), h = Yt(i, G), H = ta(i), J = h ? it(h) : H, ft = Ct(J), gt = ut ? a("availability_checking") : nt(a, h, J), X = h ? rt(h) : H === "OUT_OF_STOCK", T = i.productVariants ?? [], bt = T.some((n) => !!Gt(n, "size")), vt = a(bt ? "product_size_label" : "product_variant_label"), xt = !!m, yt = () => {
133
+ m && ot({
134
134
  kind: i.kind,
135
- productId: i.id,
136
- ...u ? { productVariantId: u } : {},
137
- quantity: V
135
+ productId: P(i),
136
+ ...m ? { productVariantId: m } : {},
137
+ quantity: L
138
138
  });
139
139
  };
140
- return /* @__PURE__ */ t("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-6", children: [
141
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [
142
- /* @__PURE__ */ s(
143
- b,
140
+ return /* @__PURE__ */ t("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-6", children: [
141
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [
142
+ /* @__PURE__ */ r(
143
+ v,
144
144
  {
145
145
  type: "button",
146
146
  variant: "ghost",
147
147
  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",
148
- onClick: q,
148
+ onClick: U,
149
149
  children: [
150
- /* @__PURE__ */ t(tt, { className: "h-4 w-4", "aria-hidden": "true" }),
151
- /* @__PURE__ */ t("span", { children: e("go_back") })
150
+ /* @__PURE__ */ t(at, { className: "h-4 w-4", "aria-hidden": "true" }),
151
+ /* @__PURE__ */ t("span", { children: a("go_back") })
152
152
  ]
153
153
  }
154
154
  ),
155
- /* @__PURE__ */ t(Z, { to: j, className: k(R > 0 ? "inline-flex" : "hidden"), children: /* @__PURE__ */ s(b, { size: "sm", className: "gap-2", children: [
156
- /* @__PURE__ */ t("span", { children: e("checkout_button") }),
157
- /* @__PURE__ */ t(B, { className: "h-4 w-4", "aria-hidden": "true" })
155
+ /* @__PURE__ */ t(tt, { to: M, className: w($ > 0 ? "inline-flex" : "hidden"), children: /* @__PURE__ */ r(v, { size: "sm", className: "gap-2", children: [
156
+ /* @__PURE__ */ t("span", { children: a("checkout_button") }),
157
+ /* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
158
158
  ] }) })
159
159
  ] }),
160
- /* @__PURE__ */ s("div", { className: "grid gap-6 lg:grid-cols-12", children: [
161
- /* @__PURE__ */ s("div", { className: "lg:col-span-7", children: [
160
+ /* @__PURE__ */ r("div", { className: "grid gap-6 lg:grid-cols-12", children: [
161
+ /* @__PURE__ */ r("div", { className: "lg:col-span-7", children: [
162
162
  /* @__PURE__ */ t(
163
163
  "div",
164
164
  {
165
- className: k("relative aspect-[1618/1000] overflow-hidden rounded-2xl", W.className),
166
- style: W.style,
167
- children: U ? /* @__PURE__ */ t(
165
+ className: w("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Q.className),
166
+ style: Q.style,
167
+ children: D ? /* @__PURE__ */ t(
168
168
  "img",
169
169
  {
170
- src: U,
171
- alt: G,
170
+ src: D,
171
+ alt: W,
172
172
  className: "absolute inset-0 h-full w-full object-contain p-2",
173
173
  loading: "lazy"
174
174
  }
175
175
  ) : /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center text-slate-400", children: /* @__PURE__ */ t(It, { className: "h-12 w-12", "aria-hidden": "true" }) })
176
176
  }
177
177
  ),
178
- /* @__PURE__ */ s("div", { className: "mt-5 flex flex-col gap-3", children: [
179
- /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
180
- /* @__PURE__ */ t(et, { variant: ht.variant, children: /* @__PURE__ */ t("span", { children: ft }) }),
181
- /* @__PURE__ */ t(Qt, { prices: i.prices })
178
+ /* @__PURE__ */ r("div", { className: "mt-5 flex flex-col gap-3", children: [
179
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
180
+ /* @__PURE__ */ t(et, { variant: ft.variant, children: /* @__PURE__ */ t("span", { children: gt }) }),
181
+ /* @__PURE__ */ t(Ht, { prices: i.prices })
182
182
  ] }),
183
- /* @__PURE__ */ t("h1", { className: "text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: G }) }),
184
- /* @__PURE__ */ t("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: ut }) }),
185
- i.features?.length ? /* @__PURE__ */ s("div", { className: "mt-2 space-y-2", children: [
186
- /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: e("product_features_title") }) }),
187
- /* @__PURE__ */ t("ul", { className: "grid gap-1 text-sm text-slate-700", children: i.features.map((r, c) => /* @__PURE__ */ s("li", { className: "inline-flex items-start gap-2", children: [
183
+ /* @__PURE__ */ t("h1", { className: "text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ t("span", { children: W }) }),
184
+ /* @__PURE__ */ t("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ t("span", { children: pt }) }),
185
+ i.features?.length ? /* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
186
+ /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: a("product_features_title") }) }),
187
+ /* @__PURE__ */ t("ul", { className: "grid gap-1 text-sm text-slate-700", children: i.features.map((n, c) => /* @__PURE__ */ r("li", { className: "inline-flex items-start gap-2", children: [
188
188
  /* @__PURE__ */ t(Pt, { className: "mt-0.5 h-4 w-4 text-emerald-600", "aria-hidden": "true" }),
189
- /* @__PURE__ */ t("span", { children: S(r, n.language, x) })
189
+ /* @__PURE__ */ t("span", { children: I(n, s.language, y) })
190
190
  ] }, `${i.id}-${c}`)) })
191
191
  ] }) : null,
192
- /* @__PURE__ */ t(Ht, { warning: pt })
192
+ /* @__PURE__ */ t(Jt, { warning: ht })
193
193
  ] })
194
194
  ] }),
195
- /* @__PURE__ */ t("div", { className: "lg:col-span-5", children: /* @__PURE__ */ s(Ot, { className: "border-slate-200 bg-white shadow-sm", children: [
196
- /* @__PURE__ */ s("div", { className: "border-b border-slate-200 px-4 py-4", children: [
197
- /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: e("add_to_cart_title") }) }),
198
- /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-slate-600", children: /* @__PURE__ */ t("span", { children: e("add_to_cart_description") }) })
195
+ /* @__PURE__ */ t("div", { className: "lg:col-span-5", children: /* @__PURE__ */ r(Ot, { className: "border-slate-200 bg-white shadow-sm", children: [
196
+ /* @__PURE__ */ r("div", { className: "border-b border-slate-200 px-4 py-4", children: [
197
+ /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: a("add_to_cart_title") }) }),
198
+ /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-slate-600", children: /* @__PURE__ */ t("span", { children: a("add_to_cart_description") }) })
199
199
  ] }),
200
- /* @__PURE__ */ s("div", { className: "grid gap-4 px-4 py-4", children: [
201
- L.length > 1 ? /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
202
- /* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: bt }) }),
203
- /* @__PURE__ */ t($t, { value: u ?? "", onValueChange: P, className: "grid gap-2", children: L.map((r) => {
204
- const c = `variant-${i.id}-${r.id}`.toLowerCase(), _ = `storefront-product-variant-option-${i.id}-${r.id}`.toLowerCase(), { label: yt, description: X } = qt(r), f = Yt(i, r.id, E), _t = f ? it(f) : J, Y = f ? st(e, f, at(f)) : J ? e("availability_out_of_stock") : null;
205
- return /* @__PURE__ */ s(
200
+ /* @__PURE__ */ r("div", { className: "grid gap-4 px-4 py-4", children: [
201
+ T.length > 1 ? /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
202
+ /* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: vt }) }),
203
+ /* @__PURE__ */ t($t, { value: m ?? "", onValueChange: C, className: "grid gap-2", children: T.map((n) => {
204
+ const c = `variant-${i.id}-${n.id}`.toLowerCase(), f = `storefront-product-variant-option-${i.id}-${n.id}`.toLowerCase(), { label: S, description: Y } = Ut(n), g = Zt(i, n.id, G), Nt = g ? rt(g) : X, Z = g ? nt(a, g, it(g)) : X ? a("availability_out_of_stock") : null;
205
+ return /* @__PURE__ */ r(
206
206
  "label",
207
207
  {
208
208
  htmlFor: c,
209
- "data-testid": _,
210
- className: k(
209
+ "data-testid": f,
210
+ className: w(
211
211
  "flex items-start gap-3 rounded-xl border p-3 transition",
212
- u === r.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"
212
+ m === n.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"
213
213
  ),
214
214
  children: [
215
- /* @__PURE__ */ t(Ft, { id: c, value: r.id, className: "mt-1" }),
216
- /* @__PURE__ */ s("span", { className: "flex flex-1 flex-col gap-0.5", children: [
217
- /* @__PURE__ */ t("span", { className: "text-sm font-medium text-slate-950", children: yt }),
218
- X ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: X }) : null,
219
- Y ? /* @__PURE__ */ t("span", { className: "pt-1", children: /* @__PURE__ */ t(et, { variant: _t ? "destructive" : "outline", children: /* @__PURE__ */ t("span", { children: Y }) }) }) : null
215
+ /* @__PURE__ */ t(Ft, { id: c, value: n.id, className: "mt-1" }),
216
+ /* @__PURE__ */ r("span", { className: "flex flex-1 flex-col gap-0.5", children: [
217
+ /* @__PURE__ */ t("span", { className: "text-sm font-medium text-slate-950", children: S }),
218
+ Y ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: Y }) : null,
219
+ Z ? /* @__PURE__ */ t("span", { className: "pt-1", children: /* @__PURE__ */ t(et, { variant: Nt ? "destructive" : "outline", children: /* @__PURE__ */ t("span", { children: Z }) }) }) : null
220
220
  ] })
221
221
  ]
222
222
  },
@@ -224,26 +224,26 @@ function ke() {
224
224
  );
225
225
  }) })
226
226
  ] }) : null,
227
- /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
228
- /* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: e("quantity_label") }) }),
227
+ /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
228
+ /* @__PURE__ */ t("p", { className: "text-xs font-medium text-slate-700", children: /* @__PURE__ */ t("span", { children: a("quantity_label") }) }),
229
229
  /* @__PURE__ */ t(
230
230
  Rt,
231
231
  {
232
232
  type: "number",
233
233
  min: 1,
234
234
  max: 99,
235
- value: I,
236
- onChange: (r) => K(Number(r.target.value))
235
+ value: A,
236
+ onChange: (n) => E(Number(n.target.value))
237
237
  }
238
238
  )
239
239
  ] }),
240
- /* @__PURE__ */ s(b, { className: "h-11 rounded-xl text-sm font-semibold gap-2", onClick: xt, disabled: !vt, children: [
241
- /* @__PURE__ */ t("span", { children: e("add_to_cart") }),
242
- /* @__PURE__ */ t(B, { className: "h-4 w-4", "aria-hidden": "true" })
240
+ /* @__PURE__ */ r(v, { className: "h-11 rounded-xl text-sm font-semibold gap-2", onClick: yt, disabled: !xt, children: [
241
+ /* @__PURE__ */ t("span", { children: a("add_to_cart") }),
242
+ /* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
243
243
  ] }),
244
- /* @__PURE__ */ t(Z, { to: j, className: k(R > 0 ? "block" : "hidden"), children: /* @__PURE__ */ s(b, { variant: "outline", className: "h-11 w-full rounded-xl gap-2", children: [
245
- /* @__PURE__ */ t("span", { children: e("go_to_checkout") }),
246
- /* @__PURE__ */ t(B, { className: "h-4 w-4", "aria-hidden": "true" })
244
+ /* @__PURE__ */ t(tt, { to: M, className: w($ > 0 ? "block" : "hidden"), children: /* @__PURE__ */ r(v, { variant: "outline", className: "h-11 w-full rounded-xl gap-2", children: [
245
+ /* @__PURE__ */ t("span", { children: a("go_to_checkout") }),
246
+ /* @__PURE__ */ t(R, { className: "h-4 w-4", "aria-hidden": "true" })
247
247
  ] }) })
248
248
  ] })
249
249
  ] }) })
@@ -251,5 +251,5 @@ function ke() {
251
251
  ] }) });
252
252
  }
253
253
  export {
254
- ke as default
254
+ ka as default
255
255
  };
@@ -8,8 +8,8 @@ function A({
8
8
  className: p,
9
9
  code: l,
10
10
  appliedCode: o,
11
- discountLabel: n,
12
- message: c,
11
+ discountLabel: c,
12
+ message: n,
13
13
  error: s,
14
14
  loading: r,
15
15
  disabled: i,
@@ -49,8 +49,8 @@ function A({
49
49
  }
50
50
  )
51
51
  ] }),
52
- o && n ? /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3 rounded-md border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm text-emerald-800", children: [
53
- /* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code: o, amount: n }) }),
52
+ o && c ? /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3 rounded-md border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm text-emerald-800", children: [
53
+ /* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code: o, amount: c }) }),
54
54
  /* @__PURE__ */ e(
55
55
  d,
56
56
  {
@@ -64,8 +64,8 @@ function A({
64
64
  }
65
65
  )
66
66
  ] }) : null,
67
- c ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: c }) }) : null,
68
- s ? /* @__PURE__ */ e("p", { className: "text-xs text-red-700", children: /* @__PURE__ */ e("span", { children: s }) }) : null
67
+ n ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: n }) }) : null,
68
+ s ? /* @__PURE__ */ e("p", { className: "text-xs text-destructive", children: /* @__PURE__ */ e("span", { children: s }) }) : null
69
69
  ] });
70
70
  }
71
71
  export {
@@ -1,28 +1,28 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { Loader2 as k, AlertTriangle as v } from "lucide-react";
2
+ import { Loader2 as y, AlertTriangle as k } from "lucide-react";
3
3
  import { useTranslation as w } from "react-i18next";
4
4
  import { Button as C } from "../../../ui/button.js";
5
5
  import { Card as j } from "../../../ui/card.js";
6
6
  function F({
7
7
  estimatedTotalLabel: m,
8
8
  couponCode: o,
9
- discountAmountLabel: s,
9
+ discountAmountLabel: d,
10
10
  totalExcludingTaxLabel: h,
11
11
  vatAmountLabel: p,
12
12
  vatRateLabel: u,
13
13
  depositAmountLabel: r,
14
14
  amountToCollectMinor: x,
15
15
  amountToCollectLabel: _,
16
- paymentSummaryHelper: n,
17
- paymentDecisionLoading: c,
18
- paymentDecisionError: d,
16
+ paymentSummaryHelper: c,
17
+ paymentDecisionLoading: n,
18
+ paymentDecisionError: s,
19
19
  canChoosePaymentMethod: i,
20
20
  showAmountDueNowRow: g,
21
21
  selectedPaymentMethod: b,
22
22
  submitting: N,
23
23
  onSelectPaymentMethod: f
24
24
  }) {
25
- const { t } = w(), y = [
25
+ const { t } = w(), v = [
26
26
  { id: "card", label: t("checkout_payment_method_card") },
27
27
  { id: "apple_pay", label: t("checkout_payment_method_apple_pay") },
28
28
  { id: "other", label: t("checkout_payment_method_other") }
@@ -38,9 +38,9 @@ function F({
38
38
  /* @__PURE__ */ e("dt", { className: "text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_estimated_total") }) }),
39
39
  /* @__PURE__ */ e("dd", { className: "font-semibold tabular-nums text-slate-900", children: /* @__PURE__ */ e("span", { children: m }) })
40
40
  ] }),
41
- s ? /* @__PURE__ */ a("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-slate-100 py-2.5", children: [
41
+ d ? /* @__PURE__ */ a("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-slate-100 py-2.5", children: [
42
42
  /* @__PURE__ */ e("dt", { className: "text-emerald-700", children: /* @__PURE__ */ e("span", { children: t("checkout_coupon_discount", { code: o ?? "" }) }) }),
43
- /* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-emerald-700", children: /* @__PURE__ */ e("span", { children: s }) })
43
+ /* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-emerald-700", children: /* @__PURE__ */ e("span", { children: d }) })
44
44
  ] }) : null,
45
45
  /* @__PURE__ */ a("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-slate-100 py-2.5", children: [
46
46
  /* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_total_excluding_tax") }) }),
@@ -59,16 +59,16 @@ function F({
59
59
  /* @__PURE__ */ e("dd", { className: `text-base font-bold tabular-nums tracking-tight ${x > 0 ? "text-slate-950" : "text-slate-800"}`, children: /* @__PURE__ */ e("span", { children: _ }) })
60
60
  ] }) : null
61
61
  ] }),
62
- n ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: n }) }) : null,
63
- c ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-slate-600", children: [
64
- /* @__PURE__ */ e(k, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
62
+ c ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: c }) }) : null,
63
+ n ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-slate-600", children: [
64
+ /* @__PURE__ */ e(y, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
65
65
  /* @__PURE__ */ e("span", { children: t("checkout_payment_loading") })
66
66
  ] }) : null,
67
- d ? /* @__PURE__ */ e("div", { className: "grid gap-3 rounded-xl border border-red-200 bg-red-50 p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-2 text-sm text-red-700", children: [
68
- /* @__PURE__ */ e(v, { className: "mt-0.5 h-4 w-4", "aria-hidden": "true" }),
69
- /* @__PURE__ */ e("span", { children: d })
67
+ s ? /* @__PURE__ */ e("div", { className: "grid gap-3 rounded-xl border border-destructive/25 bg-destructive/5 p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-2 text-sm text-destructive", children: [
68
+ /* @__PURE__ */ e(k, { className: "mt-0.5 h-4 w-4", "aria-hidden": "true" }),
69
+ /* @__PURE__ */ e("span", { children: s })
70
70
  ] }) }) : null,
71
- !c && !d && i ? /* @__PURE__ */ e("div", { className: "grid gap-2 sm:grid-cols-3", children: y.map((l) => /* @__PURE__ */ e(
71
+ !n && !s && i ? /* @__PURE__ */ e("div", { className: "grid gap-2 sm:grid-cols-3", children: v.map((l) => /* @__PURE__ */ e(
72
72
  C,
73
73
  {
74
74
  type: "button",