@loczer/storefront-sdk 0.222.0 → 0.224.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 +14 -0
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontProvider.d.ts +7 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/components/Footer/index.d.ts +2 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +32 -28
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +47 -45
- package/dist/components/StorefrontInformationDocument/index.d.ts +13 -0
- package/dist/components/StorefrontInformationDocument/index.d.ts.map +1 -0
- package/dist/components/StorefrontInformationDocument/index.js +48 -0
- package/dist/i18n/en.d.ts +4 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +5 -1
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +5 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +9 -8
- package/dist/lib/checkoutPaymentDecision.d.ts +1 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +1 -0
- package/dist/lib/contractSaleDocument.d.ts +3 -0
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +1 -0
- package/dist/lib/contractSaleDocumentApi.d.ts +3 -0
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/lib/richText.d.ts +3 -0
- package/dist/lib/richText.d.ts.map +1 -0
- package/dist/lib/richText.js +19 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +156 -154
- package/dist/pages/ContractSaleDocumentPage.d.ts +1 -1
- package/dist/pages/InsuranceTermsPage.d.ts +2 -0
- package/dist/pages/InsuranceTermsPage.d.ts.map +1 -0
- package/dist/pages/InsuranceTermsPage.js +22 -0
- package/dist/pages/RentalTermsPage.d.ts.map +1 -1
- package/dist/pages/RentalTermsPage.js +15 -46
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +14 -10
- package/dist/storefrontSchemas.d.ts +14 -0
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -1
- package/package.json +1 -1
|
@@ -45,102 +45,102 @@ var Fe = .2, f = (e, t, n) => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
function p() {
|
|
48
|
-
let { t: p, i18n: m } = Ae(), { storefrontConfiguration: h } = fe(), Le = h.workspace?.workspaceLanguage, { bikes:
|
|
49
|
-
let e = t(
|
|
48
|
+
let { t: p, i18n: m } = Ae(), { storefrontConfiguration: h } = fe(), Le = h.workspace?.workspaceLanguage, { bikes: g, accessories: Re } = pe(), { storeSlug: _ } = Oe(), [v, ze] = ke(), Be = De(), { items: Ve, itemCount: He, setQuantity: Ue, removeItem: We, beginCheckoutSubmission: Ge, confirmCheckoutPaymentSession: Ke, clearCheckoutSession: qe, clear: Je } = ee(), [y, Ye] = l(!1), b = Te(!1), [x, S] = l(null), [Xe, C] = l(!1), [w, T] = l(null), Ze = v.get("coupon") ?? v.get("code") ?? "", [Qe, E] = l(Ze), [$e, et] = l(Ze.trim()), [D, O] = l(null), [k, A] = l(null), [j, M] = l(!1), [tt, N] = l(null), [nt, P] = l(null), [F, rt] = l(!1), [I, it] = l(!1), at = n(v).toString(), ot = c(() => r(new URLSearchParams(at), _), [at, _]), L = h.settings.fulfillmentModes.includes("delivery"), st = h.settings.deliveryDisabledReason.trim(), ct = L || st.length > 0, lt = h.shop.address?.trim() ?? "", R = c(() => {
|
|
49
|
+
let e = t(ot, {
|
|
50
50
|
start_time: "",
|
|
51
51
|
end_time: ""
|
|
52
52
|
});
|
|
53
|
-
return e.fulfillment === "delivery" && !
|
|
53
|
+
return e.fulfillment === "delivery" && !L ? {
|
|
54
54
|
...e,
|
|
55
55
|
fulfillment: "pickup"
|
|
56
56
|
} : e;
|
|
57
|
-
}, [
|
|
58
|
-
items:
|
|
57
|
+
}, [ot, L]), z = c(() => le(R), [R]), B = h.bookingEngine.pricing, ut = te(R, B, h.bookingEngine.shop.timeZone), dt = ne(B.baseUnit, p), ft = ut?.billableUnitCount, V = c(() => re({
|
|
58
|
+
items: Ve,
|
|
59
59
|
language: m.language,
|
|
60
60
|
fallbackLanguage: Le,
|
|
61
61
|
products: {
|
|
62
|
-
bikes:
|
|
63
|
-
accessories:
|
|
62
|
+
bikes: g,
|
|
63
|
+
accessories: Re
|
|
64
64
|
},
|
|
65
|
-
priceUnit:
|
|
66
|
-
billableUnitCount:
|
|
65
|
+
priceUnit: B.baseUnit,
|
|
66
|
+
billableUnitCount: ft
|
|
67
67
|
}), [
|
|
68
|
-
ze,
|
|
69
68
|
Re,
|
|
70
|
-
|
|
69
|
+
g,
|
|
70
|
+
ft,
|
|
71
71
|
m.language,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
Ve,
|
|
73
|
+
B.baseUnit,
|
|
74
74
|
Le
|
|
75
|
-
]),
|
|
75
|
+
]), H = c(() => V.lines.map((e) => ({
|
|
76
76
|
productId: e.checkoutProductId,
|
|
77
77
|
productVariantId: e.productVariantId,
|
|
78
78
|
quantity: e.quantity
|
|
79
|
-
})), [
|
|
79
|
+
})), [V.lines]), [pt, U] = l([]), [W, G] = l(!1);
|
|
80
80
|
s(() => {
|
|
81
|
-
if (!
|
|
82
|
-
|
|
81
|
+
if (!_ || H.length === 0) {
|
|
82
|
+
U([]), G(!1);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (!
|
|
86
|
-
|
|
85
|
+
if (!z) {
|
|
86
|
+
U([]), G(!1);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
let e = !1;
|
|
90
|
-
return
|
|
90
|
+
return G(!0), U([]), (async () => {
|
|
91
91
|
try {
|
|
92
92
|
let t = await o(oe, {
|
|
93
|
-
storeSlug:
|
|
94
|
-
schedule:
|
|
95
|
-
products:
|
|
93
|
+
storeSlug: _,
|
|
94
|
+
schedule: z,
|
|
95
|
+
products: H
|
|
96
96
|
}), n = ue.parse(t);
|
|
97
97
|
if (e) return;
|
|
98
|
-
|
|
98
|
+
U(n.success ? n.availability ?? [] : []);
|
|
99
99
|
} catch (t) {
|
|
100
100
|
if (e) return;
|
|
101
|
-
console.error("Failed to load checkout cart availability", t),
|
|
101
|
+
console.error("Failed to load checkout cart availability", t), U([]);
|
|
102
102
|
} finally {
|
|
103
|
-
e ||
|
|
103
|
+
e || G(!1);
|
|
104
104
|
}
|
|
105
105
|
})(), () => {
|
|
106
106
|
e = !0;
|
|
107
107
|
};
|
|
108
108
|
}, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
R.end_date,
|
|
110
|
+
R.end_time,
|
|
111
|
+
R.start_date,
|
|
112
|
+
R.start_time,
|
|
113
|
+
z,
|
|
114
|
+
H,
|
|
115
|
+
_
|
|
116
116
|
]);
|
|
117
|
-
let
|
|
118
|
-
...
|
|
119
|
-
lines:
|
|
120
|
-
let t =
|
|
117
|
+
let mt = c(() => new Map(pt.map((e) => [se(e.productId, e.productVariantId), e])), [pt]), ht = c(() => ({
|
|
118
|
+
...V,
|
|
119
|
+
lines: V.lines.map((e) => {
|
|
120
|
+
let t = mt.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
121
121
|
return {
|
|
122
122
|
...e,
|
|
123
|
-
insufficientCapacity: !
|
|
124
|
-
availabilityIssue:
|
|
123
|
+
insufficientCapacity: !W && n !== void 0,
|
|
124
|
+
availabilityIssue: W ? void 0 : n
|
|
125
125
|
};
|
|
126
126
|
})
|
|
127
127
|
}), [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
]),
|
|
128
|
+
mt,
|
|
129
|
+
W,
|
|
130
|
+
V
|
|
131
|
+
]), K = c(() => V.lines.map((e) => ({
|
|
132
132
|
kind: e.kind,
|
|
133
133
|
productId: e.checkoutProductId,
|
|
134
134
|
productVariantId: e.productVariantId,
|
|
135
135
|
quantity: e.quantity
|
|
136
|
-
})), [
|
|
137
|
-
let t =
|
|
136
|
+
})), [V.lines]), gt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), q = V.lines.flatMap((e) => {
|
|
137
|
+
let t = gt.get(e.checkoutProductId);
|
|
138
138
|
return t?.insurance?.enabled ? [{
|
|
139
139
|
quantity: e.quantity,
|
|
140
140
|
pricePerDayMinor: t.insurance.pricePerDayMinor,
|
|
141
141
|
deductibleAmountMinor: t.insurance.deductibleAmountMinor
|
|
142
142
|
}] : [];
|
|
143
|
-
}),
|
|
143
|
+
}), J = h.modules?.insurance?.enabled === !0 && q.length > 0, Y = J && I, _t = q.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), vt = q.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), yt = V.totalMinor ?? 0, X = k?.totalMinor ?? yt, Z = k?.insuranceSubtotalMinor ?? 0, bt = D?.discountAmountMinor ?? 0, Q = e(new URLSearchParams(), R).toString(), xt = `/${_ ?? ""}/booking${Q ? `?${Q}` : ""}`, St = `/${_ ?? ""}/checkout${Q ? `?${Q}` : ""}`, Ct = Ne({
|
|
144
144
|
resolver: Pe(we),
|
|
145
145
|
defaultValues: {
|
|
146
146
|
first_name: "",
|
|
@@ -151,121 +151,123 @@ function p() {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
s(() => {
|
|
154
|
-
i(
|
|
155
|
-
}, [
|
|
156
|
-
!
|
|
157
|
-
}, [
|
|
158
|
-
let
|
|
154
|
+
i(_, R);
|
|
155
|
+
}, [R, _]), s(() => {
|
|
156
|
+
!J && I && it(!1);
|
|
157
|
+
}, [I, J]);
|
|
158
|
+
let wt = (t) => {
|
|
159
159
|
let n = {
|
|
160
|
-
...
|
|
160
|
+
...R,
|
|
161
161
|
...t
|
|
162
|
-
}, r = e(
|
|
163
|
-
r.toString() !==
|
|
162
|
+
}, r = e(v, n);
|
|
163
|
+
r.toString() !== v.toString() && (ze(r, { replace: !0 }), i(_, r));
|
|
164
164
|
};
|
|
165
165
|
s(() => {
|
|
166
|
-
if (!
|
|
167
|
-
|
|
166
|
+
if (!_ || K.length === 0 || !z) {
|
|
167
|
+
O(null), A(null), M(!1), N(null), P(null);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
let e =
|
|
171
|
-
return
|
|
170
|
+
let e = $e.trim(), t = e.length === 0 && !F, n = !1;
|
|
171
|
+
return M(!0), P(null), N(null), (async () => {
|
|
172
172
|
try {
|
|
173
173
|
let r = await o(ye, {
|
|
174
|
-
storeSlug:
|
|
175
|
-
schedule:
|
|
176
|
-
items:
|
|
174
|
+
storeSlug: _,
|
|
175
|
+
schedule: z,
|
|
176
|
+
items: K,
|
|
177
177
|
couponCode: e || void 0,
|
|
178
178
|
includeAutoApply: t,
|
|
179
|
-
insuranceAccepted:
|
|
179
|
+
insuranceAccepted: Y
|
|
180
180
|
}), i = be.parse(r);
|
|
181
181
|
if (n) return;
|
|
182
|
-
if (
|
|
182
|
+
if (A(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
|
|
183
183
|
subtotalMinor: i.subtotalMinor,
|
|
184
184
|
totalMinor: i.totalMinor,
|
|
185
185
|
lateReturnSurchargeMinor: i.lateReturnSurchargeMinor,
|
|
186
186
|
insuranceSubtotalMinor: i.insuranceSubtotalMinor,
|
|
187
187
|
insuranceBillableDays: i.insuranceBillableDays
|
|
188
188
|
} : null), !i.success) {
|
|
189
|
-
|
|
189
|
+
O(null), P(i.message || p("checkout_coupon_invalid"));
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
O(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (E(i.coupon.code), N(p("checkout_coupon_auto_applied", { code: i.coupon.code }))) : N(p("checkout_coupon_manual_applied")));
|
|
193
193
|
} catch (e) {
|
|
194
194
|
if (n) return;
|
|
195
|
-
console.error("Failed to verify checkout coupon", e),
|
|
195
|
+
console.error("Failed to verify checkout coupon", e), O(null), A(null), P(p("checkout_coupon_error"));
|
|
196
196
|
} finally {
|
|
197
|
-
n ||
|
|
197
|
+
n || M(!1);
|
|
198
198
|
}
|
|
199
199
|
})(), () => {
|
|
200
200
|
n = !0;
|
|
201
201
|
};
|
|
202
202
|
}, [
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
203
|
+
F,
|
|
204
|
+
R.end_date,
|
|
205
|
+
R.end_time,
|
|
206
|
+
R.start_date,
|
|
207
|
+
R.start_time,
|
|
208
|
+
z,
|
|
209
|
+
K,
|
|
210
|
+
Y,
|
|
211
|
+
_,
|
|
212
|
+
$e,
|
|
213
213
|
p
|
|
214
214
|
]), s(() => {
|
|
215
|
-
if (!
|
|
216
|
-
|
|
215
|
+
if (!_ || V.lines.length === 0 || !z) {
|
|
216
|
+
S(null), T(null), C(!1);
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
let e = !1;
|
|
220
|
-
return
|
|
220
|
+
return C(!0), T(null), (async () => {
|
|
221
221
|
try {
|
|
222
222
|
let t = await o(_e, {
|
|
223
|
-
storeSlug:
|
|
224
|
-
schedule:
|
|
225
|
-
estimatedTotalMinor:
|
|
223
|
+
storeSlug: _,
|
|
224
|
+
schedule: z,
|
|
225
|
+
estimatedTotalMinor: X,
|
|
226
|
+
insuranceAmountMinor: Z
|
|
226
227
|
}), n = ve.parse(t);
|
|
227
228
|
if (e) return;
|
|
228
229
|
if (!n.success || !n.decision) {
|
|
229
|
-
|
|
230
|
+
S(null), T(n.message || p("checkout_payment_error"));
|
|
230
231
|
return;
|
|
231
232
|
}
|
|
232
|
-
|
|
233
|
+
S(n.decision);
|
|
233
234
|
} catch (t) {
|
|
234
235
|
if (e) return;
|
|
235
|
-
console.error("Failed to load checkout payment decision", t),
|
|
236
|
+
console.error("Failed to load checkout payment decision", t), S(null), T(p("checkout_payment_error"));
|
|
236
237
|
} finally {
|
|
237
|
-
e ||
|
|
238
|
+
e || C(!1);
|
|
238
239
|
}
|
|
239
240
|
})(), () => {
|
|
240
241
|
e = !0;
|
|
241
242
|
};
|
|
242
243
|
}, [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
R.end_date,
|
|
245
|
+
R.end_time,
|
|
246
|
+
R.start_date,
|
|
247
|
+
R.start_time,
|
|
248
|
+
z,
|
|
249
|
+
X,
|
|
250
|
+
V.lines.length,
|
|
251
|
+
Z,
|
|
252
|
+
_,
|
|
251
253
|
p
|
|
252
254
|
]);
|
|
253
|
-
let
|
|
254
|
-
if (!
|
|
255
|
-
|
|
256
|
-
let t =
|
|
255
|
+
let $ = x?.currency ?? "EUR", Tt = f(X, $, m.language), Et = Math.max(0, X - Z), Dt = Math.round(Et / 1.2), Ot = Dt + Z, kt = Math.max(0, Et - Dt), At = f(Ot, $, m.language), jt = f(kt, $, m.language), Mt = Ie(Fe, m.language), Nt = Z > 0 ? f(Z, $, m.language) : void 0, Pt = x?.amountToCollectMinor ?? 0, Ft = x?.shouldCollectOnlinePayment === !0 && Pt > 0, It = Ct.handleSubmit(async (e) => {
|
|
256
|
+
if (!_ || K.length === 0 || !z || b.current) return;
|
|
257
|
+
Ye(!0), b.current = !0;
|
|
258
|
+
let t = Ge();
|
|
257
259
|
try {
|
|
258
260
|
let n = await o(ie, {
|
|
259
|
-
storeSlug:
|
|
261
|
+
storeSlug: _,
|
|
260
262
|
checkoutSessionId: t.checkoutSessionId,
|
|
261
263
|
replacesCheckoutSessionId: t.replacesCheckoutSessionId,
|
|
262
|
-
schedule:
|
|
263
|
-
fulfillment:
|
|
264
|
-
startAddress:
|
|
265
|
-
endAddress:
|
|
266
|
-
couponCode:
|
|
267
|
-
couponAutoApplied: !
|
|
268
|
-
insuranceAccepted:
|
|
264
|
+
schedule: z,
|
|
265
|
+
fulfillment: R.fulfillment,
|
|
266
|
+
startAddress: R.fulfillment === "delivery" ? R.start_address : void 0,
|
|
267
|
+
endAddress: R.fulfillment === "delivery" ? R.end_address : void 0,
|
|
268
|
+
couponCode: D?.code,
|
|
269
|
+
couponAutoApplied: !F && D?.autoApplied,
|
|
270
|
+
insuranceAccepted: Y,
|
|
269
271
|
customer: {
|
|
270
272
|
firstName: e.first_name,
|
|
271
273
|
lastName: e.last_name,
|
|
@@ -273,20 +275,20 @@ function p() {
|
|
|
273
275
|
phone: e.phone,
|
|
274
276
|
notes: e.notes
|
|
275
277
|
},
|
|
276
|
-
items:
|
|
278
|
+
items: K
|
|
277
279
|
}), r = ae.parse(n);
|
|
278
280
|
if (!r.success || !r.checkout) {
|
|
279
|
-
|
|
281
|
+
qe(), a.error(r.message || p("checkout_payment_error"));
|
|
280
282
|
return;
|
|
281
283
|
}
|
|
282
|
-
r.checkout.requiresPayment ?
|
|
284
|
+
r.checkout.requiresPayment ? Ke(r.checkout.checkoutSessionId ?? t.checkoutSessionId) : a.success(p("checkout_success_toast")), await Be(r.checkout.nextPath), r.checkout.requiresPayment || Je();
|
|
283
285
|
} catch (e) {
|
|
284
286
|
console.error("Failed to submit storefront checkout", e), a.error(p("checkout_payment_error"));
|
|
285
287
|
} finally {
|
|
286
|
-
|
|
288
|
+
b.current = !1, Ye(!1);
|
|
287
289
|
}
|
|
288
|
-
}), Lt = p(Ft ? "checkout_continue_to_payment" : "checkout_submit"), Rt =
|
|
289
|
-
return
|
|
290
|
+
}), Lt = p(Ft ? "checkout_continue_to_payment" : "checkout_submit"), Rt = R.fulfillment === "delivery" && R.start_address.trim().length === 0, zt = !y && !Xe && !w && !j && !nt && !!x && !!z && !Rt && K.length > 0;
|
|
291
|
+
return V.lines.length === 0 ? /* @__PURE__ */ u("div", {
|
|
290
292
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
291
293
|
children: /* @__PURE__ */ d("div", {
|
|
292
294
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
@@ -302,7 +304,7 @@ function p() {
|
|
|
302
304
|
/* @__PURE__ */ u("div", {
|
|
303
305
|
className: "mt-6",
|
|
304
306
|
children: /* @__PURE__ */ u(Ee, {
|
|
305
|
-
to:
|
|
307
|
+
to: xt,
|
|
306
308
|
children: /* @__PURE__ */ d(de, {
|
|
307
309
|
className: "gap-2",
|
|
308
310
|
children: [/* @__PURE__ */ u(Me, {
|
|
@@ -316,9 +318,9 @@ function p() {
|
|
|
316
318
|
})
|
|
317
319
|
}) : /* @__PURE__ */ u(he, {
|
|
318
320
|
currentStep: "checkout",
|
|
319
|
-
bookingPath:
|
|
320
|
-
checkoutPath:
|
|
321
|
-
backPath:
|
|
321
|
+
bookingPath: xt,
|
|
322
|
+
checkoutPath: St,
|
|
323
|
+
backPath: xt,
|
|
322
324
|
backLabel: p("back_to_booking"),
|
|
323
325
|
children: /* @__PURE__ */ d("div", {
|
|
324
326
|
className: "grid gap-6 lg:grid-cols-12",
|
|
@@ -329,7 +331,7 @@ function p() {
|
|
|
329
331
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
330
332
|
children: /* @__PURE__ */ u("span", { children: p("checkout_title") })
|
|
331
333
|
}),
|
|
332
|
-
|
|
334
|
+
z ? null : /* @__PURE__ */ u("p", {
|
|
333
335
|
role: "alert",
|
|
334
336
|
className: "mt-3 text-sm text-destructive",
|
|
335
337
|
children: /* @__PURE__ */ u("span", { children: p("booking_time_slots_required") })
|
|
@@ -337,33 +339,33 @@ function p() {
|
|
|
337
339
|
/* @__PURE__ */ d("div", {
|
|
338
340
|
className: "mt-5 grid gap-4",
|
|
339
341
|
children: [
|
|
340
|
-
|
|
342
|
+
ct ? /* @__PURE__ */ u("div", {
|
|
341
343
|
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
342
344
|
children: /* @__PURE__ */ u(me, {
|
|
343
|
-
value:
|
|
344
|
-
onValueChange: (e) =>
|
|
345
|
-
pickupAddress:
|
|
346
|
-
deliveryEnabled:
|
|
347
|
-
deliveryDisabledReason:
|
|
348
|
-
startAddress:
|
|
349
|
-
onStartAddressChange: (e) =>
|
|
350
|
-
endAddress:
|
|
351
|
-
onEndAddressChange: (e) =>
|
|
345
|
+
value: R.fulfillment,
|
|
346
|
+
onValueChange: (e) => wt({ fulfillment: e }),
|
|
347
|
+
pickupAddress: lt,
|
|
348
|
+
deliveryEnabled: L,
|
|
349
|
+
deliveryDisabledReason: st,
|
|
350
|
+
startAddress: R.start_address,
|
|
351
|
+
onStartAddressChange: (e) => wt({ start_address: e }),
|
|
352
|
+
endAddress: R.end_address,
|
|
353
|
+
onEndAddressChange: (e) => wt({ end_address: e }),
|
|
352
354
|
showPickupAddressWhenPickupOnly: !1,
|
|
353
355
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
354
356
|
})
|
|
355
357
|
}) : null,
|
|
356
|
-
/* @__PURE__ */ u(xe, { form:
|
|
357
|
-
|
|
358
|
-
accepted:
|
|
359
|
-
disabled:
|
|
360
|
-
dailyAmountLabel: f(
|
|
358
|
+
/* @__PURE__ */ u(xe, { form: Ct }),
|
|
359
|
+
J ? /* @__PURE__ */ u(Se, {
|
|
360
|
+
accepted: Y,
|
|
361
|
+
disabled: y || j,
|
|
362
|
+
dailyAmountLabel: f(_t, $, m.language),
|
|
361
363
|
totalAmountLabel: Nt,
|
|
362
|
-
billableDays:
|
|
363
|
-
deductibleLabel:
|
|
364
|
-
onAcceptedChange:
|
|
364
|
+
billableDays: k?.insuranceBillableDays,
|
|
365
|
+
deductibleLabel: vt > 0 ? f(vt, $, m.language) : void 0,
|
|
366
|
+
onAcceptedChange: it
|
|
365
367
|
}) : null,
|
|
366
|
-
|
|
368
|
+
Xe ? /* @__PURE__ */ d("div", {
|
|
367
369
|
className: "flex items-center gap-2 text-sm text-slate-600",
|
|
368
370
|
role: "status",
|
|
369
371
|
children: [/* @__PURE__ */ u(ge, {
|
|
@@ -371,13 +373,13 @@ function p() {
|
|
|
371
373
|
"aria-hidden": "true"
|
|
372
374
|
}), /* @__PURE__ */ u("span", { children: p("checkout_payment_loading") })]
|
|
373
375
|
}) : null,
|
|
374
|
-
|
|
376
|
+
w ? /* @__PURE__ */ d("div", {
|
|
375
377
|
className: "flex items-start gap-2 rounded-md bg-destructive p-3 text-sm text-destructive-foreground shadow-sm",
|
|
376
378
|
role: "alert",
|
|
377
379
|
children: [/* @__PURE__ */ u(je, {
|
|
378
380
|
className: "mt-0.5 h-4 w-4",
|
|
379
381
|
"aria-hidden": "true"
|
|
380
|
-
}), /* @__PURE__ */ u("span", { children:
|
|
382
|
+
}), /* @__PURE__ */ u("span", { children: w })]
|
|
381
383
|
}) : null,
|
|
382
384
|
/* @__PURE__ */ u(de, {
|
|
383
385
|
type: "button",
|
|
@@ -397,31 +399,31 @@ function p() {
|
|
|
397
399
|
})
|
|
398
400
|
]
|
|
399
401
|
}), /* @__PURE__ */ u(Ce, {
|
|
400
|
-
lines:
|
|
401
|
-
itemCount:
|
|
402
|
-
baseUnitLabel:
|
|
402
|
+
lines: ht.lines,
|
|
403
|
+
itemCount: He,
|
|
404
|
+
baseUnitLabel: dt,
|
|
403
405
|
bookingSubtotalLabel: At,
|
|
404
406
|
vatAmountLabel: jt,
|
|
405
407
|
vatRateLabel: Mt,
|
|
406
408
|
bookingTotalLabel: Tt,
|
|
407
|
-
onQuantityChange:
|
|
408
|
-
onRemove:
|
|
409
|
+
onQuantityChange: Ue,
|
|
410
|
+
onRemove: We,
|
|
409
411
|
coupon: {
|
|
410
|
-
code:
|
|
411
|
-
appliedCode:
|
|
412
|
-
discountLabel:
|
|
413
|
-
message:
|
|
414
|
-
error:
|
|
415
|
-
loading:
|
|
416
|
-
disabled:
|
|
412
|
+
code: Qe,
|
|
413
|
+
appliedCode: D?.code,
|
|
414
|
+
discountLabel: D && bt > 0 ? f(bt, $, m.language) : null,
|
|
415
|
+
message: tt,
|
|
416
|
+
error: nt,
|
|
417
|
+
loading: j,
|
|
418
|
+
disabled: y,
|
|
417
419
|
onCodeChange: (e) => {
|
|
418
|
-
|
|
420
|
+
E(e), P(null), N(null);
|
|
419
421
|
},
|
|
420
422
|
onApply: () => {
|
|
421
|
-
|
|
423
|
+
rt(!1), et(Qe.trim());
|
|
422
424
|
},
|
|
423
425
|
onRemove: () => {
|
|
424
|
-
|
|
426
|
+
E(""), et(""), O(null), A(null), P(null), N(null), rt(!0);
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
429
|
})]
|
|
@@ -82,7 +82,7 @@ export declare const loader: ({ ctx, params, request }: ContractSaleDocumentLoad
|
|
|
82
82
|
}[];
|
|
83
83
|
appendices: {
|
|
84
84
|
id: string;
|
|
85
|
-
kind: "rental_contract" | "rental_terms" | "sale_terms";
|
|
85
|
+
kind: "rental_contract" | "rental_terms" | "insurance_terms" | "sale_terms";
|
|
86
86
|
title: string;
|
|
87
87
|
articles: {
|
|
88
88
|
id: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsuranceTermsPage.d.ts","sourceRoot":"","sources":["../../src/pages/InsuranceTermsPage.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAsBzC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useStorefront as e } from "../StorefrontContext.js";
|
|
2
|
+
import { hasStorefrontRichTextContent as t } from "../lib/richText.js";
|
|
3
|
+
import { StorefrontInformationDocument as n, formatStorefrontInformationDocumentDate as r } from "../components/StorefrontInformationDocument/index.js";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import { useTranslation as a } from "react-i18next";
|
|
6
|
+
//#region src/pages/InsuranceTermsPage.tsx
|
|
7
|
+
function o() {
|
|
8
|
+
let { t: o, i18n: s } = a(), { storefrontConfiguration: c } = e(), l = c.information?.insuranceTerms, u = t(l) ? l?.html.trim() ?? "" : "", d = r({
|
|
9
|
+
language: s.resolvedLanguage || s.language || "en",
|
|
10
|
+
timeZone: c.shop.timeZone,
|
|
11
|
+
value: c.information?.insuranceTermsUpdatedAt
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ i(n, {
|
|
14
|
+
title: o("insurance_terms_title"),
|
|
15
|
+
description: o("insurance_terms_description", { shop_name: c.shop.name }),
|
|
16
|
+
effectiveDateLabel: d ? o("insurance_terms_effective_date", { date: d }) : void 0,
|
|
17
|
+
contentHtml: u,
|
|
18
|
+
unavailableLabel: o("insurance_terms_unavailable")
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { o as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RentalTermsPage.d.ts","sourceRoot":"","sources":["../../src/pages/RentalTermsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RentalTermsPage.d.ts","sourceRoot":"","sources":["../../src/pages/RentalTermsPage.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,eAAe,4CAoBtC"}
|
|
@@ -1,52 +1,21 @@
|
|
|
1
1
|
import { useStorefront as e } from "../StorefrontContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { StorefrontInformationDocument as t, formatStorefrontInformationDocumentDate as n } from "../components/StorefrontInformationDocument/index.js";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { useTranslation as i } from "react-i18next";
|
|
5
5
|
//#region src/pages/RentalTermsPage.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}).format(new Date(n)) : "";
|
|
12
|
-
function s() {
|
|
13
|
-
let { t: s, i18n: c } = r(), { storefrontConfiguration: l } = e(), u = l.information?.rentalTerms, d = u?.text.trim() ? u.html.trim() : "", f = o({
|
|
14
|
-
language: c.resolvedLanguage || c.language || "en",
|
|
15
|
-
timeZone: l.shop.timeZone,
|
|
16
|
-
value: l.information?.rentalTermsUpdatedAt
|
|
6
|
+
function a() {
|
|
7
|
+
let { t: a, i18n: o } = i(), { storefrontConfiguration: s } = e(), c = s.information?.rentalTerms, l = c?.text.trim() ? c.html.trim() : "", u = n({
|
|
8
|
+
language: o.resolvedLanguage || o.language || "en",
|
|
9
|
+
timeZone: s.shop.timeZone,
|
|
10
|
+
value: s.information?.rentalTermsUpdatedAt
|
|
17
11
|
});
|
|
18
|
-
return /* @__PURE__ */ t
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: [/* @__PURE__ */ n("header", {
|
|
25
|
-
className: "border-b border-slate-200 pb-8 sm:pb-10",
|
|
26
|
-
children: [
|
|
27
|
-
f ? /* @__PURE__ */ t("p", {
|
|
28
|
-
className: "text-sm text-slate-500",
|
|
29
|
-
children: /* @__PURE__ */ t("span", { children: s("rental_terms_effective_date", { date: f }) })
|
|
30
|
-
}) : null,
|
|
31
|
-
/* @__PURE__ */ t("h1", {
|
|
32
|
-
className: i("font-serif text-4xl font-normal leading-tight tracking-tight text-slate-950 sm:text-5xl", f && "mt-3"),
|
|
33
|
-
children: /* @__PURE__ */ t("span", { children: s("rental_terms_title") })
|
|
34
|
-
}),
|
|
35
|
-
/* @__PURE__ */ t("p", {
|
|
36
|
-
className: "mt-4 max-w-2xl text-base leading-7 text-slate-600 sm:text-lg sm:leading-8",
|
|
37
|
-
children: /* @__PURE__ */ t("span", { children: s("rental_terms_description", { shop_name: l.shop.name }) })
|
|
38
|
-
})
|
|
39
|
-
]
|
|
40
|
-
}), d ? /* @__PURE__ */ t("div", {
|
|
41
|
-
className: a,
|
|
42
|
-
dangerouslySetInnerHTML: { __html: d }
|
|
43
|
-
}) : /* @__PURE__ */ t("p", {
|
|
44
|
-
className: "mt-10 border-l-2 border-slate-300 pl-5 text-base leading-8 text-slate-600 sm:mt-12",
|
|
45
|
-
children: /* @__PURE__ */ t("span", { children: s("rental_terms_unavailable") })
|
|
46
|
-
})]
|
|
47
|
-
})
|
|
48
|
-
})
|
|
12
|
+
return /* @__PURE__ */ r(t, {
|
|
13
|
+
title: a("rental_terms_title"),
|
|
14
|
+
description: a("rental_terms_description", { shop_name: s.shop.name }),
|
|
15
|
+
effectiveDateLabel: u ? a("rental_terms_effective_date", { date: u }) : void 0,
|
|
16
|
+
contentHtml: l,
|
|
17
|
+
unavailableLabel: a("rental_terms_unavailable")
|
|
49
18
|
});
|
|
50
19
|
}
|
|
51
20
|
//#endregion
|
|
52
|
-
export {
|
|
21
|
+
export { a as default };
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.tsx"],"names":[],"mappings":";AAkCA,wBA0BC"}
|