@loczer/storefront-sdk 0.176.0 → 0.178.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/chunks/ui/dist/Map/{MapContent-BqCzk6pD.js → MapContent-DUHBHUBa.js} +7 -7
- package/dist/chunks/ui/dist/Map/constants-DlJEohkl.js +4 -0
- package/dist/chunks/ui/dist/{Map-Cqn7INdm.js → Map-_kbTiMe4.js} +7 -7
- package/dist/chunks/ui/dist/Spinner/index-SbbUxcsT.js +48 -0
- package/dist/components/BookingBikeVariantDialog/index.js +12 -12
- package/dist/components/ContractSaleDocument/Invoice.js +1 -1
- package/dist/components/Map/index.js +1 -1
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +11 -11
- package/dist/components/StorefrontCartPanel/index.js +7 -7
- package/dist/components/TestimonialsSection/index.d.ts.map +1 -1
- package/dist/components/TestimonialsSection/index.js +108 -117
- package/dist/components/payment/MollieCardFieldsForm.d.ts.map +1 -1
- package/dist/components/payment/MollieCardFieldsForm.js +16 -15
- package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +11 -10
- package/dist/lib/nameInitials.d.ts +3 -0
- package/dist/lib/nameInitials.d.ts.map +1 -0
- package/dist/lib/nameInitials.js +19 -0
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +42 -41
- package/dist/pages/CheckoutSuccessPage.js +11 -11
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +25 -24
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +37 -37
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +44 -43
- package/dist/pages/PaymentLinkSuccessPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +15 -14
- package/dist/pages/ProductPage.js +1 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.js +36 -35
- package/dist/pages/checkout/components/CheckoutPaymentCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +10 -9
- package/dist/storefront.css +1 -1
- package/package.json +3 -2
- package/dist/chunks/ui/dist/Map/constants-AiBwXZf6.js +0 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as p, useEffect as T, useMemo as M } from "react";
|
|
3
3
|
import { useNavigate as j, useLoaderData as G, Link as Y, replace as q } from "@rpcbase/router";
|
|
4
|
-
import { loadStripe as
|
|
5
|
-
import { Elements as
|
|
6
|
-
import {
|
|
4
|
+
import { loadStripe as z } from "@stripe/stripe-js";
|
|
5
|
+
import { Elements as D, useStripe as H } from "@stripe/react-stripe-js";
|
|
6
|
+
import { Spinner as J } from "../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
7
|
+
import { AlertTriangle as Q, ShieldCheck as V } from "lucide-react";
|
|
7
8
|
import { useTranslation as k } from "react-i18next";
|
|
8
9
|
import { apiPost as g, apiGet as W } from "../lib/apiCall.js";
|
|
9
10
|
import { GET_MOLLIE_SECURE_PAYMENT_SESSION_ROUTE as R, getMollieSecurePaymentSessionResponseSchema as U, GET_STRIPE_SECURE_PAYMENT_SESSION_ROUTE as X, getStripeSecurePaymentSessionResponseSchema as Z, GET_SECURE_PAYMENT_LINK_ROUTE as ee, getSecurePaymentLinkResponseSchema as re } from "../lib/securePaymentLink.js";
|
|
@@ -11,7 +12,7 @@ import { MollieCardFieldsForm as se } from "../components/payment/MollieCardFiel
|
|
|
11
12
|
import { StripeCardFieldsForm as te } from "../components/payment/StripeCardFieldsForm.js";
|
|
12
13
|
import { Button as ne } from "../ui/button.js";
|
|
13
14
|
import { Card as x } from "../ui/card.js";
|
|
14
|
-
const ie = {}, le = () => ie?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "",
|
|
15
|
+
const ie = {}, le = () => ie?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", oe = le(), ae = (r, d, l) => {
|
|
15
16
|
try {
|
|
16
17
|
return new Intl.NumberFormat(l, {
|
|
17
18
|
style: "currency",
|
|
@@ -24,16 +25,16 @@ const ie = {}, le = () => ie?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", ae
|
|
|
24
25
|
function C() {
|
|
25
26
|
const { t: r } = k();
|
|
26
27
|
return /* @__PURE__ */ c("div", { className: "flex min-h-48 items-center justify-center gap-2 text-sm text-slate-600", children: [
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
+
/* @__PURE__ */ e(J, { className: "size-4", "aria-hidden": "true" }),
|
|
28
29
|
/* @__PURE__ */ e("span", { children: r("secure_payment_link.form.loading_session") })
|
|
29
30
|
] });
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
const l = typeof d.storeSlug == "string" ? d.storeSlug.trim().toLowerCase() : "",
|
|
33
|
-
if (!l || !
|
|
32
|
+
const ve = (async ({ ctx: r, params: d }) => {
|
|
33
|
+
const l = typeof d.storeSlug == "string" ? d.storeSlug.trim().toLowerCase() : "", o = typeof d.token == "string" ? d.token.trim() : "";
|
|
34
|
+
if (!l || !o)
|
|
34
35
|
return {
|
|
35
36
|
storeSlug: l,
|
|
36
|
-
token:
|
|
37
|
+
token: o,
|
|
37
38
|
session: null,
|
|
38
39
|
errorMessage: null,
|
|
39
40
|
errorKey: "invalid_link"
|
|
@@ -43,23 +44,23 @@ const be = (async ({ ctx: r, params: d }) => {
|
|
|
43
44
|
ee,
|
|
44
45
|
{
|
|
45
46
|
storeSlug: l,
|
|
46
|
-
token:
|
|
47
|
+
token: o
|
|
47
48
|
},
|
|
48
49
|
r
|
|
49
50
|
), t = re.parse(n);
|
|
50
51
|
if (!t.success || !t.paymentLinkSession)
|
|
51
52
|
return {
|
|
52
53
|
storeSlug: l,
|
|
53
|
-
token:
|
|
54
|
+
token: o,
|
|
54
55
|
session: null,
|
|
55
56
|
errorMessage: t.message || null,
|
|
56
57
|
errorKey: null
|
|
57
58
|
};
|
|
58
59
|
if (t.paymentLinkSession.status !== "pending")
|
|
59
|
-
throw q(`/${encodeURIComponent(l)}/secure-payment-link/${encodeURIComponent(
|
|
60
|
+
throw q(`/${encodeURIComponent(l)}/secure-payment-link/${encodeURIComponent(o)}/success`);
|
|
60
61
|
return {
|
|
61
62
|
storeSlug: l,
|
|
62
|
-
token:
|
|
63
|
+
token: o,
|
|
63
64
|
session: t.paymentLinkSession,
|
|
64
65
|
errorMessage: null,
|
|
65
66
|
errorKey: null
|
|
@@ -69,7 +70,7 @@ const be = (async ({ ctx: r, params: d }) => {
|
|
|
69
70
|
throw n;
|
|
70
71
|
return console.error("Failed to load secure payment link", n), {
|
|
71
72
|
storeSlug: l,
|
|
72
|
-
token:
|
|
73
|
+
token: o,
|
|
73
74
|
session: null,
|
|
74
75
|
errorMessage: null,
|
|
75
76
|
errorKey: "load_failed"
|
|
@@ -80,15 +81,15 @@ function ce({
|
|
|
80
81
|
clientSecret: r,
|
|
81
82
|
onSuccess: d
|
|
82
83
|
}) {
|
|
83
|
-
const { t: l } = k(),
|
|
84
|
+
const { t: l } = k(), o = H();
|
|
84
85
|
return /* @__PURE__ */ e(
|
|
85
86
|
te,
|
|
86
87
|
{
|
|
87
88
|
requireEmail: !1,
|
|
88
89
|
onSubmit: async ({ paymentMethodId: n }) => {
|
|
89
|
-
if (!
|
|
90
|
+
if (!o)
|
|
90
91
|
throw new Error(l("secure_payment_link.errors.stripe_not_ready"));
|
|
91
|
-
const t = await
|
|
92
|
+
const t = await o.confirmCardPayment(
|
|
92
93
|
r,
|
|
93
94
|
{
|
|
94
95
|
payment_method: n
|
|
@@ -104,8 +105,8 @@ function ce({
|
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
const { t: r, i18n: d } = k(), l = j(),
|
|
108
|
+
function we() {
|
|
109
|
+
const { t: r, i18n: d } = k(), l = j(), o = G(), { storeSlug: n, token: t } = o, s = o.session, b = o.errorMessage ?? (o.errorKey ? r(`secure_payment_link.errors.${o.errorKey}`) : null), K = s?.providerType === "mollie_connect_oauth" && s.status === "pending" && !!(n && t), A = s?.providerType === "stripe_connect_oauth" && s.status === "pending" && !!(n && t), [y, h] = p(null), [F, f] = p(K), [N, _] = p(null), [m, v] = p(null), [$, w] = p(A), [E, S] = p(null), L = `/${n ?? ""}/secure-payment-link/${t ?? ""}/success`;
|
|
109
110
|
T(() => {
|
|
110
111
|
if (!s || !n || !t) {
|
|
111
112
|
h(null), _(null), f(!1);
|
|
@@ -115,7 +116,7 @@ function ve() {
|
|
|
115
116
|
h(null), _(null), f(!1);
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
|
-
let
|
|
119
|
+
let a = !1;
|
|
119
120
|
return f(!0), _(null), h(null), (async () => {
|
|
120
121
|
try {
|
|
121
122
|
const u = await g(
|
|
@@ -125,24 +126,24 @@ function ve() {
|
|
|
125
126
|
token: t
|
|
126
127
|
}
|
|
127
128
|
), i = U.parse(u);
|
|
128
|
-
if (
|
|
129
|
+
if (a) return;
|
|
129
130
|
if (!i.success || !i.profileId) {
|
|
130
131
|
_(i.message || r("secure_payment_link.errors.session_failed"));
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
h(i);
|
|
134
135
|
} catch (u) {
|
|
135
|
-
if (
|
|
136
|
+
if (a) return;
|
|
136
137
|
console.error("Failed to create mollie secure session", u), _(r("secure_payment_link.errors.session_failed"));
|
|
137
138
|
} finally {
|
|
138
|
-
|
|
139
|
+
a || f(!1);
|
|
139
140
|
}
|
|
140
141
|
})(), () => {
|
|
141
|
-
|
|
142
|
+
a = !0;
|
|
142
143
|
};
|
|
143
144
|
}, [s, n, r, t]), T(() => {
|
|
144
145
|
if (!s || s.providerType !== "stripe_connect_oauth" || s.status !== "pending" || !n || !t) return;
|
|
145
|
-
let
|
|
146
|
+
let a = !1;
|
|
146
147
|
return w(!0), S(null), v(null), (async () => {
|
|
147
148
|
try {
|
|
148
149
|
const u = await g(
|
|
@@ -152,25 +153,25 @@ function ve() {
|
|
|
152
153
|
token: t
|
|
153
154
|
}
|
|
154
155
|
), i = Z.parse(u);
|
|
155
|
-
if (
|
|
156
|
+
if (a) return;
|
|
156
157
|
if (!i.success || !i.clientSecret || !i.payment) {
|
|
157
158
|
S(i.message || r("secure_payment_link.errors.session_failed"));
|
|
158
159
|
return;
|
|
159
160
|
}
|
|
160
161
|
v(i);
|
|
161
162
|
} catch (u) {
|
|
162
|
-
if (
|
|
163
|
+
if (a) return;
|
|
163
164
|
console.error("Failed to create stripe secure session", u), S(r("secure_payment_link.errors.session_failed"));
|
|
164
165
|
} finally {
|
|
165
|
-
|
|
166
|
+
a || w(!1);
|
|
166
167
|
}
|
|
167
168
|
})(), () => {
|
|
168
|
-
|
|
169
|
+
a = !0;
|
|
169
170
|
};
|
|
170
171
|
}, [s, n, r, t]);
|
|
171
172
|
const P = M(() => {
|
|
172
|
-
const
|
|
173
|
-
return !
|
|
173
|
+
const a = m?.stripePublishableKey?.trim() || oe;
|
|
174
|
+
return !a || !m?.stripeAccountId ? null : z(a, {
|
|
174
175
|
stripeAccount: m.stripeAccountId
|
|
175
176
|
});
|
|
176
177
|
}, [m?.stripeAccountId, m?.stripePublishableKey]), I = M(() => {
|
|
@@ -178,18 +179,18 @@ function ve() {
|
|
|
178
179
|
return {
|
|
179
180
|
clientSecret: m.clientSecret
|
|
180
181
|
};
|
|
181
|
-
}, [m?.clientSecret]), B = s ?
|
|
182
|
-
return
|
|
183
|
-
/* @__PURE__ */ e(
|
|
182
|
+
}, [m?.clientSecret]), B = s ? ae(s.amountMinor, s.currency, d.language) : "—";
|
|
183
|
+
return b || !s ? /* @__PURE__ */ e("div", { className: "mx-auto max-w-4xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(x, { className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
|
|
184
|
+
/* @__PURE__ */ e(Q, { className: "mt-0.5 h-5 w-5 text-destructive", "aria-hidden": "true" }),
|
|
184
185
|
/* @__PURE__ */ c("div", { className: "space-y-3", children: [
|
|
185
186
|
/* @__PURE__ */ e("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.errors.title") }) }),
|
|
186
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children:
|
|
187
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: b ?? r("secure_payment_link.errors.invalid_link") }) }),
|
|
187
188
|
/* @__PURE__ */ e(Y, { to: `/${n ?? ""}`, children: /* @__PURE__ */ e(ne, { variant: "outline", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.back_to_store") }) }) })
|
|
188
189
|
] })
|
|
189
190
|
] }) }) }) : /* @__PURE__ */ e("div", { className: "mx-auto max-w-5xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ c("div", { className: "grid gap-6 lg:grid-cols-[1fr_1fr]", children: [
|
|
190
191
|
/* @__PURE__ */ e(x, { className: "border-slate-200 bg-white p-5 shadow-sm", children: /* @__PURE__ */ c("div", { className: "space-y-5", children: [
|
|
191
|
-
/* @__PURE__ */ c("div", { className: "inline-flex items-center gap-2 rounded-full border border-
|
|
192
|
-
/* @__PURE__ */ e(
|
|
192
|
+
/* @__PURE__ */ c("div", { className: "inline-flex items-center gap-2 rounded-full border border-success-border bg-success-subtle px-3 py-1 text-xs font-medium text-success", children: [
|
|
193
|
+
/* @__PURE__ */ e(V, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
193
194
|
/* @__PURE__ */ e("span", { children: r("secure_payment_link.secured_badge") })
|
|
194
195
|
] }),
|
|
195
196
|
/* @__PURE__ */ c("div", { children: [
|
|
@@ -214,18 +215,18 @@ function ve() {
|
|
|
214
215
|
/* @__PURE__ */ e(x, { className: "border-slate-200 bg-white p-5 shadow-sm", children: s.providerType === "mollie_connect_oauth" ? /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
215
216
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.mollie.form_title") }) }),
|
|
216
217
|
/* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.mollie.form_description") }) }),
|
|
217
|
-
F ? /* @__PURE__ */ e(C, {}) :
|
|
218
|
+
F ? /* @__PURE__ */ e(C, {}) : N ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: N }) }) : y?.profileId ? /* @__PURE__ */ e(
|
|
218
219
|
se,
|
|
219
220
|
{
|
|
220
221
|
profileId: y.profileId,
|
|
221
222
|
testmode: y.testmode === !0,
|
|
222
|
-
onSubmit: async (
|
|
223
|
+
onSubmit: async (a) => {
|
|
223
224
|
const u = await g(
|
|
224
225
|
R,
|
|
225
226
|
{
|
|
226
227
|
storeSlug: n,
|
|
227
228
|
token: t,
|
|
228
|
-
cardToken:
|
|
229
|
+
cardToken: a
|
|
229
230
|
}
|
|
230
231
|
), i = U.parse(u);
|
|
231
232
|
if (!i.success)
|
|
@@ -241,7 +242,7 @@ function ve() {
|
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.errors.session_failed") }) })
|
|
244
|
-
] }) : $ ? /* @__PURE__ */ e(C, {}) : E ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: E }) }) : !m?.clientSecret || !P || !I ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(
|
|
245
|
+
] }) : $ ? /* @__PURE__ */ e(C, {}) : E ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: E }) }) : !m?.clientSecret || !P || !I ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(D, { stripe: P, options: I, children: /* @__PURE__ */ e(
|
|
245
246
|
ce,
|
|
246
247
|
{
|
|
247
248
|
clientSecret: m.clientSecret,
|
|
@@ -253,6 +254,6 @@ function ve() {
|
|
|
253
254
|
] }) });
|
|
254
255
|
}
|
|
255
256
|
export {
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
we as default,
|
|
258
|
+
ve as loader
|
|
258
259
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentLinkSuccessPage.d.ts","sourceRoot":"","sources":["../../src/pages/PaymentLinkSuccessPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaymentLinkSuccessPage.d.ts","sourceRoot":"","sources":["../../src/pages/PaymentLinkSuccessPage.tsx"],"names":[],"mappings":"AAiCA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,CAAA;AAEnB,MAAM,CAAC,OAAO,UAAU,sBAAsB,4CAiK7C"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as h, useRef as
|
|
2
|
+
import { useState as h, useRef as L, useEffect as y } from "react";
|
|
3
3
|
import { useLoaderData as C, Link as M } from "@rpcbase/router";
|
|
4
|
-
import {
|
|
4
|
+
import { Spinner as S } from "../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
5
|
+
import { CheckCircle2 as K, XCircle as R, CircleDashed as T } from "lucide-react";
|
|
5
6
|
import { useTranslation as D } from "react-i18next";
|
|
6
|
-
import { apiGet as
|
|
7
|
+
import { apiGet as w } from "../lib/apiCall.js";
|
|
7
8
|
import { GET_SECURE_PAYMENT_LINK_ROUTE as v, getSecurePaymentLinkResponseSchema as b } from "../lib/securePaymentLink.js";
|
|
8
9
|
import { Button as $ } from "../ui/button.js";
|
|
9
10
|
import { Card as j } from "../ui/card.js";
|
|
@@ -16,7 +17,7 @@ const I = (s, l, r) => {
|
|
|
16
17
|
} catch {
|
|
17
18
|
return `${(s / 100).toFixed(2)} ${l.toUpperCase()}`;
|
|
18
19
|
}
|
|
19
|
-
},
|
|
20
|
+
}, E = 2500, P = E * 3, J = (async ({ ctx: s, params: l }) => {
|
|
20
21
|
const r = typeof l.storeSlug == "string" ? l.storeSlug.trim().toLowerCase() : "", a = typeof l.token == "string" ? l.token.trim() : "";
|
|
21
22
|
if (!r || !a)
|
|
22
23
|
return {
|
|
@@ -27,7 +28,7 @@ const I = (s, l, r) => {
|
|
|
27
28
|
errorKey: "invalid_link"
|
|
28
29
|
};
|
|
29
30
|
try {
|
|
30
|
-
const c = await
|
|
31
|
+
const c = await w(
|
|
31
32
|
v,
|
|
32
33
|
{
|
|
33
34
|
storeSlug: r,
|
|
@@ -58,10 +59,10 @@ const I = (s, l, r) => {
|
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
|
-
function
|
|
62
|
+
function Q() {
|
|
62
63
|
const { t: s, i18n: l } = D(), r = C(), { storeSlug: a, token: c } = r, [t, x] = h(r.session), [_, u] = h(!1), [p, d] = h(
|
|
63
64
|
r.errorMessage ?? (r.errorKey ? s(`secure_payment_link.errors.${r.errorKey}`) : null)
|
|
64
|
-
), [g, N] = h(0), k =
|
|
65
|
+
), [g, N] = h(0), k = L(Date.now());
|
|
65
66
|
y(() => {
|
|
66
67
|
x(r.session), u(!1), d(
|
|
67
68
|
r.errorMessage ?? (r.errorKey ? s(`secure_payment_link.errors.${r.errorKey}`) : null)
|
|
@@ -76,7 +77,7 @@ function J() {
|
|
|
76
77
|
return (async () => {
|
|
77
78
|
u(!0), d(null);
|
|
78
79
|
try {
|
|
79
|
-
const m = await
|
|
80
|
+
const m = await w(v, {
|
|
80
81
|
storeSlug: a,
|
|
81
82
|
token: c,
|
|
82
83
|
reconcileStripeStatus: Date.now() - k.current >= P ? "true" : void 0
|
|
@@ -102,21 +103,21 @@ function J() {
|
|
|
102
103
|
if (!t || p || _ || n !== "pending") return;
|
|
103
104
|
const o = window.setTimeout(() => {
|
|
104
105
|
N((m) => m + 1);
|
|
105
|
-
},
|
|
106
|
+
}, E);
|
|
106
107
|
return () => {
|
|
107
108
|
window.clearTimeout(o);
|
|
108
109
|
};
|
|
109
110
|
}, [p, _, t, n]), /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(j, { className: "border-slate-200 bg-white p-5 shadow-sm sm:p-6", children: _ && !t ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-sm text-slate-600", children: [
|
|
110
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(S, { className: "size-4", "aria-hidden": "true" }),
|
|
111
112
|
/* @__PURE__ */ e("span", { children: s("secure_payment_link.loading") })
|
|
112
113
|
] }) : p || !t ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: p ?? s("secure_payment_link.errors.invalid_link") }) }) : n === "pending" ? /* @__PURE__ */ i("div", { className: "space-y-4 text-center", children: [
|
|
113
|
-
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(
|
|
114
|
+
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(S, { className: "size-6 text-slate-600", "aria-hidden": "true" }) }),
|
|
114
115
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
115
116
|
/* @__PURE__ */ e("h1", { className: "text-2xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: s("secure_payment_link.confirmation_loading_title") }) }),
|
|
116
117
|
/* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: s("secure_payment_link.confirmation_loading_description") }) })
|
|
117
118
|
] })
|
|
118
119
|
] }) : /* @__PURE__ */ i("div", { className: "space-y-6 text-center", children: [
|
|
119
|
-
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(n === "succeeded" || n === "authorized" ? K : n === "failed" || n === "cancelled" ? R : T, { className: `h-6 w-6 ${n === "succeeded" || n === "authorized" ? "text-
|
|
120
|
+
/* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(n === "succeeded" || n === "authorized" ? K : n === "failed" || n === "cancelled" ? R : T, { className: `h-6 w-6 ${n === "succeeded" || n === "authorized" ? "text-success" : n === "failed" || n === "cancelled" ? "text-destructive" : "text-warning"}`, "aria-hidden": "true" }) }),
|
|
120
121
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
121
122
|
/* @__PURE__ */ e("h1", { className: "text-2xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: s(`secure_payment_link.success_titles.${n}`) }) }),
|
|
122
123
|
/* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: s(`secure_payment_link.statuses.${n}`) }) })
|
|
@@ -135,6 +136,6 @@ function J() {
|
|
|
135
136
|
] }) }) });
|
|
136
137
|
}
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
Q as default,
|
|
140
|
+
J as loader
|
|
140
141
|
};
|
|
@@ -185,7 +185,7 @@ function ka() {
|
|
|
185
185
|
i.features?.length ? /* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
|
|
186
186
|
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ t("span", { children: a("product_features_title") }) }),
|
|
187
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
|
-
/* @__PURE__ */ t(Pt, { className: "mt-0.5 h-4 w-4 text-
|
|
188
|
+
/* @__PURE__ */ t(Pt, { className: "mt-0.5 h-4 w-4 text-success", "aria-hidden": "true" }),
|
|
189
189
|
/* @__PURE__ */ t("span", { children: I(n, s.language, y) })
|
|
190
190
|
] }, `${i.id}-${c}`)) })
|
|
191
191
|
] }) : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutCouponCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutCouponCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutCouponCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutCouponCard.tsx"],"names":[],"mappings":"AASA,KAAK,uBAAuB,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,2CA8DzB"}
|
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as g } from "@rpcbase/ui";
|
|
3
|
+
import { Spinner as f } from "../../../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
4
|
+
import { Tag as _, X as v } from "lucide-react";
|
|
5
|
+
import { useTranslation as N } from "react-i18next";
|
|
6
|
+
import { Button as p } from "../../../ui/button.js";
|
|
6
7
|
import { Input as k } from "../../../ui/input.js";
|
|
7
|
-
function
|
|
8
|
-
className:
|
|
9
|
-
code:
|
|
10
|
-
appliedCode:
|
|
11
|
-
discountLabel:
|
|
12
|
-
message:
|
|
13
|
-
error:
|
|
14
|
-
loading:
|
|
8
|
+
function B({
|
|
9
|
+
className: u,
|
|
10
|
+
code: r,
|
|
11
|
+
appliedCode: a,
|
|
12
|
+
discountLabel: l,
|
|
13
|
+
message: o,
|
|
14
|
+
error: n,
|
|
15
|
+
loading: c,
|
|
15
16
|
disabled: i,
|
|
16
|
-
onCodeChange:
|
|
17
|
-
onApply:
|
|
17
|
+
onCodeChange: d,
|
|
18
|
+
onApply: m,
|
|
18
19
|
onRemove: h
|
|
19
20
|
}) {
|
|
20
|
-
const { t } =
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ e(
|
|
21
|
+
const { t } = N(), x = r.trim().length > 0 && !c && !i;
|
|
22
|
+
return /* @__PURE__ */ s("div", { className: g("grid gap-3 border-t border-slate-200 pt-3", u), children: [
|
|
23
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
24
|
+
/* @__PURE__ */ e(_, { className: "h-4 w-4 text-slate-500", "aria-hidden": "true" }),
|
|
24
25
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t("checkout_coupon_title") }) })
|
|
25
26
|
] }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ s("div", { className: "grid gap-2 sm:grid-cols-[1fr_auto] lg:grid-cols-1 xl:grid-cols-[1fr_auto]", children: [
|
|
27
28
|
/* @__PURE__ */ e(
|
|
28
29
|
k,
|
|
29
30
|
{
|
|
30
|
-
value:
|
|
31
|
-
onChange: (
|
|
31
|
+
value: r,
|
|
32
|
+
onChange: (b) => d(b.target.value.toUpperCase()),
|
|
32
33
|
placeholder: t("checkout_coupon_placeholder"),
|
|
33
|
-
disabled:
|
|
34
|
+
disabled: c || i,
|
|
34
35
|
"aria-label": t("checkout_coupon_label")
|
|
35
36
|
}
|
|
36
37
|
),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
38
|
+
/* @__PURE__ */ s(
|
|
39
|
+
p,
|
|
39
40
|
{
|
|
40
41
|
type: "button",
|
|
41
42
|
variant: "outline",
|
|
42
43
|
disabled: !x,
|
|
43
44
|
className: "gap-2",
|
|
44
|
-
onClick:
|
|
45
|
+
onClick: m,
|
|
45
46
|
children: [
|
|
46
|
-
|
|
47
|
+
c ? /* @__PURE__ */ e(f, { className: "size-4", "aria-hidden": "true" }) : null,
|
|
47
48
|
/* @__PURE__ */ e("span", { children: t("checkout_coupon_apply") })
|
|
48
49
|
]
|
|
49
50
|
}
|
|
50
51
|
)
|
|
51
52
|
] }),
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code:
|
|
53
|
+
a && l ? /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3 rounded-md border border-success-border bg-success-subtle px-3 py-2 text-sm text-success", children: [
|
|
54
|
+
/* @__PURE__ */ e("span", { children: t("checkout_coupon_applied", { code: a, amount: l }) }),
|
|
54
55
|
/* @__PURE__ */ e(
|
|
55
|
-
|
|
56
|
+
p,
|
|
56
57
|
{
|
|
57
58
|
type: "button",
|
|
58
59
|
variant: "ghost",
|
|
59
60
|
size: "icon",
|
|
60
|
-
className: "h-7 w-7 text-
|
|
61
|
+
className: "h-7 w-7 text-success hover:bg-success-subtle-hover",
|
|
61
62
|
onClick: h,
|
|
62
63
|
"aria-label": t("checkout_coupon_remove"),
|
|
63
|
-
children: /* @__PURE__ */ e(
|
|
64
|
+
children: /* @__PURE__ */ e(v, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
64
65
|
}
|
|
65
66
|
)
|
|
66
67
|
] }) : null,
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
o ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: o }) }) : null,
|
|
69
|
+
n ? /* @__PURE__ */ e("p", { className: "text-xs text-destructive", children: /* @__PURE__ */ e("span", { children: n }) }) : null
|
|
69
70
|
] });
|
|
70
71
|
}
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
B as CheckoutCouponCard
|
|
73
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPaymentCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutPaymentCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"CheckoutPaymentCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutPaymentCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAK/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAMrF,KAAK,wBAAwB,GAAG;IAC9B,oBAAoB,EAAE,sBAAsB,GAAG,sBAAsB,CAAA;IACrE,qBAAqB,EAAE,6BAA6B,CAAA;IACpD,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE;QACN,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAA;QACtC,iBAAiB,EAAE,MAAM,CAAA;QACzB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAC/C,CAAA;IACD,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;QACtC,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAC9B,CAAA;CACF,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,oBAAoB,EACpB,qBAAqB,EACrB,QAAQ,EACR,MAAM,EACN,MAAM,GACP,EAAE,wBAAwB,2CA+E1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPaymentSummaryCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutPaymentSummaryCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutPaymentSummaryCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutPaymentSummaryCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAK7D,KAAK,+BAA+B,GAAG;IACrC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,qBAAqB,EAAE,6BAA6B,CAAA;IACpD,UAAU,EAAE,OAAO,CAAA;IACnB,qBAAqB,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;CACvE,CAAA;AAED,wBAAgB,0BAA0B,CAAC,EACzC,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,qBAAqB,GACtB,EAAE,+BAA+B,2CAgIjC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Spinner as y } from "../../../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
3
|
+
import { AlertTriangle as k } from "lucide-react";
|
|
3
4
|
import { useTranslation as w } from "react-i18next";
|
|
4
5
|
import { Button as C } from "../../../ui/button.js";
|
|
5
6
|
import { Card as j } from "../../../ui/card.js";
|
|
@@ -14,9 +15,9 @@ function F({
|
|
|
14
15
|
amountToCollectMinor: x,
|
|
15
16
|
amountToCollectLabel: _,
|
|
16
17
|
paymentSummaryHelper: c,
|
|
17
|
-
paymentDecisionLoading:
|
|
18
|
+
paymentDecisionLoading: i,
|
|
18
19
|
paymentDecisionError: s,
|
|
19
|
-
canChoosePaymentMethod:
|
|
20
|
+
canChoosePaymentMethod: n,
|
|
20
21
|
showAmountDueNowRow: g,
|
|
21
22
|
selectedPaymentMethod: b,
|
|
22
23
|
submitting: N,
|
|
@@ -30,7 +31,7 @@ function F({
|
|
|
30
31
|
return /* @__PURE__ */ a(j, { className: "border-slate-200 bg-white shadow-sm", children: [
|
|
31
32
|
/* @__PURE__ */ a("div", { className: "border-b border-slate-200 px-4 py-4", children: [
|
|
32
33
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_totals_title") }) }),
|
|
33
|
-
|
|
34
|
+
n ? /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_totals_description") }) }) : null
|
|
34
35
|
] }),
|
|
35
36
|
/* @__PURE__ */ a("div", { className: "grid gap-4 px-4 py-4", children: [
|
|
36
37
|
/* @__PURE__ */ a("dl", { className: "grid text-sm", children: [
|
|
@@ -39,8 +40,8 @@ function F({
|
|
|
39
40
|
/* @__PURE__ */ e("dd", { className: "font-semibold tabular-nums text-slate-900", children: /* @__PURE__ */ e("span", { children: m }) })
|
|
40
41
|
] }),
|
|
41
42
|
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
|
-
/* @__PURE__ */ e("dt", { className: "text-
|
|
43
|
-
/* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-
|
|
43
|
+
/* @__PURE__ */ e("dt", { className: "text-success", children: /* @__PURE__ */ e("span", { children: t("checkout_coupon_discount", { code: o ?? "" }) }) }),
|
|
44
|
+
/* @__PURE__ */ e("dd", { className: "font-medium tabular-nums text-success", children: /* @__PURE__ */ e("span", { children: d }) })
|
|
44
45
|
] }) : null,
|
|
45
46
|
/* @__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
47
|
/* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_total_excluding_tax") }) }),
|
|
@@ -60,15 +61,15 @@ function F({
|
|
|
60
61
|
] }) : null
|
|
61
62
|
] }),
|
|
62
63
|
c ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: c }) }) : null,
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ e(y, { className: "
|
|
64
|
+
i ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-slate-600", children: [
|
|
65
|
+
/* @__PURE__ */ e(y, { className: "size-4", "aria-hidden": "true" }),
|
|
65
66
|
/* @__PURE__ */ e("span", { children: t("checkout_payment_loading") })
|
|
66
67
|
] }) : null,
|
|
67
68
|
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
69
|
/* @__PURE__ */ e(k, { className: "mt-0.5 h-4 w-4", "aria-hidden": "true" }),
|
|
69
70
|
/* @__PURE__ */ e("span", { children: s })
|
|
70
71
|
] }) }) : null,
|
|
71
|
-
!
|
|
72
|
+
!i && !s && n ? /* @__PURE__ */ e("div", { className: "grid gap-2 sm:grid-cols-3", children: v.map((l) => /* @__PURE__ */ e(
|
|
72
73
|
C,
|
|
73
74
|
{
|
|
74
75
|
type: "button",
|