@loczer/storefront-sdk 0.183.0 → 0.184.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.
@@ -31,15 +31,18 @@ var s = o.object({
31
31
  productId: e,
32
32
  productVariantId: e.optional(),
33
33
  qty: o.number().int().positive()
34
- }), u = a;
35
- function d(e, t) {
34
+ }), u = a, d = "pickup";
35
+ function f(e) {
36
+ return e === "delivery" ? "delivery" : d;
37
+ }
38
+ function p(e, t) {
36
39
  e.deliveryOption === "delivery" && (e.startAddress?.trim() || t.addIssue({
37
40
  code: o.ZodIssueCode.custom,
38
41
  message: "Delivery start address is required.",
39
42
  path: ["startAddress"]
40
43
  }));
41
44
  }
42
- var f = o.object({
45
+ var m = o.object({
43
46
  customer: c,
44
47
  items: o.array(l),
45
48
  schedule: s,
@@ -53,6 +56,6 @@ var f = o.object({
53
56
  deliveryOption: u.optional(),
54
57
  startAddress: o.string().trim().max(500).optional(),
55
58
  endAddress: o.string().trim().max(500).optional()
56
- }), p = f.superRefine(d);
59
+ }), h = m.superRefine(p);
57
60
  //#endregion
58
- export { c as bookingCustomerInputSchema, u as bookingDeliveryOptionSchema, s as bookingScheduleInputSchema, l as cartItemInputSchema, f as createBookingInputBaseSchema, p as createBookingInputSchema, d as validateBookingDeliveryAddress };
61
+ export { d as DEFAULT_BOOKING_DELIVERY_OPTION, c as bookingCustomerInputSchema, u as bookingDeliveryOptionSchema, s as bookingScheduleInputSchema, l as cartItemInputSchema, m as createBookingInputBaseSchema, h as createBookingInputSchema, f as resolveBookingDeliveryOption, p as validateBookingDeliveryAddress };
@@ -0,0 +1,13 @@
1
+ import { createLocalizedStringEntry as e, getLocalizedStringValue as t, localizedStringArraySchema as n, localizedStringEntrySchema as r, localizedStringSchema as i } from "./models/LocalizedString-D_TRgAdr.js";
2
+ import { currencyCodeSchema as a, currencyMinorUnitDigits as o, majorToMinor as s, minorToMajor as c, moneyMinorSchema as l, signedMoneyMinorSchema as u } from "./schemas/money-CVoCY4of.js";
3
+ import { priceSchema as d, priceUnitSchema as f } from "./models/Price-DCAgqkKh.js";
4
+ import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./models/Product.shared-CTuk4fiR.js";
5
+ import { richTextJsonDocSchema as E, richTextSchema as D, richTextVersionSchema as O } from "./schemas/rich-text-DTRh7U3z.js";
6
+ import { isoDateSchema as k, shopConfigurationSchema as A, shopExtraTimeSlotRuleSchema as j, shopOpeningDayIndexSchema as M, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as P, shopOpeningHoursPeriodSchema as F, shopOpeningSlotSchema as I, timeOfDaySchema as L } from "./schemas/shop-opening-hours-BlLD1gfz.js";
7
+ import { DEFAULT_CANCELLATION_POLICY as R, DEFAULT_PAYMENT_POLICIES as z, cancellationPolicySchema as B, cancellationPolicyTierSchema as V, paymentPoliciesSchema as H } from "./schemas/booking-engine-configuration-D02MRF9U.js";
8
+ import { fulfillmentModeSchema as U, publicBookingEngineConfigurationSchema as W, publicCheckoutConfigurationSchema as G, publicCheckoutDynamicOptionsSchema as K } from "./schemas/public-booking-engine-configuration-BnJ_H-p1.js";
9
+ import { DEFAULT_BOOKING_DELIVERY_OPTION as q, bookingCustomerInputSchema as J, bookingDeliveryOptionSchema as Y, bookingScheduleInputSchema as X, cartItemInputSchema as Z, createBookingInputBaseSchema as Q, createBookingInputSchema as $, resolveBookingDeliveryOption as ee, validateBookingDeliveryAddress as te } from "./schemas/cart-inputs-j1yWfJxO.js";
10
+ import "./schemas/base-product-1H8l2aUv.js";
11
+ import { baseAssetSchema as ne, baseAssetStatusSchema as re } from "./schemas/base-asset-B_Dm8_Vk.js";
12
+ import { baseBookingItemSchema as ie, baseBookingSchema as ae, baseBookingStateSchema as oe } from "./schemas/base-booking-DW8AEPKo.js";
13
+ export { q as DEFAULT_BOOKING_DELIVERY_OPTION, R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, h as accessoryProductSchema, ne as baseAssetSchema, re as baseAssetStatusSchema, ie as baseBookingItemSchema, ae as baseBookingSchema, oe as baseBookingStateSchema, g as bikeProductSchema, J as bookingCustomerInputSchema, Y as bookingDeliveryOptionSchema, X as bookingScheduleInputSchema, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, Z as cartItemInputSchema, Q as createBookingInputBaseSchema, $ as createBookingInputSchema, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, _ as eBikeProductSchema, U as fulfillmentModeSchema, t as getLocalizedStringValue, v as isProductVariantCodeIdentifierKind, k as isoDateSchema, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, ee as resolveBookingDeliveryOption, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, u as signedMoneyMinorSchema, L as timeOfDaySchema, te as validateBookingDeliveryAddress };
@@ -1 +1 @@
1
- {"version":3,"file":"useBookingPeriodController.d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AI,CAAA;IACT;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAwGD,eAAO,MAAM,0BAA0B,GACrC,SAAS,8BAA8B,KACtC,4BAoyBF,CAAA"}
1
+ {"version":3,"file":"useBookingPeriodController.d.ts","sourceRoot":"","sources":["../../../src/components/BookingPeriodSelector/useBookingPeriodController.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,OAAO,EAQL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAiC,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAGpH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,MAAM,CAAA;AAEX,MAAM,MAAM,6BAA6B,GAAG,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,KACjB,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAA;AAE/B,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,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e,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,aAAa,EAAE,CACb,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KACtE,IAAI,CAAA;IACT;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAwGD,eAAO,MAAM,0BAA0B,GACrC,SAAS,8BAA8B,KACtC,4BA6yBF,CAAA"}
@@ -3,33 +3,33 @@ import { getBookingPeriodTimeSlotsSync as s } from "../../lib/booking-period-tim
3
3
  import { differenceInCalendarDays as c } from "date-fns";
4
4
  import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
5
5
  import { useMediaQuery as ee } from "@rpcbase/client";
6
- import { de as te, enUS as m, es as h, fr as g, it as ne } from "date-fns/locale";
6
+ import { de as te, enUS as m, es as ne, fr as h, it as re } from "date-fns/locale";
7
7
  //#region src/components/BookingPeriodSelector/useBookingPeriodController.ts
8
- var re = (e) => e, ie = {
8
+ var ie = (e) => e, ae = {
9
9
  startDate: "Start date",
10
10
  pickStartDate: "Pick a date",
11
11
  startTime: "Start time",
12
12
  endDate: "End date",
13
13
  pickEndDate: "Pick a date",
14
14
  endTime: "End time"
15
- }, ae = ({ locale: e, localeCode: t }) => {
15
+ }, oe = ({ locale: e, localeCode: t }) => {
16
16
  if (e) return e;
17
17
  let n = t?.toLowerCase() ?? "";
18
- return n.startsWith("fr") ? g : n.startsWith("de") ? te : n.startsWith("es") ? h : n.startsWith("it") ? ne : m;
19
- }, oe = (e) => {
18
+ return n.startsWith("fr") ? h : n.startsWith("de") ? te : n.startsWith("es") ? ne : n.startsWith("it") ? re : m;
19
+ }, se = (e) => {
20
20
  if (!e?.length) return null;
21
21
  let t = e.map((e) => o(e.value)).filter((e) => typeof e == "number").sort((e, t) => e - t);
22
22
  if (t.length < 2) return null;
23
23
  let n = t[1] - t[0];
24
24
  return !Number.isFinite(n) || n <= 0 ? null : n;
25
- }, _ = (e) => {
25
+ }, g = (e) => {
26
26
  if (typeof e != "string") return null;
27
27
  let t = e.match(/(\d{1,2}:\d{2})\s*-\s*(\d{1,2}:\d{2})/);
28
28
  return t ? o(t[2]) : null;
29
- }, se = (e, t) => e.map((e) => {
29
+ }, ce = (e, t) => e.map((e) => {
30
30
  let n = o(e.value);
31
31
  if (n == null) return null;
32
- let r = _(e.label) ?? n + t, i = typeof e.label == "string" ? e.label : e.value;
32
+ let r = g(e.label) ?? n + t, i = typeof e.label == "string" ? e.label : e.value;
33
33
  return {
34
34
  value: e.value,
35
35
  label: i,
@@ -38,135 +38,139 @@ var re = (e) => e, ie = {
38
38
  isExtra: !1,
39
39
  isDisabled: !!e.disabled
40
40
  };
41
- }).filter((e) => !!e), ce = (e) => !e.isDisabled && !e.isExtra, le = (e) => {
42
- for (let t = e.length - 1; t >= 0; --t) if (ce(e[t])) return e[t];
41
+ }).filter((e) => !!e), _ = (e) => !e.isDisabled && !e.isExtra, le = (e) => {
42
+ for (let t = e.length - 1; t >= 0; --t) if (_(e[t])) return e[t];
43
43
  return null;
44
- }, ue = (e, t) => e.find((e) => ce(e) && e.startMinutes >= t) ?? null, v = (te) => {
45
- let { startDate: m, onStartDateChange: h, startTime: g, onStartTimeChange: ne, endDate: _, onEndDateChange: v, endTime: y, onEndTimeChange: de, onEndDateCommit: b, onEndTimeCommit: x, errors: fe = {}, labels: pe, t: me = re, language: he, labelClassName: ge, inputClassName: _e, buttonClassName: ve, bookingPeriodConfig: S, fetchTimeSlots: C, selectionFlow: w = "chained-times", withMobileDateDrawer: ye = !1, currencyCode: be = "EUR", disableAutomaticTimeCorrection: T = !1, openDatePickerOnFocus: xe = !0, startTimeOptions: E = [], endTimeOptions: Se, locale: Ce, localeCode: we } = te, D = ee("(max-width: 767px)"), O = we ?? he ?? "en-US", Te = d(() => ae({
44
+ }, ue = (e, t) => e.find((e) => _(e) && e.startMinutes >= t) ?? null, v = (te) => {
45
+ let { startDate: m, onStartDateChange: ne, startTime: h, onStartTimeChange: re, endDate: g, onEndDateChange: v, endTime: y, onEndTimeChange: de, onEndDateCommit: b, onEndTimeCommit: x, errors: fe = {}, labels: pe, t: me = ie, language: he, labelClassName: ge, inputClassName: _e, buttonClassName: ve, bookingPeriodConfig: S, fetchTimeSlots: C, selectionFlow: w = "chained-times", withMobileDateDrawer: ye = !1, currencyCode: be = "EUR", disableAutomaticTimeCorrection: T = !1, openDatePickerOnFocus: xe = !0, startTimeOptions: E = [], endTimeOptions: Se, locale: Ce, localeCode: we } = te, D = ee("(max-width: 767px)"), O = we ?? he ?? "en-US", Te = d(() => oe({
46
46
  locale: Ce,
47
47
  localeCode: O
48
- }), [Ce, O]), k = d(() => S ? t(S) : null, [S]), A = d(() => S?.timing.slotIntervalMinutes ? S.timing.slotIntervalMinutes : oe(E) ?? 30, [S?.timing.slotIntervalMinutes, E]), [Ee, j] = p(!1), [De, Oe] = p(!1), [ke, M] = p(!1), [Ae, je] = p(!1), [Me, Ne] = p(void 0), [Pe, Fe] = p(!1), [Ie, Le] = p(!1), [N, Re] = p([]), [ze, P] = p([]), [F, I] = p(void 0), L = f(null), R = f(0), Be = f(0), Ve = f(0), He = f(void 0), z = f(void 0), Ue = l(() => {
49
- Ne(void 0);
50
- }, []), We = d(() => !m || !_ ? !1 : c(_, m) === 0, [m, _]), Ge = d(() => o(g), [g]), B = l((e) => {
48
+ }), [Ce, O]), k = d(() => S ? t(S) : null, [S]), A = d(() => S?.timing.slotIntervalMinutes ? S.timing.slotIntervalMinutes : se(E) ?? 30, [S?.timing.slotIntervalMinutes, E]), [j, M] = p(!1), [N, Ee] = p(!1), [De, P] = p(!1), [F, Oe] = p(!1), [ke, Ae] = p(void 0), [je, Me] = p(!1), [Ne, Pe] = p(!1), [Fe, Ie] = p([]), [Le, I] = p([]), [L, R] = p(void 0), z = f(null), Re = f(0), ze = f(0), Be = f(0), Ve = f(void 0), B = f(void 0), He = l(() => {
49
+ Ae(void 0);
50
+ }, []), Ue = d(() => !m || !g ? !1 : c(g, m) === 0, [m, g]), We = d(() => o(h), [h]), V = l((e) => {
51
51
  let t = (e instanceof Date ? e : e ? new Date(e) : void 0) ?? /* @__PURE__ */ new Date();
52
52
  return k ? n(t, k.timeZone) ?? void 0 : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
53
- }, [k]), V = d(() => B(m), [m, B]), H = d(() => B(_ ?? m), [
54
- _,
53
+ }, [k]), H = d(() => V(m), [m, V]), U = d(() => V(g ?? m), [
54
+ g,
55
55
  m,
56
- B
57
- ]), Ke = k ? i(/* @__PURE__ */ new Date(), k.timeZone) : null, U = Ke?.dateString, qe = Ke?.minutesFromMidnight, W = d(() => U ? !!(m && V && V === U) : !!m && c(m, /* @__PURE__ */ new Date()) === 0, [
56
+ V
57
+ ]), Ge = k ? i(/* @__PURE__ */ new Date(), k.timeZone) : null, W = Ge?.dateString, Ke = Ge?.minutesFromMidnight, G = d(() => W ? !!(m && H && H === W) : !!m && c(m, /* @__PURE__ */ new Date()) === 0, [
58
58
  m,
59
- V,
60
- U
61
- ]), G = d(() => U ? !!(_ && H && H === U) : !!_ && c(_, /* @__PURE__ */ new Date()) === 0, [
62
- _,
63
59
  H,
64
- U
65
- ]), Je = d(() => {
66
- if (U) return e(U);
60
+ W
61
+ ]), K = d(() => W ? !!(g && U && U === W) : !!g && c(g, /* @__PURE__ */ new Date()) === 0, [
62
+ g,
63
+ U,
64
+ W
65
+ ]), qe = d(() => {
66
+ if (W) return e(W);
67
67
  let t = /* @__PURE__ */ new Date();
68
68
  return t.setHours(0, 0, 0, 0), t;
69
- }, [U]), K = S?.timing.minBufferMinutes ?? 10, q = d(() => {
70
- if (!W && !G) return null;
71
- if (qe != null) return qe + K;
69
+ }, [W]), Je = S?.timing.minBufferMinutes ?? 10, q = d(() => {
70
+ if (!G && !K) return null;
71
+ if (Ke != null) return Ke + Je;
72
72
  let e = /* @__PURE__ */ new Date();
73
- return e.setMinutes(e.getMinutes() + K), e.getHours() * 60 + e.getMinutes();
73
+ return e.setMinutes(e.getMinutes() + Je), e.getHours() * 60 + e.getMinutes();
74
74
  }, [
75
- qe,
75
+ Ke,
76
+ K,
76
77
  G,
77
- W,
78
- K
79
- ]), Ye = d(() => W ? q : null, [q, W]), Xe = l((e) => {
78
+ Je
79
+ ]), J = d(() => G ? q : null, [q, G]), Ye = l((e) => {
80
80
  if (!k) return;
81
- let t = B(e);
81
+ let t = V(e);
82
82
  if (!t) return k.defaultEndTime;
83
83
  let n = r(t), i = k.getLastStartMinutesForWeekday(n, { dateString: t });
84
84
  return typeof i == "number" ? a(i) : k.defaultEndTime;
85
- }, [k, B]);
85
+ }, [k, V]);
86
86
  u(() => {
87
- if (!C || !V) return;
87
+ if (!C || !H) return;
88
88
  let e = !0;
89
- return C(V, "start").then((t) => {
90
- e && t && Re(t);
89
+ return C(H, "start").then((t) => {
90
+ e && t && Ie(t);
91
91
  }).catch((e) => {
92
92
  console.error("Failed to fetch availability time slots", e);
93
93
  }), () => {
94
94
  e = !1;
95
95
  };
96
- }, [C, V]), u(() => {
96
+ }, [C, H]), u(() => {
97
97
  if (!C) return;
98
- let e = He.current, t = e !== void 0 && e !== H;
99
- He.current = H, t && H && (z.current = H);
100
- }, [H, C]), u(() => {
98
+ let e = Ve.current, t = e !== void 0 && e !== U;
99
+ Ve.current = U, t && U && (B.current = U);
100
+ }, [U, C]), u(() => {
101
101
  if (!C) return;
102
- if (!H) {
103
- P([]), I(void 0);
102
+ if (!U) {
103
+ I([]), R(void 0);
104
104
  return;
105
105
  }
106
106
  let e = !0;
107
- return I(void 0), C(H, "end").then((t) => {
108
- e && (t ? (P(t), I(H)) : (P([]), I(void 0)));
107
+ return R(void 0), C(U, "end").then((t) => {
108
+ e && (t ? (I(t), R(U)) : (I([]), R(void 0)));
109
109
  }).catch((t) => {
110
- console.error("Failed to fetch availability time slots", t), e && (P([]), I(void 0));
110
+ console.error("Failed to fetch availability time slots", t), e && (I([]), R(void 0));
111
111
  }), () => {
112
112
  e = !1;
113
113
  };
114
- }, [H, C]);
115
- let J = d(() => C || !S ? null : s(S, { date: V }), [
114
+ }, [U, C]);
115
+ let Xe = d(() => C || !S ? null : s(S, { date: H }).startTimeSlots, [
116
116
  S,
117
117
  C,
118
- V
119
- ]), Ze = d(() => !C || !S ? null : s(S, { date: V }).startTimeSlots, [
118
+ H
119
+ ]), Ze = d(() => C || !S ? null : s(S, { date: U }).endTimeSlots, [
120
+ S,
121
+ U,
122
+ C
123
+ ]), Qe = d(() => !C || !S ? null : s(S, { date: H }).startTimeSlots, [
120
124
  S,
121
125
  C,
122
- V
123
- ]), Qe = d(() => !C || !S ? null : s(S, { date: H }).endTimeSlots, [
126
+ H
127
+ ]), $e = d(() => !C || !S ? null : s(S, { date: U }).endTimeSlots, [
124
128
  S,
125
- H,
129
+ U,
126
130
  C
127
- ]), Y = d(() => C ? N.length ? N : Ze ?? [] : S ? J?.startTimeSlots ?? [] : se(E, A), [
131
+ ]), Y = d(() => C ? Fe.length ? Fe : Qe ?? [] : S ? Xe ?? [] : ce(E, A), [
128
132
  S,
129
- J?.startTimeSlots,
130
- Ze,
133
+ Xe,
134
+ Qe,
131
135
  C,
132
- N,
136
+ Fe,
133
137
  A,
134
138
  E
135
- ]), X = d(() => C ? F === H ? ze : Qe ?? [] : S ? J?.endTimeSlots ?? [] : se(Se ?? E, A), [
139
+ ]), X = d(() => C ? L === U ? Le : $e ?? [] : S ? Ze ?? [] : ce(Se ?? E, A), [
136
140
  S,
137
- J?.endTimeSlots,
138
- H,
141
+ Ze,
142
+ U,
139
143
  Se,
140
- Qe,
144
+ $e,
141
145
  C,
142
- ze,
143
- F,
146
+ Le,
147
+ L,
144
148
  A,
145
149
  E
146
150
  ]), Z = l((e, t) => {
147
- e !== g && (Le(t === "user"), ne(e, { source: t }));
148
- }, [ne, g]), Q = l((e, t = "auto") => {
151
+ e !== h && (Pe(t === "user"), re(e, { source: t }));
152
+ }, [re, h]), Q = l((e, t = "auto") => {
149
153
  e !== y && (t !== "user" && e && X.find((t) => t.value === e)?.isExtra || de(e, { source: t }));
150
154
  }, [
151
155
  X,
152
156
  y,
153
157
  de
154
- ]), $ = d(() => Y.length ? Y.find((e) => !(e.isDisabled || Ye != null && e.startMinutes < Ye)) ?? null : null, [Ye, Y]);
158
+ ]), $ = d(() => Y.length ? Y.find((e) => !(e.isDisabled || J != null && e.startMinutes < J)) ?? null : null, [J, Y]);
155
159
  u(() => {
156
- T || Ie || $ && g !== $.value && Z($.value, "auto");
160
+ T || Ne || $ && h !== $.value && Z($.value, "auto");
157
161
  }, [
158
162
  T,
159
163
  $,
160
- Ie,
161
- g,
164
+ Ne,
165
+ h,
162
166
  Z
163
167
  ]), u(() => {
164
168
  if (T || !Y.length) return;
165
- let e = g ? Y.find((e) => e.value === g) : void 0, t = q ?? void 0, n = W ? t : null, r = (e) => {
169
+ let e = h ? Y.find((e) => e.value === h) : void 0, t = q ?? void 0, n = G ? t : null, r = (e) => {
166
170
  let t = typeof e == "number" ? e : null, n = Y.find((e) => !(e.isDisabled || t != null && e.startMinutes < t));
167
- n && n.value !== g ? Z(n.value, "auto") : !n && g && Z("", "auto");
171
+ n && n.value !== h ? Z(n.value, "auto") : !n && h && Z("", "auto");
168
172
  };
169
- if (g && !e) {
173
+ if (h && !e) {
170
174
  r(n);
171
175
  return;
172
176
  }
@@ -174,32 +178,32 @@ var re = (e) => e, ie = {
174
178
  r(n);
175
179
  return;
176
180
  }
177
- if (!W || t == null) return;
178
- let i = o(g);
181
+ if (!G || t == null) return;
182
+ let i = o(h);
179
183
  if (i != null && i >= t && !e?.isDisabled) return;
180
184
  let a = Y.find((e) => !e.isDisabled && e.startMinutes >= t);
181
- a && a.value !== g && Z(a.value, "auto");
185
+ a && a.value !== h && Z(a.value, "auto");
182
186
  }, [
183
187
  T,
184
188
  q,
185
- W,
186
- g,
189
+ G,
190
+ h,
187
191
  Y,
188
192
  Z
189
193
  ]), u(() => {
190
194
  if (T || !X.length) return;
191
- if (C && z.current === H && F === H) {
192
- z.current = void 0;
195
+ if (C && B.current === U && L === U) {
196
+ B.current = void 0;
193
197
  let e = le(X);
194
198
  if (e && e.value !== y) {
195
199
  Q(e.value);
196
200
  return;
197
201
  }
198
202
  }
199
- let e = o(g), t = o(y), n = y ? X.find((e) => e.value === y) : void 0, r = [];
200
- G && q != null && r.push(q), We && e != null && r.push(e + A);
203
+ let e = o(h), t = o(y), n = y ? X.find((e) => e.value === y) : void 0, r = [];
204
+ K && q != null && r.push(q), Ue && e != null && r.push(e + A);
201
205
  let i = r.length ? Math.max(...r) : null, a = (e) => {
202
- let t = typeof e == "number" ? e : null, n = X.find((e) => !(!ce(e) || t != null && e.startMinutes < t));
206
+ let t = typeof e == "number" ? e : null, n = X.find((e) => !(!_(e) || t != null && e.startMinutes < t));
203
207
  n && n.value !== y ? Q(n.value) : !n && y && Q("");
204
208
  };
205
209
  if (C && y && !n) {
@@ -217,88 +221,88 @@ var re = (e) => e, ie = {
217
221
  X,
218
222
  T,
219
223
  q,
220
- H,
224
+ U,
221
225
  y,
222
226
  C,
223
- F,
224
- G,
225
- We,
227
+ L,
228
+ K,
229
+ Ue,
226
230
  A,
227
- g,
231
+ h,
228
232
  Q
229
- ]), u(() => (Fe(!0), () => {
230
- L.current != null && clearTimeout(L.current);
233
+ ]), u(() => (Me(!0), () => {
234
+ z.current != null && clearTimeout(z.current);
231
235
  }), []), u(() => {
232
- De && Ee && j(!1);
233
- }, [Ee, De]), u(() => {
234
- Ae && ke && M(!1);
235
- }, [ke, Ae]);
236
- let $e = l((e) => {
237
- e && R.current && Date.now() < R.current || j(e);
238
- }, []), et = l((e) => {
239
- e && Be.current && Date.now() < Be.current || M(e);
236
+ N && j && M(!1);
237
+ }, [j, N]), u(() => {
238
+ F && De && P(!1);
239
+ }, [De, F]);
240
+ let et = l((e) => {
241
+ e && Re.current && Date.now() < Re.current || M(e);
240
242
  }, []), tt = l((e) => {
241
- e && Ve.current && Date.now() < Ve.current || je(e);
242
- }, []), nt = l((e, { openTimePicker: t, openEndDatePicker: n, close: r = !0 } = {}) => {
243
+ e && ze.current && Date.now() < ze.current || P(e);
244
+ }, []), nt = l((e) => {
245
+ e && Be.current && Date.now() < Be.current || Oe(e);
246
+ }, []), rt = l((e, { openTimePicker: t, openEndDatePicker: n, close: r = !0 } = {}) => {
243
247
  let i = t ?? w === "chained-times", a = n ?? w === "dates-first";
244
248
  if (!e) {
245
- r && j(!1);
249
+ r && M(!1);
246
250
  return;
247
251
  }
248
- h(e), (r || a) && (R.current = Date.now() + 250, j(!1)), _ && e > _ && v(e), i && Oe(!0), a && (L.current != null && clearTimeout(L.current), D ? (M(!0), L.current = null) : L.current = setTimeout(() => {
249
- M(!0);
252
+ ne(e), (r || a) && (Re.current = Date.now() + 250, M(!1)), g && e > g && v(e), i && Ee(!0), a && (z.current != null && clearTimeout(z.current), D ? (P(!0), z.current = null) : z.current = setTimeout(() => {
253
+ P(!0);
250
254
  }, 100));
251
255
  }, [
252
- _,
256
+ g,
253
257
  D,
254
258
  v,
255
- h,
259
+ ne,
256
260
  w
257
- ]), rt = l((e) => {
258
- Z(e, "user"), Oe(!1), L.current != null && clearTimeout(L.current), w === "chained-times" && e && m ? L.current = setTimeout(() => {
259
- M(!0);
260
- }, 100) : L.current = null;
261
+ ]), it = l((e) => {
262
+ Z(e, "user"), Ee(!1), z.current != null && clearTimeout(z.current), w === "chained-times" && e && m ? z.current = setTimeout(() => {
263
+ P(!0);
264
+ }, 100) : z.current = null;
261
265
  }, [
262
266
  w,
263
267
  m,
264
268
  Z
265
- ]), it = l((e) => {
266
- e && e !== g && Z(e, "user");
267
- }, [g, Z]), at = l((e, { openTimePicker: t, close: n = !0, commit: r = w === "dates-first" && D } = {}) => {
269
+ ]), at = l((e) => {
270
+ e && e !== h && Z(e, "user");
271
+ }, [h, Z]), ot = l((e, { openTimePicker: t, close: n = !0, commit: r = w === "dates-first" && D } = {}) => {
268
272
  let i = t ?? w === "chained-times", a = y;
269
273
  if (e && w === "dates-first") {
270
274
  if (C) {
271
- let t = B(e);
272
- t && (z.current = t);
275
+ let t = V(e);
276
+ t && (B.current = t);
273
277
  }
274
- let t = Xe(e);
278
+ let t = Ye(e);
275
279
  t && (a = t, Q(t));
276
280
  }
277
- v(e), Ne(void 0), n && (Be.current = Date.now() + 250, M(!1)), e && i && je(!0), e && r && b && (typeof window > "u" ? b(e, a) : requestAnimationFrame(() => b(e, a)));
281
+ v(e), Ae(void 0), n && (ze.current = Date.now() + 250, P(!1)), e && i && Oe(!0), e && r && b && (typeof window > "u" ? b(e, a) : requestAnimationFrame(() => b(e, a)));
278
282
  }, [
279
283
  y,
280
284
  C,
281
- Xe,
285
+ Ye,
282
286
  D,
283
287
  v,
284
288
  b,
285
289
  w,
286
- B,
290
+ V,
287
291
  Q
288
- ]), ot = l((e) => {
292
+ ]), st = l((e) => {
289
293
  Q(e, "user");
290
- }, [Q]), st = l((e) => {
291
- z.current = void 0, Q(e, "user"), Ve.current = Date.now() + 250, je(!1), x && (typeof window > "u" ? x() : requestAnimationFrame(() => {
294
+ }, [Q]), ct = l((e) => {
295
+ B.current = void 0, Q(e, "user"), Be.current = Date.now() + 250, Oe(!1), x && (typeof window > "u" ? x() : requestAnimationFrame(() => {
292
296
  requestAnimationFrame(x);
293
297
  }));
294
298
  }, [x, Q]);
295
299
  return {
296
300
  startDate: m,
297
- startTime: g,
298
- endDate: _,
301
+ startTime: h,
302
+ endDate: g,
299
303
  endTime: y,
300
304
  errors: fe,
301
- labels: pe ?? ie,
305
+ labels: pe ?? ae,
302
306
  t: me,
303
307
  language: he ?? O,
304
308
  labelClassName: ge,
@@ -310,35 +314,35 @@ var re = (e) => e, ie = {
310
314
  dateLocale: Te,
311
315
  numberOfMonths: D ? 1 : 2,
312
316
  isMobile: D,
313
- isHydrated: Pe,
317
+ isHydrated: je,
314
318
  openDatePickerOnFocus: xe,
315
319
  withMobileDateDrawer: ye,
316
320
  selectionFlow: w,
317
- isStartDatePopoverOpen: Ee,
318
- setIsStartDatePopoverOpen: $e,
319
- isStartTimeSelectOpen: De,
320
- setIsStartTimeSelectOpen: Oe,
321
- isEndDatePopoverOpen: ke,
322
- setIsEndDatePopoverOpen: et,
323
- isEndTimeSelectOpen: Ae,
324
- setIsEndTimeSelectOpen: tt,
325
- hoveredEndDate: Me,
326
- setHoveredEndDate: Ne,
327
- resetHoveredEndDate: Ue,
321
+ isStartDatePopoverOpen: j,
322
+ setIsStartDatePopoverOpen: et,
323
+ isStartTimeSelectOpen: N,
324
+ setIsStartTimeSelectOpen: Ee,
325
+ isEndDatePopoverOpen: De,
326
+ setIsEndDatePopoverOpen: tt,
327
+ isEndTimeSelectOpen: F,
328
+ setIsEndTimeSelectOpen: nt,
329
+ hoveredEndDate: ke,
330
+ setHoveredEndDate: Ae,
331
+ resetHoveredEndDate: He,
328
332
  startTimeSlots: Y,
329
333
  availableEndTimeSlots: X,
330
- isStartToday: W,
331
- isEndToday: G,
332
- minSelectableDate: Je,
334
+ isStartToday: G,
335
+ isEndToday: K,
336
+ minSelectableDate: qe,
333
337
  earliestMinutesForToday: q,
334
- startMinutesValue: Ge,
335
- isSameDaySelection: We,
336
- updateStartTime: it,
337
- selectStartDate: nt,
338
- selectStartTime: rt,
339
- selectEndDate: at,
340
- updateEndTime: ot,
341
- selectEndTime: st
338
+ startMinutesValue: We,
339
+ isSameDaySelection: Ue,
340
+ updateStartTime: at,
341
+ selectStartDate: rt,
342
+ selectStartTime: it,
343
+ selectEndDate: ot,
344
+ updateEndTime: st,
345
+ selectEndTime: ct
342
346
  };
343
347
  };
344
348
  //#endregion
package/dist/index.d.ts CHANGED
@@ -1367,6 +1367,10 @@ export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (b
1367
1367
  sameDayCutoff?: string;
1368
1368
  }) => BookingPeriodConfig;
1369
1369
 
1370
+ export declare const createBookingPeriodConfigFromShopConfiguration: (shop: StorefrontConfiguration["bookingEngine"]["shop"], options?: {
1371
+ sameDayCutoff?: string;
1372
+ }) => BookingPeriodConfig;
1373
+
1370
1374
  export declare const createBookingPeriodConfigFromStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration) => BookingPeriodConfig;
1371
1375
 
1372
1376
  export declare function createLocalizedStringEntry(value: string, updatedAt?: Date): {
@@ -1391,6 +1395,8 @@ export declare type DailyPriceRow = {
1391
1395
  perDayPriceLabel: string;
1392
1396
  };
1393
1397
 
1398
+ export declare const DEFAULT_BOOKING_DELIVERY_OPTION: "pickup";
1399
+
1394
1400
  export declare const DEFAULT_CANCELLATION_POLICY: CancellationPolicy;
1395
1401
 
1396
1402
  export declare const DEFAULT_PAYMENT_POLICIES: PaymentPolicies;
@@ -2537,6 +2543,8 @@ export declare const requestSchema: z.ZodObject<{
2537
2543
  message: z.ZodString;
2538
2544
  }, z.core.$strip>;
2539
2545
 
2546
+ export declare function resolveBookingDeliveryOption(value: unknown): BookingDeliveryOption;
2547
+
2540
2548
  export declare const resolveBookingSearchParams: (searchParams: URLSearchParams, options?: {
2541
2549
  storage?: BookingSearchStorage;
2542
2550
  storeSlug?: string;
package/dist/index.js CHANGED
@@ -7,74 +7,74 @@ import { richTextJsonDocSchema as E, richTextSchema as D, richTextVersionSchema
7
7
  import { isoDateSchema as k, shopConfigurationSchema as A, shopExtraTimeSlotRuleSchema as j, shopOpeningDayIndexSchema as M, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as P, shopOpeningHoursPeriodSchema as F, shopOpeningSlotSchema as I, timeOfDaySchema as L } from "./chunks/booking-engine/dist/schemas/shop-opening-hours-BlLD1gfz.js";
8
8
  import { DEFAULT_CANCELLATION_POLICY as R, DEFAULT_PAYMENT_POLICIES as z, cancellationPolicySchema as B, cancellationPolicyTierSchema as V, paymentPoliciesSchema as H } from "./chunks/booking-engine/dist/schemas/booking-engine-configuration-D02MRF9U.js";
9
9
  import { fulfillmentModeSchema as U, publicBookingEngineConfigurationSchema as W, publicCheckoutConfigurationSchema as G, publicCheckoutDynamicOptionsSchema as K } from "./chunks/booking-engine/dist/schemas/public-booking-engine-configuration-BnJ_H-p1.js";
10
- import { bookingCustomerInputSchema as q, bookingDeliveryOptionSchema as J, bookingScheduleInputSchema as Y, cartItemInputSchema as X, createBookingInputBaseSchema as Z, createBookingInputSchema as Q, validateBookingDeliveryAddress as $ } from "./chunks/booking-engine/dist/schemas/cart-inputs-9vM8GCrc.js";
11
- import { baseAssetSchema as ee, baseAssetStatusSchema as te } from "./chunks/booking-engine/dist/schemas/base-asset-B_Dm8_Vk.js";
12
- import { baseBookingItemSchema as ne, baseBookingSchema as re, baseBookingStateSchema as ie } from "./chunks/booking-engine/dist/schemas/base-booking-DW8AEPKo.js";
13
- import "./chunks/booking-engine/dist/schemas-34QQv0EH.js";
14
- import { storefrontCheckoutModeSchema as ae, storefrontConfigurationSchema as oe, storefrontContentSchema as se, storefrontFaqItemSchema as ce, storefrontFaqSchema as le, storefrontFulfillmentModeSchema as ue, storefrontLocalizedRichTextSchema as de, storefrontModalMessageSchema as fe, storefrontModulesSchema as pe, storefrontReviewsModuleSchema as me, storefrontRichTextSchema as he, storefrontSettingsSchema as ge, storefrontShopSchema as _e, storefrontStatusSchema as ve, storefrontWorkspaceSchema as ye } from "./storefrontSchemas.js";
15
- import { BOOKING_SEARCH_KEYS as be, TIME_OPTIONS as xe, applyBookingParamsToSearch as Se, createBookingPeriodConfigFromBookingEngineConfiguration as Ce, createBookingPeriodConfigFromStorefrontConfiguration as we, getBookingDurationLabel as Te, getBookingDurationMinutes as Ee, getBookingParamsFromSearch as De, getBookingSessionStorageKey as Oe, getDefaultBookingParams as ke, getDefaultBookingParamsForStorefrontConfiguration as Ae, pickBookingSearchParams as je, readBookingSearchParamsFromSessionStorage as Me, readBookingSearchParamsFromStorage as Ne, resolveBookingSearchParams as Pe, resolveBookingSearchParamsFromSessionStorage as Fe, writeBookingSearchParamsToSessionStorage as Ie, writeBookingSearchParamsToStorage as Le } from "./lib/booking.js";
16
- import { CATALOG_PRODUCT_BASE_RATE_UNSET as Re, buildStorefrontProductSlug as ze, buildVariantStorefrontProductId as Be, compareCatalogProducts as Ve, compareStorefrontAccessoryProducts as He, compareStorefrontBikeProducts as Ue, findStorefrontProduct as We, findStorefrontProductBySlug as Ge, getCatalogProductBaseRateMinor as Ke, getCatalogProductPaginationSort as qe, getCatalogProductSortFieldForPriceUnit as Je, getStorefrontBaseDailyRateMinor as Ye, getStorefrontCheckoutProductId as Xe, getStorefrontRepresentedVariantId as Ze, toStorefrontAccessoryProducts as Qe, toStorefrontBikeProducts as $e, toStorefrontBookingProducts as et, toStorefrontBookingProductsCollections as tt } from "./lib/products.js";
17
- import { StorefrontCartProvider as nt, resolveStorefrontCartItemProduct as rt, useStorefrontCart as it } from "./lib/cart.js";
18
- import { cn as at, formatPriceMinor as ot, getAvailabilityVariant as st, getMinDayPriceMinor as ct } from "./lib/utils.js";
19
- import { buildDailyPriceRows as lt, buildPriceTierLabels as ut, calculateDailyPriceForQuantity as dt, formatStorefrontPriceMinor as ft } from "./lib/pricing.js";
20
- import { getLocalizedEntry as pt, getLocalizedValue as mt } from "./localization.js";
21
- import { buildStorefrontCartSummary as ht } from "./lib/cartSummary.js";
22
- import { ROUTE as gt, requestSchema as _t, responseSchema as vt } from "./lib/contactForm.js";
23
- import { formatStorefrontPhoneDisplay as yt, resolveStorefrontMapsHref as bt, resolveStorefrontPhoneContact as xt } from "./lib/storefrontContact.js";
24
- import { buildWhatsAppHref as St, resolveStorefrontWhatsAppContact as Ct, resolveStorefrontWhatsAppHref as wt } from "./lib/whatsapp.js";
25
- import { ROUTE as Tt, requestBaseSchema as Et, requestCheckoutItemSchema as Dt, requestDeliveryRefinement as Ot, requestSchema as kt, responseSchema as At } from "./lib/checkoutSubmit.js";
26
- import { ROUTE as jt, requestSchema as Mt, responseSchema as Nt, storefrontPublicAccessoryProductSchema as Pt, storefrontPublicBikeAvailabilityStatusSchema as Ft, storefrontPublicBikeProductSchema as It, storefrontPublicProductDisplayModeSchema as Lt, storefrontPublicProductPriceSchema as Rt, storefrontPublicProductVariantAttributeSchema as zt, storefrontPublicProductVariantIdentifierSchema as Bt, storefrontPublicProductVariantSchema as Vt } from "./lib/storefrontProducts.js";
27
- import { ROUTE as Ht, buildStorefrontAvailabilityKey as Ut, doesStorefrontAvailabilityDisplaySoldOut as Wt, getStorefrontAvailabilityIssue as Gt, getStorefrontAvailabilityStatus as Kt, isStorefrontAvailabilityInsufficient as qt, publicAvailabilityDisplayModeSchema as Jt, requestSchema as Yt, responseSchema as Xt, shouldBlockStorefrontUnavailableItem as Zt, storefrontAvailabilityProductSchema as Qt, storefrontAvailabilityScheduleSchema as $t, storefrontPublicAvailabilityRecordSchema as en } from "./lib/storefrontAvailability.js";
28
- import { ROUTE as tn, buildStorefrontImageUrl as nn, requestSchema as rn } from "./lib/storefrontImage.js";
29
- import { ROUTE as an, requestSchema as on, responseSchema as sn, storefrontTimeSlotSchema as cn, timeSlotJourneySchema as ln } from "./lib/storefrontTimeSlots.js";
30
- import { Footer as un } from "./components/Footer/index.js";
31
- import { Badge as dn, badgeVariants as fn } from "./ui/badge.js";
32
- import { Button as pn, buttonVariants as mn } from "./ui/button.js";
33
- import { Header as hn } from "./components/Header/index.js";
34
- import { storefront as gn } from "./i18n/en.js";
35
- import { storefront as _n } from "./i18n/fr.js";
36
- import { PoweredByLoczerBadge as vn } from "./components/PoweredByLoczerBadge/index.js";
37
- import { PlatformFooter as yn } from "./components/PlatformFooter/index.js";
38
- import { useWhatsAppFloatingButton as bn } from "./components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js";
39
- import { WhatsAppFloatingButton as xn } from "./components/WhatsAppFloatingButton/WhatsAppFloatingButton.js";
10
+ import { DEFAULT_BOOKING_DELIVERY_OPTION as q, bookingCustomerInputSchema as J, bookingDeliveryOptionSchema as Y, bookingScheduleInputSchema as X, cartItemInputSchema as Z, createBookingInputBaseSchema as Q, createBookingInputSchema as $, resolveBookingDeliveryOption as ee, validateBookingDeliveryAddress as te } from "./chunks/booking-engine/dist/schemas/cart-inputs-j1yWfJxO.js";
11
+ import { baseAssetSchema as ne, baseAssetStatusSchema as re } from "./chunks/booking-engine/dist/schemas/base-asset-B_Dm8_Vk.js";
12
+ import { baseBookingItemSchema as ie, baseBookingSchema as ae, baseBookingStateSchema as oe } from "./chunks/booking-engine/dist/schemas/base-booking-DW8AEPKo.js";
13
+ import "./chunks/booking-engine/dist/schemas-DftrSnTE.js";
14
+ import { storefrontCheckoutModeSchema as se, storefrontConfigurationSchema as ce, storefrontContentSchema as le, storefrontFaqItemSchema as ue, storefrontFaqSchema as de, storefrontFulfillmentModeSchema as fe, storefrontLocalizedRichTextSchema as pe, storefrontModalMessageSchema as me, storefrontModulesSchema as he, storefrontReviewsModuleSchema as ge, storefrontRichTextSchema as _e, storefrontSettingsSchema as ve, storefrontShopSchema as ye, storefrontStatusSchema as be, storefrontWorkspaceSchema as xe } from "./storefrontSchemas.js";
15
+ import { BOOKING_SEARCH_KEYS as Se, TIME_OPTIONS as Ce, applyBookingParamsToSearch as we, createBookingPeriodConfigFromBookingEngineConfiguration as Te, createBookingPeriodConfigFromShopConfiguration as Ee, createBookingPeriodConfigFromStorefrontConfiguration as De, getBookingDurationLabel as Oe, getBookingDurationMinutes as ke, getBookingParamsFromSearch as Ae, getBookingSessionStorageKey as je, getDefaultBookingParams as Me, getDefaultBookingParamsForStorefrontConfiguration as Ne, pickBookingSearchParams as Pe, readBookingSearchParamsFromSessionStorage as Fe, readBookingSearchParamsFromStorage as Ie, resolveBookingSearchParams as Le, resolveBookingSearchParamsFromSessionStorage as Re, writeBookingSearchParamsToSessionStorage as ze, writeBookingSearchParamsToStorage as Be } from "./lib/booking.js";
16
+ import { CATALOG_PRODUCT_BASE_RATE_UNSET as Ve, buildStorefrontProductSlug as He, buildVariantStorefrontProductId as Ue, compareCatalogProducts as We, compareStorefrontAccessoryProducts as Ge, compareStorefrontBikeProducts as Ke, findStorefrontProduct as qe, findStorefrontProductBySlug as Je, getCatalogProductBaseRateMinor as Ye, getCatalogProductPaginationSort as Xe, getCatalogProductSortFieldForPriceUnit as Ze, getStorefrontBaseDailyRateMinor as Qe, getStorefrontCheckoutProductId as $e, getStorefrontRepresentedVariantId as et, toStorefrontAccessoryProducts as tt, toStorefrontBikeProducts as nt, toStorefrontBookingProducts as rt, toStorefrontBookingProductsCollections as it } from "./lib/products.js";
17
+ import { StorefrontCartProvider as at, resolveStorefrontCartItemProduct as ot, useStorefrontCart as st } from "./lib/cart.js";
18
+ import { cn as ct, formatPriceMinor as lt, getAvailabilityVariant as ut, getMinDayPriceMinor as dt } from "./lib/utils.js";
19
+ import { buildDailyPriceRows as ft, buildPriceTierLabels as pt, calculateDailyPriceForQuantity as mt, formatStorefrontPriceMinor as ht } from "./lib/pricing.js";
20
+ import { getLocalizedEntry as gt, getLocalizedValue as _t } from "./localization.js";
21
+ import { buildStorefrontCartSummary as vt } from "./lib/cartSummary.js";
22
+ import { ROUTE as yt, requestSchema as bt, responseSchema as xt } from "./lib/contactForm.js";
23
+ import { formatStorefrontPhoneDisplay as St, resolveStorefrontMapsHref as Ct, resolveStorefrontPhoneContact as wt } from "./lib/storefrontContact.js";
24
+ import { buildWhatsAppHref as Tt, resolveStorefrontWhatsAppContact as Et, resolveStorefrontWhatsAppHref as Dt } from "./lib/whatsapp.js";
25
+ import { ROUTE as Ot, requestBaseSchema as kt, requestCheckoutItemSchema as At, requestDeliveryRefinement as jt, requestSchema as Mt, responseSchema as Nt } from "./lib/checkoutSubmit.js";
26
+ import { ROUTE as Pt, requestSchema as Ft, responseSchema as It, storefrontPublicAccessoryProductSchema as Lt, storefrontPublicBikeAvailabilityStatusSchema as Rt, storefrontPublicBikeProductSchema as zt, storefrontPublicProductDisplayModeSchema as Bt, storefrontPublicProductPriceSchema as Vt, storefrontPublicProductVariantAttributeSchema as Ht, storefrontPublicProductVariantIdentifierSchema as Ut, storefrontPublicProductVariantSchema as Wt } from "./lib/storefrontProducts.js";
27
+ import { ROUTE as Gt, buildStorefrontAvailabilityKey as Kt, doesStorefrontAvailabilityDisplaySoldOut as qt, getStorefrontAvailabilityIssue as Jt, getStorefrontAvailabilityStatus as Yt, isStorefrontAvailabilityInsufficient as Xt, publicAvailabilityDisplayModeSchema as Zt, requestSchema as Qt, responseSchema as $t, shouldBlockStorefrontUnavailableItem as en, storefrontAvailabilityProductSchema as tn, storefrontAvailabilityScheduleSchema as nn, storefrontPublicAvailabilityRecordSchema as rn } from "./lib/storefrontAvailability.js";
28
+ import { ROUTE as an, buildStorefrontImageUrl as on, requestSchema as sn } from "./lib/storefrontImage.js";
29
+ import { ROUTE as cn, requestSchema as ln, responseSchema as un, storefrontTimeSlotSchema as dn, timeSlotJourneySchema as fn } from "./lib/storefrontTimeSlots.js";
30
+ import { Footer as pn } from "./components/Footer/index.js";
31
+ import { Badge as mn, badgeVariants as hn } from "./ui/badge.js";
32
+ import { Button as gn, buttonVariants as _n } from "./ui/button.js";
33
+ import { Header as vn } from "./components/Header/index.js";
34
+ import { storefront as yn } from "./i18n/en.js";
35
+ import { storefront as bn } from "./i18n/fr.js";
36
+ import { PoweredByLoczerBadge as xn } from "./components/PoweredByLoczerBadge/index.js";
37
+ import { PlatformFooter as Sn } from "./components/PlatformFooter/index.js";
38
+ import { useWhatsAppFloatingButton as Cn } from "./components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js";
39
+ import { WhatsAppFloatingButton as wn } from "./components/WhatsAppFloatingButton/WhatsAppFloatingButton.js";
40
40
  import "./components/WhatsAppFloatingButton/index.js";
41
- import { Layout as Sn } from "./components/Layout/index.js";
42
- import { DelayedPlaceholder as Cn, DelayedReveal as wn } from "./components/DelayedReveal/index.js";
43
- import { BookingPeriodProvider as Tn, useBookingPeriod as En } from "./components/BookingPeriodSelector/BookingPeriodContext.js";
44
- import { Label as Dn } from "./ui/label.js";
45
- import { BookingStartDateField as On } from "./components/BookingPeriodSelector/components/BookingStartDateField.js";
46
- import { BookingStartTimeField as kn } from "./components/BookingPeriodSelector/components/BookingStartTimeField.js";
47
- import { BookingEndDateField as An } from "./components/BookingPeriodSelector/components/BookingEndDateField.js";
48
- import { BookingEndTimeField as jn } from "./components/BookingPeriodSelector/components/BookingEndTimeField.js";
49
- import { BookingMobileDateDrawer as Mn } from "./components/BookingPeriodSelector/components/BookingMobileDateDrawer.js";
50
- import { BookingPeriodSelector as Nn } from "./components/BookingPeriodSelector/index.js";
51
- import { BookingFlowSteps as Pn } from "./components/BookingFlowSteps/index.js";
52
- import { Input as Fn } from "./ui/input.js";
53
- import { DeliveryAddressSelector as In } from "./components/DeliveryAddressSelector/index.js";
54
- import { loader as Ln, useOptionalStorefront as Rn, useStorefront as zn, useStorefrontBookingProducts as Bn, useStorefrontConfig as Vn, useStorefrontProducts as Hn, useStorefrontWorkspaceLanguage as Un } from "./StorefrontProvider.js";
55
- import { Form as Wn, FormControl as Gn, FormDescription as Kn, FormField as qn, FormItem as Jn, FormLabel as Yn, FormMessage as Xn, useFormField as Zn } from "./ui/form.js";
56
- import { Textarea as Qn } from "./ui/textarea.js";
57
- import { ContactSection as $n } from "./components/ContactSection/index.js";
58
- import { TestimonialsSection as er } from "./components/TestimonialsSection/index.js";
59
- import { AboutSection as tr } from "./components/AboutSection/index.js";
60
- import { StepSectionTitle as nr } from "./components/StepSectionTitle/index.js";
61
- import { Card as rr, CardAction as ir, CardContent as ar, CardDescription as or, CardFooter as sr, CardHeader as cr, CardTitle as lr } from "./ui/card.js";
62
- import { ProductWarningNotice as ur } from "./components/ProductWarningNotice/index.js";
63
- import { StorefrontCartPanel as dr } from "./components/StorefrontCartPanel/index.js";
64
- import { ProductPriceBadge as fr } from "./components/ProductPriceBadge/index.js";
65
- import { ContractSaleDocument as pr } from "./components/ContractSaleDocument/Invoice.js";
41
+ import { Layout as Tn } from "./components/Layout/index.js";
42
+ import { DelayedPlaceholder as En, DelayedReveal as Dn } from "./components/DelayedReveal/index.js";
43
+ import { BookingPeriodProvider as On, useBookingPeriod as kn } from "./components/BookingPeriodSelector/BookingPeriodContext.js";
44
+ import { Label as An } from "./ui/label.js";
45
+ import { BookingStartDateField as jn } from "./components/BookingPeriodSelector/components/BookingStartDateField.js";
46
+ import { BookingStartTimeField as Mn } from "./components/BookingPeriodSelector/components/BookingStartTimeField.js";
47
+ import { BookingEndDateField as Nn } from "./components/BookingPeriodSelector/components/BookingEndDateField.js";
48
+ import { BookingEndTimeField as Pn } from "./components/BookingPeriodSelector/components/BookingEndTimeField.js";
49
+ import { BookingMobileDateDrawer as Fn } from "./components/BookingPeriodSelector/components/BookingMobileDateDrawer.js";
50
+ import { BookingPeriodSelector as In } from "./components/BookingPeriodSelector/index.js";
51
+ import { BookingFlowSteps as Ln } from "./components/BookingFlowSteps/index.js";
52
+ import { Input as Rn } from "./ui/input.js";
53
+ import { DeliveryAddressSelector as zn } from "./components/DeliveryAddressSelector/index.js";
54
+ import { loader as Bn, useOptionalStorefront as Vn, useStorefront as Hn, useStorefrontBookingProducts as Un, useStorefrontConfig as Wn, useStorefrontProducts as Gn, useStorefrontWorkspaceLanguage as Kn } from "./StorefrontProvider.js";
55
+ import { Form as qn, FormControl as Jn, FormDescription as Yn, FormField as Xn, FormItem as Zn, FormLabel as Qn, FormMessage as $n, useFormField as er } from "./ui/form.js";
56
+ import { Textarea as tr } from "./ui/textarea.js";
57
+ import { ContactSection as nr } from "./components/ContactSection/index.js";
58
+ import { TestimonialsSection as rr } from "./components/TestimonialsSection/index.js";
59
+ import { AboutSection as ir } from "./components/AboutSection/index.js";
60
+ import { StepSectionTitle as ar } from "./components/StepSectionTitle/index.js";
61
+ import { Card as or, CardAction as sr, CardContent as cr, CardDescription as lr, CardFooter as ur, CardHeader as dr, CardTitle as fr } from "./ui/card.js";
62
+ import { ProductWarningNotice as pr } from "./components/ProductWarningNotice/index.js";
63
+ import { StorefrontCartPanel as mr } from "./components/StorefrontCartPanel/index.js";
64
+ import { ProductPriceBadge as hr } from "./components/ProductPriceBadge/index.js";
65
+ import { ContractSaleDocument as gr } from "./components/ContractSaleDocument/Invoice.js";
66
66
  import "./components/ContractSaleDocument/index.js";
67
- import { RadioGroup as mr, RadioGroupItem as hr } from "./ui/radio-group.js";
67
+ import { RadioGroup as _r, RadioGroupItem as vr } from "./ui/radio-group.js";
68
68
  import "./pages/HomePage.js";
69
69
  import "./pages/BookingPage.js";
70
70
  import "./pages/ProductPage.js";
71
71
  import "./pages/CheckoutPage.js";
72
72
  import "./pages/CheckoutSuccessPage.js";
73
73
  import "./pages/NotFoundPage.js";
74
- import { accessories as gr } from "./data/accessories.js";
75
- import _r from "./data/bikes.js";
76
- import { contractSaleDocumentAcceptanceLevelSchema as vr, contractSaleDocumentAcceptanceRecordSchema as yr, contractSaleDocumentAcceptanceSchema as br, contractSaleDocumentAddressSchema as xr, contractSaleDocumentContactSchema as Sr, contractSaleDocumentKindSchema as Cr, contractSaleDocumentLanguageCodeSchema as wr, contractSaleDocumentLanguageSchema as Tr, contractSaleDocumentLineItemSchema as Er, contractSaleDocumentSchema as Dr, contractSaleDocumentSignatureSchema as Or } from "./lib/contractSaleDocument.js";
77
- import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as kr, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as Ar, GET_CONTRACT_SALE_DOCUMENT_ROUTE as jr, acceptContractSaleDocumentRequestSchema as Mr, acceptContractSaleDocumentResponseSchema as Nr, contractSaleDocumentAcceptanceInputSchema as Pr, contractSaleDocumentAcceptanceRecordInputSchema as Fr, contractSaleDocumentApiAcceptanceRecordSchema as Ir, contractSaleDocumentApiAcceptanceSchema as Lr, contractSaleDocumentApiSchema as Rr, contractSaleDocumentApiSignatureSchema as zr, contractSaleDocumentReferenceSchema as Br, contractSaleDocumentReferenceTypeSchema as Vr, contractSaleDocumentSignatureInputSchema as Hr, downloadContractSaleDocumentPdfRequestSchema as Ur, getContractSaleDocumentRequestSchema as Wr, getContractSaleDocumentResponseSchema as Gr } from "./lib/contractSaleDocumentApi.js";
78
- import Kr from "./routes.js";
79
- import { Select as qr, SelectContent as Jr, SelectGroup as Yr, SelectIcon as Xr, SelectItem as Zr, SelectItemIndicator as Qr, SelectItemText as $r, SelectLabel as ei, SelectScrollDownButton as ti, SelectScrollUpButton as ni, SelectSeparator as ri, SelectTrigger as ii, SelectValue as ai } from "./ui/select.js";
80
- export { kr as ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE, tr as AboutSection, be as BOOKING_SEARCH_KEYS, dn as Badge, An as BookingEndDateField, jn as BookingEndTimeField, Pn as BookingFlowSteps, Mn as BookingMobileDateDrawer, Tn as BookingPeriodProvider, Nn as BookingPeriodSelector, On as BookingStartDateField, kn as BookingStartTimeField, pn as Button, Re as CATALOG_PRODUCT_BASE_RATE_UNSET, rr as Card, ir as CardAction, ar as CardContent, or as CardDescription, sr as CardFooter, cr as CardHeader, lr as CardTitle, $n as ContactSection, pr as ContractSaleDocument, R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, Ar as DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE, Cn as DelayedPlaceholder, wn as DelayedReveal, In as DeliveryAddressSelector, un as Footer, Wn as Form, Gn as FormControl, Kn as FormDescription, qn as FormField, Jn as FormItem, Yn as FormLabel, Xn as FormMessage, jr as GET_CONTRACT_SALE_DOCUMENT_ROUTE, hn as Header, Fn as Input, Dn as Label, Sn as Layout, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, yn as PlatformFooter, vn as PoweredByLoczerBadge, fr as ProductPriceBadge, ur as ProductWarningNotice, gt as ROUTE, mr as RadioGroup, hr as RadioGroupItem, Ht as STOREFRONT_AVAILABILITY_ROUTE, Tt as STOREFRONT_CHECKOUT_SUBMIT_ROUTE, tn as STOREFRONT_IMAGE_ROUTE, jt as STOREFRONT_PRODUCTS_ROUTE, an as STOREFRONT_TIME_SLOTS_ROUTE, qr as Select, Jr as SelectContent, Yr as SelectGroup, Xr as SelectIcon, Zr as SelectItem, Qr as SelectItemIndicator, $r as SelectItemText, ei as SelectLabel, ti as SelectScrollDownButton, ni as SelectScrollUpButton, ri as SelectSeparator, ii as SelectTrigger, ai as SelectValue, nr as StepSectionTitle, dr as StorefrontCartPanel, nt as StorefrontCartProvider, xe as TIME_OPTIONS, er as TestimonialsSection, Qn as Textarea, xn as WhatsAppFloatingButton, Mr as acceptContractSaleDocumentRequestSchema, Nr as acceptContractSaleDocumentResponseSchema, gr as accessories, h as accessoryProductSchema, Se as applyBookingParamsToSearch, fn as badgeVariants, ee as baseAssetSchema, te as baseAssetStatusSchema, ne as baseBookingItemSchema, re as baseBookingSchema, ie as baseBookingStateSchema, g as bikeProductSchema, _r as bikes, q as bookingCustomerInputSchema, J as bookingDeliveryOptionSchema, Y as bookingScheduleInputSchema, lt as buildDailyPriceRows, ut as buildPriceTierLabels, Ut as buildStorefrontAvailabilityKey, ht as buildStorefrontCartSummary, nn as buildStorefrontImageUrl, ze as buildStorefrontProductSlug, Be as buildVariantStorefrontProductId, St as buildWhatsAppHref, mn as buttonVariants, dt as calculateDailyPriceForQuantity, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, X as cartItemInputSchema, at as cn, Ve as compareCatalogProducts, He as compareStorefrontAccessoryProducts, Ue as compareStorefrontBikeProducts, Pr as contractSaleDocumentAcceptanceInputSchema, vr as contractSaleDocumentAcceptanceLevelSchema, Fr as contractSaleDocumentAcceptanceRecordInputSchema, yr as contractSaleDocumentAcceptanceRecordSchema, br as contractSaleDocumentAcceptanceSchema, xr as contractSaleDocumentAddressSchema, Ir as contractSaleDocumentApiAcceptanceRecordSchema, Lr as contractSaleDocumentApiAcceptanceSchema, Rr as contractSaleDocumentApiSchema, zr as contractSaleDocumentApiSignatureSchema, Sr as contractSaleDocumentContactSchema, Cr as contractSaleDocumentKindSchema, wr as contractSaleDocumentLanguageCodeSchema, Tr as contractSaleDocumentLanguageSchema, Er as contractSaleDocumentLineItemSchema, Br as contractSaleDocumentReferenceSchema, Vr as contractSaleDocumentReferenceTypeSchema, Dr as contractSaleDocumentSchema, Hr as contractSaleDocumentSignatureInputSchema, Or as contractSaleDocumentSignatureSchema, Z as createBookingInputBaseSchema, Q as createBookingInputSchema, Ce as createBookingPeriodConfigFromBookingEngineConfiguration, we as createBookingPeriodConfigFromStorefrontConfiguration, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, Wt as doesStorefrontAvailabilityDisplaySoldOut, Ur as downloadContractSaleDocumentPdfRequestSchema, _ as eBikeProductSchema, We as findStorefrontProduct, Ge as findStorefrontProductBySlug, ot as formatPriceMinor, yt as formatStorefrontPhoneDisplay, ft as formatStorefrontPriceMinor, U as fulfillmentModeSchema, st as getAvailabilityVariant, Te as getBookingDurationLabel, Ee as getBookingDurationMinutes, De as getBookingParamsFromSearch, Oe as getBookingSessionStorageKey, Ke as getCatalogProductBaseRateMinor, qe as getCatalogProductPaginationSort, Je as getCatalogProductSortFieldForPriceUnit, Wr as getContractSaleDocumentRequestSchema, Gr as getContractSaleDocumentResponseSchema, ke as getDefaultBookingParams, Ae as getDefaultBookingParamsForStorefrontConfiguration, pt as getLocalizedEntry, t as getLocalizedStringValue, mt as getLocalizedValue, ct as getMinDayPriceMinor, Gt as getStorefrontAvailabilityIssue, Kt as getStorefrontAvailabilityStatus, Ye as getStorefrontBaseDailyRateMinor, Xe as getStorefrontCheckoutProductId, Ze as getStorefrontRepresentedVariantId, v as isProductVariantCodeIdentifierKind, qt as isStorefrontAvailabilityInsufficient, k as isoDateSchema, Ln as loader, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, je as pickBookingSearchParams, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, Jt as publicAvailabilityDisplayModeSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, Me as readBookingSearchParamsFromSessionStorage, Ne as readBookingSearchParamsFromStorage, _t as requestSchema, Pe as resolveBookingSearchParams, Fe as resolveBookingSearchParamsFromSessionStorage, rt as resolveStorefrontCartItemProduct, bt as resolveStorefrontMapsHref, xt as resolveStorefrontPhoneContact, Ct as resolveStorefrontWhatsAppContact, wt as resolveStorefrontWhatsAppHref, vt as responseSchema, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, Zt as shouldBlockStorefrontUnavailableItem, u as signedMoneyMinorSchema, Qt as storefrontAvailabilityProductSchema, Yt as storefrontAvailabilityRequestSchema, Xt as storefrontAvailabilityResponseSchema, $t as storefrontAvailabilityScheduleSchema, ae as storefrontCheckoutModeSchema, Ot as storefrontCheckoutSubmitDeliveryRefinement, Dt as storefrontCheckoutSubmitItemSchema, Et as storefrontCheckoutSubmitRequestBaseSchema, kt as storefrontCheckoutSubmitRequestSchema, At as storefrontCheckoutSubmitResponseSchema, oe as storefrontConfigurationSchema, se as storefrontContentSchema, gn as storefrontEn, ce as storefrontFaqItemSchema, le as storefrontFaqSchema, _n as storefrontFr, ue as storefrontFulfillmentModeSchema, rn as storefrontImageRequestSchema, de as storefrontLocalizedRichTextSchema, fe as storefrontModalMessageSchema, pe as storefrontModulesSchema, Mt as storefrontProductsRequestSchema, Nt as storefrontProductsResponseSchema, Pt as storefrontPublicAccessoryProductSchema, en as storefrontPublicAvailabilityRecordSchema, Ft as storefrontPublicBikeAvailabilityStatusSchema, It as storefrontPublicBikeProductSchema, Lt as storefrontPublicProductDisplayModeSchema, Rt as storefrontPublicProductPriceSchema, zt as storefrontPublicProductVariantAttributeSchema, Bt as storefrontPublicProductVariantIdentifierSchema, Vt as storefrontPublicProductVariantSchema, me as storefrontReviewsModuleSchema, he as storefrontRichTextSchema, Kr as storefrontRoutes, ge as storefrontSettingsSchema, _e as storefrontShopSchema, ve as storefrontStatusSchema, ln as storefrontTimeSlotJourneySchema, cn as storefrontTimeSlotSchema, on as storefrontTimeSlotsRequestSchema, sn as storefrontTimeSlotsResponseSchema, ye as storefrontWorkspaceSchema, L as timeOfDaySchema, Qe as toStorefrontAccessoryProducts, $e as toStorefrontBikeProducts, et as toStorefrontBookingProducts, tt as toStorefrontBookingProductsCollections, En as useBookingPeriod, Zn as useFormField, Rn as useOptionalStorefront, zn as useStorefront, Bn as useStorefrontBookingProducts, it as useStorefrontCart, Vn as useStorefrontConfig, Hn as useStorefrontProducts, Un as useStorefrontWorkspaceLanguage, bn as useWhatsAppFloatingButton, $ as validateBookingDeliveryAddress, Ie as writeBookingSearchParamsToSessionStorage, Le as writeBookingSearchParamsToStorage };
74
+ import { accessories as yr } from "./data/accessories.js";
75
+ import br from "./data/bikes.js";
76
+ import { contractSaleDocumentAcceptanceLevelSchema as xr, contractSaleDocumentAcceptanceRecordSchema as Sr, contractSaleDocumentAcceptanceSchema as Cr, contractSaleDocumentAddressSchema as wr, contractSaleDocumentContactSchema as Tr, contractSaleDocumentKindSchema as Er, contractSaleDocumentLanguageCodeSchema as Dr, contractSaleDocumentLanguageSchema as Or, contractSaleDocumentLineItemSchema as kr, contractSaleDocumentSchema as Ar, contractSaleDocumentSignatureSchema as jr } from "./lib/contractSaleDocument.js";
77
+ import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as Mr, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as Nr, GET_CONTRACT_SALE_DOCUMENT_ROUTE as Pr, acceptContractSaleDocumentRequestSchema as Fr, acceptContractSaleDocumentResponseSchema as Ir, contractSaleDocumentAcceptanceInputSchema as Lr, contractSaleDocumentAcceptanceRecordInputSchema as Rr, contractSaleDocumentApiAcceptanceRecordSchema as zr, contractSaleDocumentApiAcceptanceSchema as Br, contractSaleDocumentApiSchema as Vr, contractSaleDocumentApiSignatureSchema as Hr, contractSaleDocumentReferenceSchema as Ur, contractSaleDocumentReferenceTypeSchema as Wr, contractSaleDocumentSignatureInputSchema as Gr, downloadContractSaleDocumentPdfRequestSchema as Kr, getContractSaleDocumentRequestSchema as qr, getContractSaleDocumentResponseSchema as Jr } from "./lib/contractSaleDocumentApi.js";
78
+ import Yr from "./routes.js";
79
+ import { Select as Xr, SelectContent as Zr, SelectGroup as Qr, SelectIcon as $r, SelectItem as ei, SelectItemIndicator as ti, SelectItemText as ni, SelectLabel as ri, SelectScrollDownButton as ii, SelectScrollUpButton as ai, SelectSeparator as oi, SelectTrigger as si, SelectValue as ci } from "./ui/select.js";
80
+ export { Mr as ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE, ir as AboutSection, Se as BOOKING_SEARCH_KEYS, mn as Badge, Nn as BookingEndDateField, Pn as BookingEndTimeField, Ln as BookingFlowSteps, Fn as BookingMobileDateDrawer, On as BookingPeriodProvider, In as BookingPeriodSelector, jn as BookingStartDateField, Mn as BookingStartTimeField, gn as Button, Ve as CATALOG_PRODUCT_BASE_RATE_UNSET, or as Card, sr as CardAction, cr as CardContent, lr as CardDescription, ur as CardFooter, dr as CardHeader, fr as CardTitle, nr as ContactSection, gr as ContractSaleDocument, q as DEFAULT_BOOKING_DELIVERY_OPTION, R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, Nr as DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE, En as DelayedPlaceholder, Dn as DelayedReveal, zn as DeliveryAddressSelector, pn as Footer, qn as Form, Jn as FormControl, Yn as FormDescription, Xn as FormField, Zn as FormItem, Qn as FormLabel, $n as FormMessage, Pr as GET_CONTRACT_SALE_DOCUMENT_ROUTE, vn as Header, Rn as Input, An as Label, Tn as Layout, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, Sn as PlatformFooter, xn as PoweredByLoczerBadge, hr as ProductPriceBadge, pr as ProductWarningNotice, yt as ROUTE, _r as RadioGroup, vr as RadioGroupItem, Gt as STOREFRONT_AVAILABILITY_ROUTE, Ot as STOREFRONT_CHECKOUT_SUBMIT_ROUTE, an as STOREFRONT_IMAGE_ROUTE, Pt as STOREFRONT_PRODUCTS_ROUTE, cn as STOREFRONT_TIME_SLOTS_ROUTE, Xr as Select, Zr as SelectContent, Qr as SelectGroup, $r as SelectIcon, ei as SelectItem, ti as SelectItemIndicator, ni as SelectItemText, ri as SelectLabel, ii as SelectScrollDownButton, ai as SelectScrollUpButton, oi as SelectSeparator, si as SelectTrigger, ci as SelectValue, ar as StepSectionTitle, mr as StorefrontCartPanel, at as StorefrontCartProvider, Ce as TIME_OPTIONS, rr as TestimonialsSection, tr as Textarea, wn as WhatsAppFloatingButton, Fr as acceptContractSaleDocumentRequestSchema, Ir as acceptContractSaleDocumentResponseSchema, yr as accessories, h as accessoryProductSchema, we as applyBookingParamsToSearch, hn as badgeVariants, ne as baseAssetSchema, re as baseAssetStatusSchema, ie as baseBookingItemSchema, ae as baseBookingSchema, oe as baseBookingStateSchema, g as bikeProductSchema, br as bikes, J as bookingCustomerInputSchema, Y as bookingDeliveryOptionSchema, X as bookingScheduleInputSchema, ft as buildDailyPriceRows, pt as buildPriceTierLabels, Kt as buildStorefrontAvailabilityKey, vt as buildStorefrontCartSummary, on as buildStorefrontImageUrl, He as buildStorefrontProductSlug, Ue as buildVariantStorefrontProductId, Tt as buildWhatsAppHref, _n as buttonVariants, mt as calculateDailyPriceForQuantity, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, Z as cartItemInputSchema, ct as cn, We as compareCatalogProducts, Ge as compareStorefrontAccessoryProducts, Ke as compareStorefrontBikeProducts, Lr as contractSaleDocumentAcceptanceInputSchema, xr as contractSaleDocumentAcceptanceLevelSchema, Rr as contractSaleDocumentAcceptanceRecordInputSchema, Sr as contractSaleDocumentAcceptanceRecordSchema, Cr as contractSaleDocumentAcceptanceSchema, wr as contractSaleDocumentAddressSchema, zr as contractSaleDocumentApiAcceptanceRecordSchema, Br as contractSaleDocumentApiAcceptanceSchema, Vr as contractSaleDocumentApiSchema, Hr as contractSaleDocumentApiSignatureSchema, Tr as contractSaleDocumentContactSchema, Er as contractSaleDocumentKindSchema, Dr as contractSaleDocumentLanguageCodeSchema, Or as contractSaleDocumentLanguageSchema, kr as contractSaleDocumentLineItemSchema, Ur as contractSaleDocumentReferenceSchema, Wr as contractSaleDocumentReferenceTypeSchema, Ar as contractSaleDocumentSchema, Gr as contractSaleDocumentSignatureInputSchema, jr as contractSaleDocumentSignatureSchema, Q as createBookingInputBaseSchema, $ as createBookingInputSchema, Te as createBookingPeriodConfigFromBookingEngineConfiguration, Ee as createBookingPeriodConfigFromShopConfiguration, De as createBookingPeriodConfigFromStorefrontConfiguration, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, qt as doesStorefrontAvailabilityDisplaySoldOut, Kr as downloadContractSaleDocumentPdfRequestSchema, _ as eBikeProductSchema, qe as findStorefrontProduct, Je as findStorefrontProductBySlug, lt as formatPriceMinor, St as formatStorefrontPhoneDisplay, ht as formatStorefrontPriceMinor, U as fulfillmentModeSchema, ut as getAvailabilityVariant, Oe as getBookingDurationLabel, ke as getBookingDurationMinutes, Ae as getBookingParamsFromSearch, je as getBookingSessionStorageKey, Ye as getCatalogProductBaseRateMinor, Xe as getCatalogProductPaginationSort, Ze as getCatalogProductSortFieldForPriceUnit, qr as getContractSaleDocumentRequestSchema, Jr as getContractSaleDocumentResponseSchema, Me as getDefaultBookingParams, Ne as getDefaultBookingParamsForStorefrontConfiguration, gt as getLocalizedEntry, t as getLocalizedStringValue, _t as getLocalizedValue, dt as getMinDayPriceMinor, Jt as getStorefrontAvailabilityIssue, Yt as getStorefrontAvailabilityStatus, Qe as getStorefrontBaseDailyRateMinor, $e as getStorefrontCheckoutProductId, et as getStorefrontRepresentedVariantId, v as isProductVariantCodeIdentifierKind, Xt as isStorefrontAvailabilityInsufficient, k as isoDateSchema, Bn as loader, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, Pe as pickBookingSearchParams, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, Zt as publicAvailabilityDisplayModeSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, Fe as readBookingSearchParamsFromSessionStorage, Ie as readBookingSearchParamsFromStorage, bt as requestSchema, ee as resolveBookingDeliveryOption, Le as resolveBookingSearchParams, Re as resolveBookingSearchParamsFromSessionStorage, ot as resolveStorefrontCartItemProduct, Ct as resolveStorefrontMapsHref, wt as resolveStorefrontPhoneContact, Et as resolveStorefrontWhatsAppContact, Dt as resolveStorefrontWhatsAppHref, xt as responseSchema, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, en as shouldBlockStorefrontUnavailableItem, u as signedMoneyMinorSchema, tn as storefrontAvailabilityProductSchema, Qt as storefrontAvailabilityRequestSchema, $t as storefrontAvailabilityResponseSchema, nn as storefrontAvailabilityScheduleSchema, se as storefrontCheckoutModeSchema, jt as storefrontCheckoutSubmitDeliveryRefinement, At as storefrontCheckoutSubmitItemSchema, kt as storefrontCheckoutSubmitRequestBaseSchema, Mt as storefrontCheckoutSubmitRequestSchema, Nt as storefrontCheckoutSubmitResponseSchema, ce as storefrontConfigurationSchema, le as storefrontContentSchema, yn as storefrontEn, ue as storefrontFaqItemSchema, de as storefrontFaqSchema, bn as storefrontFr, fe as storefrontFulfillmentModeSchema, sn as storefrontImageRequestSchema, pe as storefrontLocalizedRichTextSchema, me as storefrontModalMessageSchema, he as storefrontModulesSchema, Ft as storefrontProductsRequestSchema, It as storefrontProductsResponseSchema, Lt as storefrontPublicAccessoryProductSchema, rn as storefrontPublicAvailabilityRecordSchema, Rt as storefrontPublicBikeAvailabilityStatusSchema, zt as storefrontPublicBikeProductSchema, Bt as storefrontPublicProductDisplayModeSchema, Vt as storefrontPublicProductPriceSchema, Ht as storefrontPublicProductVariantAttributeSchema, Ut as storefrontPublicProductVariantIdentifierSchema, Wt as storefrontPublicProductVariantSchema, ge as storefrontReviewsModuleSchema, _e as storefrontRichTextSchema, Yr as storefrontRoutes, ve as storefrontSettingsSchema, ye as storefrontShopSchema, be as storefrontStatusSchema, fn as storefrontTimeSlotJourneySchema, dn as storefrontTimeSlotSchema, ln as storefrontTimeSlotsRequestSchema, un as storefrontTimeSlotsResponseSchema, xe as storefrontWorkspaceSchema, L as timeOfDaySchema, tt as toStorefrontAccessoryProducts, nt as toStorefrontBikeProducts, rt as toStorefrontBookingProducts, it as toStorefrontBookingProductsCollections, kn as useBookingPeriod, er as useFormField, Vn as useOptionalStorefront, Hn as useStorefront, Un as useStorefrontBookingProducts, st as useStorefrontCart, Wn as useStorefrontConfig, Gn as useStorefrontProducts, Kn as useStorefrontWorkspaceLanguage, Cn as useWhatsAppFloatingButton, te as validateBookingDeliveryAddress, ze as writeBookingSearchParamsToSessionStorage, Be as writeBookingSearchParamsToStorage };
@@ -14,6 +14,9 @@ export type StorefrontBookingParams = {
14
14
  type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
15
15
  export declare const TIME_OPTIONS: string[];
16
16
  export declare const getDefaultBookingParams: (now?: Date) => StorefrontBookingParams;
17
+ export declare const createBookingPeriodConfigFromShopConfiguration: (shop: StorefrontConfiguration["bookingEngine"]["shop"], options?: {
18
+ sameDayCutoff?: string;
19
+ }) => BookingPeriodConfig;
17
20
  export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (bookingEngine: StorefrontConfiguration["bookingEngine"], options?: {
18
21
  sameDayCutoff?: string;
19
22
  }) => BookingPeriodConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/lib/booking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,mBAAmB,8GAQtB,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAID,KAAK,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,CAAA;AAelG,eAAO,MAAM,YAAY,UAAqB,CAAA;AAE9C,eAAO,MAAM,uBAAuB,GAAI,MAAK,IAAiB,KAAG,uBAWhE,CAAA;AA6BD,eAAO,MAAM,uDAAuD,GAClE,eAAe,uBAAuB,CAAC,eAAe,CAAC,EACvD,UAAS;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,KACvC,mBAoBF,CAAA;AAED,eAAO,M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B,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAQzH,CAAA"}
@@ -1,7 +1,9 @@
1
- import { getDefaultBookingPeriod as e, parseTimeToMinutes as t } from "./booking-period.js";
2
- import { differenceInMinutes as n, format as r } from "date-fns";
1
+ import { DEFAULT_BOOKING_DELIVERY_OPTION as e } from "../chunks/booking-engine/dist/schemas/cart-inputs-j1yWfJxO.js";
2
+ import "../chunks/booking-engine/dist/schemas-DftrSnTE.js";
3
+ import { getDefaultBookingPeriod as t, parseTimeToMinutes as n } from "./booking-period.js";
4
+ import { differenceInMinutes as r, format as i } from "date-fns";
3
5
  //#region src/lib/booking.ts
4
- var i = [
6
+ var a = [
5
7
  "fulfillment",
6
8
  "start_date",
7
9
  "start_time",
@@ -9,78 +11,78 @@ var i = [
9
11
  "end_time",
10
12
  "start_address",
11
13
  "end_address"
12
- ], a = "loczer_storefront_booking:", o = (e) => r(e, "yyyy-MM-dd"), s = (() => {
14
+ ], o = "loczer_storefront_booking:", s = (e) => i(e, "yyyy-MM-dd"), c = (() => {
13
15
  let e = [];
14
16
  for (let t = 8; t <= 18; t += 1) for (let n of [0, 30]) t === 18 && n > 0 || e.push(`${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`);
15
17
  return e;
16
- })(), c = (e = /* @__PURE__ */ new Date()) => {
17
- let t = o(e);
18
+ })(), l = (t = /* @__PURE__ */ new Date()) => {
19
+ let n = s(t);
18
20
  return {
19
- fulfillment: "pickup",
20
- start_date: t,
21
- start_time: s[3] ?? "09:30",
22
- end_date: t,
23
- end_time: s.at(-1) ?? "18:00",
21
+ fulfillment: e,
22
+ start_date: n,
23
+ start_time: c[3] ?? "09:30",
24
+ end_date: n,
25
+ end_time: c.at(-1) ?? "18:00",
24
26
  start_address: "",
25
27
  end_address: ""
26
28
  };
27
- }, l = 30, u = 15, d = 10, f = 960, p = (e) => t(e) ?? f, m = (e) => (Math.trunc(e) % 7 + 7) % 7, h = (e) => {
29
+ }, u = 30, d = 15, f = 10, p = 960, m = (e) => n(e) ?? p, h = (e) => (Math.trunc(e) % 7 + 7) % 7, g = (e) => {
28
30
  if (e?.length) return e.map((e) => ({
29
31
  minutesAfterClose: e.minutesAfterClose,
30
32
  extraAmount: e.extraAmount
31
33
  }));
32
- }, g = (e, t = {}) => {
33
- let n = e.checkout.dynamicOptions?.sameDayCutoff;
34
- return {
35
- timing: {
36
- slotIntervalMinutes: l,
37
- autoFillCutoffMinutes: p(t.sameDayCutoff ?? n),
38
- pastToleranceMinutes: u,
39
- minBufferMinutes: d
40
- },
41
- openingHours: e.shop.openingHours.map((e) => ({
34
+ }, _ = (e, t = {}) => ({
35
+ timing: {
36
+ slotIntervalMinutes: u,
37
+ autoFillCutoffMinutes: m(t.sameDayCutoff),
38
+ pastToleranceMinutes: d,
39
+ minBufferMinutes: f
40
+ },
41
+ openingHours: e.openingHours.map((e) => ({
42
+ ...e,
43
+ openingHours: e.openingHours.map((e) => ({
42
44
  ...e,
43
- openingHours: e.openingHours.map((e) => ({
44
- ...e,
45
- day: m(e.day)
46
- }))
47
- })),
48
- openingHoursOverrides: e.shop.openingHoursOverrides ?? [],
49
- timeZone: e.shop.timeZone,
50
- extraTimeSlots: h(e.shop.extraTimeSlots)
51
- };
52
- }, _ = (e) => g(e.bookingEngine, { sameDayCutoff: e.settings.sameDayCutoff }), v = (t, n = /* @__PURE__ */ new Date()) => {
53
- let r = e({
54
- config: _(t),
55
- referenceDate: n
45
+ day: h(e.day)
46
+ }))
47
+ })),
48
+ openingHoursOverrides: e.openingHoursOverrides ?? [],
49
+ timeZone: e.timeZone,
50
+ extraTimeSlots: g(e.extraTimeSlots)
51
+ }), v = (e, t = {}) => {
52
+ let n = e.checkout.dynamicOptions?.sameDayCutoff;
53
+ return _(e.shop, { sameDayCutoff: t.sameDayCutoff ?? n });
54
+ }, y = (e) => v(e.bookingEngine, { sameDayCutoff: e.settings.sameDayCutoff }), b = (n, r = /* @__PURE__ */ new Date()) => {
55
+ let i = t({
56
+ config: y(n),
57
+ referenceDate: r
56
58
  });
57
59
  return {
58
- fulfillment: "pickup",
59
- start_date: o(r.startDate),
60
- start_time: r.startTime,
61
- end_date: o(r.endDate),
62
- end_time: r.endTime,
60
+ fulfillment: e,
61
+ start_date: s(i.startDate),
62
+ start_time: i.startTime,
63
+ end_date: s(i.endDate),
64
+ end_time: i.endTime,
63
65
  start_address: "",
64
66
  end_address: ""
65
67
  };
66
- }, y = (e, t, n) => {
68
+ }, x = (e, t, n) => {
67
69
  let r = e.get(t);
68
70
  return r == null || r.trim() === "" ? n : r;
69
- }, b = (e, t) => {
71
+ }, S = (e, t) => {
70
72
  let n = {
71
- ...c(),
73
+ ...l(),
72
74
  ...t
73
75
  };
74
76
  return {
75
77
  fulfillment: e.get("fulfillment") === "delivery" ? "delivery" : e.get("fulfillment") === "pickup" ? "pickup" : n.fulfillment,
76
- start_date: y(e, "start_date", n.start_date),
77
- start_time: y(e, "start_time", n.start_time),
78
- end_date: y(e, "end_date", n.end_date),
79
- end_time: y(e, "end_time", n.end_time),
80
- start_address: y(e, "start_address", n.start_address),
81
- end_address: y(e, "end_address", n.end_address)
78
+ start_date: x(e, "start_date", n.start_date),
79
+ start_time: x(e, "start_time", n.start_time),
80
+ end_date: x(e, "end_date", n.end_date),
81
+ end_time: x(e, "end_time", n.end_time),
82
+ start_address: x(e, "start_address", n.start_address),
83
+ end_address: x(e, "end_address", n.end_address)
82
84
  };
83
- }, x = (e, t) => {
85
+ }, C = (e, t) => {
84
86
  let n = new URLSearchParams(e), r = (e, t) => {
85
87
  if (t != null) {
86
88
  if (t.trim() === "") {
@@ -91,38 +93,38 @@ var i = [
91
93
  }
92
94
  };
93
95
  return r("fulfillment", t.fulfillment), r("start_date", t.start_date), r("start_time", t.start_time), r("end_date", t.end_date), r("end_time", t.end_time), r("start_address", t.start_address), r("end_address", t.end_address), n;
94
- }, S = (e) => {
96
+ }, w = (e) => {
95
97
  let t = new URLSearchParams();
96
- for (let n of i) {
98
+ for (let n of a) {
97
99
  let r = e.get(n);
98
100
  if (r == null) continue;
99
101
  let i = r.trim();
100
102
  i.length !== 0 && t.set(n, i);
101
103
  }
102
104
  return t;
103
- }, C = () => {
105
+ }, T = () => {
104
106
  if (typeof window > "u") return null;
105
107
  try {
106
108
  return window.sessionStorage;
107
109
  } catch {
108
110
  return null;
109
111
  }
110
- }, w = (e) => e instanceof URLSearchParams ? S(e) : x(new URLSearchParams(), e), T = (e) => {
112
+ }, E = (e) => e instanceof URLSearchParams ? w(e) : C(new URLSearchParams(), e), D = (e) => {
111
113
  let t = e?.trim() ?? "";
112
- return t ? `${a}${t}` : "";
113
- }, E = (e, t) => {
114
- let n = T(t);
114
+ return t ? `${o}${t}` : "";
115
+ }, O = (e, t) => {
116
+ let n = D(t);
115
117
  if (!n || !e) return new URLSearchParams();
116
118
  try {
117
119
  let t = e.getItem(n);
118
- return t ? S(new URLSearchParams(t)) : new URLSearchParams();
120
+ return t ? w(new URLSearchParams(t)) : new URLSearchParams();
119
121
  } catch {
120
122
  return new URLSearchParams();
121
123
  }
122
- }, D = (e, t, n) => {
123
- let r = T(t);
124
+ }, k = (e, t, n) => {
125
+ let r = D(t);
124
126
  if (!r || !e) return;
125
- let i = w(n).toString();
127
+ let i = E(n).toString();
126
128
  try {
127
129
  if (!i) {
128
130
  e.removeItem(r);
@@ -130,19 +132,19 @@ var i = [
130
132
  }
131
133
  e.setItem(r, i);
132
134
  } catch {}
133
- }, O = (e) => E(C(), e), k = (e, t) => {
134
- D(C(), e, t);
135
- }, A = (e, t) => {
136
- let n = S(e);
137
- return n.toString() ? n : E(t?.storage, t?.storeSlug);
138
- }, j = (e, t) => A(e, {
139
- storage: C(),
135
+ }, A = (e) => O(T(), e), j = (e, t) => {
136
+ k(T(), e, t);
137
+ }, M = (e, t) => {
138
+ let n = w(e);
139
+ return n.toString() ? n : O(t?.storage, t?.storeSlug);
140
+ }, N = (e, t) => M(e, {
141
+ storage: T(),
140
142
  storeSlug: t
141
- }), M = (e) => {
142
- let t = /* @__PURE__ */ new Date(`${e.start_date}T${e.start_time}:00`), r = /* @__PURE__ */ new Date(`${e.end_date}T${e.end_time}:00`);
143
- return Number.isNaN(t.getTime()) || Number.isNaN(r.getTime()) ? 0 : Math.max(0, n(r, t));
144
- }, N = (e) => {
145
- let t = M(e), n = Math.floor(t / 60), r = t % 60;
143
+ }), P = (e) => {
144
+ let t = /* @__PURE__ */ new Date(`${e.start_date}T${e.start_time}:00`), n = /* @__PURE__ */ new Date(`${e.end_date}T${e.end_time}:00`);
145
+ return Number.isNaN(t.getTime()) || Number.isNaN(n.getTime()) ? 0 : Math.max(0, r(n, t));
146
+ }, F = (e) => {
147
+ let t = P(e), n = Math.floor(t / 60), r = t % 60;
146
148
  return r === 0 ? {
147
149
  hours: n,
148
150
  minutes: r,
@@ -154,4 +156,4 @@ var i = [
154
156
  };
155
157
  };
156
158
  //#endregion
157
- export { i as BOOKING_SEARCH_KEYS, s as TIME_OPTIONS, x as applyBookingParamsToSearch, g as createBookingPeriodConfigFromBookingEngineConfiguration, _ as createBookingPeriodConfigFromStorefrontConfiguration, N as getBookingDurationLabel, M as getBookingDurationMinutes, b as getBookingParamsFromSearch, T as getBookingSessionStorageKey, c as getDefaultBookingParams, v as getDefaultBookingParamsForStorefrontConfiguration, S as pickBookingSearchParams, O as readBookingSearchParamsFromSessionStorage, E as readBookingSearchParamsFromStorage, A as resolveBookingSearchParams, j as resolveBookingSearchParamsFromSessionStorage, k as writeBookingSearchParamsToSessionStorage, D as writeBookingSearchParamsToStorage };
159
+ export { a as BOOKING_SEARCH_KEYS, c as TIME_OPTIONS, C as applyBookingParamsToSearch, v as createBookingPeriodConfigFromBookingEngineConfiguration, _ as createBookingPeriodConfigFromShopConfiguration, y as createBookingPeriodConfigFromStorefrontConfiguration, F as getBookingDurationLabel, P as getBookingDurationMinutes, S as getBookingParamsFromSearch, D as getBookingSessionStorageKey, l as getDefaultBookingParams, b as getDefaultBookingParamsForStorefrontConfiguration, w as pickBookingSearchParams, A as readBookingSearchParamsFromSessionStorage, O as readBookingSearchParamsFromStorage, M as resolveBookingSearchParams, N as resolveBookingSearchParamsFromSessionStorage, j as writeBookingSearchParamsToSessionStorage, k as writeBookingSearchParamsToStorage };
@@ -1 +1 @@
1
- {"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;AAE7D,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAI3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,GACpC,SAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,KAAK,CAAC,CAAC,aAAa,SAWrB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2D,CAAA;AACrF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;iBAYzB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;AAE7D,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAI3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,GACpC,SAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,KAAK,CAAC,CAAC,aAAa,SAWrB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2D,CAAA;AACrF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;iBAYzB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -1,46 +1,46 @@
1
1
  import { productKindSchema as e } from "../chunks/booking-engine/dist/models/Product.shared-CTuk4fiR.js";
2
- import { bookingScheduleInputSchema as t } from "../chunks/booking-engine/dist/schemas/cart-inputs-9vM8GCrc.js";
3
- import "../chunks/booking-engine/dist/schemas-34QQv0EH.js";
4
- import { storefrontFulfillmentModeSchema as n } from "../storefrontSchemas.js";
5
- import { z as r } from "zod";
2
+ import { DEFAULT_BOOKING_DELIVERY_OPTION as t, bookingScheduleInputSchema as n } from "../chunks/booking-engine/dist/schemas/cart-inputs-j1yWfJxO.js";
3
+ import "../chunks/booking-engine/dist/schemas-DftrSnTE.js";
4
+ import { storefrontFulfillmentModeSchema as r } from "../storefrontSchemas.js";
5
+ import { z as i } from "zod";
6
6
  //#region src/lib/checkoutSubmit.ts
7
- var i = "/api/public/storefront/checkout/submit", a = r.object({
7
+ var a = "/api/public/storefront/checkout/submit", o = i.object({
8
8
  kind: e,
9
- productId: r.string().trim().min(1),
10
- productVariantId: r.string().trim().min(1).optional(),
11
- quantity: r.number().int().positive()
12
- }), o = r.object({
13
- storeSlug: r.string().trim().min(1).toLowerCase(),
14
- schedule: t,
15
- fulfillment: n.default("pickup"),
16
- startAddress: r.string().trim().max(500).optional(),
17
- endAddress: r.string().trim().max(500).optional(),
18
- couponCode: r.string().trim().max(64).optional().or(r.literal("")),
19
- couponAutoApplied: r.boolean().optional(),
20
- customer: r.object({
21
- fullName: r.string().trim().min(2),
22
- email: r.string().trim().email(),
23
- phone: r.string().trim().min(6),
24
- notes: r.string().trim().max(2e3).optional().or(r.literal(""))
9
+ productId: i.string().trim().min(1),
10
+ productVariantId: i.string().trim().min(1).optional(),
11
+ quantity: i.number().int().positive()
12
+ }), s = i.object({
13
+ storeSlug: i.string().trim().min(1).toLowerCase(),
14
+ schedule: n,
15
+ fulfillment: r.default(t),
16
+ startAddress: i.string().trim().max(500).optional(),
17
+ endAddress: i.string().trim().max(500).optional(),
18
+ couponCode: i.string().trim().max(64).optional().or(i.literal("")),
19
+ couponAutoApplied: i.boolean().optional(),
20
+ customer: i.object({
21
+ fullName: i.string().trim().min(2),
22
+ email: i.string().trim().email(),
23
+ phone: i.string().trim().min(6),
24
+ notes: i.string().trim().max(2e3).optional().or(i.literal(""))
25
25
  }),
26
- items: r.array(a).min(1),
27
- nowIso: r.string().datetime({ offset: !0 }).optional()
28
- }), s = (e, t) => {
26
+ items: i.array(o).min(1),
27
+ nowIso: i.string().datetime({ offset: !0 }).optional()
28
+ }), c = (e, t) => {
29
29
  e.fulfillment === "delivery" && (e.startAddress?.trim() || t.addIssue({
30
- code: r.ZodIssueCode.custom,
30
+ code: i.ZodIssueCode.custom,
31
31
  message: "Delivery start address is required.",
32
32
  path: ["startAddress"]
33
33
  }));
34
- }, c = o.superRefine(s), l = r.object({
35
- success: r.boolean(),
36
- message: r.string().optional(),
37
- checkout: r.object({
38
- bookingExternalId: r.string().trim().min(1),
39
- saleId: r.string().trim().min(1),
40
- nextPath: r.string().trim().min(1),
41
- successPath: r.string().trim().min(1),
42
- requiresPayment: r.boolean()
34
+ }, l = s.superRefine(c), u = i.object({
35
+ success: i.boolean(),
36
+ message: i.string().optional(),
37
+ checkout: i.object({
38
+ bookingExternalId: i.string().trim().min(1),
39
+ saleId: i.string().trim().min(1),
40
+ nextPath: i.string().trim().min(1),
41
+ successPath: i.string().trim().min(1),
42
+ requiresPayment: i.boolean()
43
43
  }).optional()
44
44
  });
45
45
  //#endregion
46
- export { i as ROUTE, o as requestBaseSchema, a as requestCheckoutItemSchema, s as requestDeliveryRefinement, c as requestSchema, l as responseSchema };
46
+ export { a as ROUTE, s as requestBaseSchema, o as requestCheckoutItemSchema, c as requestDeliveryRefinement, l as requestSchema, u as responseSchema };
@@ -1,6 +1,6 @@
1
1
  import { timeOfDaySchema as e } from "./chunks/booking-engine/dist/schemas/shop-opening-hours-BlLD1gfz.js";
2
2
  import { publicBookingEngineConfigurationSchema as t } from "./chunks/booking-engine/dist/schemas/public-booking-engine-configuration-BnJ_H-p1.js";
3
- import "./chunks/booking-engine/dist/schemas-34QQv0EH.js";
3
+ import "./chunks/booking-engine/dist/schemas-DftrSnTE.js";
4
4
  import { z as n } from "zod";
5
5
  //#region src/storefrontSchemas.ts
6
6
  var r = n.string().trim().regex(/^\+[1-9]\d{1,14}$/, { message: "Invalid phone number format (expected E.164, e.g. +14155552671)." }), i = n.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loczer/storefront-sdk",
3
- "version": "0.183.0",
3
+ "version": "0.184.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,13 +0,0 @@
1
- import { createLocalizedStringEntry as e, getLocalizedStringValue as t, localizedStringArraySchema as n, localizedStringEntrySchema as r, localizedStringSchema as i } from "./models/LocalizedString-D_TRgAdr.js";
2
- import { currencyCodeSchema as a, currencyMinorUnitDigits as o, majorToMinor as s, minorToMajor as c, moneyMinorSchema as l, signedMoneyMinorSchema as u } from "./schemas/money-CVoCY4of.js";
3
- import { priceSchema as d, priceUnitSchema as f } from "./models/Price-DCAgqkKh.js";
4
- import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./models/Product.shared-CTuk4fiR.js";
5
- import { richTextJsonDocSchema as E, richTextSchema as D, richTextVersionSchema as O } from "./schemas/rich-text-DTRh7U3z.js";
6
- import { isoDateSchema as k, shopConfigurationSchema as A, shopExtraTimeSlotRuleSchema as j, shopOpeningDayIndexSchema as M, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as P, shopOpeningHoursPeriodSchema as F, shopOpeningSlotSchema as I, timeOfDaySchema as L } from "./schemas/shop-opening-hours-BlLD1gfz.js";
7
- import { DEFAULT_CANCELLATION_POLICY as R, DEFAULT_PAYMENT_POLICIES as z, cancellationPolicySchema as B, cancellationPolicyTierSchema as V, paymentPoliciesSchema as H } from "./schemas/booking-engine-configuration-D02MRF9U.js";
8
- import { fulfillmentModeSchema as U, publicBookingEngineConfigurationSchema as W, publicCheckoutConfigurationSchema as G, publicCheckoutDynamicOptionsSchema as K } from "./schemas/public-booking-engine-configuration-BnJ_H-p1.js";
9
- import { bookingCustomerInputSchema as q, bookingDeliveryOptionSchema as J, bookingScheduleInputSchema as Y, cartItemInputSchema as X, createBookingInputBaseSchema as Z, createBookingInputSchema as Q, validateBookingDeliveryAddress as $ } from "./schemas/cart-inputs-9vM8GCrc.js";
10
- import "./schemas/base-product-1H8l2aUv.js";
11
- import { baseAssetSchema as ee, baseAssetStatusSchema as te } from "./schemas/base-asset-B_Dm8_Vk.js";
12
- import { baseBookingItemSchema as ne, baseBookingSchema as re, baseBookingStateSchema as ie } from "./schemas/base-booking-DW8AEPKo.js";
13
- export { R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, h as accessoryProductSchema, ee as baseAssetSchema, te as baseAssetStatusSchema, ne as baseBookingItemSchema, re as baseBookingSchema, ie as baseBookingStateSchema, g as bikeProductSchema, q as bookingCustomerInputSchema, J as bookingDeliveryOptionSchema, Y as bookingScheduleInputSchema, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, X as cartItemInputSchema, Z as createBookingInputBaseSchema, Q as createBookingInputSchema, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, _ as eBikeProductSchema, U as fulfillmentModeSchema, t as getLocalizedStringValue, v as isProductVariantCodeIdentifierKind, k as isoDateSchema, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, u as signedMoneyMinorSchema, L as timeOfDaySchema, $ as validateBookingDeliveryAddress };