@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.
- package/dist/StorefrontProvider.d.ts +29 -3
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +68 -58
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
- package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
- package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
- package/dist/components/AboutSection/index.js +1 -1
- package/dist/components/BikeProductCard/index.d.ts +2 -1
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +59 -41
- package/dist/components/BookingBikeVariantDialog/index.js +1 -1
- package/dist/components/BookingFlowSteps/index.js +8 -8
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
- package/dist/components/ContactSection/index.js +4 -4
- package/dist/components/Header/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.js +1 -1
- package/dist/components/ProductWarningNotice/index.js +10 -10
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +13 -13
- package/dist/i18n/en.d.ts +12 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/fr.d.ts +12 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +12 -0
- package/dist/index.d.ts +116 -7
- package/dist/index.js +312 -305
- package/dist/lib/cart.js +1 -1
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +28 -28
- package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +14 -6
- package/dist/lib/checkoutPaymentSession.d.ts +1 -0
- package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentSession.js +12 -11
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +34 -15
- package/dist/lib/products.d.ts +4 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +74 -39
- package/dist/lib/securePaymentLink.d.ts +1 -0
- package/dist/lib/securePaymentLink.d.ts.map +1 -1
- package/dist/lib/securePaymentLink.js +1 -0
- package/dist/lib/storefrontAvailability.d.ts +9 -0
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +28 -18
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +290 -289
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +224 -216
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +92 -92
- package/dist/pages/ContractSaleDocumentPage.js +3 -3
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +167 -161
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +62 -62
- package/dist/pages/PaymentLinkSuccessPage.js +7 -7
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +161 -161
- package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +4 -4
- package/dist/ui/day-picker.js +5 -5
- package/package.json +2 -2
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
- 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":"
|
|
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
|
|
3
|
-
import { toast as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { loadStripe as
|
|
6
|
-
import { Elements as
|
|
7
|
-
import { AlertTriangle as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { apiPost as
|
|
10
|
-
import { ROUTE as
|
|
11
|
-
import { pickBookingSearchParams as
|
|
12
|
-
import { useStorefrontCart as
|
|
13
|
-
import { MollieCardFieldsForm as
|
|
14
|
-
import { StripeCardFieldsForm as
|
|
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
|
|
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(
|
|
19
|
+
return new Intl.NumberFormat(c, {
|
|
23
20
|
style: "currency",
|
|
24
|
-
currency:
|
|
21
|
+
currency: l.toUpperCase()
|
|
25
22
|
}).format(t / 100);
|
|
26
23
|
} catch {
|
|
27
|
-
return `${(t / 100).toFixed(2)} ${
|
|
24
|
+
return `${(t / 100).toFixed(2)} ${l.toUpperCase()}`;
|
|
28
25
|
}
|
|
29
26
|
};
|
|
30
27
|
function ge({
|
|
31
28
|
clientSecret: t,
|
|
32
|
-
onSuccess:
|
|
29
|
+
onSuccess: l
|
|
33
30
|
}) {
|
|
34
|
-
const { t:
|
|
31
|
+
const { t: c } = I(), u = ee();
|
|
35
32
|
return /* @__PURE__ */ e(
|
|
36
|
-
|
|
33
|
+
ue,
|
|
37
34
|
{
|
|
38
35
|
requireEmail: !1,
|
|
39
|
-
submitLabel:
|
|
40
|
-
submittingLabel:
|
|
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(
|
|
44
|
-
const
|
|
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 (
|
|
51
|
-
throw new Error(
|
|
52
|
-
const r =
|
|
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(
|
|
55
|
-
|
|
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 } =
|
|
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(
|
|
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
|
|
68
|
-
const { t, i18n:
|
|
69
|
-
|
|
70
|
-
const d =
|
|
71
|
-
if (!
|
|
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
|
|
74
|
-
|
|
70
|
+
const s = await ce(
|
|
71
|
+
ie,
|
|
75
72
|
{
|
|
76
|
-
storeSlug:
|
|
73
|
+
storeSlug: c,
|
|
77
74
|
checkoutSessionId: m,
|
|
78
75
|
returnSearch: d || void 0,
|
|
79
|
-
cardToken:
|
|
76
|
+
cardToken: a
|
|
80
77
|
}
|
|
81
78
|
);
|
|
82
79
|
return le.parse(s);
|
|
83
80
|
}, C = async () => {
|
|
84
|
-
k.current || (k.current = !0,
|
|
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 (!
|
|
86
|
+
if (!c || !m) {
|
|
90
87
|
p(null), g(t("checkout_payment_return_missing_session")), S(!1);
|
|
91
88
|
return;
|
|
92
89
|
}
|
|
93
|
-
let
|
|
90
|
+
let a = !1;
|
|
94
91
|
return S(!0), g(null), (async () => {
|
|
95
92
|
try {
|
|
96
|
-
const s = await
|
|
97
|
-
if (
|
|
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
|
|
104
|
-
(
|
|
100
|
+
const w = s.paymentStatus;
|
|
101
|
+
(w === "authorized" || w === "succeeded") && !k.current && await C();
|
|
105
102
|
} catch (s) {
|
|
106
|
-
if (
|
|
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
|
-
|
|
106
|
+
a || S(!1);
|
|
110
107
|
}
|
|
111
108
|
})(), () => {
|
|
112
|
-
|
|
109
|
+
a = !0;
|
|
113
110
|
};
|
|
114
|
-
}, [m, x, u, d, D,
|
|
115
|
-
const
|
|
111
|
+
}, [m, x, u, d, D, c, P, t]);
|
|
112
|
+
const i = r?.paymentStatus ?? "pending";
|
|
116
113
|
E(() => {
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
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(
|
|
119
|
+
window.clearTimeout(a);
|
|
123
120
|
};
|
|
124
|
-
}, [
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
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-
|
|
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(
|
|
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(
|
|
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-
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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
|
-
|
|
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:
|
|
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(
|
|
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
|
-
|
|
179
|
-
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(
|
|
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.${
|
|
182
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.statuses.${
|
|
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
|
-
|
|
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(
|
|
187
|
-
] }) }) : /* @__PURE__ */ e(
|
|
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
|
-
|
|
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 (
|
|
199
|
-
const s = await
|
|
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
|
|
209
|
-
window.location.assign(
|
|
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-
|
|
213
|
-
] }) : r.providerType === "stripe_connect_oauth" ? h ? /* @__PURE__ */ e(q, {}) : !r.clientSecret || !
|
|
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-
|
|
222
|
-
|
|
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((
|
|
228
|
+
U((a) => a + 1);
|
|
229
229
|
},
|
|
230
230
|
disabled: h,
|
|
231
231
|
className: "gap-2",
|
|
232
232
|
children: [
|
|
233
|
-
h ? /* @__PURE__ */ e(
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAgqB/B"}
|