@loczer/storefront-sdk 0.230.0 → 0.232.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/StorefrontContext.d.ts +0 -2
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontProvider.d.ts +0 -1
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
- package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
- package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
- package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
- package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
- package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -56
- package/dist/components/LanguageSelector/index.d.ts.map +1 -1
- package/dist/components/LanguageSelector/index.js +19 -64
- package/dist/components/StorefrontCartPanel/index.js +1 -1
- package/dist/i18n/en.d.ts +2 -4
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -5
- package/dist/i18n/fr.d.ts +2 -4
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -6
- package/dist/index.d.ts +17 -35
- package/dist/index.js +3 -3
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.d.ts +6 -6
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +21 -21
- package/dist/lib/cart.d.ts +1 -0
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +2 -0
- package/dist/lib/checkoutSubmit.d.ts +2 -6
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +3 -11
- package/dist/lib/pricing.js +1 -1
- package/dist/lib/storefrontAvailability.d.ts +12 -8
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +17 -7
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +236 -238
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +127 -125
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +117 -171
- package/dist/pages/HomePage.js +8 -8
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +187 -181
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
- package/dist/pages/checkout/types.d.ts +1 -2
- package/dist/pages/checkout/types.d.ts.map +1 -1
- package/dist/pages/checkout/types.js +1 -2
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +0 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +1 -2
- package/package.json +1 -1
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-Q8O5Rjfq.js} +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAqFA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA+oBnC"}
|
|
@@ -15,16 +15,17 @@ import { ROUTE as _e, responseSchema as ve } from "../lib/checkoutPaymentDecisio
|
|
|
15
15
|
import { ROUTE as ye, responseSchema as be } from "../lib/checkoutVerifyCoupon.js";
|
|
16
16
|
import { CheckoutDetailsCard as xe } from "./checkout/components/CheckoutDetailsCard.js";
|
|
17
17
|
import { CheckoutInsuranceCard as Se } from "./checkout/components/CheckoutInsuranceCard.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { CheckoutLoadingSkeleton as Ce } from "./checkout/components/CheckoutLoadingSkeleton.js";
|
|
19
|
+
import { CheckoutSummaryColumn as we } from "./checkout/components/CheckoutSummaryColumn.js";
|
|
20
|
+
import { checkoutFormSchema as Te } from "./checkout/types.js";
|
|
21
|
+
import { useEffect as s, useMemo as c, useRef as Ee, useState as l } from "react";
|
|
21
22
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
22
|
-
import { Link as
|
|
23
|
-
import { useTranslation as
|
|
24
|
-
import { AlertTriangle as
|
|
25
|
-
import { useForm as
|
|
23
|
+
import { Link as De, useNavigate as Oe, useParams as ke, useSearchParams as Ae } from "@rpcbase/router";
|
|
24
|
+
import { useTranslation as je } from "react-i18next";
|
|
25
|
+
import { AlertTriangle as Me, ArrowLeft as Ne } from "lucide-react";
|
|
26
|
+
import { useForm as Pe, zodResolver as Fe } from "@rpcbase/form";
|
|
26
27
|
//#region src/pages/CheckoutPage.tsx
|
|
27
|
-
var
|
|
28
|
+
var Ie = .2, f = (e, t, n) => {
|
|
28
29
|
try {
|
|
29
30
|
return new Intl.NumberFormat(n, {
|
|
30
31
|
style: "currency",
|
|
@@ -33,7 +34,7 @@ var Fe = .2, f = (e, t, n) => {
|
|
|
33
34
|
} catch {
|
|
34
35
|
return `${(e / 100).toFixed(2)} ${t.toUpperCase()}`;
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
+
}, Le = (e, t) => {
|
|
37
38
|
try {
|
|
38
39
|
return new Intl.NumberFormat(t, {
|
|
39
40
|
style: "percent",
|
|
@@ -45,49 +46,49 @@ var Fe = .2, f = (e, t, n) => {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
function p() {
|
|
48
|
-
let { t: p, i18n: m } =
|
|
49
|
-
let e = t(
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
let { t: p, i18n: m } = je(), { storefrontConfiguration: h } = fe(), Re = h.workspace?.workspaceLanguage, { bikes: g, accessories: ze } = pe(), { storeSlug: _ } = ke(), [v, Be] = Ae(), Ve = Oe(), { items: He, itemCount: Ue, isReady: We, setQuantity: Ge, removeItem: Ke, beginCheckoutSubmission: qe, confirmCheckoutPaymentSession: Je, clearCheckoutSession: Ye, clear: Xe } = ee(), [y, Ze] = l(!1), b = Ee(!1), [x, S] = l(null), [Qe, C] = l(!1), [w, T] = l(null), $e = v.get("coupon") ?? v.get("code") ?? "", [et, E] = l($e), [tt, nt] = l($e.trim()), [D, O] = l(null), [k, A] = l(null), [j, M] = l(!1), [rt, N] = l(null), [it, P] = l(null), [F, at] = l(!1), [I, ot] = l(!1), st = n(v).toString(), ct = c(() => r(new URLSearchParams(st), _), [st, _]), L = h.settings.fulfillmentModes.includes("delivery"), lt = h.settings.deliveryDisabledReason.trim(), ut = L || lt.length > 0, dt = h.shop.address?.trim() ?? "", R = c(() => {
|
|
50
|
+
let e = t(ct, {
|
|
51
|
+
startTime: "",
|
|
52
|
+
endTime: ""
|
|
52
53
|
});
|
|
53
54
|
return e.fulfillment === "delivery" && !L ? {
|
|
54
55
|
...e,
|
|
55
56
|
fulfillment: "pickup"
|
|
56
57
|
} : e;
|
|
57
|
-
}, [
|
|
58
|
-
items:
|
|
58
|
+
}, [ct, L]), z = c(() => le(R), [R]), B = h.bookingEngine.pricing, ft = te(R, B, h.bookingEngine.shop.timeZone), pt = ne(B.baseUnit, p), mt = ft?.billableUnitCount, V = c(() => re({
|
|
59
|
+
items: He,
|
|
59
60
|
language: m.language,
|
|
60
|
-
fallbackLanguage:
|
|
61
|
+
fallbackLanguage: Re,
|
|
61
62
|
products: {
|
|
62
63
|
bikes: g,
|
|
63
|
-
accessories:
|
|
64
|
+
accessories: ze
|
|
64
65
|
},
|
|
65
66
|
priceUnit: B.baseUnit,
|
|
66
|
-
billableUnitCount:
|
|
67
|
+
billableUnitCount: mt
|
|
67
68
|
}), [
|
|
68
|
-
|
|
69
|
+
ze,
|
|
69
70
|
g,
|
|
70
|
-
|
|
71
|
+
mt,
|
|
71
72
|
m.language,
|
|
72
|
-
|
|
73
|
+
He,
|
|
73
74
|
B.baseUnit,
|
|
74
|
-
|
|
75
|
+
Re
|
|
75
76
|
]), H = c(() => V.lines.map((e) => ({
|
|
76
77
|
productId: e.checkoutProductId,
|
|
77
78
|
productVariantId: e.productVariantId,
|
|
78
79
|
quantity: e.quantity
|
|
79
|
-
})), [V.lines]), [
|
|
80
|
+
})), [V.lines]), [ht, U] = l([]), [gt, W] = l(!1);
|
|
80
81
|
s(() => {
|
|
81
82
|
if (!_ || H.length === 0) {
|
|
82
|
-
U([]),
|
|
83
|
+
U([]), W(!1);
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
85
86
|
if (!z) {
|
|
86
|
-
U([]),
|
|
87
|
+
U([]), W(!1);
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
90
|
let e = !1;
|
|
90
|
-
return
|
|
91
|
+
return W(!0), U([]), (async () => {
|
|
91
92
|
try {
|
|
92
93
|
let t = await o(oe, {
|
|
93
94
|
storeSlug: _,
|
|
@@ -100,51 +101,50 @@ function p() {
|
|
|
100
101
|
if (e) return;
|
|
101
102
|
console.error("Failed to load checkout cart availability", t), U([]);
|
|
102
103
|
} finally {
|
|
103
|
-
e ||
|
|
104
|
+
e || W(!1);
|
|
104
105
|
}
|
|
105
106
|
})(), () => {
|
|
106
107
|
e = !0;
|
|
107
108
|
};
|
|
108
109
|
}, [
|
|
109
|
-
R.
|
|
110
|
-
R.
|
|
111
|
-
R.
|
|
112
|
-
R.
|
|
110
|
+
R.endDate,
|
|
111
|
+
R.endTime,
|
|
112
|
+
R.startDate,
|
|
113
|
+
R.startTime,
|
|
113
114
|
z,
|
|
114
115
|
H,
|
|
115
116
|
_
|
|
116
117
|
]);
|
|
117
|
-
let
|
|
118
|
+
let _t = c(() => new Map(ht.map((e) => [se(e.productId, e.productVariantId), e])), [ht]), vt = c(() => ({
|
|
118
119
|
...V,
|
|
119
120
|
lines: V.lines.map((e) => {
|
|
120
|
-
let t =
|
|
121
|
+
let t = _t.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
121
122
|
return {
|
|
122
123
|
...e,
|
|
123
|
-
insufficientCapacity: !
|
|
124
|
-
availabilityIssue:
|
|
124
|
+
insufficientCapacity: !gt && n !== void 0,
|
|
125
|
+
availabilityIssue: gt ? void 0 : n
|
|
125
126
|
};
|
|
126
127
|
})
|
|
127
128
|
}), [
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
_t,
|
|
130
|
+
gt,
|
|
130
131
|
V
|
|
131
|
-
]),
|
|
132
|
+
]), G = c(() => V.lines.map((e) => ({
|
|
132
133
|
kind: e.kind,
|
|
133
134
|
productId: e.checkoutProductId,
|
|
134
135
|
productVariantId: e.productVariantId,
|
|
135
136
|
quantity: e.quantity
|
|
136
|
-
})), [V.lines]),
|
|
137
|
-
let t =
|
|
137
|
+
})), [V.lines]), yt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), bt = V.lines.flatMap((e) => {
|
|
138
|
+
let t = yt.get(e.checkoutProductId);
|
|
138
139
|
return t?.insurance?.enabled ? [{
|
|
139
140
|
quantity: e.quantity,
|
|
140
141
|
pricePerDayMinor: t.insurance.pricePerDayMinor,
|
|
141
142
|
deductibleAmountMinor: t.insurance.deductibleAmountMinor
|
|
142
143
|
}] : [];
|
|
143
|
-
}),
|
|
144
|
-
resolver:
|
|
144
|
+
}), K = h.modules?.insurance?.enabled === !0 && bt.length > 0, q = K && I, xt = bt.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), St = bt.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), Ct = V.totalMinor ?? 0, J = k?.totalMinor ?? Ct, Y = k?.insuranceSubtotalMinor ?? 0, wt = D?.discountAmountMinor ?? 0, X = e(new URLSearchParams(), R).toString(), Z = `/${_ ?? ""}/booking${X ? `?${X}` : ""}`, Tt = `/${_ ?? ""}/checkout${X ? `?${X}` : ""}`, Et = Pe({
|
|
145
|
+
resolver: Fe(Te),
|
|
145
146
|
defaultValues: {
|
|
146
|
-
|
|
147
|
-
last_name: "",
|
|
147
|
+
fullName: "",
|
|
148
148
|
email: "",
|
|
149
149
|
phone: "",
|
|
150
150
|
notes: ""
|
|
@@ -153,30 +153,30 @@ function p() {
|
|
|
153
153
|
s(() => {
|
|
154
154
|
i(_, R);
|
|
155
155
|
}, [R, _]), s(() => {
|
|
156
|
-
!
|
|
157
|
-
}, [I,
|
|
158
|
-
let
|
|
156
|
+
!K && I && ot(!1);
|
|
157
|
+
}, [I, K]);
|
|
158
|
+
let Q = (t) => {
|
|
159
159
|
let n = {
|
|
160
160
|
...R,
|
|
161
161
|
...t
|
|
162
162
|
}, r = e(v, n);
|
|
163
|
-
r.toString() !== v.toString() && (
|
|
163
|
+
r.toString() !== v.toString() && (Be(r, { replace: !0 }), i(_, r));
|
|
164
164
|
};
|
|
165
165
|
s(() => {
|
|
166
|
-
if (!_ ||
|
|
166
|
+
if (!_ || G.length === 0 || !z) {
|
|
167
167
|
O(null), A(null), M(!1), N(null), P(null);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
let e =
|
|
170
|
+
let e = tt.trim(), t = e.length === 0 && !F, n = !1;
|
|
171
171
|
return M(!0), P(null), N(null), (async () => {
|
|
172
172
|
try {
|
|
173
173
|
let r = await o(ye, {
|
|
174
174
|
storeSlug: _,
|
|
175
175
|
schedule: z,
|
|
176
|
-
items:
|
|
176
|
+
items: G,
|
|
177
177
|
couponCode: e || void 0,
|
|
178
178
|
includeAutoApply: t,
|
|
179
|
-
insuranceAccepted:
|
|
179
|
+
insuranceAccepted: q
|
|
180
180
|
}), i = be.parse(r);
|
|
181
181
|
if (n) return;
|
|
182
182
|
if (A(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
|
|
@@ -201,15 +201,15 @@ function p() {
|
|
|
201
201
|
};
|
|
202
202
|
}, [
|
|
203
203
|
F,
|
|
204
|
-
R.
|
|
205
|
-
R.
|
|
206
|
-
R.
|
|
207
|
-
R.
|
|
204
|
+
R.endDate,
|
|
205
|
+
R.endTime,
|
|
206
|
+
R.startDate,
|
|
207
|
+
R.startTime,
|
|
208
208
|
z,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
G,
|
|
210
|
+
q,
|
|
211
211
|
_,
|
|
212
|
-
|
|
212
|
+
tt,
|
|
213
213
|
p
|
|
214
214
|
]), s(() => {
|
|
215
215
|
if (!_ || V.lines.length === 0 || !z) {
|
|
@@ -222,8 +222,8 @@ function p() {
|
|
|
222
222
|
let t = await o(_e, {
|
|
223
223
|
storeSlug: _,
|
|
224
224
|
schedule: z,
|
|
225
|
-
estimatedTotalMinor:
|
|
226
|
-
insuranceAmountMinor:
|
|
225
|
+
estimatedTotalMinor: J,
|
|
226
|
+
insuranceAmountMinor: Y
|
|
227
227
|
}), n = ve.parse(t);
|
|
228
228
|
if (e) return;
|
|
229
229
|
if (!n.success || !n.decision) {
|
|
@@ -241,21 +241,21 @@ function p() {
|
|
|
241
241
|
e = !0;
|
|
242
242
|
};
|
|
243
243
|
}, [
|
|
244
|
-
R.
|
|
245
|
-
R.
|
|
246
|
-
R.
|
|
247
|
-
R.
|
|
244
|
+
R.endDate,
|
|
245
|
+
R.endTime,
|
|
246
|
+
R.startDate,
|
|
247
|
+
R.startTime,
|
|
248
248
|
z,
|
|
249
|
-
|
|
249
|
+
J,
|
|
250
250
|
V.lines.length,
|
|
251
|
-
|
|
251
|
+
Y,
|
|
252
252
|
_,
|
|
253
253
|
p
|
|
254
254
|
]);
|
|
255
|
-
let $ = x?.currency ?? "EUR",
|
|
256
|
-
if (!_ ||
|
|
257
|
-
|
|
258
|
-
let t =
|
|
255
|
+
let $ = x?.currency ?? "EUR", Dt = f(J, $, m.language), Ot = Math.max(0, J - Y), kt = Math.round(Ot / 1.2), At = kt + Y, jt = Math.max(0, Ot - kt), Mt = f(At, $, m.language), Nt = f(jt, $, m.language), Pt = Le(Ie, m.language), Ft = Y > 0 ? f(Y, $, m.language) : void 0, It = x?.amountToCollectMinor ?? 0, Lt = x?.shouldCollectOnlinePayment === !0 && It > 0, Rt = Et.handleSubmit(async (e) => {
|
|
256
|
+
if (!_ || G.length === 0 || !z || b.current) return;
|
|
257
|
+
Ze(!0), b.current = !0;
|
|
258
|
+
let t = qe();
|
|
259
259
|
try {
|
|
260
260
|
let n = await o(ie, {
|
|
261
261
|
storeSlug: _,
|
|
@@ -263,32 +263,31 @@ function p() {
|
|
|
263
263
|
replacesCheckoutSessionId: t.replacesCheckoutSessionId,
|
|
264
264
|
schedule: z,
|
|
265
265
|
fulfillment: R.fulfillment,
|
|
266
|
-
startAddress: R.fulfillment === "delivery" ? R.
|
|
267
|
-
endAddress: R.fulfillment === "delivery" ? R.
|
|
266
|
+
startAddress: R.fulfillment === "delivery" ? R.startAddress : void 0,
|
|
267
|
+
endAddress: R.fulfillment === "delivery" ? R.endAddress : void 0,
|
|
268
268
|
couponCode: D?.code,
|
|
269
269
|
couponAutoApplied: !F && D?.autoApplied,
|
|
270
|
-
insuranceAccepted:
|
|
270
|
+
insuranceAccepted: q,
|
|
271
271
|
customer: {
|
|
272
|
-
|
|
273
|
-
lastName: e.last_name,
|
|
272
|
+
name: e.fullName,
|
|
274
273
|
email: e.email,
|
|
275
274
|
phone: e.phone,
|
|
276
275
|
notes: e.notes
|
|
277
276
|
},
|
|
278
|
-
items:
|
|
277
|
+
items: G
|
|
279
278
|
}), r = ae.parse(n);
|
|
280
279
|
if (!r.success || !r.checkout) {
|
|
281
|
-
|
|
280
|
+
Ye(), a.error(r.message || p("checkout_payment_error"));
|
|
282
281
|
return;
|
|
283
282
|
}
|
|
284
|
-
r.checkout.requiresPayment ?
|
|
283
|
+
r.checkout.requiresPayment ? Je(r.checkout.checkoutSessionId ?? t.checkoutSessionId) : a.success(p("checkout_success_toast")), await Ve(r.checkout.nextPath), r.checkout.requiresPayment || Xe();
|
|
285
284
|
} catch (e) {
|
|
286
285
|
console.error("Failed to submit storefront checkout", e), a.error(p("checkout_payment_error"));
|
|
287
286
|
} finally {
|
|
288
|
-
b.current = !1,
|
|
287
|
+
b.current = !1, Ze(!1);
|
|
289
288
|
}
|
|
290
|
-
}),
|
|
291
|
-
return V.lines.length === 0 ? /* @__PURE__ */ u("div", {
|
|
289
|
+
}), zt = p(Lt ? "checkout_continue_to_payment" : "checkout_submit"), Bt = R.fulfillment === "delivery" && R.startAddress.trim().length === 0, Vt = !y && !Qe && !w && !j && !it && !!x && !!z && !Bt && G.length > 0;
|
|
290
|
+
return We ? V.lines.length === 0 ? /* @__PURE__ */ u("div", {
|
|
292
291
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
293
292
|
children: /* @__PURE__ */ d("div", {
|
|
294
293
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
@@ -303,11 +302,11 @@ function p() {
|
|
|
303
302
|
}),
|
|
304
303
|
/* @__PURE__ */ u("div", {
|
|
305
304
|
className: "mt-6",
|
|
306
|
-
children: /* @__PURE__ */ u(
|
|
307
|
-
to:
|
|
305
|
+
children: /* @__PURE__ */ u(De, {
|
|
306
|
+
to: Z,
|
|
308
307
|
children: /* @__PURE__ */ d(de, {
|
|
309
308
|
className: "gap-2",
|
|
310
|
-
children: [/* @__PURE__ */ u(
|
|
309
|
+
children: [/* @__PURE__ */ u(Ne, {
|
|
311
310
|
className: "h-4 w-4",
|
|
312
311
|
"aria-hidden": "true"
|
|
313
312
|
}), /* @__PURE__ */ u("span", { children: p("back_to_booking") })]
|
|
@@ -318,9 +317,9 @@ function p() {
|
|
|
318
317
|
})
|
|
319
318
|
}) : /* @__PURE__ */ u(he, {
|
|
320
319
|
currentStep: "checkout",
|
|
321
|
-
bookingPath:
|
|
322
|
-
checkoutPath:
|
|
323
|
-
backPath:
|
|
320
|
+
bookingPath: Z,
|
|
321
|
+
checkoutPath: Tt,
|
|
322
|
+
backPath: Z,
|
|
324
323
|
backLabel: p("back_to_booking"),
|
|
325
324
|
children: /* @__PURE__ */ d("div", {
|
|
326
325
|
className: "grid gap-6 lg:grid-cols-12",
|
|
@@ -339,33 +338,33 @@ function p() {
|
|
|
339
338
|
/* @__PURE__ */ d("div", {
|
|
340
339
|
className: "mt-5 grid gap-4",
|
|
341
340
|
children: [
|
|
342
|
-
|
|
341
|
+
ut ? /* @__PURE__ */ u("div", {
|
|
343
342
|
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
344
343
|
children: /* @__PURE__ */ u(me, {
|
|
345
344
|
value: R.fulfillment,
|
|
346
|
-
onValueChange: (e) =>
|
|
347
|
-
pickupAddress:
|
|
345
|
+
onValueChange: (e) => Q({ fulfillment: e }),
|
|
346
|
+
pickupAddress: dt,
|
|
348
347
|
deliveryEnabled: L,
|
|
349
|
-
deliveryDisabledReason:
|
|
350
|
-
startAddress: R.
|
|
351
|
-
onStartAddressChange: (e) =>
|
|
352
|
-
endAddress: R.
|
|
353
|
-
onEndAddressChange: (e) =>
|
|
348
|
+
deliveryDisabledReason: lt,
|
|
349
|
+
startAddress: R.startAddress,
|
|
350
|
+
onStartAddressChange: (e) => Q({ startAddress: e }),
|
|
351
|
+
endAddress: R.endAddress,
|
|
352
|
+
onEndAddressChange: (e) => Q({ endAddress: e }),
|
|
354
353
|
showPickupAddressWhenPickupOnly: !1,
|
|
355
354
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
356
355
|
})
|
|
357
356
|
}) : null,
|
|
358
|
-
/* @__PURE__ */ u(xe, { form:
|
|
359
|
-
|
|
360
|
-
accepted:
|
|
357
|
+
/* @__PURE__ */ u(xe, { form: Et }),
|
|
358
|
+
K ? /* @__PURE__ */ u(Se, {
|
|
359
|
+
accepted: q,
|
|
361
360
|
disabled: y || j,
|
|
362
|
-
dailyAmountLabel: f(
|
|
363
|
-
totalAmountLabel:
|
|
361
|
+
dailyAmountLabel: f(xt, $, m.language),
|
|
362
|
+
totalAmountLabel: Ft,
|
|
364
363
|
billableDays: k?.insuranceBillableDays,
|
|
365
|
-
deductibleLabel:
|
|
366
|
-
onAcceptedChange:
|
|
364
|
+
deductibleLabel: St > 0 ? f(St, $, m.language) : void 0,
|
|
365
|
+
onAcceptedChange: ot
|
|
367
366
|
}) : null,
|
|
368
|
-
|
|
367
|
+
Qe ? /* @__PURE__ */ d("div", {
|
|
369
368
|
className: "flex items-center gap-2 text-sm text-slate-600",
|
|
370
369
|
role: "status",
|
|
371
370
|
children: [/* @__PURE__ */ u(ge, {
|
|
@@ -376,7 +375,7 @@ function p() {
|
|
|
376
375
|
w ? /* @__PURE__ */ d("div", {
|
|
377
376
|
className: "flex items-start gap-2 rounded-md bg-destructive p-3 text-sm text-destructive-foreground shadow-sm",
|
|
378
377
|
role: "alert",
|
|
379
|
-
children: [/* @__PURE__ */ u(
|
|
378
|
+
children: [/* @__PURE__ */ u(Me, {
|
|
380
379
|
className: "mt-0.5 h-4 w-4",
|
|
381
380
|
"aria-hidden": "true"
|
|
382
381
|
}), /* @__PURE__ */ u("span", { children: w })]
|
|
@@ -385,49 +384,52 @@ function p() {
|
|
|
385
384
|
type: "button",
|
|
386
385
|
size: "lg",
|
|
387
386
|
onClick: () => {
|
|
388
|
-
|
|
387
|
+
Rt();
|
|
389
388
|
},
|
|
390
|
-
disabled: !
|
|
389
|
+
disabled: !Vt,
|
|
391
390
|
className: "mt-4 w-fit",
|
|
392
|
-
children: /* @__PURE__ */ u("span", { children:
|
|
391
|
+
children: /* @__PURE__ */ u("span", { children: zt })
|
|
393
392
|
}),
|
|
394
|
-
|
|
393
|
+
Bt ? /* @__PURE__ */ u("p", {
|
|
395
394
|
className: "text-sm text-slate-600",
|
|
396
395
|
children: /* @__PURE__ */ u("span", { children: p("checkout_delivery_address_required") })
|
|
397
396
|
}) : null
|
|
398
397
|
]
|
|
399
398
|
})
|
|
400
399
|
]
|
|
401
|
-
}), /* @__PURE__ */ u(
|
|
402
|
-
lines:
|
|
403
|
-
itemCount:
|
|
404
|
-
baseUnitLabel:
|
|
405
|
-
bookingSubtotalLabel:
|
|
406
|
-
vatAmountLabel:
|
|
407
|
-
vatRateLabel:
|
|
408
|
-
bookingTotalLabel:
|
|
409
|
-
onQuantityChange:
|
|
410
|
-
onRemove:
|
|
400
|
+
}), /* @__PURE__ */ u(we, {
|
|
401
|
+
lines: vt.lines,
|
|
402
|
+
itemCount: Ue,
|
|
403
|
+
baseUnitLabel: pt,
|
|
404
|
+
bookingSubtotalLabel: Mt,
|
|
405
|
+
vatAmountLabel: Nt,
|
|
406
|
+
vatRateLabel: Pt,
|
|
407
|
+
bookingTotalLabel: Dt,
|
|
408
|
+
onQuantityChange: Ge,
|
|
409
|
+
onRemove: Ke,
|
|
411
410
|
coupon: {
|
|
412
|
-
code:
|
|
411
|
+
code: et,
|
|
413
412
|
appliedCode: D?.code,
|
|
414
|
-
discountLabel: D &&
|
|
415
|
-
message:
|
|
416
|
-
error:
|
|
413
|
+
discountLabel: D && wt > 0 ? f(wt, $, m.language) : null,
|
|
414
|
+
message: rt,
|
|
415
|
+
error: it,
|
|
417
416
|
loading: j,
|
|
418
417
|
disabled: y,
|
|
419
418
|
onCodeChange: (e) => {
|
|
420
419
|
E(e), P(null), N(null);
|
|
421
420
|
},
|
|
422
421
|
onApply: () => {
|
|
423
|
-
|
|
422
|
+
at(!1), nt(et.trim());
|
|
424
423
|
},
|
|
425
424
|
onRemove: () => {
|
|
426
|
-
E(""),
|
|
425
|
+
E(""), nt(""), O(null), A(null), P(null), N(null), at(!0);
|
|
427
426
|
}
|
|
428
427
|
}
|
|
429
428
|
})]
|
|
430
429
|
})
|
|
430
|
+
}) : /* @__PURE__ */ u(Ce, {
|
|
431
|
+
bookingPath: Z,
|
|
432
|
+
checkoutPath: Tt
|
|
431
433
|
});
|
|
432
434
|
}
|
|
433
435
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAoC7C,eAAO,MAAM,mCAAmC,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe7E,CAAA;AAsFD,KAAK,8BAA8B,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,MAAM,6BAAqC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEnE,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CAyQ/C"}
|