@loczer/storefront-sdk 0.163.0 → 0.165.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 +68 -58
  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 +167 -161
  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 +1 @@
1
- {"version":3,"file":"CheckoutPaymentPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPaymentPage.tsx"],"names":[],"mappings":"AAqGA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CAuW1C"}
1
+ {"version":3,"file":"CheckoutPaymentPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPaymentPage.tsx"],"names":[],"mappings":"AAkGA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CAwW1C"}
@@ -1,158 +1,158 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useState as _, useRef as G, useEffect as E, useMemo as O } from "react";
3
- import { toast as J } from "@rpcbase/client";
4
- import { useParams as Q, useNavigate as V, useSearchParams as W, Link as b } from "@rpcbase/router";
5
- import { loadStripe as Z } from "@stripe/stripe-js";
6
- import { Elements as ee, useStripe as te } from "@stripe/react-stripe-js";
7
- import { AlertTriangle as K, ShieldCheck as re, Loader2 as I, CheckCircle2 as se, XCircle as ne, CircleDashed as ae, ArrowRight as ce } from "lucide-react";
8
- import { useTranslation as T } from "react-i18next";
9
- import { apiPost as ie } from "../lib/apiCall.js";
10
- import { ROUTE as oe, responseSchema as le } from "../lib/checkoutPaymentSession.js";
11
- import { pickBookingSearchParams as me } from "../lib/booking.js";
12
- import { useStorefrontCart as de } from "../lib/cart.js";
13
- import { MollieCardFieldsForm as ue } from "../components/payment/MollieCardFieldsForm.js";
14
- import { StripeCardFieldsForm as pe } from "../components/payment/StripeCardFieldsForm.js";
2
+ import { useState as _, useRef as H, useEffect as E, useMemo as K } from "react";
3
+ import { toast as G } from "@rpcbase/client";
4
+ import { useParams as J, useNavigate as Q, useSearchParams as V, Link as N } from "@rpcbase/router";
5
+ import { loadStripe as W } from "@stripe/stripe-js";
6
+ import { Elements as Z, useStripe as ee } from "@stripe/react-stripe-js";
7
+ import { AlertTriangle as O, ShieldCheck as te, Loader2 as T, CheckCircle2 as re, XCircle as se, CircleDashed as ne, ArrowRight as ae } from "lucide-react";
8
+ import { useTranslation as I } from "react-i18next";
9
+ import { apiPost as ce } from "../lib/apiCall.js";
10
+ import { ROUTE as ie, responseSchema as le } from "../lib/checkoutPaymentSession.js";
11
+ import { pickBookingSearchParams as oe } from "../lib/booking.js";
12
+ import { useStorefrontCart as me } from "../lib/cart.js";
13
+ import { MollieCardFieldsForm as de } from "../components/payment/MollieCardFieldsForm.js";
14
+ import { StripeCardFieldsForm as ue } from "../components/payment/StripeCardFieldsForm.js";
15
15
  import { Button as f } from "../ui/button.js";
16
16
  import { Card as y } from "../ui/card.js";
17
- const he = {}, _e = () => {
18
- const t = he, i = t?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim();
19
- return i || (t?.RB_PUBLIC_STRIPE_PUBLISHABLE_API_KEY?.trim() ?? "");
20
- }, Y = _e(), fe = 20, ye = 2500, xe = (t, i, a) => {
17
+ const pe = {}, he = () => pe?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", _e = he(), fe = 20, ye = 2500, xe = (t, l, c) => {
21
18
  try {
22
- return new Intl.NumberFormat(a, {
19
+ return new Intl.NumberFormat(c, {
23
20
  style: "currency",
24
- currency: i.toUpperCase()
21
+ currency: l.toUpperCase()
25
22
  }).format(t / 100);
26
23
  } catch {
27
- return `${(t / 100).toFixed(2)} ${i.toUpperCase()}`;
24
+ return `${(t / 100).toFixed(2)} ${l.toUpperCase()}`;
28
25
  }
29
26
  };
30
27
  function ge({
31
28
  clientSecret: t,
32
- onSuccess: i
29
+ onSuccess: l
33
30
  }) {
34
- const { t: a } = T(), u = te();
31
+ const { t: c } = I(), u = ee();
35
32
  return /* @__PURE__ */ e(
36
- pe,
33
+ ue,
37
34
  {
38
35
  requireEmail: !1,
39
- submitLabel: a("checkout_payment_authorize_button"),
40
- submittingLabel: a("checkout_payment_authorizing_button"),
36
+ submitLabel: c("checkout_payment_authorize_button"),
37
+ submittingLabel: c("checkout_payment_authorizing_button"),
41
38
  onSubmit: async ({ paymentMethodId: x }) => {
42
39
  if (!u)
43
- throw new Error(a("secure_payment_link.errors.stripe_not_ready"));
44
- const l = await u.confirmCardPayment(
40
+ throw new Error(c("secure_payment_link.errors.stripe_not_ready"));
41
+ const o = await u.confirmCardPayment(
45
42
  t,
46
43
  {
47
44
  payment_method: x
48
45
  }
49
46
  );
50
- if (l.error)
51
- throw new Error(l.error.message ?? a("secure_payment_link.errors.payment_failed"));
52
- const r = l.paymentIntent?.status;
47
+ if (o.error)
48
+ throw new Error(o.error.message ?? c("secure_payment_link.errors.payment_failed"));
49
+ const r = o.paymentIntent?.status;
53
50
  if (r !== "succeeded" && r !== "processing" && r !== "requires_capture")
54
- throw new Error(a("secure_payment_link.errors.payment_failed"));
55
- i();
51
+ throw new Error(c("secure_payment_link.errors.payment_failed"));
52
+ l();
56
53
  }
57
54
  }
58
55
  );
59
56
  }
60
57
  function q() {
61
- const { t } = T();
58
+ const { t } = I();
62
59
  return /* @__PURE__ */ n("div", { className: "flex min-h-48 items-center justify-center gap-2 text-sm text-slate-600", children: [
63
- /* @__PURE__ */ e(I, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
60
+ /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
64
61
  /* @__PURE__ */ e("span", { children: t("secure_payment_link.form.loading_session") })
65
62
  ] });
66
63
  }
67
- function Be() {
68
- const { t, i18n: i } = T(), { storeSlug: a } = Q(), u = V(), { clear: x } = de(), [l] = W(), [r, p] = _(null), [h, S] = _(!0), [A, g] = _(null), [D, U] = _(0), [$, R] = _(0), k = G(!1), m = l.get("checkout_session_id")?.trim() ?? "", B = new URLSearchParams(l.toString());
69
- B.delete("checkout_session_id");
70
- const d = me(B).toString(), v = `/${a ?? ""}/checkout${d ? `?${d}` : ""}`, P = `/${a ?? ""}/checkout/success${d ? `?${d}` : ""}`, M = async (c) => {
71
- if (!a || !m)
64
+ function Me() {
65
+ const { t, i18n: l } = I(), { storeSlug: c } = J(), u = Q(), { clear: x } = me(), [o] = V(), [r, p] = _(null), [h, S] = _(!0), [A, g] = _(null), [D, U] = _(0), [$, R] = _(0), k = H(!1), m = o.get("checkout_session_id")?.trim() ?? "", M = new URLSearchParams(o.toString());
66
+ M.delete("checkout_session_id");
67
+ const d = oe(M).toString(), v = `/${c ?? ""}/checkout${d ? `?${d}` : ""}`, P = `/${c ?? ""}/checkout/success${d ? `?${d}` : ""}`, j = async (a) => {
68
+ if (!c || !m)
72
69
  throw new Error(t("checkout_payment_return_missing_session"));
73
- const s = await ie(
74
- oe,
70
+ const s = await ce(
71
+ ie,
75
72
  {
76
- storeSlug: a,
73
+ storeSlug: c,
77
74
  checkoutSessionId: m,
78
75
  returnSearch: d || void 0,
79
- cardToken: c
76
+ cardToken: a
80
77
  }
81
78
  );
82
79
  return le.parse(s);
83
80
  }, C = async () => {
84
- k.current || (k.current = !0, J.success(t("checkout_success_toast")), await u(P, { replace: !0 }), x());
81
+ k.current || (k.current = !0, G.success(t("checkout_success_toast")), await u(P, { replace: !0 }), x());
85
82
  };
86
83
  E(() => {
87
84
  k.current = !1, R(0);
88
85
  }, [m]), E(() => {
89
- if (!a || !m) {
86
+ if (!c || !m) {
90
87
  p(null), g(t("checkout_payment_return_missing_session")), S(!1);
91
88
  return;
92
89
  }
93
- let c = !1;
90
+ let a = !1;
94
91
  return S(!0), g(null), (async () => {
95
92
  try {
96
- const s = await M();
97
- if (c) return;
93
+ const s = await j();
94
+ if (a) return;
98
95
  if (!s.success) {
99
96
  p(null), g(s.message || t("checkout_payment_return_status_error"));
100
97
  return;
101
98
  }
102
99
  p(s);
103
- const N = s.paymentStatus;
104
- (N === "authorized" || N === "succeeded") && !k.current && await C();
100
+ const w = s.paymentStatus;
101
+ (w === "authorized" || w === "succeeded") && !k.current && await C();
105
102
  } catch (s) {
106
- if (c) return;
103
+ if (a) return;
107
104
  console.error("Failed to fetch checkout payment session", s), p(null), g(t("checkout_payment_return_status_error"));
108
105
  } finally {
109
- c || S(!1);
106
+ a || S(!1);
110
107
  }
111
108
  })(), () => {
112
- c = !0;
109
+ a = !0;
113
110
  };
114
- }, [m, x, u, d, D, a, P, t]);
115
- const o = r?.paymentStatus ?? "pending";
111
+ }, [m, x, u, d, D, c, P, t]);
112
+ const i = r?.paymentStatus ?? "pending";
116
113
  E(() => {
117
- if (o !== "pending" || $ >= fe || !r?.payment?.id) return;
118
- const c = window.setTimeout(() => {
114
+ if (i !== "pending" || $ >= fe || !r?.payment?.id) return;
115
+ const a = window.setTimeout(() => {
119
116
  R((s) => s + 1), U((s) => s + 1);
120
117
  }, ye);
121
118
  return () => {
122
- window.clearTimeout(c);
119
+ window.clearTimeout(a);
123
120
  };
124
- }, [o, $, r?.payment?.id]);
125
- const j = O(() => !Y.trim() || !r?.stripeAccountId ? null : Z(Y, {
126
- stripeAccount: r.stripeAccountId
127
- }), [r?.stripeAccountId]), z = O(() => {
121
+ }, [i, $, r?.payment?.id]);
122
+ const z = K(() => {
123
+ const a = r?.stripePublishableKey?.trim() || _e;
124
+ return !a || !r?.stripeAccountId ? null : W(a, {
125
+ stripeAccount: r.stripeAccountId
126
+ });
127
+ }, [r?.stripeAccountId, r?.stripePublishableKey]), F = K(() => {
128
128
  if (r?.clientSecret)
129
129
  return {
130
130
  clientSecret: r.clientSecret
131
131
  };
132
132
  }, [r?.clientSecret]);
133
133
  if (!m)
134
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
134
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
135
135
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
136
- /* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
136
+ /* @__PURE__ */ e(O, { className: "mt-0.5 h-5 w-5 text-destructive", "aria-hidden": "true" }),
137
137
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_missing_session") }) })
138
138
  ] }),
139
- /* @__PURE__ */ e(b, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
139
+ /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
140
140
  ] }) }) });
141
141
  if (h && !r)
142
142
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ e(q, {}) }) });
143
143
  if (A || !r)
144
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
144
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
145
145
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
146
- /* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
146
+ /* @__PURE__ */ e(O, { className: "mt-0.5 h-5 w-5 text-destructive", "aria-hidden": "true" }),
147
147
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: A ?? t("checkout_payment_return_status_error") }) })
148
148
  ] }),
149
- /* @__PURE__ */ e(b, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
149
+ /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
150
150
  ] }) }) });
151
- const F = typeof r.amountMinor == "number" && r.currency ? xe(r.amountMinor, r.currency, i.language) : null, w = o === "authorized" || o === "succeeded", L = o === "failed" || o === "cancelled", H = w ? se : L ? ne : ae, X = w ? "text-emerald-600" : L ? "text-red-600" : "text-amber-600";
151
+ const B = typeof r.amountMinor == "number" && r.currency ? xe(r.amountMinor, r.currency, l.language) : null, b = i === "authorized" || i === "succeeded", L = i === "failed" || i === "cancelled", X = b ? re : L ? se : ne, Y = b ? "text-emerald-600" : L ? "text-destructive" : "text-amber-600";
152
152
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-5xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ n("div", { className: "grid gap-6 lg:grid-cols-[1fr_1fr]", children: [
153
153
  /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-5", children: [
154
154
  /* @__PURE__ */ n("div", { className: "inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1 text-xs font-medium text-emerald-700", children: [
155
- /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
155
+ /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
156
156
  /* @__PURE__ */ e("span", { children: t("secure_payment_link.secured_badge") })
157
157
  ] }),
158
158
  /* @__PURE__ */ n("div", { children: [
@@ -160,9 +160,9 @@ function Be() {
160
160
  /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_hold_description") }) })
161
161
  ] }),
162
162
  /* @__PURE__ */ n("dl", { className: "grid gap-3 rounded-xl border border-slate-200 bg-slate-50 p-4 text-sm", children: [
163
- F ? /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3", children: [
163
+ B ? /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3", children: [
164
164
  /* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_hold_amount") }) }),
165
- /* @__PURE__ */ e("dd", { className: "font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: F }) })
165
+ /* @__PURE__ */ e("dd", { className: "font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: B }) })
166
166
  ] }) : null,
167
167
  r.providerType ? /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3", children: [
168
168
  /* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_provider") }) }),
@@ -170,33 +170,33 @@ function Be() {
170
170
  ] }) : null
171
171
  ] }),
172
172
  h ? /* @__PURE__ */ n("p", { className: "inline-flex items-center gap-2 text-sm text-slate-500", children: [
173
- /* @__PURE__ */ e(I, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
173
+ /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
174
174
  /* @__PURE__ */ e("span", { children: t("checkout_payment_return_loading") })
175
175
  ] }) : null
176
176
  ] }) }),
177
177
  /* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: [
178
- w || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
179
- /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(H, { className: `h-6 w-6 ${X}`, "aria-hidden": "true" }) }),
178
+ b || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
179
+ /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(X, { className: `h-6 w-6 ${Y}`, "aria-hidden": "true" }) }),
180
180
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
181
- /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.success_titles.${o}`) }) }),
182
- /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.statuses.${o}`) }) })
181
+ /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.success_titles.${i}`) }) }),
182
+ /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.statuses.${i}`) }) })
183
183
  ] }),
184
- w ? /* @__PURE__ */ e(b, { to: P, children: /* @__PURE__ */ n(f, { className: "gap-2", children: [
184
+ b ? /* @__PURE__ */ e(N, { to: P, children: /* @__PURE__ */ n(f, { className: "gap-2", children: [
185
185
  /* @__PURE__ */ e("span", { children: t("checkout_payment_return_go_to_success") }),
186
- /* @__PURE__ */ e(ce, { className: "h-4 w-4", "aria-hidden": "true" })
187
- ] }) }) : /* @__PURE__ */ e(b, { to: v, children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_retry_checkout") }) }) })
186
+ /* @__PURE__ */ e(ae, { className: "h-4 w-4", "aria-hidden": "true" })
187
+ ] }) }) : /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_retry_checkout") }) }) })
188
188
  ] }) : r.providerType === "mollie_connect_oauth" ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
189
189
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.mollie.form_title") }) }),
190
190
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_hold_form_description") }) }),
191
191
  r.profileId ? /* @__PURE__ */ e(
192
- ue,
192
+ de,
193
193
  {
194
194
  profileId: r.profileId,
195
195
  testmode: r.testmode === !0,
196
196
  submitLabel: t("checkout_payment_authorize_button"),
197
197
  submittingLabel: t("checkout_payment_authorizing_button"),
198
- onSubmit: async (c) => {
199
- const s = await M(c);
198
+ onSubmit: async (a) => {
199
+ const s = await j(a);
200
200
  if (!s.success)
201
201
  throw new Error(s.message || t("secure_payment_link.errors.payment_failed"));
202
202
  if (p(s), s.paymentStatus === "authorized" || s.paymentStatus === "succeeded") {
@@ -205,12 +205,12 @@ function Be() {
205
205
  }
206
206
  if (!s.checkoutUrl)
207
207
  throw new Error(s.message || t("secure_payment_link.errors.mollie_missing_url"));
208
- const N = new URL(s.checkoutUrl, window.location.origin).toString();
209
- window.location.assign(N);
208
+ const w = new URL(s.checkoutUrl, window.location.origin).toString();
209
+ window.location.assign(w);
210
210
  }
211
211
  }
212
- ) : /* @__PURE__ */ e("p", { className: "text-sm text-red-600", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) })
213
- ] }) : r.providerType === "stripe_connect_oauth" ? h ? /* @__PURE__ */ e(q, {}) : !r.clientSecret || !j || !z ? /* @__PURE__ */ e("p", { className: "text-sm text-red-600", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(ee, { stripe: j, options: z, children: /* @__PURE__ */ e(
212
+ ) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) })
213
+ ] }) : r.providerType === "stripe_connect_oauth" ? h ? /* @__PURE__ */ e(q, {}) : !r.clientSecret || !z || !F ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(Z, { stripe: z, options: F, children: /* @__PURE__ */ e(
214
214
  ge,
215
215
  {
216
216
  clientSecret: r.clientSecret,
@@ -218,19 +218,19 @@ function Be() {
218
218
  C();
219
219
  }
220
220
  }
221
- ) }, r.clientSecret) : /* @__PURE__ */ e("p", { className: "text-sm text-red-600", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) }),
222
- o === "pending" && r.payment?.id ? /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col justify-center gap-3 sm:flex-row", children: /* @__PURE__ */ n(
221
+ ) }, r.clientSecret) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) }),
222
+ i === "pending" && r.payment?.id ? /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col justify-center gap-3 sm:flex-row", children: /* @__PURE__ */ n(
223
223
  f,
224
224
  {
225
225
  type: "button",
226
226
  variant: "outline",
227
227
  onClick: () => {
228
- U((c) => c + 1);
228
+ U((a) => a + 1);
229
229
  },
230
230
  disabled: h,
231
231
  className: "gap-2",
232
232
  children: [
233
- h ? /* @__PURE__ */ e(I, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }) : null,
233
+ h ? /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }) : null,
234
234
  /* @__PURE__ */ e("span", { children: t("checkout_payment_return_refresh_status") })
235
235
  ]
236
236
  }
@@ -239,5 +239,5 @@ function Be() {
239
239
  ] }) });
240
240
  }
241
241
  export {
242
- Be as default
242
+ Me as default
243
243
  };
@@ -120,7 +120,7 @@ function me({
120
120
  ),
121
121
  children: [
122
122
  /* @__PURE__ */ t("span", { children: o(r.labelKey) }),
123
- /* @__PURE__ */ t("span", { className: "text-xs uppercase text-muted-foreground", children: r.code })
123
+ /* @__PURE__ */ t("span", { className: "text-2xs uppercase text-muted-foreground", children: r.code })
124
124
  ]
125
125
  },
126
126
  r.code
@@ -207,7 +207,7 @@ function Ce() {
207
207
  if (!w)
208
208
  return /* @__PURE__ */ t("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ t(ae, { className: "border-slate-200 bg-white p-5 shadow-sm sm:p-6", children: /* @__PURE__ */ g("div", { className: "space-y-4", children: [
209
209
  /* @__PURE__ */ t("h1", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: e("docs_contract_sale_not_found_title") }) }),
210
- /* @__PURE__ */ t("p", { className: "text-sm text-red-600", children: /* @__PURE__ */ t("span", { children: y ?? e("docs_contract_sale_load_error") }) }),
210
+ /* @__PURE__ */ t("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ t("span", { children: y ?? e("docs_contract_sale_load_error") }) }),
211
211
  /* @__PURE__ */ t(I, { to: `/${c ?? ""}`, children: /* @__PURE__ */ g(P, { className: "gap-2", children: [
212
212
  /* @__PURE__ */ t($, { className: "h-4 w-4", "aria-hidden": "true" }),
213
213
  /* @__PURE__ */ t("span", { children: e("docs_contract_sale_back_to_storefront") })
@@ -257,7 +257,7 @@ function Ce() {
257
257
  /* @__PURE__ */ t("span", { children: e("docs_contract_sale_back_to_storefront") })
258
258
  ] }),
259
259
  /* @__PURE__ */ g("div", { className: "flex min-w-0 items-center gap-2", children: [
260
- y ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-red-600", children: y }) : E === "signature" ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600", children: e("docs_contract_sale_submitting_signature") }) : E === "acceptance" ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600", children: e("docs_contract_sale_submitting_acceptance") }) : null,
260
+ y ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-destructive", children: y }) : E === "signature" ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600", children: e("docs_contract_sale_submitting_signature") }) : E === "acceptance" ? /* @__PURE__ */ t("span", { className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600", children: e("docs_contract_sale_submitting_acceptance") }) : null,
261
261
  /* @__PURE__ */ t(
262
262
  me,
263
263
  {
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AAyGA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAspB/B"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAgqB/B"}