@loczer/storefront-sdk 0.192.0 → 0.194.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/pkg/booking-engine/dist/models/{Product.shared-cjcvMCMa.js → Product.shared-iVSHRdn4.js} +21 -21
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-CsOe0vXi.js → base-asset-BRQVuIes.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-Sjsqh31e.js → base-booking-Bhy2Kww1.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-C_ATjuc6.js → base-product-BJHQLX8t.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-B01h642r.js → insurance-CPeHsTss.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas-BfXM1Dgb.js +14 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +35 -53
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +35 -53
- package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +7 -0
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +29 -0
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +11 -2
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +3 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +114 -110
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
- package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +182 -135
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +106 -138
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
- package/dist/i18n/en.d.ts +4 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +4 -0
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -0
- package/dist/index.d.ts +126 -9
- package/dist/index.js +70 -70
- package/dist/lib/booking.js +1 -1
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/contractSaleDocument.d.ts +44 -3
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +33 -17
- package/dist/lib/contractSaleDocumentApi.d.ts +54 -6
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/lib/contractSaleDocumentApi.js +41 -37
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +180 -152
- package/dist/pages/ContractSaleDocumentPage.d.ts +21 -9
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +263 -257
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +0 -14
|
@@ -29,30 +29,30 @@ import { Link as E, useLocation as ye, useParams as be, useSearchParams as xe }
|
|
|
29
29
|
import { useTranslation as Se } from "react-i18next";
|
|
30
30
|
import { ArrowLeft as Ce, ArrowRight as we, Bike as Te, ShoppingCart as Ee } from "lucide-react";
|
|
31
31
|
//#region src/pages/BookingPage.tsx
|
|
32
|
-
var D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e.getFullYear()}-${D(e.getMonth() + 1)}-${D(e.getDate())}`,
|
|
32
|
+
var D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e.getFullYear()}-${D(e.getMonth() + 1)}-${D(e.getDate())}`, Oe = (e) => {
|
|
33
33
|
if (!e) return;
|
|
34
34
|
let t = e.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
35
35
|
if (!t) return;
|
|
36
36
|
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a = new Date(n, r - 1, i);
|
|
37
37
|
if (!(Number.isNaN(a.getTime()) || a.getFullYear() !== n || a.getMonth() !== r - 1 || a.getDate() !== i)) return a;
|
|
38
|
-
},
|
|
38
|
+
}, ke = (e, t) => e.fulfillment === t.fulfillment && e.start_date === t.start_date && e.start_time === t.start_time && e.end_date === t.end_date && e.end_time === t.end_time && e.start_address === t.start_address && e.end_address === t.end_address, k = (e, t = () => !0) => {
|
|
39
39
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
40
40
|
let n = e.productVariants ?? [], r = n.find((e) => t(e.id))?.id ?? n[0]?.id;
|
|
41
41
|
return typeof r == "string" && r.trim().length > 0 ? r : null;
|
|
42
|
-
},
|
|
42
|
+
}, Ae = (e, t) => e.fulfillment === "delivery" && !t ? {
|
|
43
43
|
...e,
|
|
44
44
|
fulfillment: "pickup"
|
|
45
|
-
} : e,
|
|
45
|
+
} : e, je = (e, t) => {
|
|
46
46
|
let n = c(e), r = e.representedVariantId?.trim();
|
|
47
47
|
if (r) {
|
|
48
48
|
let e = t.get(p(n, r));
|
|
49
49
|
if (e) return e;
|
|
50
50
|
}
|
|
51
51
|
return t.get(p(n));
|
|
52
|
-
},
|
|
52
|
+
}, Me = (e, t, n) => n.get(p(c(e), t)), Ne = (e, t, n) => {
|
|
53
53
|
let r = ee(t);
|
|
54
54
|
return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
|
|
55
|
-
},
|
|
55
|
+
}, Pe = (e) => {
|
|
56
56
|
let t = /* @__PURE__ */ new Map();
|
|
57
57
|
for (let n of e) {
|
|
58
58
|
let e = c(n);
|
|
@@ -69,7 +69,7 @@ var D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e
|
|
|
69
69
|
}
|
|
70
70
|
return Array.from(t.values());
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function Fe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCancel: i, getVariantAvailabilityLabel: a, isVariantOutOfCapacity: c, confirmDisabled: l = !1 }) {
|
|
73
73
|
let { t: u } = Se(), d = e.productVariants ?? [];
|
|
74
74
|
return /* @__PURE__ */ w("div", {
|
|
75
75
|
className: "grid gap-3 rounded-xl border border-slate-200 bg-slate-50 p-3",
|
|
@@ -139,39 +139,61 @@ function Pe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCan
|
|
|
139
139
|
]
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
let { t: o, i18n: s } = Se(), { storeSlug: v } = be(), y = ye(), { storefrontConfiguration: D } = oe(),
|
|
142
|
+
function A() {
|
|
143
|
+
let { t: o, i18n: s } = Se(), { storeSlug: v } = be(), y = ye(), { storefrontConfiguration: D } = oe(), A = D.workspace?.workspaceLanguage, { bikes: Ie, accessories: Le } = ce(), { bikes: j, accessories: M } = se(), [N, P] = xe(), { items: Re, itemCount: F, addItem: ze, clear: Be, removeItem: Ve, setQuantity: He } = l(), Ue = x(() => t(D), [D]), I = x(() => r(D), [D]), L = D.settings.fulfillmentModes.includes("delivery"), We = D.settings.deliveryDisabledReason.trim(), Ge = D.shop.address?.trim() ?? "", R = x(() => i(N, v), [N, v]), [z, Ke] = S(() => Ae(n(R, I), L)), [qe, Je] = S(void 0), Ye = [
|
|
144
|
+
z.start_date,
|
|
145
|
+
z.start_time,
|
|
146
|
+
z.end_date,
|
|
147
|
+
z.end_time
|
|
148
|
+
].join(":"), B = qe === Ye, V = B ? z.start_time : "", H = B ? z.end_time : "", Xe = !B && N.get("start_date") === z.start_date && N.get("start_time") === z.start_time && N.get("end_date") === z.end_date && N.get("end_time") === z.end_time;
|
|
144
149
|
b(() => {
|
|
145
|
-
|
|
150
|
+
Ke((e) => {
|
|
146
151
|
let t = {
|
|
147
|
-
...
|
|
152
|
+
...I,
|
|
148
153
|
...e
|
|
149
|
-
}, r =
|
|
150
|
-
return
|
|
154
|
+
}, r = Ae(n(R, t), L);
|
|
155
|
+
return ke(e, r) ? e : r;
|
|
151
156
|
});
|
|
152
157
|
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
R,
|
|
159
|
+
I,
|
|
160
|
+
L
|
|
156
161
|
]), b(() => {
|
|
157
|
-
|
|
158
|
-
t
|
|
162
|
+
if (Xe) return;
|
|
163
|
+
let t = e(N, {
|
|
164
|
+
...z,
|
|
165
|
+
start_time: V,
|
|
166
|
+
end_time: H
|
|
167
|
+
});
|
|
168
|
+
t.toString() !== N.toString() && P(t, { replace: !0 });
|
|
159
169
|
}, [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
170
|
+
z,
|
|
171
|
+
Xe,
|
|
172
|
+
H,
|
|
173
|
+
V,
|
|
174
|
+
N,
|
|
175
|
+
P
|
|
163
176
|
]), b(() => {
|
|
164
|
-
a(v,
|
|
165
|
-
|
|
166
|
-
|
|
177
|
+
a(v, {
|
|
178
|
+
...z,
|
|
179
|
+
start_time: V,
|
|
180
|
+
end_time: H
|
|
181
|
+
});
|
|
182
|
+
}, [
|
|
183
|
+
z,
|
|
184
|
+
H,
|
|
185
|
+
V,
|
|
186
|
+
v
|
|
187
|
+
]);
|
|
188
|
+
let U = x(() => Pe([...j, ...M]), [M, j]), [Ze, W] = S([]);
|
|
167
189
|
b(() => {
|
|
168
|
-
if (!v ||
|
|
169
|
-
|
|
190
|
+
if (!v || U.length === 0) {
|
|
191
|
+
W([]);
|
|
170
192
|
return;
|
|
171
193
|
}
|
|
172
|
-
let e = h(
|
|
194
|
+
let e = B ? h(z) : null;
|
|
173
195
|
if (!e) {
|
|
174
|
-
|
|
196
|
+
W([]);
|
|
175
197
|
return;
|
|
176
198
|
}
|
|
177
199
|
let t = !1;
|
|
@@ -180,10 +202,10 @@ function j() {
|
|
|
180
202
|
let n = await he(f, {
|
|
181
203
|
storeSlug: v,
|
|
182
204
|
schedule: e,
|
|
183
|
-
products:
|
|
205
|
+
products: U
|
|
184
206
|
}), r = ne.parse(n);
|
|
185
207
|
if (t) return;
|
|
186
|
-
|
|
208
|
+
W(r.success ? r.availability ?? [] : []);
|
|
187
209
|
} catch (e) {
|
|
188
210
|
if (t) return;
|
|
189
211
|
console.error("Failed to load storefront availability", e);
|
|
@@ -192,26 +214,27 @@ function j() {
|
|
|
192
214
|
t = !0;
|
|
193
215
|
};
|
|
194
216
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
U,
|
|
218
|
+
z.end_date,
|
|
219
|
+
z.end_time,
|
|
220
|
+
z.start_date,
|
|
221
|
+
z.start_time,
|
|
222
|
+
B,
|
|
200
223
|
v
|
|
201
224
|
]);
|
|
202
|
-
let
|
|
203
|
-
let t =
|
|
225
|
+
let G = x(() => new Map(Ze.map((e) => [p(e.productId, e.productVariantId), e])), [Ze]), Qe = x(() => j.map((e) => {
|
|
226
|
+
let t = je(e, G);
|
|
204
227
|
return {
|
|
205
228
|
...e,
|
|
206
229
|
availabilityStatus: t ? m(t) : e.availabilityStatus ?? "AVAILABLE"
|
|
207
230
|
};
|
|
208
|
-
}), [
|
|
209
|
-
let n =
|
|
231
|
+
}), [G, j]), $e = (e, t) => {
|
|
232
|
+
let n = Me(e, t, G);
|
|
210
233
|
return n ? te(n) : e.availabilityStatus === "OUT_OF_STOCK";
|
|
211
|
-
},
|
|
212
|
-
let n =
|
|
213
|
-
return n ?
|
|
214
|
-
},
|
|
234
|
+
}, et = (e) => (e.productVariants ?? []).length > 0, tt = (e, t) => {
|
|
235
|
+
let n = Me(e, t, G);
|
|
236
|
+
return n ? Ne(o, n, m(n)) : e.availabilityStatus === "OUT_OF_STOCK" ? o("availability_out_of_stock") : null;
|
|
237
|
+
}, nt = ge(v), rt = x(() => ({
|
|
215
238
|
startDate: o("booking_start_date"),
|
|
216
239
|
pickStartDate: o("booking_start_date"),
|
|
217
240
|
startTime: o("booking_start_time"),
|
|
@@ -223,61 +246,61 @@ function j() {
|
|
|
223
246
|
timeSlotsUnavailable: o("booking_time_slots_unavailable"),
|
|
224
247
|
timeSlotsLoadError: o("booking_time_slots_load_error"),
|
|
225
248
|
retryTimeSlots: o("booking_time_slots_retry")
|
|
226
|
-
}), [s.language, o]),
|
|
227
|
-
|
|
249
|
+
}), [s.language, o]), K = (e) => {
|
|
250
|
+
Ke((t) => {
|
|
228
251
|
let n = {
|
|
229
252
|
...t,
|
|
230
253
|
...e
|
|
231
254
|
};
|
|
232
|
-
return
|
|
255
|
+
return ke(t, n) ? t : n;
|
|
233
256
|
});
|
|
234
|
-
},
|
|
235
|
-
startDate:
|
|
257
|
+
}, it = {
|
|
258
|
+
startDate: Oe(z.start_date),
|
|
236
259
|
onStartDateChange: (e) => {
|
|
237
|
-
e &&
|
|
260
|
+
e && K({ start_date: De(e) });
|
|
238
261
|
},
|
|
239
|
-
startTime:
|
|
240
|
-
onStartTimeChange: (e) =>
|
|
241
|
-
endDate:
|
|
262
|
+
startTime: z.start_time,
|
|
263
|
+
onStartTimeChange: (e) => K({ start_time: e }),
|
|
264
|
+
endDate: Oe(z.end_date) ?? Oe(z.start_date),
|
|
242
265
|
onEndDateChange: (e) => {
|
|
243
|
-
e &&
|
|
266
|
+
e && K({ end_date: De(e) });
|
|
244
267
|
},
|
|
245
|
-
endTime:
|
|
246
|
-
onEndTimeChange: (e) =>
|
|
247
|
-
bookingPeriodConfig:
|
|
248
|
-
fetchTimeSlots:
|
|
249
|
-
|
|
250
|
-
|
|
268
|
+
endTime: z.end_time,
|
|
269
|
+
onEndTimeChange: (e) => K({ end_time: e }),
|
|
270
|
+
bookingPeriodConfig: Ue,
|
|
271
|
+
fetchTimeSlots: nt,
|
|
272
|
+
onTimeSlotsConfirmationChange: (e) => {
|
|
273
|
+
Je(e ? Ye : void 0);
|
|
251
274
|
},
|
|
252
|
-
labels:
|
|
275
|
+
labels: rt,
|
|
253
276
|
localeCode: s.language
|
|
254
|
-
},
|
|
255
|
-
items:
|
|
277
|
+
}, q = x(() => d({
|
|
278
|
+
items: Re,
|
|
256
279
|
language: s.language,
|
|
257
|
-
fallbackLanguage:
|
|
280
|
+
fallbackLanguage: A,
|
|
258
281
|
products: {
|
|
259
|
-
bikes:
|
|
260
|
-
accessories:
|
|
282
|
+
bikes: Ie,
|
|
283
|
+
accessories: Le
|
|
261
284
|
}
|
|
262
285
|
}), [
|
|
286
|
+
Le,
|
|
263
287
|
Ie,
|
|
264
|
-
Fe,
|
|
265
288
|
s.language,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
]),
|
|
289
|
+
Re,
|
|
290
|
+
A
|
|
291
|
+
]), J = x(() => q.lines.map((e) => ({
|
|
269
292
|
productId: e.checkoutProductId,
|
|
270
293
|
productVariantId: e.productVariantId,
|
|
271
294
|
quantity: e.quantity
|
|
272
|
-
})), [
|
|
295
|
+
})), [q.lines]), [at, ot] = S([]);
|
|
273
296
|
b(() => {
|
|
274
|
-
if (!v ||
|
|
275
|
-
|
|
297
|
+
if (!v || J.length === 0) {
|
|
298
|
+
ot([]);
|
|
276
299
|
return;
|
|
277
300
|
}
|
|
278
|
-
let e = h(
|
|
301
|
+
let e = B ? h(z) : null;
|
|
279
302
|
if (!e) {
|
|
280
|
-
|
|
303
|
+
ot([]);
|
|
281
304
|
return;
|
|
282
305
|
}
|
|
283
306
|
let t = !1;
|
|
@@ -286,10 +309,10 @@ function j() {
|
|
|
286
309
|
let n = await he(f, {
|
|
287
310
|
storeSlug: v,
|
|
288
311
|
schedule: e,
|
|
289
|
-
products:
|
|
312
|
+
products: J
|
|
290
313
|
}), r = ne.parse(n);
|
|
291
314
|
if (t) return;
|
|
292
|
-
|
|
315
|
+
ot(r.success ? r.availability ?? [] : []);
|
|
293
316
|
} catch (e) {
|
|
294
317
|
if (t) return;
|
|
295
318
|
console.error("Failed to load storefront cart availability", e);
|
|
@@ -298,62 +321,67 @@ function j() {
|
|
|
298
321
|
t = !0;
|
|
299
322
|
};
|
|
300
323
|
}, [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
324
|
+
z.end_date,
|
|
325
|
+
z.end_time,
|
|
326
|
+
z.start_date,
|
|
327
|
+
z.start_time,
|
|
328
|
+
B,
|
|
329
|
+
J,
|
|
306
330
|
v
|
|
307
331
|
]);
|
|
308
|
-
let
|
|
309
|
-
...
|
|
310
|
-
lines:
|
|
311
|
-
let t =
|
|
332
|
+
let st = x(() => new Map(at.map((e) => [p(e.productId, e.productVariantId), e])), [at]), ct = x(() => ({
|
|
333
|
+
...q,
|
|
334
|
+
lines: q.lines.map((e) => {
|
|
335
|
+
let t = st.get(p(e.checkoutProductId, e.productVariantId)), n = t ? ee(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
312
336
|
return {
|
|
313
337
|
...e,
|
|
314
338
|
insufficientCapacity: n !== void 0,
|
|
315
339
|
availabilityIssue: n
|
|
316
340
|
};
|
|
317
341
|
})
|
|
318
|
-
}), [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
t
|
|
342
|
+
}), [st, q]), Y = e(new URLSearchParams(), {
|
|
343
|
+
...z,
|
|
344
|
+
start_time: V,
|
|
345
|
+
end_time: H
|
|
346
|
+
}).toString(), X = B && h(z) !== null, lt = `/${v ?? ""}${Y ? `?${Y}` : ""}`, ut = `/${v ?? ""}/booking${Y ? `?${Y}` : ""}`, dt = `/${v ?? ""}/checkout${Y ? `?${Y}` : ""}`, ft = { backTo: `${y.pathname}${y.search}${y.hash}` }, [pt, Z] = S(null), [mt, ht] = S({}), gt = (e) => {
|
|
347
|
+
let t = mt[e.id];
|
|
348
|
+
return t && e.productVariants?.some((e) => e.id === t) ? t : k(e);
|
|
349
|
+
}, _t = N.get(O)?.trim() ?? "", Q = _t ? Qe.find((e) => e.id === _t) ?? null : null, vt = (e) => {
|
|
350
|
+
let t = new URLSearchParams(N);
|
|
351
|
+
e?.trim() ? t.set(O, e) : t.delete(O), P(t, { replace: !0 });
|
|
352
|
+
}, yt = (e) => {
|
|
353
|
+
let t = k(e);
|
|
354
|
+
t && (ht((n) => n[e.id] ? n : {
|
|
327
355
|
...n,
|
|
328
356
|
[e.id]: t
|
|
329
357
|
}), Z(e.id));
|
|
330
|
-
},
|
|
331
|
-
|
|
358
|
+
}, bt = (e) => {
|
|
359
|
+
k(e) && (Z(null), vt(e.id));
|
|
332
360
|
}, $ = (e, t, n = 1) => {
|
|
333
|
-
|
|
361
|
+
X && ze({
|
|
334
362
|
kind: e.kind,
|
|
335
363
|
productId: c(e),
|
|
336
364
|
...t ? { productVariantId: t } : {},
|
|
337
365
|
quantity: n
|
|
338
366
|
});
|
|
339
|
-
},
|
|
340
|
-
let t =
|
|
367
|
+
}, xt = (e) => {
|
|
368
|
+
let t = k(e), n = e.productVariants ?? [];
|
|
341
369
|
if (t && n.length <= 1) {
|
|
342
370
|
$(e, t);
|
|
343
371
|
return;
|
|
344
372
|
}
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
let t = e.productVariants ?? [], n =
|
|
373
|
+
bt(e);
|
|
374
|
+
}, St = (e) => {
|
|
375
|
+
let t = e.productVariants ?? [], n = gt(e);
|
|
348
376
|
if (n) {
|
|
349
377
|
if (t.length > 1) {
|
|
350
|
-
|
|
378
|
+
yt(e);
|
|
351
379
|
return;
|
|
352
380
|
}
|
|
353
381
|
$(e, n);
|
|
354
382
|
}
|
|
355
|
-
},
|
|
356
|
-
let t =
|
|
383
|
+
}, Ct = (e) => {
|
|
384
|
+
let t = gt(e);
|
|
357
385
|
t && ($(e, t), Z((t) => t === e.id ? null : t));
|
|
358
386
|
};
|
|
359
387
|
return /* @__PURE__ */ w("div", {
|
|
@@ -363,22 +391,22 @@ function j() {
|
|
|
363
391
|
children: [
|
|
364
392
|
/* @__PURE__ */ C(ae, {
|
|
365
393
|
currentStep: "booking",
|
|
366
|
-
bookingPath:
|
|
367
|
-
checkoutPath:
|
|
368
|
-
checkoutEnabled:
|
|
394
|
+
bookingPath: ut,
|
|
395
|
+
checkoutPath: dt,
|
|
396
|
+
checkoutEnabled: F > 0 && X
|
|
369
397
|
}),
|
|
370
398
|
/* @__PURE__ */ w("div", {
|
|
371
399
|
className: "flex items-center justify-between gap-3",
|
|
372
400
|
children: [/* @__PURE__ */ w(E, {
|
|
373
|
-
to:
|
|
401
|
+
to: lt,
|
|
374
402
|
className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
|
|
375
403
|
children: [/* @__PURE__ */ C(Ce, {
|
|
376
404
|
className: "h-4 w-4",
|
|
377
405
|
"aria-hidden": "true"
|
|
378
406
|
}), /* @__PURE__ */ C("span", { children: o("back_to_home") })]
|
|
379
407
|
}), /* @__PURE__ */ C(E, {
|
|
380
|
-
to:
|
|
381
|
-
className: T(
|
|
408
|
+
to: dt,
|
|
409
|
+
className: T(F > 0 && X ? "inline-flex" : "hidden"),
|
|
382
410
|
children: /* @__PURE__ */ w(g, {
|
|
383
411
|
size: "sm",
|
|
384
412
|
className: "gap-2",
|
|
@@ -404,21 +432,21 @@ function j() {
|
|
|
404
432
|
title: o("booking_summary_title")
|
|
405
433
|
}),
|
|
406
434
|
/* @__PURE__ */ C(ie, {
|
|
407
|
-
...
|
|
435
|
+
...it,
|
|
408
436
|
className: "gap-3",
|
|
409
437
|
labelClassName: "text-xs font-medium text-slate-700",
|
|
410
438
|
inputClassName: "h-10"
|
|
411
439
|
}),
|
|
412
440
|
/* @__PURE__ */ C(_e, {
|
|
413
|
-
value:
|
|
414
|
-
onValueChange: (e) =>
|
|
415
|
-
pickupAddress:
|
|
416
|
-
deliveryEnabled:
|
|
417
|
-
deliveryDisabledReason:
|
|
418
|
-
startAddress:
|
|
419
|
-
onStartAddressChange: (e) =>
|
|
420
|
-
endAddress:
|
|
421
|
-
onEndAddressChange: (e) =>
|
|
441
|
+
value: z.fulfillment,
|
|
442
|
+
onValueChange: (e) => K({ fulfillment: e }),
|
|
443
|
+
pickupAddress: Ge,
|
|
444
|
+
deliveryEnabled: L,
|
|
445
|
+
deliveryDisabledReason: We,
|
|
446
|
+
startAddress: z.start_address,
|
|
447
|
+
onStartAddressChange: (e) => K({ start_address: e }),
|
|
448
|
+
endAddress: z.end_address,
|
|
449
|
+
onEndAddressChange: (e) => K({ end_address: e }),
|
|
422
450
|
testIdPrefix: "storefront-booking-fulfillment"
|
|
423
451
|
})
|
|
424
452
|
]
|
|
@@ -436,16 +464,16 @@ function j() {
|
|
|
436
464
|
}),
|
|
437
465
|
/* @__PURE__ */ C("div", {
|
|
438
466
|
className: "grid gap-4 md:grid-cols-2",
|
|
439
|
-
children:
|
|
440
|
-
let t = `/${v ?? ""}/products/${e.slug}`, n = !!
|
|
467
|
+
children: Qe.map((e) => {
|
|
468
|
+
let t = `/${v ?? ""}/products/${e.slug}`, n = !!k(e) || et(e);
|
|
441
469
|
return /* @__PURE__ */ C(me, {
|
|
442
470
|
bike: e,
|
|
443
471
|
detailsPath: t,
|
|
444
|
-
productDetailsLinkState:
|
|
472
|
+
productDetailsLinkState: ft,
|
|
445
473
|
actionLabelKey: "add_to_cart",
|
|
446
|
-
onAction: () =>
|
|
447
|
-
actionDisabled: !n || !
|
|
448
|
-
fallbackLanguage:
|
|
474
|
+
onAction: () => xt(e),
|
|
475
|
+
actionDisabled: !n || !X,
|
|
476
|
+
fallbackLanguage: A,
|
|
449
477
|
variant: "booking",
|
|
450
478
|
testId: `storefront-booking-bike-card-${e.id}`.toLowerCase()
|
|
451
479
|
}, e.id);
|
|
@@ -463,8 +491,8 @@ function j() {
|
|
|
463
491
|
}),
|
|
464
492
|
/* @__PURE__ */ C("div", {
|
|
465
493
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
466
|
-
children:
|
|
467
|
-
let t = u(e.name, s.language,
|
|
494
|
+
children: M.map((e) => {
|
|
495
|
+
let t = u(e.name, s.language, A), n = u(e.description, s.language, A), r = u(e.warning, s.language, A), i = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", a = pe(e.primaryImageStyle), c = `/${v ?? ""}/products/${e.slug}`, l = k(e), d = gt(e), f = m(je(e, G)) === "OUT_OF_STOCK", p = !!l || et(e);
|
|
468
496
|
return /* @__PURE__ */ C(le, {
|
|
469
497
|
className: "h-full border-slate-200 bg-white shadow-sm",
|
|
470
498
|
children: /* @__PURE__ */ w("div", {
|
|
@@ -513,32 +541,32 @@ function j() {
|
|
|
513
541
|
})
|
|
514
542
|
]
|
|
515
543
|
}),
|
|
516
|
-
e.productVariants?.length && e.productVariants.length > 1 &&
|
|
544
|
+
e.productVariants?.length && e.productVariants.length > 1 && pt === e.id && d ? /* @__PURE__ */ C(Fe, {
|
|
517
545
|
product: e,
|
|
518
546
|
selectedVariantId: d,
|
|
519
|
-
onSelect: (t) =>
|
|
547
|
+
onSelect: (t) => ht((n) => ({
|
|
520
548
|
...n,
|
|
521
549
|
[e.id]: t
|
|
522
550
|
})),
|
|
523
|
-
onConfirm: () =>
|
|
551
|
+
onConfirm: () => Ct(e),
|
|
524
552
|
onCancel: () => Z((t) => t === e.id ? null : t),
|
|
525
|
-
getVariantAvailabilityLabel: (t) =>
|
|
526
|
-
isVariantOutOfCapacity: (t) =>
|
|
527
|
-
confirmDisabled: !
|
|
553
|
+
getVariantAvailabilityLabel: (t) => tt(e, t),
|
|
554
|
+
isVariantOutOfCapacity: (t) => $e(e, t),
|
|
555
|
+
confirmDisabled: !X
|
|
528
556
|
}) : null,
|
|
529
557
|
/* @__PURE__ */ w("div", {
|
|
530
558
|
className: "mt-auto flex items-center gap-2",
|
|
531
559
|
children: [/* @__PURE__ */ C(E, {
|
|
532
560
|
to: c,
|
|
533
|
-
state:
|
|
561
|
+
state: ft,
|
|
534
562
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
535
563
|
children: /* @__PURE__ */ C("span", { children: o("product_details_link") })
|
|
536
564
|
}), /* @__PURE__ */ w(g, {
|
|
537
565
|
type: "button",
|
|
538
566
|
size: "sm",
|
|
539
567
|
className: "ml-auto rounded-full gap-2",
|
|
540
|
-
onClick: () =>
|
|
541
|
-
disabled: !p || !
|
|
568
|
+
onClick: () => St(e),
|
|
569
|
+
disabled: !p || !X,
|
|
542
570
|
children: [/* @__PURE__ */ C("span", { children: o("add_to_cart") }), /* @__PURE__ */ C(we, {
|
|
543
571
|
className: "h-4 w-4",
|
|
544
572
|
"aria-hidden": "true"
|
|
@@ -555,17 +583,17 @@ function j() {
|
|
|
555
583
|
}), /* @__PURE__ */ C("div", {
|
|
556
584
|
className: "lg:col-span-4",
|
|
557
585
|
children: /* @__PURE__ */ C(de, {
|
|
558
|
-
lines:
|
|
559
|
-
itemCount:
|
|
560
|
-
totalPerDayMinor:
|
|
561
|
-
checkoutPath:
|
|
562
|
-
showCheckoutAction:
|
|
586
|
+
lines: ct.lines,
|
|
587
|
+
itemCount: F,
|
|
588
|
+
totalPerDayMinor: ct.totalPerDayMinor,
|
|
589
|
+
checkoutPath: dt,
|
|
590
|
+
showCheckoutAction: X,
|
|
563
591
|
showClearAction: !0,
|
|
564
592
|
editable: !0,
|
|
565
593
|
stickyTopClassName: "top-32",
|
|
566
|
-
onQuantityChange:
|
|
567
|
-
onRemove:
|
|
568
|
-
onClear:
|
|
594
|
+
onQuantityChange: He,
|
|
595
|
+
onRemove: Ve,
|
|
596
|
+
onClear: Be
|
|
569
597
|
})
|
|
570
598
|
})]
|
|
571
599
|
})
|
|
@@ -574,16 +602,16 @@ function j() {
|
|
|
574
602
|
open: !!Q,
|
|
575
603
|
product: Q,
|
|
576
604
|
onOpenChange: (e) => {
|
|
577
|
-
e ||
|
|
605
|
+
e || vt(null);
|
|
578
606
|
},
|
|
579
|
-
getVariantAvailabilityLabel: (e) => Q ?
|
|
580
|
-
isVariantOutOfCapacity: (e) => Q ?
|
|
581
|
-
addDisabled: !
|
|
607
|
+
getVariantAvailabilityLabel: (e) => Q ? tt(Q, e) : null,
|
|
608
|
+
isVariantOutOfCapacity: (e) => Q ? $e(Q, e) : !1,
|
|
609
|
+
addDisabled: !X,
|
|
582
610
|
onAddVariant: (e, t) => {
|
|
583
|
-
Q && ($(Q, e, t),
|
|
611
|
+
Q && ($(Q, e, t), vt(null));
|
|
584
612
|
}
|
|
585
613
|
})]
|
|
586
614
|
});
|
|
587
615
|
}
|
|
588
616
|
//#endregion
|
|
589
|
-
export {
|
|
617
|
+
export { A as default };
|
|
@@ -74,26 +74,38 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
74
74
|
taxRate?: number | undefined;
|
|
75
75
|
taxExemptionReason?: string | undefined;
|
|
76
76
|
}[];
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
language?: {
|
|
81
|
-
legal: "fr" | "en";
|
|
82
|
-
customer: "fr" | "en";
|
|
83
|
-
translation?: "fr" | "en" | undefined;
|
|
84
|
-
} | undefined;
|
|
85
|
-
terms?: {
|
|
77
|
+
appendices: {
|
|
78
|
+
id: string;
|
|
79
|
+
kind: "rental_contract" | "rental_terms" | "sale_terms";
|
|
86
80
|
title: string;
|
|
87
81
|
articles: {
|
|
88
82
|
id: string;
|
|
89
83
|
title: string;
|
|
90
84
|
body: string;
|
|
85
|
+
bodyHtml?: string | undefined;
|
|
91
86
|
translationTitle?: string | undefined;
|
|
92
87
|
translationBody?: string | undefined;
|
|
88
|
+
translationBodyHtml?: string | undefined;
|
|
93
89
|
}[];
|
|
90
|
+
}[];
|
|
91
|
+
acceptanceLevel: "none" | "acceptance" | "signature";
|
|
92
|
+
date: Date;
|
|
93
|
+
dueDate: Date;
|
|
94
|
+
language?: {
|
|
95
|
+
legal: "fr" | "en";
|
|
96
|
+
customer: "fr" | "en";
|
|
97
|
+
translation?: "fr" | "en" | undefined;
|
|
94
98
|
} | undefined;
|
|
95
99
|
taxRate?: number | undefined;
|
|
96
100
|
notes?: string | undefined;
|
|
101
|
+
rental?: {
|
|
102
|
+
bookingNumber: string;
|
|
103
|
+
start: Date;
|
|
104
|
+
end: Date;
|
|
105
|
+
pickupAddress?: string | undefined;
|
|
106
|
+
returnAddress?: string | undefined;
|
|
107
|
+
timeZone?: string | undefined;
|
|
108
|
+
} | undefined;
|
|
97
109
|
acceptance?: {
|
|
98
110
|
mode: "acceptance";
|
|
99
111
|
date: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAmC,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAsLnG,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAmC,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAsLnG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEA,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CAqP/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAouB/B"}
|