@loczer/storefront-sdk 0.163.0 → 0.165.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.
Files changed (89) hide show
  1. package/dist/StorefrontProvider.d.ts +29 -3
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.js +68 -58
  4. package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
  5. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
  6. package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
  8. package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
  9. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
  10. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
  11. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
  12. package/dist/components/AboutSection/index.js +1 -1
  13. package/dist/components/BikeProductCard/index.d.ts +2 -1
  14. package/dist/components/BikeProductCard/index.d.ts.map +1 -1
  15. package/dist/components/BikeProductCard/index.js +59 -41
  16. package/dist/components/BookingBikeVariantDialog/index.js +1 -1
  17. package/dist/components/BookingFlowSteps/index.js +8 -8
  18. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  19. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  20. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
  21. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  22. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  23. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  24. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
  25. package/dist/components/ContactSection/index.js +4 -4
  26. package/dist/components/Header/index.js +1 -1
  27. package/dist/components/PoweredByLoczerBadge/index.js +1 -1
  28. package/dist/components/ProductPriceBadge/index.js +1 -1
  29. package/dist/components/ProductWarningNotice/index.js +10 -10
  30. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
  31. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
  32. package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
  33. package/dist/components/payment/MollieCardFieldsForm.js +1 -1
  34. package/dist/components/payment/StripeCardFieldsForm.js +13 -13
  35. package/dist/i18n/en.d.ts +12 -0
  36. package/dist/i18n/en.d.ts.map +1 -1
  37. package/dist/i18n/en.js +12 -0
  38. package/dist/i18n/fr.d.ts +12 -0
  39. package/dist/i18n/fr.d.ts.map +1 -1
  40. package/dist/i18n/fr.js +12 -0
  41. package/dist/index.d.ts +116 -7
  42. package/dist/index.js +312 -305
  43. package/dist/lib/cart.js +1 -1
  44. package/dist/lib/cartSummary.d.ts.map +1 -1
  45. package/dist/lib/cartSummary.js +28 -28
  46. package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
  47. package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
  48. package/dist/lib/checkoutPaymentDecision.js +14 -6
  49. package/dist/lib/checkoutPaymentSession.d.ts +1 -0
  50. package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
  51. package/dist/lib/checkoutPaymentSession.js +12 -11
  52. package/dist/lib/checkoutSubmit.js +4 -4
  53. package/dist/lib/productVariants.d.ts.map +1 -1
  54. package/dist/lib/productVariants.js +34 -15
  55. package/dist/lib/products.d.ts +4 -0
  56. package/dist/lib/products.d.ts.map +1 -1
  57. package/dist/lib/products.js +74 -39
  58. package/dist/lib/securePaymentLink.d.ts +1 -0
  59. package/dist/lib/securePaymentLink.d.ts.map +1 -1
  60. package/dist/lib/securePaymentLink.js +1 -0
  61. package/dist/lib/storefrontAvailability.d.ts +9 -0
  62. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  63. package/dist/lib/storefrontAvailability.js +28 -18
  64. package/dist/pages/BookingPage.d.ts.map +1 -1
  65. package/dist/pages/BookingPage.js +290 -289
  66. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  67. package/dist/pages/CheckoutPage.js +224 -216
  68. package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
  69. package/dist/pages/CheckoutPaymentPage.js +92 -92
  70. package/dist/pages/ContractSaleDocumentPage.js +3 -3
  71. package/dist/pages/HomePage.d.ts.map +1 -1
  72. package/dist/pages/HomePage.js +167 -161
  73. package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
  74. package/dist/pages/PaymentLinkPage.js +62 -62
  75. package/dist/pages/PaymentLinkSuccessPage.js +7 -7
  76. package/dist/pages/ProductPage.d.ts.map +1 -1
  77. package/dist/pages/ProductPage.js +161 -161
  78. package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
  79. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
  80. package/dist/storefront.css +1 -1
  81. package/dist/storefrontSchemas.d.ts +14 -2
  82. package/dist/storefrontSchemas.d.ts.map +1 -1
  83. package/dist/storefrontSchemas.js +4 -4
  84. package/dist/ui/day-picker.js +5 -5
  85. package/package.json +2 -2
  86. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
  87. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
  88. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
  89. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
@@ -1,8 +1,8 @@
1
- import { useMemo as f, useState as w, useRef as N, useCallback as g, useEffect as F } from "react";
1
+ import { useMemo as c, useState as C, useRef as N, useCallback as p, useEffect as k } from "react";
2
2
  import { differenceInCalendarDays as De } from "date-fns";
3
- import { fr as ot, de as lt, es as ut, it as ct, enUS as ft } from "date-fns/locale";
4
- import { useMediaQuery as dt } from "@rpcbase/client";
5
- import { createBookingPeriodConstants as mt, parseTimeToMinutes as R, dateToBusinessDateString as St, instantToBusinessDateTimeParts as Tt, businessDateStringToDate as Dt, getWeekdayFromDateString as pt, minutesToTimeString as vt } from "../../lib/booking-period.js";
3
+ import { fr as at, de as ot, es as lt, it as ut, enUS as ct } from "date-fns/locale";
4
+ import { useMediaQuery as ft } from "@rpcbase/client";
5
+ import { createBookingPeriodConstants as dt, parseTimeToMinutes as R, dateToBusinessDateString as mt, instantToBusinessDateTimeParts as St, businessDateStringToDate as Tt, getWeekdayFromDateString as Dt, minutesToTimeString as pt } from "../../lib/booking-period.js";
6
6
  import { getBookingPeriodTimeSlotsSync as pe } from "../../lib/booking-period-time-slots.js";
7
7
  const gt = (s) => s, ht = {
8
8
  startDate: "Start date",
@@ -11,393 +11,387 @@ const gt = (s) => s, ht = {
11
11
  endDate: "End date",
12
12
  pickEndDate: "Pick a date",
13
13
  endTime: "End time"
14
- }, Et = ({
14
+ }, vt = ({
15
15
  locale: s,
16
16
  localeCode: n
17
17
  }) => {
18
18
  if (s)
19
19
  return s;
20
- const a = n?.toLowerCase() ?? "";
21
- return a.startsWith("fr") ? ot : a.startsWith("de") ? lt : a.startsWith("es") ? ut : a.startsWith("it") ? ct : ft;
22
- }, bt = (s) => {
20
+ const i = n?.toLowerCase() ?? "";
21
+ return i.startsWith("fr") ? at : i.startsWith("de") ? ot : i.startsWith("es") ? lt : i.startsWith("it") ? ut : ct;
22
+ }, Et = (s) => {
23
23
  if (!s?.length)
24
24
  return null;
25
25
  const n = s.map((r) => R(r.value)).filter((r) => typeof r == "number").sort((r, K) => r - K);
26
26
  if (n.length < 2)
27
27
  return null;
28
- const a = n[1] - n[0];
29
- return !Number.isFinite(a) || a <= 0 ? null : a;
30
- }, Mt = (s) => {
28
+ const i = n[1] - n[0];
29
+ return !Number.isFinite(i) || i <= 0 ? null : i;
30
+ }, bt = (s) => {
31
31
  if (typeof s != "string")
32
32
  return null;
33
33
  const n = s.match(/(\d{1,2}:\d{2})\s*-\s*(\d{1,2}:\d{2})/);
34
34
  return n ? R(n[2]) : null;
35
- }, Ae = (s, n) => s.map((a) => {
36
- const r = R(a.value);
35
+ }, Ae = (s, n) => s.map((i) => {
36
+ const r = R(i.value);
37
37
  if (r == null)
38
38
  return null;
39
- const K = Mt(a.label) ?? r + n, T = typeof a.label == "string" ? a.label : a.value;
39
+ const K = bt(i.label) ?? r + n, m = typeof i.label == "string" ? i.label : i.value;
40
40
  return {
41
- value: a.value,
42
- label: T,
41
+ value: i.value,
42
+ label: m,
43
43
  startMinutes: r,
44
44
  endMinutes: K,
45
45
  isExtra: !1,
46
- isDisabled: !!a.disabled
46
+ isDisabled: !!i.disabled
47
47
  };
48
- }).filter((a) => !!a), ve = (s) => !s.isDisabled && !s.isExtra, Be = (s) => {
48
+ }).filter((i) => !!i), ge = (s) => !s.isDisabled && !s.isExtra, Mt = (s) => {
49
49
  for (let n = s.length - 1; n >= 0; n -= 1)
50
- if (ve(s[n]))
50
+ if (ge(s[n]))
51
51
  return s[n];
52
52
  return null;
53
- }, At = (s) => {
53
+ }, yt = (s, n) => s.find((i) => ge(i) && i.startMinutes >= n) ?? null, Bt = (s) => {
54
54
  const {
55
55
  startDate: n,
56
- onStartDateChange: a,
56
+ onStartDateChange: i,
57
57
  startTime: r,
58
58
  onStartTimeChange: K,
59
- endDate: T,
59
+ endDate: m,
60
60
  onEndDateChange: _,
61
- endTime: d,
62
- onEndTimeChange: ge,
61
+ endTime: S,
62
+ onEndTimeChange: he,
63
63
  onEndDateCommit: Q,
64
64
  onEndTimeCommit: V,
65
- errors: Ie = {},
66
- labels: Le,
67
- t: xe = gt,
68
- language: he,
69
- labelClassName: Re,
70
- inputClassName: Ke,
71
- buttonClassName: He,
65
+ errors: Be = {},
66
+ labels: Ie,
67
+ t: Le = gt,
68
+ language: ve,
69
+ labelClassName: xe,
70
+ inputClassName: Re,
71
+ buttonClassName: Ke,
72
72
  bookingPeriodConfig: o,
73
- fetchTimeSlots: i,
73
+ fetchTimeSlots: a,
74
74
  selectionFlow: E = "chained-times",
75
- withMobileDateDrawer: Ue = !1,
76
- currencyCode: We = "EUR",
75
+ withMobileDateDrawer: He = !1,
76
+ currencyCode: Ue = "EUR",
77
77
  disableAutomaticTimeCorrection: H = !1,
78
- openDatePickerOnFocus: ze = !0,
78
+ openDatePickerOnFocus: We = !0,
79
79
  startTimeOptions: U = [],
80
80
  endTimeOptions: Ee,
81
81
  locale: be,
82
- localeCode: Ne
83
- } = s, W = dt("(max-width: 767px)"), Y = Ne ?? he ?? "en-US", qe = f(
84
- () => Et({ locale: be, localeCode: Y }),
82
+ localeCode: ze
83
+ } = s, W = ft("(max-width: 767px)"), Y = ze ?? ve ?? "en-US", Ne = c(
84
+ () => vt({ locale: be, localeCode: Y }),
85
85
  [be, Y]
86
- ), b = f(
87
- () => o ? mt(o) : null,
86
+ ), b = c(
87
+ () => o ? dt(o) : null,
88
88
  [o]
89
- ), L = f(() => o?.timing.slotIntervalMinutes ? o.timing.slotIntervalMinutes : bt(U) ?? 30, [o?.timing.slotIntervalMinutes, U]), [ne, j] = w(!1), [re, ie] = w(!1), [se, z] = w(!1), [ae, oe] = w(!1), [$e, le] = w(void 0), [Ze, _e] = w(!1), [Me, Qe] = w(!1), [ue, Ve] = w([]), [ye, G] = w([]), [J, q] = w(void 0), M = N(null), ce = N(0), fe = N(0), de = N(0), Ce = N(void 0), $ = N(void 0), Ye = g(() => {
90
- le(void 0);
91
- }, []), X = f(() => !n || !T ? !1 : De(T, n) === 0, [n, T]), je = f(() => R(r), [r]), A = g(
89
+ ), L = c(() => o?.timing.slotIntervalMinutes ? o.timing.slotIntervalMinutes : Et(U) ?? 30, [o?.timing.slotIntervalMinutes, U]), [te, j] = C(!1), [ne, re] = C(!1), [ie, z] = C(!1), [se, ae] = C(!1), [qe, oe] = C(void 0), [$e, Ze] = C(!1), [Me, _e] = C(!1), [le, Qe] = C([]), [ye, G] = C([]), [J, q] = C(void 0), M = N(null), ue = N(0), ce = N(0), fe = N(0), Oe = N(void 0), $ = N(void 0), Ve = p(() => {
90
+ oe(void 0);
91
+ }, []), de = c(() => !n || !m ? !1 : De(m, n) === 0, [n, m]), Ye = c(() => R(r), [r]), A = p(
92
92
  (e) => {
93
- const m = (e instanceof Date ? e : e ? new Date(e) : void 0) ?? /* @__PURE__ */ new Date();
93
+ const f = (e instanceof Date ? e : e ? new Date(e) : void 0) ?? /* @__PURE__ */ new Date();
94
94
  if (b)
95
- return St(m, b.timeZone) ?? void 0;
96
- const u = m.getFullYear(), v = String(m.getMonth() + 1).padStart(2, "0"), D = String(m.getDate()).padStart(2, "0");
97
- return `${u}-${v}-${D}`;
95
+ return mt(f, b.timeZone) ?? void 0;
96
+ const u = f.getFullYear(), D = String(f.getMonth() + 1).padStart(2, "0"), T = String(f.getDate()).padStart(2, "0");
97
+ return `${u}-${D}-${T}`;
98
98
  },
99
99
  [b]
100
- ), y = f(() => A(n), [n, A]), l = f(() => A(T ?? n), [T, n, A]), Oe = b ? Tt(/* @__PURE__ */ new Date(), b.timeZone) : null, P = Oe?.dateString, me = Oe?.minutesFromMidnight, B = f(() => P ? !!(n && y && y === P) : !!n && De(n, /* @__PURE__ */ new Date()) === 0, [n, y, P]), Z = f(() => P ? !!(T && l && l === P) : !!T && De(T, /* @__PURE__ */ new Date()) === 0, [T, l, P]), Ge = f(() => {
101
- if (P)
102
- return Dt(P);
100
+ ), y = c(() => A(n), [n, A]), l = c(() => A(m ?? n), [m, n, A]), Ce = b ? St(/* @__PURE__ */ new Date(), b.timeZone) : null, w = Ce?.dateString, me = Ce?.minutesFromMidnight, B = c(() => w ? !!(n && y && y === w) : !!n && De(n, /* @__PURE__ */ new Date()) === 0, [n, y, w]), Z = c(() => w ? !!(m && l && l === w) : !!m && De(m, /* @__PURE__ */ new Date()) === 0, [m, l, w]), je = c(() => {
101
+ if (w)
102
+ return Tt(w);
103
103
  const e = /* @__PURE__ */ new Date();
104
104
  return e.setHours(0, 0, 0, 0), e;
105
- }, [P]), Se = o?.timing.minBufferMinutes ?? 10, I = f(() => {
105
+ }, [w]), Se = o?.timing.minBufferMinutes ?? 10, I = c(() => {
106
106
  if (!B && !Z)
107
107
  return null;
108
108
  if (me != null)
109
109
  return me + Se;
110
110
  const e = /* @__PURE__ */ new Date();
111
111
  return e.setMinutes(e.getMinutes() + Se), e.getHours() * 60 + e.getMinutes();
112
- }, [me, Z, B, Se]), Te = f(
112
+ }, [me, Z, B, Se]), Te = c(
113
113
  () => B ? I : null,
114
114
  [I, B]
115
- ), we = g(
115
+ ), we = p(
116
116
  (e) => {
117
117
  if (!b)
118
118
  return;
119
119
  const t = A(e);
120
120
  if (!t)
121
121
  return b.defaultEndTime;
122
- const m = pt(t), u = b.getLastStartMinutesForWeekday(m, {
122
+ const f = Dt(t), u = b.getLastStartMinutesForWeekday(f, {
123
123
  dateString: t
124
124
  });
125
- return typeof u == "number" ? vt(u) : b.defaultEndTime;
125
+ return typeof u == "number" ? pt(u) : b.defaultEndTime;
126
126
  },
127
127
  [b, A]
128
128
  );
129
- F(() => {
130
- if (!i || !y)
129
+ k(() => {
130
+ if (!a || !y)
131
131
  return;
132
132
  let e = !0;
133
- return i(y, "start").then((t) => {
134
- e && t && Ve(t);
133
+ return a(y, "start").then((t) => {
134
+ e && t && Qe(t);
135
135
  }).catch((t) => {
136
136
  console.error("Failed to fetch availability time slots", t);
137
137
  }), () => {
138
138
  e = !1;
139
139
  };
140
- }, [i, y]), F(() => {
141
- if (!i)
140
+ }, [a, y]), k(() => {
141
+ if (!a)
142
142
  return;
143
- const e = Ce.current, t = e !== void 0 && e !== l;
144
- Ce.current = l, t && l && ($.current = l);
145
- }, [l, i]), F(() => {
146
- if (!i)
143
+ const e = Oe.current, t = e !== void 0 && e !== l;
144
+ Oe.current = l, t && l && ($.current = l);
145
+ }, [l, a]), k(() => {
146
+ if (!a)
147
147
  return;
148
148
  if (!l) {
149
149
  G([]), q(void 0);
150
150
  return;
151
151
  }
152
152
  let e = !0;
153
- return q(void 0), i(l, "end").then((t) => {
153
+ return q(void 0), a(l, "end").then((t) => {
154
154
  e && (t ? (G(t), q(l)) : (G([]), q(void 0)));
155
155
  }).catch((t) => {
156
156
  console.error("Failed to fetch availability time slots", t), e && (G([]), q(void 0));
157
157
  }), () => {
158
158
  e = !1;
159
159
  };
160
- }, [l, i]);
161
- const ee = f(() => i || !o ? null : pe(o, {
160
+ }, [l, a]);
161
+ const X = c(() => a || !o ? null : pe(o, {
162
162
  date: y
163
- }), [o, i, y]), Pe = f(() => !i || !o ? null : pe(o, {
163
+ }), [o, a, y]), Fe = c(() => !a || !o ? null : pe(o, {
164
164
  date: y
165
- }).startTimeSlots, [o, i, y]), ke = f(() => !i || !o ? null : pe(o, {
165
+ }).startTimeSlots, [o, a, y]), Pe = c(() => !a || !o ? null : pe(o, {
166
166
  date: l
167
- }).endTimeSlots, [o, l, i]), k = f(() => i ? ue.length ? ue : Pe ?? [] : o ? ee?.startTimeSlots ?? [] : Ae(U, L), [
167
+ }).endTimeSlots, [o, l, a]), F = c(() => a ? le.length ? le : Fe ?? [] : o ? X?.startTimeSlots ?? [] : Ae(U, L), [
168
168
  o,
169
- ee?.startTimeSlots,
170
- Pe,
171
- i,
172
- ue,
169
+ X?.startTimeSlots,
170
+ Fe,
171
+ a,
172
+ le,
173
173
  L,
174
174
  U
175
- ]), C = f(() => i ? J === l ? ye : ke ?? [] : o ? ee?.endTimeSlots ?? [] : Ae(Ee ?? U, L), [
175
+ ]), P = c(() => a ? J === l ? ye : Pe ?? [] : o ? X?.endTimeSlots ?? [] : Ae(Ee ?? U, L), [
176
176
  o,
177
- ee?.endTimeSlots,
177
+ X?.endTimeSlots,
178
178
  l,
179
179
  Ee,
180
- ke,
181
- i,
180
+ Pe,
181
+ a,
182
182
  ye,
183
183
  J,
184
184
  L,
185
185
  U
186
- ]), O = g(
186
+ ]), O = p(
187
187
  (e, t) => {
188
- e !== r && (Qe(t === "user"), K(e, { source: t }));
188
+ e !== r && (_e(t === "user"), K(e, { source: t }));
189
189
  },
190
190
  [K, r]
191
- ), p = g(
191
+ ), g = p(
192
192
  (e, t = "auto") => {
193
- e !== d && (t !== "user" && e && C.find((u) => u.value === e)?.isExtra || ge(e, { source: t }));
193
+ e !== S && (t !== "user" && e && P.find((u) => u.value === e)?.isExtra || he(e, { source: t }));
194
194
  },
195
- [C, d, ge]
196
- ), te = f(() => k.length ? k.find((e) => !(e.isDisabled || Te != null && e.startMinutes < Te)) ?? null : null, [Te, k]);
197
- F(() => {
198
- H || Me || te && r !== te.value && O(te.value, "auto");
199
- }, [H, te, Me, r, O]), F(() => {
200
- if (H || !k.length)
195
+ [P, S, he]
196
+ ), ee = c(() => F.length ? F.find((e) => !(e.isDisabled || Te != null && e.startMinutes < Te)) ?? null : null, [Te, F]);
197
+ k(() => {
198
+ H || Me || ee && r !== ee.value && O(ee.value, "auto");
199
+ }, [H, ee, Me, r, O]), k(() => {
200
+ if (H || !F.length)
201
201
  return;
202
- const e = r ? k.find((S) => S.value === r) : void 0, t = I ?? void 0, m = B ? t : null, u = (S) => {
203
- const c = typeof S == "number" ? S : null, h = k.find((x) => !(x.isDisabled || c != null && x.startMinutes < c));
204
- h && h.value !== r ? O(h.value, "auto") : !h && r && O("", "auto");
202
+ const e = r ? F.find((d) => d.value === r) : void 0, t = I ?? void 0, f = B ? t : null, u = (d) => {
203
+ const h = typeof d == "number" ? d : null, v = F.find((x) => !(x.isDisabled || h != null && x.startMinutes < h));
204
+ v && v.value !== r ? O(v.value, "auto") : !v && r && O("", "auto");
205
205
  };
206
206
  if (r && !e) {
207
- u(m);
207
+ u(f);
208
208
  return;
209
209
  }
210
210
  if (e?.isDisabled) {
211
- u(m);
211
+ u(f);
212
212
  return;
213
213
  }
214
214
  if (!B || t == null)
215
215
  return;
216
- const v = R(r);
217
- if (v != null && v >= t && !e?.isDisabled)
216
+ const D = R(r);
217
+ if (D != null && D >= t && !e?.isDisabled)
218
218
  return;
219
- const D = k.find((S) => !S.isDisabled && S.startMinutes >= t);
220
- D && D.value !== r && O(D.value, "auto");
221
- }, [H, I, B, r, k, O]), F(() => {
222
- if (H || !C.length)
219
+ const T = F.find((d) => !d.isDisabled && d.startMinutes >= t);
220
+ T && T.value !== r && O(T.value, "auto");
221
+ }, [H, I, B, r, F, O]), k(() => {
222
+ if (H || !P.length)
223
223
  return;
224
- if (i && $.current === l && J === l) {
224
+ if (a && $.current === l && J === l) {
225
225
  $.current = void 0;
226
- const h = Be(C);
227
- if (h && h.value !== d) {
228
- p(h.value);
226
+ const v = Mt(P);
227
+ if (v && v.value !== S) {
228
+ g(v.value);
229
229
  return;
230
230
  }
231
231
  }
232
- const e = R(r), t = R(d), m = d ? C.find((c) => c.value === d) : void 0;
233
- if (X && e != null && t != null && t < e) {
234
- const c = Be(C);
235
- c && c.value !== d ? p(c.value) : !c && d && p("");
236
- return;
237
- }
238
- const u = [];
239
- Z && I != null && u.push(I), X && e != null && u.push(e + L);
240
- const v = u.length ? Math.max(...u) : null, D = (c) => {
241
- const h = typeof c == "number" ? c : null, x = C.find((Fe) => !(!ve(Fe) || h != null && Fe.startMinutes < h));
242
- x && x.value !== d ? p(x.value) : !x && d && p("");
232
+ const e = R(r), t = R(S), f = S ? P.find((h) => h.value === S) : void 0, u = [];
233
+ Z && I != null && u.push(I), de && e != null && u.push(e + L);
234
+ const D = u.length ? Math.max(...u) : null, T = (h) => {
235
+ const v = typeof h == "number" ? h : null, x = P.find((ke) => !(!ge(ke) || v != null && ke.startMinutes < v));
236
+ x && x.value !== S ? g(x.value) : !x && S && g("");
243
237
  };
244
- if (i && d && !m) {
245
- D(v);
238
+ if (a && S && !f) {
239
+ T(D);
246
240
  return;
247
241
  }
248
- if (m?.isDisabled) {
249
- D(v);
242
+ if (f?.isDisabled) {
243
+ T(D);
250
244
  return;
251
245
  }
252
- if (v == null || t != null && t >= v)
246
+ if (D == null || t != null && t >= D)
253
247
  return;
254
- const S = C.find((c) => ve(c) && c.startMinutes >= v);
255
- S && S.value !== d ? p(S.value) : !S && d && p("");
248
+ const d = yt(P, D);
249
+ d && d.value !== S ? g(d.value) : !d && S && g("");
256
250
  }, [
257
- C,
251
+ P,
258
252
  H,
259
253
  I,
260
254
  l,
261
- d,
262
- i,
255
+ S,
256
+ a,
263
257
  J,
264
258
  Z,
265
- X,
259
+ de,
266
260
  L,
267
261
  r,
268
- p
269
- ]), F(() => (_e(!0), () => {
262
+ g
263
+ ]), k(() => (Ze(!0), () => {
270
264
  M.current != null && clearTimeout(M.current);
271
- }), []), F(() => {
272
- re && ne && j(!1);
273
- }, [ne, re]), F(() => {
274
- ae && se && z(!1);
275
- }, [se, ae]);
276
- const Je = g((e) => {
277
- e && ce.current && Date.now() < ce.current || j(e);
278
- }, []), Xe = g((e) => {
279
- e && fe.current && Date.now() < fe.current || z(e);
280
- }, []), et = g((e) => {
281
- e && de.current && Date.now() < de.current || oe(e);
282
- }, []), tt = g(
265
+ }), []), k(() => {
266
+ ne && te && j(!1);
267
+ }, [te, ne]), k(() => {
268
+ se && ie && z(!1);
269
+ }, [ie, se]);
270
+ const Ge = p((e) => {
271
+ e && ue.current && Date.now() < ue.current || j(e);
272
+ }, []), Je = p((e) => {
273
+ e && ce.current && Date.now() < ce.current || z(e);
274
+ }, []), Xe = p((e) => {
275
+ e && fe.current && Date.now() < fe.current || ae(e);
276
+ }, []), et = p(
283
277
  (e, {
284
278
  openTimePicker: t,
285
- openEndDatePicker: m,
279
+ openEndDatePicker: f,
286
280
  close: u = !0
287
281
  } = {}) => {
288
- const v = t ?? E === "chained-times", D = m ?? E === "dates-first";
282
+ const D = t ?? E === "chained-times", T = f ?? E === "dates-first";
289
283
  if (!e) {
290
284
  u && j(!1);
291
285
  return;
292
286
  }
293
- a(e), (u || D) && (ce.current = Date.now() + 250, j(!1)), T && e > T && _(e), v && ie(!0), D && (M.current != null && clearTimeout(M.current), W ? (z(!0), M.current = null) : M.current = setTimeout(() => {
287
+ i(e), (u || T) && (ue.current = Date.now() + 250, j(!1)), m && e > m && _(e), D && re(!0), T && (M.current != null && clearTimeout(M.current), W ? (z(!0), M.current = null) : M.current = setTimeout(() => {
294
288
  z(!0);
295
289
  }, 100));
296
290
  },
297
- [T, W, _, a, E]
298
- ), nt = g(
291
+ [m, W, _, i, E]
292
+ ), tt = p(
299
293
  (e) => {
300
- O(e, "user"), ie(!1), M.current != null && clearTimeout(M.current), E === "chained-times" && e && n ? M.current = setTimeout(() => {
294
+ O(e, "user"), re(!1), M.current != null && clearTimeout(M.current), E === "chained-times" && e && n ? M.current = setTimeout(() => {
301
295
  z(!0);
302
296
  }, 100) : M.current = null;
303
297
  },
304
298
  [E, n, O]
305
- ), rt = g(
299
+ ), nt = p(
306
300
  (e) => {
307
301
  e && e !== r && O(e, "user");
308
302
  },
309
303
  [r, O]
310
- ), it = g(
304
+ ), rt = p(
311
305
  (e, {
312
306
  openTimePicker: t,
313
- close: m = !0,
307
+ close: f = !0,
314
308
  commit: u = E === "dates-first" ? W : !1
315
309
  } = {}) => {
316
- const v = t ?? E === "chained-times";
317
- let D = d;
310
+ const D = t ?? E === "chained-times";
311
+ let T = S;
318
312
  if (e && E === "dates-first") {
319
- if (i) {
320
- const c = A(e);
321
- c && ($.current = c);
313
+ if (a) {
314
+ const h = A(e);
315
+ h && ($.current = h);
322
316
  }
323
- const S = we(e);
324
- S && (D = S, p(S));
317
+ const d = we(e);
318
+ d && (T = d, g(d));
325
319
  }
326
- _(e), le(void 0), m && (fe.current = Date.now() + 250, z(!1)), e && v && oe(!0), e && u && Q && (typeof window > "u" ? Q(e, D) : requestAnimationFrame(() => Q(e, D)));
320
+ _(e), oe(void 0), f && (ce.current = Date.now() + 250, z(!1)), e && D && ae(!0), e && u && Q && (typeof window > "u" ? Q(e, T) : requestAnimationFrame(() => Q(e, T)));
327
321
  },
328
322
  [
329
- d,
330
- i,
323
+ S,
324
+ a,
331
325
  we,
332
326
  W,
333
327
  _,
334
328
  Q,
335
329
  E,
336
330
  A,
337
- p
331
+ g
338
332
  ]
339
- ), st = g(
333
+ ), it = p(
340
334
  (e) => {
341
- p(e, "user");
335
+ g(e, "user");
342
336
  },
343
- [p]
344
- ), at = g(
337
+ [g]
338
+ ), st = p(
345
339
  (e) => {
346
- $.current = void 0, p(e, "user"), de.current = Date.now() + 250, oe(!1), V && (typeof window > "u" ? V() : requestAnimationFrame(() => {
340
+ $.current = void 0, g(e, "user"), fe.current = Date.now() + 250, ae(!1), V && (typeof window > "u" ? V() : requestAnimationFrame(() => {
347
341
  requestAnimationFrame(V);
348
342
  }));
349
343
  },
350
- [V, p]
344
+ [V, g]
351
345
  );
352
346
  return {
353
347
  startDate: n,
354
348
  startTime: r,
355
- endDate: T,
356
- endTime: d,
357
- errors: Ie,
358
- labels: Le ?? ht,
359
- t: xe,
360
- language: he ?? Y,
361
- labelClassName: Re,
362
- inputClassName: Ke,
363
- buttonClassName: He,
364
- currencyCode: We,
349
+ endDate: m,
350
+ endTime: S,
351
+ errors: Be,
352
+ labels: Ie ?? ht,
353
+ t: Le,
354
+ language: ve ?? Y,
355
+ labelClassName: xe,
356
+ inputClassName: Re,
357
+ buttonClassName: Ke,
358
+ currencyCode: Ue,
365
359
  localeCode: Y,
366
360
  slotIntervalMinutes: L,
367
- dateLocale: qe,
361
+ dateLocale: Ne,
368
362
  numberOfMonths: W ? 1 : 2,
369
363
  isMobile: W,
370
- isHydrated: Ze,
371
- openDatePickerOnFocus: ze,
372
- withMobileDateDrawer: Ue,
364
+ isHydrated: $e,
365
+ openDatePickerOnFocus: We,
366
+ withMobileDateDrawer: He,
373
367
  selectionFlow: E,
374
- isStartDatePopoverOpen: ne,
375
- setIsStartDatePopoverOpen: Je,
376
- isStartTimeSelectOpen: re,
377
- setIsStartTimeSelectOpen: ie,
378
- isEndDatePopoverOpen: se,
379
- setIsEndDatePopoverOpen: Xe,
380
- isEndTimeSelectOpen: ae,
381
- setIsEndTimeSelectOpen: et,
382
- hoveredEndDate: $e,
383
- setHoveredEndDate: le,
384
- resetHoveredEndDate: Ye,
385
- startTimeSlots: k,
386
- availableEndTimeSlots: C,
368
+ isStartDatePopoverOpen: te,
369
+ setIsStartDatePopoverOpen: Ge,
370
+ isStartTimeSelectOpen: ne,
371
+ setIsStartTimeSelectOpen: re,
372
+ isEndDatePopoverOpen: ie,
373
+ setIsEndDatePopoverOpen: Je,
374
+ isEndTimeSelectOpen: se,
375
+ setIsEndTimeSelectOpen: Xe,
376
+ hoveredEndDate: qe,
377
+ setHoveredEndDate: oe,
378
+ resetHoveredEndDate: Ve,
379
+ startTimeSlots: F,
380
+ availableEndTimeSlots: P,
387
381
  isStartToday: B,
388
382
  isEndToday: Z,
389
- minSelectableDate: Ge,
383
+ minSelectableDate: je,
390
384
  earliestMinutesForToday: I,
391
- startMinutesValue: je,
392
- isSameDaySelection: X,
393
- updateStartTime: rt,
394
- selectStartDate: tt,
395
- selectStartTime: nt,
396
- selectEndDate: it,
397
- updateEndTime: st,
398
- selectEndTime: at
385
+ startMinutesValue: Ye,
386
+ isSameDaySelection: de,
387
+ updateStartTime: nt,
388
+ selectStartDate: et,
389
+ selectStartTime: tt,
390
+ selectEndDate: rt,
391
+ updateEndTime: it,
392
+ selectEndTime: st
399
393
  };
400
394
  };
401
395
  export {
402
- At as useBookingPeriodController
396
+ Bt as useBookingPeriodController
403
397
  };
@@ -72,7 +72,7 @@ function we({ preset: s, storeSlug: j }) {
72
72
  c ? /* @__PURE__ */ r("a", { className: x, href: c.href, target: "_blank", rel: "noreferrer", children: [
73
73
  /* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e("img", { src: U, className: "h-6 w-6", alt: "", "aria-hidden": "true" }) }),
74
74
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
75
- /* @__PURE__ */ e("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_whatsapp_label") }),
75
+ /* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_whatsapp_label") }),
76
76
  /* @__PURE__ */ e(
77
77
  w,
78
78
  {
@@ -87,7 +87,7 @@ function we({ preset: s, storeSlug: j }) {
87
87
  /* @__PURE__ */ r("a", { className: x, href: s.phone_href, children: [
88
88
  /* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(q, { className: "h-5 w-5", "aria-hidden": "true" }) }),
89
89
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
90
- /* @__PURE__ */ e("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_phone_label") }),
90
+ /* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_phone_label") }),
91
91
  /* @__PURE__ */ e(
92
92
  w,
93
93
  {
@@ -102,7 +102,7 @@ function we({ preset: s, storeSlug: j }) {
102
102
  /* @__PURE__ */ r("a", { className: x, href: `mailto:${s.email}`, children: [
103
103
  /* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(E, { className: "h-5 w-5", "aria-hidden": "true" }) }),
104
104
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
105
- /* @__PURE__ */ e("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_email_label") }),
105
+ /* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_email_label") }),
106
106
  /* @__PURE__ */ e(
107
107
  w,
108
108
  {
@@ -117,7 +117,7 @@ function we({ preset: s, storeSlug: j }) {
117
117
  /* @__PURE__ */ r("a", { className: x, href: P, target: "_blank", rel: "noreferrer", children: [
118
118
  /* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(H, { className: "h-5 w-5", "aria-hidden": "true" }) }),
119
119
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
120
- /* @__PURE__ */ e("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_address_label") }),
120
+ /* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_address_label") }),
121
121
  /* @__PURE__ */ e("span", { className: g, children: s.address })
122
122
  ] })
123
123
  ] })
@@ -100,7 +100,7 @@ function de({ preset: n, storefrontConfiguration: s, whatsappHref: l }) {
100
100
  children: /* @__PURE__ */ a(r, { to: R, children: [
101
101
  /* @__PURE__ */ e(F, { className: "h-4 w-4", "aria-hidden": "true" }),
102
102
  /* @__PURE__ */ e("span", { children: t("cart_button") }),
103
- /* @__PURE__ */ e(G, { className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-[11px]", children: /* @__PURE__ */ e("span", { children: p }) })
103
+ /* @__PURE__ */ e(G, { className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs", children: /* @__PURE__ */ e("span", { children: p }) })
104
104
  ] })
105
105
  }
106
106
  ),