@alfadocs/ui-kit 0.33.9 → 0.33.10

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.
@@ -1,43 +1,44 @@
1
- import { jsxs as g, jsx as a, Fragment as Y } from "react/jsx-runtime";
2
- import { forwardRef as Ge, useId as Ue, useState as q, useCallback as ie, useRef as se, useEffect as te, useMemo as C, useImperativeHandle as ft } from "react";
3
- import { c as Ie } from "./index-D2ZczOXr.js";
4
- import { useTranslation as _, Trans as ht } from "react-i18next";
5
- import { u as vt } from "./registry-nPAVE19X.js";
6
- import { A as L } from "./alert-ywPR59NE.js";
7
- import { B as ne } from "./button-DD_0Xdmr.js";
8
- import { C as Be } from "./checkbox-DRcOdmXv.js";
9
- import { C as bt } from "./checkbox-group-CpUwlHug.js";
10
- import { D as yt } from "./date-picker-B94HAV4A.js";
11
- import { E as kt } from "./email-input-lQivsFrw.js";
12
- import { F as U } from "./form-field-BOm9hK35.js";
13
- import { P as xt } from "./phone-input-DfZbPPvh.js";
14
- import { T as St } from "./text-area-BIx0tZ05.js";
15
- import { T as be } from "./text-input-BaClJL8Y.js";
16
- import { S as Nt } from "./spinner-CCByyvcb.js";
17
- import { I as $e } from "./icon-button-CKEOrN37.js";
18
- import { S as we } from "./select-hsCaJSX3.js";
19
- import { S as Se } from "./skeleton-CZbwyJAA.js";
20
- import { E as Ye } from "./empty-state-BLy7tigq.js";
21
- import { S as It } from "./stepper-accordion-BfS6lUB9.js";
22
- import { S as wt } from "./stepper-progress-DDjq5nei.js";
23
- import { p as ae } from "./parseISO-DEpUNwxZ.js";
24
- import { w as Ze, f as ue, d as Ct, h as xe, x as ye } from "./react-day-picker-DsjfS7uI.js";
25
- import { C as Mt } from "./chevron-left-CX1jqD2M.js";
26
- import { C as Dt } from "./chevron-right-BrpYejk0.js";
27
- import { i as Ke } from "./isSameDay-DUEiAT0G.js";
28
- import { c as B } from "./createLucideIcon-CrFbzy84.js";
29
- import { M as Tt, S as _t } from "./sun-BuXE0xUS.js";
30
- import { S as At } from "./stethoscope-DT5qCW8Y.js";
31
- import { H as Bt } from "./heart-pulse-CvuyFKHB.js";
32
- import { E as Ot } from "./eye-LHlSU38h.js";
33
- import { S as Et } from "./sparkles-CuYXqQLg.js";
1
+ import { jsxs as v, jsx as s, Fragment as W } from "react/jsx-runtime";
2
+ import { forwardRef as Je, useId as Xe, useState as j, useCallback as q, useRef as te, useEffect as ee, useMemo as w, useImperativeHandle as kt } from "react";
3
+ import { c as we } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as A, Trans as xt } from "react-i18next";
5
+ import { u as St } from "./registry-nPAVE19X.js";
6
+ import { A as $ } from "./alert-ywPR59NE.js";
7
+ import { B as ae } from "./button-DD_0Xdmr.js";
8
+ import { C as Re } from "./checkbox-DRcOdmXv.js";
9
+ import { C as Nt } from "./checkbox-group-CpUwlHug.js";
10
+ import { D as It } from "./date-picker-B94HAV4A.js";
11
+ import { E as wt } from "./email-input-lQivsFrw.js";
12
+ import { F as Y } from "./form-field-BOm9hK35.js";
13
+ import { P as Ct } from "./phone-input-DfZbPPvh.js";
14
+ import { T as Mt } from "./text-area-BIx0tZ05.js";
15
+ import { T as ye } from "./text-input-BaClJL8Y.js";
16
+ import { S as Dt } from "./spinner-CCByyvcb.js";
17
+ import { I as Ge } from "./icon-button-CKEOrN37.js";
18
+ import { S as Ce } from "./select-hsCaJSX3.js";
19
+ import { S as Ie } from "./skeleton-CZbwyJAA.js";
20
+ import { E as Qe } from "./empty-state-BLy7tigq.js";
21
+ import { S as _t } from "./stepper-accordion-BfS6lUB9.js";
22
+ import { S as Tt } from "./stepper-progress-DDjq5nei.js";
23
+ import { p as K, S as At } from "./slot-grid-BlHHP9Qy.js";
24
+ import { s as Ve, i as Ue } from "./isSameDay-DUEiAT0G.js";
25
+ import { w as et, n as pe, a as Le, f as ge, d as Bt, h as Ne, x as ke } from "./react-day-picker-DsjfS7uI.js";
26
+ import { s as Ot } from "./subDays-CANHP9hz.js";
27
+ import { C as Pt } from "./chevron-left-CX1jqD2M.js";
28
+ import { C as Et } from "./chevron-right-BrpYejk0.js";
29
+ import { c as P } from "./createLucideIcon-CrFbzy84.js";
30
+ import { M as Rt, S as Vt } from "./sun-BuXE0xUS.js";
31
+ import { S as Lt } from "./stethoscope-DT5qCW8Y.js";
32
+ import { H as Ft } from "./heart-pulse-CvuyFKHB.js";
33
+ import { E as $t } from "./eye-LHlSU38h.js";
34
+ import { S as zt } from "./sparkles-CuYXqQLg.js";
34
35
  /**
35
36
  * @license lucide-react v1.8.0 - ISC
36
37
  *
37
38
  * This source code is licensed under the ISC license.
38
39
  * See the LICENSE file in the root directory of this source tree.
39
40
  */
40
- const Pt = [
41
+ const Kt = [
41
42
  [
42
43
  "path",
43
44
  {
@@ -45,14 +46,14 @@ const Pt = [
45
46
  key: "169zse"
46
47
  }
47
48
  ]
48
- ], Vt = B("activity", Pt);
49
+ ], jt = P("activity", Kt);
49
50
  /**
50
51
  * @license lucide-react v1.8.0 - ISC
51
52
  *
52
53
  * This source code is licensed under the ISC license.
53
54
  * See the LICENSE file in the root directory of this source tree.
54
55
  */
55
- const Rt = [
56
+ const qt = [
56
57
  ["path", { d: "M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5", key: "1u7htd" }],
57
58
  ["path", { d: "M15 12h.01", key: "1k8ypt" }],
58
59
  [
@@ -63,14 +64,14 @@ const Rt = [
63
64
  }
64
65
  ],
65
66
  ["path", { d: "M9 12h.01", key: "157uk2" }]
66
- ], Lt = B("baby", Rt);
67
+ ], Ht = P("baby", qt);
67
68
  /**
68
69
  * @license lucide-react v1.8.0 - ISC
69
70
  *
70
71
  * This source code is licensed under the ISC license.
71
72
  * See the LICENSE file in the root directory of this source tree.
72
73
  */
73
- const Ft = [
74
+ const Gt = [
74
75
  [
75
76
  "path",
76
77
  {
@@ -78,14 +79,14 @@ const Ft = [
78
79
  key: "w610uw"
79
80
  }
80
81
  ]
81
- ], zt = B("bone", Ft);
82
+ ], Ut = P("bone", Gt);
82
83
  /**
83
84
  * @license lucide-react v1.8.0 - ISC
84
85
  *
85
86
  * This source code is licensed under the ISC license.
86
87
  * See the LICENSE file in the root directory of this source tree.
87
88
  */
88
- const $t = [
89
+ const Yt = [
89
90
  ["path", { d: "M12 18V5", key: "adv99a" }],
90
91
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
91
92
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -94,14 +95,14 @@ const $t = [
94
95
  ["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
95
96
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
96
97
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
97
- ], Kt = B("brain", $t);
98
+ ], Wt = P("brain", Yt);
98
99
  /**
99
100
  * @license lucide-react v1.8.0 - ISC
100
101
  *
101
102
  * This source code is licensed under the ISC license.
102
103
  * See the LICENSE file in the root directory of this source tree.
103
104
  */
104
- const jt = [
105
+ const Zt = [
105
106
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
106
107
  ["path", { d: "M16 2v4", key: "4m81vk" }],
107
108
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -110,14 +111,14 @@ const jt = [
110
111
  ["path", { d: "M13 18H7", key: "bb0bb7" }],
111
112
  ["path", { d: "M7 14h.01", key: "1qa3f1" }],
112
113
  ["path", { d: "M17 18h.01", key: "1bdyru" }]
113
- ], qt = B("calendar-range", jt);
114
+ ], Jt = P("calendar-range", Zt);
114
115
  /**
115
116
  * @license lucide-react v1.8.0 - ISC
116
117
  *
117
118
  * This source code is licensed under the ISC license.
118
119
  * See the LICENSE file in the root directory of this source tree.
119
120
  */
120
- const Ht = [
121
+ const Xt = [
121
122
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
122
123
  [
123
124
  "path",
@@ -127,89 +128,89 @@ const Ht = [
127
128
  }
128
129
  ],
129
130
  ["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
130
- ], Gt = B("clipboard-check", Ht);
131
+ ], Qt = P("clipboard-check", Xt);
131
132
  /**
132
133
  * @license lucide-react v1.8.0 - ISC
133
134
  *
134
135
  * This source code is licensed under the ISC license.
135
136
  * See the LICENSE file in the root directory of this source tree.
136
137
  */
137
- const Ut = [
138
+ const ea = [
138
139
  ["path", { d: "M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0", key: "1dfaln" }],
139
140
  ["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
140
- ], Yt = B("ear", Ut);
141
+ ], ta = P("ear", ea);
141
142
  /**
142
143
  * @license lucide-react v1.8.0 - ISC
143
144
  *
144
145
  * This source code is licensed under the ISC license.
145
146
  * See the LICENSE file in the root directory of this source tree.
146
147
  */
147
- const Zt = [
148
+ const aa = [
148
149
  ["path", { d: "M6 18h8", key: "1borvv" }],
149
150
  ["path", { d: "M3 22h18", key: "8prr45" }],
150
151
  ["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
151
152
  ["path", { d: "M9 14h2", key: "197e7h" }],
152
153
  ["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
153
154
  ["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
154
- ], Jt = B("microscope", Zt);
155
+ ], sa = P("microscope", aa);
155
156
  /**
156
157
  * @license lucide-react v1.8.0 - ISC
157
158
  *
158
159
  * This source code is licensed under the ISC license.
159
160
  * See the LICENSE file in the root directory of this source tree.
160
161
  */
161
- const Xt = [
162
+ const ia = [
162
163
  [
163
164
  "path",
164
165
  { d: "m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z", key: "wa1lgi" }
165
166
  ],
166
167
  ["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
167
- ], Wt = B("pill", Xt);
168
+ ], na = P("pill", ia);
168
169
  /**
169
170
  * @license lucide-react v1.8.0 - ISC
170
171
  *
171
172
  * This source code is licensed under the ISC license.
172
173
  * See the LICENSE file in the root directory of this source tree.
173
174
  */
174
- const Qt = [
175
+ const oa = [
175
176
  ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
176
177
  ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
177
178
  ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
178
179
  ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
179
180
  ["path", { d: "M7 12h10", key: "b7w52i" }]
180
- ], ea = B("scan-line", Qt);
181
+ ], ra = P("scan-line", oa);
181
182
  /**
182
183
  * @license lucide-react v1.8.0 - ISC
183
184
  *
184
185
  * This source code is licensed under the ISC license.
185
186
  * See the LICENSE file in the root directory of this source tree.
186
187
  */
187
- const ta = [
188
+ const da = [
188
189
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
189
190
  ["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
190
191
  ["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
191
192
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
192
193
  ["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
193
- ], aa = B("scissors", ta);
194
+ ], la = P("scissors", da);
194
195
  /**
195
196
  * @license lucide-react v1.8.0 - ISC
196
197
  *
197
198
  * This source code is licensed under the ISC license.
198
199
  * See the LICENSE file in the root directory of this source tree.
199
200
  */
200
- const sa = [
201
+ const ca = [
201
202
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
202
203
  ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
203
204
  ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
204
205
  ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
205
- ], ia = B("smile", sa);
206
+ ], ua = P("smile", ca);
206
207
  /**
207
208
  * @license lucide-react v1.8.0 - ISC
208
209
  *
209
210
  * This source code is licensed under the ISC license.
210
211
  * See the LICENSE file in the root directory of this source tree.
211
212
  */
212
- const na = [
213
+ const ma = [
213
214
  ["path", { d: "M12 10V2", key: "16sf7g" }],
214
215
  ["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
215
216
  ["path", { d: "M2 18h2", key: "j10viu" }],
@@ -218,25 +219,25 @@ const na = [
218
219
  ["path", { d: "M22 22H2", key: "19qnx5" }],
219
220
  ["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
220
221
  ["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
221
- ], oa = B("sunset", na);
222
+ ], pa = P("sunset", ma);
222
223
  /**
223
224
  * @license lucide-react v1.8.0 - ISC
224
225
  *
225
226
  * This source code is licensed under the ISC license.
226
227
  * See the LICENSE file in the root directory of this source tree.
227
228
  */
228
- const ra = [
229
+ const ga = [
229
230
  ["path", { d: "m18 2 4 4", key: "22kx64" }],
230
231
  ["path", { d: "m17 7 3-3", key: "1w1zoj" }],
231
232
  ["path", { d: "M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5", key: "1exhtz" }],
232
233
  ["path", { d: "m9 11 4 4", key: "rovt3i" }],
233
234
  ["path", { d: "m5 19-3 3", key: "59f2uf" }],
234
235
  ["path", { d: "m14 4 6 6", key: "yqp9t2" }]
235
- ], je = B("syringe", ra);
236
- function da(e, t, s) {
237
- return Ze(e, -1, s);
236
+ ], Ye = P("syringe", ga);
237
+ function fa(e, t, a) {
238
+ return et(e, -1, a);
238
239
  }
239
- const la = {
240
+ const ha = {
240
241
  id: "booking",
241
242
  capabilities: ["navigate", "view_change"],
242
243
  state: {
@@ -278,23 +279,23 @@ const la = {
278
279
  description: "Sourced from the id prop."
279
280
  }
280
281
  }
281
- }, Ee = [
282
+ }, Fe = [
282
283
  "email",
283
284
  "whatsapp",
284
285
  "sms"
285
- ], pe = "all", ca = "de";
286
- function ma(e) {
286
+ ], he = "all", va = "de";
287
+ function ba(e) {
287
288
  return [...e.lockedOperatorId ? e.specialties.filter(
288
- (s) => {
289
+ (a) => {
289
290
  var i;
290
- return (i = s.operatorIds) == null ? void 0 : i.includes(e.lockedOperatorId);
291
+ return (i = a.operatorIds) == null ? void 0 : i.includes(e.lockedOperatorId);
291
292
  }
292
- ) : e.specialties].sort((s, i) => {
293
- const n = s.sequenceNumber ?? Number.POSITIVE_INFINITY, o = i.sequenceNumber ?? Number.POSITIVE_INFINITY;
293
+ ) : e.specialties].sort((a, i) => {
294
+ const n = a.sequenceNumber ?? Number.POSITIVE_INFINITY, o = i.sequenceNumber ?? Number.POSITIVE_INFINITY;
294
295
  return n - o;
295
296
  });
296
297
  }
297
- function ua(e) {
298
+ function ya(e) {
298
299
  let t = e.services;
299
300
  return e.lockedOperatorId && (t = t.filter(
300
301
  (i) => {
@@ -303,44 +304,44 @@ function ua(e) {
303
304
  }
304
305
  )), (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && e.value.specialtyId && (t = t.filter((i) => i.specialtyId === e.value.specialtyId)), t;
305
306
  }
306
- function pa(e) {
307
+ function ka(e) {
307
308
  const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties;
308
309
  if (t && e.value.specialtyId) {
309
- const s = e.value.specialtyId;
310
+ const a = e.value.specialtyId;
310
311
  return e.operators.filter(
311
312
  (i) => {
312
313
  var n;
313
- return (n = i.specialtyIds) == null ? void 0 : n.includes(s);
314
+ return (n = i.specialtyIds) == null ? void 0 : n.includes(a);
314
315
  }
315
316
  );
316
317
  }
317
318
  if (!t && e.value.serviceId) {
318
- const s = e.value.serviceId;
319
+ const a = e.value.serviceId;
319
320
  return e.operators.filter(
320
321
  (i) => {
321
322
  var n;
322
- return (n = i.appointmentBookingReasonIds) == null ? void 0 : n.includes(s);
323
+ return (n = i.appointmentBookingReasonIds) == null ? void 0 : n.includes(a);
323
324
  }
324
325
  );
325
326
  }
326
327
  return [];
327
328
  }
328
- function ga(e, t) {
329
- const s = e.country === ca, i = !s || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, c = !o || e.value.specialtyId !== void 0, d = !c || e.value.serviceId !== void 0, p = t.operators, f = !!e.allowOperatorSelection && d && e.value.serviceId !== void 0 && !e.lockedOperatorId && p.length > 1, u = d && e.value.serviceId !== void 0, k = (!u || e.value.date !== void 0) && e.value.date !== void 0, v = (!k || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, w = !!e.value.serviceId && p.length === 0;
329
+ function xa(e, t) {
330
+ const a = e.country === va, i = !a || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, m = !o || e.value.specialtyId !== void 0, d = !m || e.value.serviceId !== void 0, c = t.operators, p = !!e.allowOperatorSelection && d && e.value.serviceId !== void 0 && !e.lockedOperatorId && c.length > 1, u = d && e.value.serviceId !== void 0, k = (!u || e.value.date !== void 0) && e.value.date !== void 0, N = (!k || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, x = !!e.value.serviceId && c.length === 0;
330
331
  return {
331
- insurance: s,
332
+ insurance: a,
332
333
  specialty: o,
333
- service: c,
334
- operator: f,
334
+ service: m,
335
+ operator: p,
335
336
  date: u,
336
337
  slot: k,
337
- details: v,
338
- onboardingIncomplete: w
338
+ details: N,
339
+ onboardingIncomplete: x
339
340
  };
340
341
  }
341
- function fa(e, t) {
342
- const s = [];
343
- t.insurance && s.push(1), t.specialty && s.push(2), s.push(3), t.operator && s.push(4), s.push(5), s.push(6), s.push(7);
342
+ function Sa(e, t) {
343
+ const a = [];
344
+ t.insurance && a.push(1), t.specialty && a.push(2), a.push(3), t.operator && a.push(4), a.push(5), a.push(6), a.push(7);
344
345
  const i = {
345
346
  1: e.value.insuranceType !== void 0,
346
347
  2: e.value.specialtyId !== void 0,
@@ -352,34 +353,34 @@ function fa(e, t) {
352
353
  // details fulfilment is owned by the form's own validation
353
354
  };
354
355
  return {
355
- currentStep: s.find((o) => !i[o]) ?? 7,
356
- visibleSteps: s
356
+ currentStep: a.find((o) => !i[o]) ?? 7,
357
+ visibleSteps: a
357
358
  };
358
359
  }
359
- function ha(e) {
360
+ function Na(e) {
360
361
  const t = {
361
- specialties: ma(e),
362
- services: ua(e),
363
- operators: pa(e)
364
- }, s = ga(e, t), { currentStep: i, visibleSteps: n } = fa(e, s);
362
+ specialties: ba(e),
363
+ services: ya(e),
364
+ operators: ka(e)
365
+ }, a = xa(e, t), { currentStep: i, visibleSteps: n } = Sa(e, a);
365
366
  let o;
366
367
  if (e.value.date && e.value.slotKey) {
367
368
  const d = e.availableSlots[e.value.date];
368
- d && (o = d.find((p) => p.key === e.value.slotKey));
369
+ d && (o = d.find((c) => c.key === e.value.slotKey));
369
370
  }
370
- const m = e.value.serviceId ? e.services.find((d) => d.id === e.value.serviceId) : void 0, c = e.value.serviceId !== void 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!s.insurance || e.value.insuranceType !== void 0) && (!s.specialty || e.value.specialtyId !== void 0);
371
+ const l = e.value.serviceId ? e.services.find((d) => d.id === e.value.serviceId) : void 0, m = e.value.serviceId !== void 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!a.insurance || e.value.insuranceType !== void 0) && (!a.specialty || e.value.specialtyId !== void 0);
371
372
  return {
372
- gates: s,
373
+ gates: a,
373
374
  filtered: t,
374
375
  currentStep: i,
375
376
  totalSteps: n.length,
376
377
  visibleSteps: n,
377
- isReadyToSubmit: c,
378
- durationMin: m == null ? void 0 : m.durationMin,
378
+ isReadyToSubmit: m,
379
+ durationMin: l == null ? void 0 : l.durationMin,
379
380
  selectedSlot: o
380
381
  };
381
382
  }
382
- function Je(e, t) {
383
+ function tt(e, t) {
383
384
  return {
384
385
  ...e,
385
386
  insuranceType: t,
@@ -391,7 +392,7 @@ function Je(e, t) {
391
392
  details: void 0
392
393
  };
393
394
  }
394
- function Xe(e, t) {
395
+ function at(e, t) {
395
396
  return {
396
397
  ...e,
397
398
  specialtyId: t,
@@ -402,20 +403,20 @@ function Xe(e, t) {
402
403
  details: void 0
403
404
  };
404
405
  }
405
- function We(e, t) {
406
+ function st(e, t) {
406
407
  return {
407
408
  ...e,
408
409
  serviceId: t,
409
410
  // Default the operator to the "All operators" sentinel so a patient
410
411
  // who doesn't care about picking lands on a satisfied step 4 without
411
412
  // any further input.
412
- operatorId: t ? pe : void 0,
413
+ operatorId: t ? he : void 0,
413
414
  date: void 0,
414
415
  slotKey: void 0,
415
416
  details: void 0
416
417
  };
417
418
  }
418
- function Qe(e, t) {
419
+ function it(e, t) {
419
420
  return {
420
421
  ...e,
421
422
  operatorId: t,
@@ -424,7 +425,7 @@ function Qe(e, t) {
424
425
  details: void 0
425
426
  };
426
427
  }
427
- function Ne(e, t) {
428
+ function Me(e, t) {
428
429
  return {
429
430
  ...e,
430
431
  date: t,
@@ -433,120 +434,120 @@ function Ne(e, t) {
433
434
  // since the user has already filled some fields.
434
435
  };
435
436
  }
436
- function et(e, t) {
437
+ function nt(e, t) {
437
438
  return {
438
439
  ...e,
439
440
  slotKey: t
440
441
  };
441
442
  }
442
- function va(e, t) {
443
- let s = e;
444
- if (t.lockedOperatorId && s.operatorId !== t.lockedOperatorId && (s = { ...s, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && s.specialtyId === void 0 && (s = { ...s, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
445
- const n = s.specialtyId ? t.services.filter((o) => o.specialtyId === s.specialtyId) : t.services;
446
- n.length === 1 && s.serviceId === void 0 && (s = { ...s, serviceId: n[0].id }, s.operatorId === void 0 && (s = { ...s, operatorId: pe }));
443
+ function Ia(e, t) {
444
+ let a = e;
445
+ if (t.lockedOperatorId && a.operatorId !== t.lockedOperatorId && (a = { ...a, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && a.specialtyId === void 0 && (a = { ...a, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
446
+ const n = a.specialtyId ? t.services.filter((o) => o.specialtyId === a.specialtyId) : t.services;
447
+ n.length === 1 && a.serviceId === void 0 && (a = { ...a, serviceId: n[0].id }, a.operatorId === void 0 && (a = { ...a, operatorId: he }));
447
448
  }
448
- return s;
449
+ return a;
449
450
  }
450
- function Pe(e) {
451
- if (e.operatorId && e.operatorId !== pe)
451
+ function $e(e) {
452
+ if (e.operatorId && e.operatorId !== he)
452
453
  return e.operatorId;
453
454
  }
454
- function ba(e) {
455
+ function wa(e) {
455
456
  if (!e) return !1;
456
457
  const t = e.trim();
457
458
  return /^\+?\d[\d\s\-()]{6,}$/.test(t);
458
459
  }
459
- function tt(e) {
460
- const t = e && e.length > 0 ? e : ["email"], s = new Set(t);
461
- return Ee.filter((i) => s.has(i));
460
+ function ot(e) {
461
+ const t = e && e.length > 0 ? e : ["email"], a = new Set(t);
462
+ return Fe.filter((i) => a.has(i));
462
463
  }
463
- function ya(e, t, s) {
464
- const i = tt(e), n = new Set(i);
465
- if (s)
466
- return Ee.filter(
467
- (p) => s.includes(p) && n.has(p)
464
+ function Ca(e, t, a) {
465
+ const i = ot(e), n = new Set(i);
466
+ if (a)
467
+ return Fe.filter(
468
+ (c) => a.includes(c) && n.has(c)
468
469
  );
469
470
  const o = [];
470
471
  n.has("email") && o.push("email");
471
- const m = ba(t), c = n.has("whatsapp");
472
- c && m && o.push("whatsapp"), !c && n.has("sms") && o.push("sms");
472
+ const l = wa(t), m = n.has("whatsapp");
473
+ m && l && o.push("whatsapp"), !m && n.has("sms") && o.push("sms");
473
474
  const d = new Set(o);
474
- return Ee.filter((p) => d.has(p));
475
+ return Fe.filter((c) => d.has(c));
475
476
  }
476
- const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 300, ke = { state: "idle" }, Ve = Ge(
477
+ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 300, xe = { state: "idle" }, ze = Je(
477
478
  ({
478
479
  value: e,
479
480
  onChange: t,
480
- onSubmit: s,
481
+ onSubmit: a,
481
482
  requireCodiceFiscale: i = !1,
482
483
  requireDateOfBirth: n = !1,
483
484
  requireInsuranceNumber: o = !1,
484
- insuranceType: m,
485
- showNote: c = !1,
485
+ insuranceType: l,
486
+ showNote: m = !1,
486
487
  showReturningPatientFlag: d = !1,
487
- privacyPolicyUrl: p,
488
- termsUrl: f,
488
+ privacyPolicyUrl: c,
489
+ termsUrl: p,
489
490
  validateCodiceFiscale: u,
490
- validateInsuranceNumber: x,
491
+ validateInsuranceNumber: S,
491
492
  submitting: k = !1,
492
493
  summarySlot: h,
493
- defaultPhoneCountry: v,
494
- confirmationChannels: w,
495
- defaultConfirmationChannels: N,
496
- submitError: S
497
- }, b) => {
498
- var R, j;
499
- const { t: r } = _(), O = Ue(), [D, y] = q(ke), [I, F] = q(ke), [A, Z] = q({}), E = ie(
500
- (l) => Z((M) => ({ ...M, [l]: !0 })),
494
+ defaultPhoneCountry: N,
495
+ confirmationChannels: x,
496
+ defaultConfirmationChannels: D,
497
+ submitError: b
498
+ }, f) => {
499
+ var Q, L;
500
+ const { t: r } = A(), _ = Xe(), [M, y] = j(xe), [C, B] = j(xe), [O, Z] = j({}), E = q(
501
+ (g) => Z((I) => ({ ...I, [g]: !0 })),
501
502
  []
502
- ), z = se(null), H = se(
503
+ ), z = te(null), G = te(
503
504
  null
504
505
  );
505
- te(
506
+ ee(
506
507
  () => () => {
507
- z.current && clearTimeout(z.current), H.current && clearTimeout(H.current);
508
+ z.current && clearTimeout(z.current), G.current && clearTimeout(G.current);
508
509
  },
509
510
  []
510
511
  );
511
- const T = ie(
512
- (l) => t({ ...e, ...l }),
512
+ const T = q(
513
+ (g) => t({ ...e, ...g }),
513
514
  [e, t]
514
- ), J = C(
515
- () => tt(w),
516
- [w]
517
- ), K = J.length >= 2, fe = se(!1);
518
- te(() => {
519
- if (!K) {
515
+ ), J = w(
516
+ () => ot(x),
517
+ [x]
518
+ ), H = J.length >= 2, ne = te(!1);
519
+ ee(() => {
520
+ if (!H) {
520
521
  e.confirmationChannels !== void 0 && T({ confirmationChannels: void 0 });
521
522
  return;
522
523
  }
523
524
  if (e.confirmationChannels !== void 0) {
524
- fe.current = !0;
525
+ ne.current = !0;
525
526
  return;
526
527
  }
527
- const l = ya(
528
+ const g = Ca(
528
529
  J,
529
530
  e.mobilePhone,
530
- N
531
+ D
531
532
  );
532
- fe.current = !0, T({ confirmationChannels: l });
533
+ ne.current = !0, T({ confirmationChannels: g });
533
534
  }, [
534
- K,
535
+ H,
535
536
  J,
536
537
  e.mobilePhone,
537
- N
538
+ D
538
539
  ]);
539
- const X = C(
540
+ const se = w(
540
541
  () => e.confirmationChannels ?? [],
541
542
  [e.confirmationChannels]
542
- ), he = K && X.length === 0;
543
- te(() => {
544
- const l = e.codiceFiscale;
545
- if (!i || !u || !l) {
546
- y(ke);
543
+ ), be = H && se.length === 0;
544
+ ee(() => {
545
+ const g = e.codiceFiscale;
546
+ if (!i || !u || !g) {
547
+ y(xe);
547
548
  return;
548
549
  }
549
- if (!ka.test(l)) {
550
+ if (!Ma.test(g)) {
550
551
  y({
551
552
  state: "invalid",
552
553
  hint: r("booking.details.codiceFiscale.invalidFormat")
@@ -554,9 +555,9 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
554
555
  return;
555
556
  }
556
557
  y({ state: "pending" }), z.current && clearTimeout(z.current), z.current = setTimeout(() => {
557
- u(l).then(
558
- (M) => y(
559
- M.valid ? { state: "valid" } : { state: "invalid", hint: M.hint }
558
+ u(g).then(
559
+ (I) => y(
560
+ I.valid ? { state: "valid" } : { state: "invalid", hint: I.hint }
560
561
  )
561
562
  ).catch(
562
563
  () => y({
@@ -564,50 +565,50 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
564
565
  hint: r("booking.details.codiceFiscale.unavailable")
565
566
  })
566
567
  );
567
- }, He);
568
+ }, Ze);
568
569
  }, [i, u, e.codiceFiscale, r]);
569
- const W = o && m === "public";
570
- te(() => {
571
- const l = e.insuranceNumber;
572
- if (!W || !x || !l) {
573
- F(ke);
570
+ const U = o && l === "public";
571
+ ee(() => {
572
+ const g = e.insuranceNumber;
573
+ if (!U || !S || !g) {
574
+ B(xe);
574
575
  return;
575
576
  }
576
- F({ state: "pending" }), H.current && clearTimeout(H.current), H.current = setTimeout(() => {
577
- x(l).then(
578
- (M) => F(
579
- M.valid ? { state: "valid" } : { state: "invalid", hint: M.hint }
577
+ B({ state: "pending" }), G.current && clearTimeout(G.current), G.current = setTimeout(() => {
578
+ S(g).then(
579
+ (I) => B(
580
+ I.valid ? { state: "valid" } : { state: "invalid", hint: I.hint }
580
581
  )
581
582
  ).catch(
582
- () => F({
583
+ () => B({
583
584
  state: "invalid",
584
585
  hint: r("booking.details.insuranceNumber.unavailable")
585
586
  })
586
587
  );
587
- }, He);
588
- }, [W, x, e.insuranceNumber, r]);
589
- const Q = C(
590
- () => !!(e.email && xa.test(e.email)),
588
+ }, Ze);
589
+ }, [U, S, e.insuranceNumber, r]);
590
+ const oe = w(
591
+ () => !!(e.email && Da.test(e.email)),
591
592
  [e.email]
592
- ), oe = C(
593
+ ), X = w(
593
594
  () => !!(e.mobilePhone && e.mobilePhone.length >= 6),
594
595
  [e.mobilePhone]
595
- ), Ce = C(() => {
596
- var l, M;
597
- return !(!((l = e.firstName) != null && l.trim()) || !((M = e.lastName) != null && M.trim()) || !Q || !oe || i && D.state !== "valid" || n && !e.dateOfBirth || W && I.state !== "valid");
596
+ ), De = w(() => {
597
+ var g, I;
598
+ return !(!((g = e.firstName) != null && g.trim()) || !((I = e.lastName) != null && I.trim()) || !oe || !X || i && M.state !== "valid" || n && !e.dateOfBirth || U && C.state !== "valid");
598
599
  }, [
599
600
  e.firstName,
600
601
  e.lastName,
601
- Q,
602
602
  oe,
603
+ X,
603
604
  i,
604
- D.state,
605
+ M.state,
605
606
  n,
606
607
  e.dateOfBirth,
607
- W,
608
- I.state
609
- ]), Me = !!(e.privacyConsent && e.termsConsent), re = !K || X.length > 0, ve = Ce && Me && re && !k, V = (l) => {
610
- if (l.preventDefault(), Z({
608
+ U,
609
+ C.state
610
+ ]), _e = !!(e.privacyConsent && e.termsConsent), Te = !H || se.length > 0, ie = De && _e && Te && !k, Ae = (g) => {
611
+ if (g.preventDefault(), Z({
611
612
  firstName: !0,
612
613
  lastName: !0,
613
614
  email: !0,
@@ -615,8 +616,8 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
615
616
  codiceFiscale: !0,
616
617
  dateOfBirth: !0,
617
618
  insuranceNumber: !0
618
- }), !ve) return;
619
- const M = {
619
+ }), !ie) return;
620
+ const I = {
620
621
  firstName: e.firstName.trim(),
621
622
  lastName: e.lastName.trim(),
622
623
  email: e.email.trim(),
@@ -631,15 +632,15 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
631
632
  // Only include when the picker was visible; otherwise the single
632
633
  // implicit channel is inferred backend-side from the practice
633
634
  // config.
634
- confirmationChannels: K ? X : void 0
635
+ confirmationChannels: H ? se : void 0
635
636
  };
636
- s(M);
637
- }, ee = (l, M) => {
638
- const G = M && /^https?:\/\//i.test(M) ? M : void 0;
639
- return G ? /* @__PURE__ */ a(
640
- ht,
637
+ a(I);
638
+ }, R = (g, I) => {
639
+ const re = I && /^https?:\/\//i.test(I) ? I : void 0;
640
+ return re ? /* @__PURE__ */ s(
641
+ xt,
641
642
  {
642
- i18nKey: l,
643
+ i18nKey: g,
643
644
  components: {
644
645
  // The `<Trans>` runtime injects link text from the i18n
645
646
  // string. The anchor renders empty at static-analysis time,
@@ -648,10 +649,10 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
648
649
  // label.
649
650
  policyLink: (
650
651
  // eslint-disable-next-line jsx-a11y/anchor-has-content
651
- /* @__PURE__ */ a(
652
+ /* @__PURE__ */ s(
652
653
  "a",
653
654
  {
654
- href: G,
655
+ href: re,
655
656
  target: "_blank",
656
657
  rel: "noopener noreferrer",
657
658
  className: "ds:underline ds:text-[var(--primary)]"
@@ -660,124 +661,124 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
660
661
  )
661
662
  }
662
663
  }
663
- ) : r(l);
664
+ ) : r(g);
664
665
  };
665
- return /* @__PURE__ */ g(
666
+ return /* @__PURE__ */ v(
666
667
  "form",
667
668
  {
668
- ref: b,
669
- id: O,
669
+ ref: f,
670
+ id: _,
670
671
  noValidate: !0,
671
- onSubmit: V,
672
+ onSubmit: Ae,
672
673
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
673
674
  children: [
674
675
  h,
675
- /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
676
- /* @__PURE__ */ a(
677
- U,
676
+ /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
677
+ /* @__PURE__ */ s(
678
+ Y,
678
679
  {
679
680
  label: r("booking.details.firstName.label"),
680
681
  required: !0,
681
- error: A.firstName && !((R = e.firstName) != null && R.trim()) ? r("booking.details.firstName.required") : void 0,
682
- children: /* @__PURE__ */ a(
683
- be,
682
+ error: O.firstName && !((Q = e.firstName) != null && Q.trim()) ? r("booking.details.firstName.required") : void 0,
683
+ children: /* @__PURE__ */ s(
684
+ ye,
684
685
  {
685
686
  autoComplete: "given-name",
686
687
  value: e.firstName ?? "",
687
- onChange: (l) => T({ firstName: l.target.value }),
688
+ onChange: (g) => T({ firstName: g.target.value }),
688
689
  onBlur: () => E("firstName")
689
690
  }
690
691
  )
691
692
  }
692
693
  ),
693
- /* @__PURE__ */ a(
694
- U,
694
+ /* @__PURE__ */ s(
695
+ Y,
695
696
  {
696
697
  label: r("booking.details.lastName.label"),
697
698
  required: !0,
698
- error: A.lastName && !((j = e.lastName) != null && j.trim()) ? r("booking.details.lastName.required") : void 0,
699
- children: /* @__PURE__ */ a(
700
- be,
699
+ error: O.lastName && !((L = e.lastName) != null && L.trim()) ? r("booking.details.lastName.required") : void 0,
700
+ children: /* @__PURE__ */ s(
701
+ ye,
701
702
  {
702
703
  autoComplete: "family-name",
703
704
  value: e.lastName ?? "",
704
- onChange: (l) => T({ lastName: l.target.value }),
705
+ onChange: (g) => T({ lastName: g.target.value }),
705
706
  onBlur: () => E("lastName")
706
707
  }
707
708
  )
708
709
  }
709
710
  )
710
711
  ] }),
711
- /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
712
- /* @__PURE__ */ a(
713
- U,
712
+ /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
713
+ /* @__PURE__ */ s(
714
+ Y,
714
715
  {
715
716
  label: r("booking.details.email.label"),
716
717
  required: !0,
717
- error: A.email && !Q ? r("booking.details.email.invalid") : void 0,
718
- children: /* @__PURE__ */ a(
719
- kt,
718
+ error: O.email && !oe ? r("booking.details.email.invalid") : void 0,
719
+ children: /* @__PURE__ */ s(
720
+ wt,
720
721
  {
721
722
  value: e.email ?? "",
722
- onChange: (l) => T({ email: l.target.value }),
723
+ onChange: (g) => T({ email: g.target.value }),
723
724
  onBlur: () => E("email")
724
725
  }
725
726
  )
726
727
  }
727
728
  ),
728
- /* @__PURE__ */ a(
729
- U,
729
+ /* @__PURE__ */ s(
730
+ Y,
730
731
  {
731
732
  label: r("booking.details.mobilePhone.label"),
732
733
  required: !0,
733
- error: A.mobilePhone && !oe ? r("booking.details.mobilePhone.invalid") : void 0,
734
- children: /* @__PURE__ */ a(
735
- xt,
734
+ error: O.mobilePhone && !X ? r("booking.details.mobilePhone.invalid") : void 0,
735
+ children: /* @__PURE__ */ s(
736
+ Ct,
736
737
  {
737
738
  value: e.mobilePhone ?? "",
738
- defaultCountry: v == null ? void 0 : v.toUpperCase(),
739
- onChange: (l) => {
740
- T({ mobilePhone: l }), E("mobilePhone");
739
+ defaultCountry: N == null ? void 0 : N.toUpperCase(),
740
+ onChange: (g) => {
741
+ T({ mobilePhone: g }), E("mobilePhone");
741
742
  }
742
743
  }
743
744
  )
744
745
  }
745
746
  )
746
747
  ] }),
747
- i || n ? /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
748
- i ? /* @__PURE__ */ a(
749
- U,
748
+ i || n ? /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
749
+ i ? /* @__PURE__ */ s(
750
+ Y,
750
751
  {
751
752
  label: r("booking.details.codiceFiscale.label"),
752
753
  required: !0,
753
- description: D.state === "pending" ? r("booking.details.codiceFiscale.checking") : r("booking.details.codiceFiscale.helper"),
754
- error: A.codiceFiscale && D.state === "invalid" ? D.hint ?? r("booking.details.codiceFiscale.invalid") : void 0,
755
- children: /* @__PURE__ */ a(
756
- be,
754
+ description: M.state === "pending" ? r("booking.details.codiceFiscale.checking") : r("booking.details.codiceFiscale.helper"),
755
+ error: O.codiceFiscale && M.state === "invalid" ? M.hint ?? r("booking.details.codiceFiscale.invalid") : void 0,
756
+ children: /* @__PURE__ */ s(
757
+ ye,
757
758
  {
758
759
  value: e.codiceFiscale ?? "",
759
760
  maxLength: 16,
760
- onChange: (l) => T({
761
- codiceFiscale: l.target.value.slice(0, 16).toUpperCase()
761
+ onChange: (g) => T({
762
+ codiceFiscale: g.target.value.slice(0, 16).toUpperCase()
762
763
  }),
763
764
  onBlur: () => E("codiceFiscale")
764
765
  }
765
766
  )
766
767
  }
767
768
  ) : null,
768
- n ? /* @__PURE__ */ a(
769
- U,
769
+ n ? /* @__PURE__ */ s(
770
+ Y,
770
771
  {
771
772
  label: r("booking.details.dateOfBirth.label"),
772
773
  required: !0,
773
- error: A.dateOfBirth && !e.dateOfBirth ? r("booking.details.dateOfBirth.required") : void 0,
774
- children: /* @__PURE__ */ a(
775
- yt,
774
+ error: O.dateOfBirth && !e.dateOfBirth ? r("booking.details.dateOfBirth.required") : void 0,
775
+ children: /* @__PURE__ */ s(
776
+ It,
776
777
  {
777
778
  value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
778
- onChange: (l) => {
779
+ onChange: (g) => {
779
780
  T({
780
- dateOfBirth: l ? l.toISOString().slice(0, 10) : void 0
781
+ dateOfBirth: g ? g.toISOString().slice(0, 10) : void 0
781
782
  }), E("dateOfBirth");
782
783
  }
783
784
  }
@@ -785,61 +786,61 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
785
786
  }
786
787
  ) : null
787
788
  ] }) : null,
788
- W ? /* @__PURE__ */ a(
789
- U,
789
+ U ? /* @__PURE__ */ s(
790
+ Y,
790
791
  {
791
792
  label: r("booking.details.insuranceNumber.label"),
792
793
  required: !0,
793
- description: I.state === "pending" ? r("booking.details.insuranceNumber.checking") : void 0,
794
- error: A.insuranceNumber && I.state === "invalid" ? I.hint ?? r("booking.details.insuranceNumber.invalid") : void 0,
795
- children: /* @__PURE__ */ a(
796
- be,
794
+ description: C.state === "pending" ? r("booking.details.insuranceNumber.checking") : void 0,
795
+ error: O.insuranceNumber && C.state === "invalid" ? C.hint ?? r("booking.details.insuranceNumber.invalid") : void 0,
796
+ children: /* @__PURE__ */ s(
797
+ ye,
797
798
  {
798
799
  value: e.insuranceNumber ?? "",
799
- onChange: (l) => T({ insuranceNumber: l.target.value }),
800
+ onChange: (g) => T({ insuranceNumber: g.target.value }),
800
801
  onBlur: () => E("insuranceNumber")
801
802
  }
802
803
  )
803
804
  }
804
805
  ) : null,
805
- c ? /* @__PURE__ */ a(
806
- U,
806
+ m ? /* @__PURE__ */ s(
807
+ Y,
807
808
  {
808
809
  label: r("booking.details.note.label"),
809
810
  description: r("booking.details.note.helper", {
810
- max: qe
811
+ max: We
811
812
  }),
812
- children: /* @__PURE__ */ a(
813
- St,
813
+ children: /* @__PURE__ */ s(
814
+ Mt,
814
815
  {
815
816
  value: e.note ?? "",
816
- maxLength: qe,
817
+ maxLength: We,
817
818
  rows: 3,
818
- onChange: (l) => T({ note: l.target.value })
819
+ onChange: (g) => T({ note: g.target.value })
819
820
  }
820
821
  )
821
822
  }
822
823
  ) : null,
823
- d ? /* @__PURE__ */ a(
824
- Be,
824
+ d ? /* @__PURE__ */ s(
825
+ Re,
825
826
  {
826
827
  checked: !!e.returningPatient,
827
- onCheckedChange: (l) => T({ returningPatient: l === !0 }),
828
+ onCheckedChange: (g) => T({ returningPatient: g === !0 }),
828
829
  label: r("booking.details.returningPatient.label")
829
830
  }
830
831
  ) : null,
831
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
832
- /* @__PURE__ */ a(
833
- Be,
832
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
833
+ /* @__PURE__ */ s(
834
+ Re,
834
835
  {
835
836
  checked: !!e.privacyConsent,
836
- onCheckedChange: (l) => T({ privacyConsent: l === !0 }),
837
- label: /* @__PURE__ */ g(Y, { children: [
838
- ee(
837
+ onCheckedChange: (g) => T({ privacyConsent: g === !0 }),
838
+ label: /* @__PURE__ */ v(W, { children: [
839
+ R(
839
840
  "booking.details.consent.privacy.label",
840
- p
841
+ c
841
842
  ),
842
- /* @__PURE__ */ a(
843
+ /* @__PURE__ */ s(
843
844
  "span",
844
845
  {
845
846
  "aria-hidden": "true",
@@ -850,17 +851,17 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
850
851
  ] })
851
852
  }
852
853
  ),
853
- /* @__PURE__ */ a(
854
- Be,
854
+ /* @__PURE__ */ s(
855
+ Re,
855
856
  {
856
857
  checked: !!e.termsConsent,
857
- onCheckedChange: (l) => T({ termsConsent: l === !0 }),
858
- label: /* @__PURE__ */ g(Y, { children: [
859
- ee(
858
+ onCheckedChange: (g) => T({ termsConsent: g === !0 }),
859
+ label: /* @__PURE__ */ v(W, { children: [
860
+ R(
860
861
  "booking.details.consent.terms.label",
861
- f
862
+ p
862
863
  ),
863
- /* @__PURE__ */ a(
864
+ /* @__PURE__ */ s(
864
865
  "span",
865
866
  {
866
867
  "aria-hidden": "true",
@@ -872,39 +873,39 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
872
873
  }
873
874
  )
874
875
  ] }),
875
- K ? /* @__PURE__ */ a(
876
+ H ? /* @__PURE__ */ s(
876
877
  "div",
877
878
  {
878
879
  "data-component": "booking-confirmation-channels",
879
880
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
880
- children: /* @__PURE__ */ a(
881
- bt,
881
+ children: /* @__PURE__ */ s(
882
+ Nt,
882
883
  {
883
884
  label: r("booking.confirmation.heading"),
884
885
  helperText: r("booking.confirmation.helper"),
885
- value: X,
886
- onChange: (l) => T({
887
- confirmationChannels: l
886
+ value: se,
887
+ onChange: (g) => T({
888
+ confirmationChannels: g
888
889
  }),
889
890
  orientation: "vertical",
890
- options: J.map((l) => ({
891
- value: l,
892
- label: r(`booking.confirmation.channel.${l}`)
891
+ options: J.map((g) => ({
892
+ value: g,
893
+ label: r(`booking.confirmation.channel.${g}`)
893
894
  })),
894
- error: he ? r("booking.confirmation.atLeastOne") : void 0
895
+ error: be ? r("booking.confirmation.atLeastOne") : void 0
895
896
  }
896
897
  )
897
898
  }
898
899
  ) : null,
899
- S ? /* @__PURE__ */ a(L, { variant: "error", children: /* @__PURE__ */ a(L.Description, { children: S }) }) : null,
900
- /* @__PURE__ */ a(
901
- ne,
900
+ b ? /* @__PURE__ */ s($, { variant: "error", children: /* @__PURE__ */ s($.Description, { children: b }) }) : null,
901
+ /* @__PURE__ */ s(
902
+ ae,
902
903
  {
903
904
  intent: "primary",
904
905
  size: "md",
905
906
  type: "submit",
906
- disabled: !ve,
907
- startIcon: k ? /* @__PURE__ */ a(Nt, { size: "sm" }) : void 0,
907
+ disabled: !ie,
908
+ startIcon: k ? /* @__PURE__ */ s(Dt, { size: "sm" }) : void 0,
908
909
  children: r("booking.details.submit")
909
910
  }
910
911
  )
@@ -913,8 +914,8 @@ const qe = 500, ka = /^[A-Z0-9]{16}$/, xa = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, He = 3
913
914
  );
914
915
  }
915
916
  );
916
- Ve.displayName = "BookingDetailsForm";
917
- const Sa = Ie(
917
+ ze.displayName = "BookingDetailsForm";
918
+ const _a = we(
918
919
  "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
919
920
  {
920
921
  variants: {
@@ -942,40 +943,40 @@ const Sa = Ie(
942
943
  },
943
944
  defaultVariants: { variant: "inline-list", surface: "flat" }
944
945
  }
945
- ), Na = [
946
+ ), Ta = [
946
947
  [
947
948
  /\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
948
- je
949
+ Ye
949
950
  ],
950
- [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Bt],
951
- [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, ia],
952
- [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, Ot],
953
- [/\b(otorin|udito|orecchi|hearing|ear)/i, Yt],
954
- [/\b(neuro|brain|cervello)/i, Kt],
955
- [/\b(pediatr|child|bambin)/i, Lt],
956
- [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, zt],
957
- [/\b(lab|analis|test|sang|esami)/i, Jt],
958
- [/\b(farmaco|pharm|pillol|refill)/i, Wt],
959
- [/\b(chirurg|surg|intervent|operat)/i, aa],
960
- [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, ea],
961
- [/\b(vacc|inject|inie|punto)/i, je],
962
- [/\b(derma|skin|pelle)/i, Et],
963
- [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, Gt],
964
- [/\b(general|medicin|family|control|check[-\s]?up)/i, Vt]
951
+ [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Ft],
952
+ [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, ua],
953
+ [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, $t],
954
+ [/\b(otorin|udito|orecchi|hearing|ear)/i, ta],
955
+ [/\b(neuro|brain|cervello)/i, Wt],
956
+ [/\b(pediatr|child|bambin)/i, Ht],
957
+ [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, Ut],
958
+ [/\b(lab|analis|test|sang|esami)/i, sa],
959
+ [/\b(farmaco|pharm|pillol|refill)/i, na],
960
+ [/\b(chirurg|surg|intervent|operat)/i, la],
961
+ [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, ra],
962
+ [/\b(vacc|inject|inie|punto)/i, Ye],
963
+ [/\b(derma|skin|pelle)/i, zt],
964
+ [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, Qt],
965
+ [/\b(general|medicin|family|control|check[-\s]?up)/i, jt]
965
966
  ];
966
- function Ia(e) {
967
- for (const [t, s] of Na)
968
- if (t.test(e)) return s;
967
+ function Aa(e) {
968
+ for (const [t, a] of Ta)
969
+ if (t.test(e)) return a;
969
970
  return null;
970
971
  }
971
- function wa(e) {
972
- const t = Ia(e.label) ?? At;
973
- return /* @__PURE__ */ a(t, { "aria-hidden": "true", className: "ds:size-5" });
972
+ function Ba(e) {
973
+ const t = Aa(e.label) ?? Lt;
974
+ return /* @__PURE__ */ s(t, { "aria-hidden": "true", className: "ds:size-5" });
974
975
  }
975
- function Oe(e) {
976
- return xe(e, "yyyy-MM-dd");
976
+ function fe(e) {
977
+ return Ne(e, "yyyy-MM-dd");
977
978
  }
978
- const Ca = [
979
+ const Oa = [
979
980
  "ds:relative ds:flex ds:items-center ds:justify-center",
980
981
  "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
981
982
  "ds:rounded-[var(--radius-sm)]",
@@ -985,7 +986,7 @@ const Ca = [
985
986
  "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
986
987
  "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
987
988
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
988
- ].join(" "), Ma = Ie(Ca, {
989
+ ].join(" "), Pa = we(Oa, {
989
990
  variants: {
990
991
  state: {
991
992
  available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
@@ -996,93 +997,93 @@ const Ca = [
996
997
  },
997
998
  defaultVariants: { state: "unavailable" }
998
999
  });
999
- function at({
1000
+ function Ea({
1000
1001
  availableDates: e,
1001
1002
  selectedDate: t,
1002
- onSelectDate: s,
1003
+ onSelectDate: a,
1003
1004
  locale: i,
1004
1005
  loading: n
1005
1006
  }) {
1006
- const { t: o } = _(), m = C(() => t ? ue(ae(t)) : e.length > 0 ? ue(ae(e[0])) : ue(/* @__PURE__ */ new Date()), [t, e]), [c, d] = q(m), [p, f] = q(null), u = C(() => {
1007
- const S = ue(c), b = Ct(c), r = S.getDay(), O = b.getDate(), D = [];
1007
+ const { t: o } = A(), l = w(() => t ? ge(K(t)) : e.length > 0 ? ge(K(e[0])) : ge(/* @__PURE__ */ new Date()), [t, e]), [m, d] = j(l), [c, p] = j(null), u = w(() => {
1008
+ const b = ge(m), f = Bt(m), r = b.getDay(), _ = f.getDate(), M = [];
1008
1009
  for (let y = r; y > 0; y -= 1) {
1009
- const I = new Date(S);
1010
- I.setDate(S.getDate() - y), D.push(I);
1010
+ const C = new Date(b);
1011
+ C.setDate(b.getDate() - y), M.push(C);
1011
1012
  }
1012
- for (let y = 0; y < O; y += 1) {
1013
- const I = new Date(S);
1014
- I.setDate(S.getDate() + y), D.push(I);
1013
+ for (let y = 0; y < _; y += 1) {
1014
+ const C = new Date(b);
1015
+ C.setDate(b.getDate() + y), M.push(C);
1015
1016
  }
1016
- for (; D.length < 42; ) {
1017
- const y = D[D.length - 1], I = new Date(y);
1018
- I.setDate(y.getDate() + 1), D.push(I);
1017
+ for (; M.length < 42; ) {
1018
+ const y = M[M.length - 1], C = new Date(y);
1019
+ C.setDate(y.getDate() + 1), M.push(C);
1019
1020
  }
1020
- return D;
1021
- }, [c]), x = C(() => {
1021
+ return M;
1022
+ }, [m]), S = w(() => {
1022
1023
  try {
1023
1024
  return new Intl.DateTimeFormat(i, {
1024
1025
  month: "long",
1025
1026
  year: "numeric"
1026
- }).format(c);
1027
+ }).format(m);
1027
1028
  } catch {
1028
- return xe(c, "MMMM yyyy");
1029
+ return Ne(m, "MMMM yyyy");
1029
1030
  }
1030
- }, [c, i]), k = C(() => {
1031
- const S = new Date(2024, 0, 7);
1032
- return Array.from({ length: 7 }, (b, r) => {
1033
- const O = new Date(S);
1034
- O.setDate(S.getDate() + r);
1031
+ }, [m, i]), k = w(() => {
1032
+ const b = new Date(2024, 0, 7);
1033
+ return Array.from({ length: 7 }, (f, r) => {
1034
+ const _ = new Date(b);
1035
+ _.setDate(b.getDate() + r);
1035
1036
  try {
1036
- return new Intl.DateTimeFormat(i, { weekday: "short" }).format(O);
1037
+ return new Intl.DateTimeFormat(i, { weekday: "short" }).format(_);
1037
1038
  } catch {
1038
- return xe(O, "EEE");
1039
+ return Ne(_, "EEE");
1039
1040
  }
1040
1041
  });
1041
- }, [i]), h = C(() => new Set(e), [e]), v = ie(
1042
- (S) => h.has(Oe(S)),
1042
+ }, [i]), h = w(() => new Set(e), [e]), N = q(
1043
+ (b) => h.has(fe(b)),
1043
1044
  [h]
1044
- ), w = C(() => {
1045
- if (p) return p;
1046
- if (t) return ae(t);
1047
- const S = u.find(
1048
- (b) => ye(b, c) && v(b)
1045
+ ), x = w(() => {
1046
+ if (c) return c;
1047
+ if (t) return K(t);
1048
+ const b = u.find(
1049
+ (f) => ke(f, m) && N(f)
1049
1050
  );
1050
- return S || (u.find((b) => ye(b, c)) ?? null);
1051
- }, [p, t, u, c, v]), N = ie(
1052
- (S, b) => {
1051
+ return b || (u.find((f) => ke(f, m)) ?? null);
1052
+ }, [c, t, u, m, N]), D = q(
1053
+ (b, f) => {
1053
1054
  let r = null;
1054
- switch (S.key) {
1055
+ switch (b.key) {
1055
1056
  case "ArrowLeft":
1056
- r = new Date(b), r.setDate(b.getDate() - 1);
1057
+ r = new Date(f), r.setDate(f.getDate() - 1);
1057
1058
  break;
1058
1059
  case "ArrowRight":
1059
- r = new Date(b), r.setDate(b.getDate() + 1);
1060
+ r = new Date(f), r.setDate(f.getDate() + 1);
1060
1061
  break;
1061
1062
  case "ArrowUp":
1062
- r = new Date(b), r.setDate(b.getDate() - 7);
1063
+ r = new Date(f), r.setDate(f.getDate() - 7);
1063
1064
  break;
1064
1065
  case "ArrowDown":
1065
- r = new Date(b), r.setDate(b.getDate() + 7);
1066
+ r = new Date(f), r.setDate(f.getDate() + 7);
1066
1067
  break;
1067
1068
  case "Home":
1068
- r = new Date(b), r.setDate(b.getDate() - b.getDay());
1069
+ r = new Date(f), r.setDate(f.getDate() - f.getDay());
1069
1070
  break;
1070
1071
  case "End":
1071
- r = new Date(b), r.setDate(b.getDate() + (6 - b.getDay()));
1072
+ r = new Date(f), r.setDate(f.getDate() + (6 - f.getDay()));
1072
1073
  break;
1073
1074
  case "Enter":
1074
1075
  case " ": {
1075
- S.preventDefault(), v(b) && s(Oe(b));
1076
+ b.preventDefault(), N(f) && a(fe(f));
1076
1077
  return;
1077
1078
  }
1078
1079
  default:
1079
1080
  return;
1080
1081
  }
1081
- r && (S.preventDefault(), ye(r, c) || d(ue(r)), f(r));
1082
+ r && (b.preventDefault(), ke(r, m) || d(ge(r)), p(r));
1082
1083
  },
1083
- [v, s, c]
1084
+ [N, a, m]
1084
1085
  );
1085
- return n ? /* @__PURE__ */ g(
1086
+ return n ? /* @__PURE__ */ v(
1086
1087
  "div",
1087
1088
  {
1088
1089
  role: "status",
@@ -1090,114 +1091,114 @@ function at({
1090
1091
  "aria-label": o("common.loading"),
1091
1092
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1092
1093
  children: [
1093
- /* @__PURE__ */ a(Se, { variant: "text", width: "40%" }),
1094
- /* @__PURE__ */ a("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (S, b) => /* @__PURE__ */ a(Se, { variant: "rounded", height: "2.5rem" }, `mg-skel-${b}`)) })
1094
+ /* @__PURE__ */ s(Ie, { variant: "text", width: "40%" }),
1095
+ /* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (b, f) => /* @__PURE__ */ s(Ie, { variant: "rounded", height: "2.5rem" }, `mg-skel-${f}`)) })
1095
1096
  ]
1096
1097
  }
1097
- ) : /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1098
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1099
- /* @__PURE__ */ a(
1100
- $e,
1098
+ ) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1099
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1100
+ /* @__PURE__ */ s(
1101
+ Ge,
1101
1102
  {
1102
- icon: /* @__PURE__ */ a(Mt, {}),
1103
+ icon: /* @__PURE__ */ s(Pt, {}),
1103
1104
  "aria-label": o("booking.previousMonth"),
1104
1105
  size: "sm",
1105
1106
  intent: "ghost",
1106
1107
  flipIconInRtl: !0,
1107
1108
  onClick: () => {
1108
- d((S) => da(S)), f(null);
1109
+ d((b) => fa(b)), p(null);
1109
1110
  }
1110
1111
  }
1111
1112
  ),
1112
- /* @__PURE__ */ a(
1113
+ /* @__PURE__ */ s(
1113
1114
  "span",
1114
1115
  {
1115
1116
  className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
1116
1117
  "aria-live": "polite",
1117
- children: x
1118
+ children: S
1118
1119
  }
1119
1120
  ),
1120
- /* @__PURE__ */ a(
1121
- $e,
1121
+ /* @__PURE__ */ s(
1122
+ Ge,
1122
1123
  {
1123
- icon: /* @__PURE__ */ a(Dt, {}),
1124
+ icon: /* @__PURE__ */ s(Et, {}),
1124
1125
  "aria-label": o("booking.nextMonth"),
1125
1126
  size: "sm",
1126
1127
  intent: "ghost",
1127
1128
  flipIconInRtl: !0,
1128
1129
  onClick: () => {
1129
- d((S) => Ze(S, 1)), f(null);
1130
+ d((b) => et(b, 1)), p(null);
1130
1131
  }
1131
1132
  }
1132
1133
  )
1133
1134
  ] }),
1134
- /* @__PURE__ */ g(
1135
+ /* @__PURE__ */ v(
1135
1136
  "div",
1136
1137
  {
1137
1138
  role: "grid",
1138
1139
  "aria-label": o("booking.monthGridLabel"),
1139
1140
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
1140
1141
  children: [
1141
- /* @__PURE__ */ a(
1142
+ /* @__PURE__ */ s(
1142
1143
  "div",
1143
1144
  {
1144
1145
  role: "row",
1145
1146
  className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1146
- children: k.map((S, b) => /* @__PURE__ */ a(
1147
+ children: k.map((b, f) => /* @__PURE__ */ s(
1147
1148
  "div",
1148
1149
  {
1149
1150
  role: "columnheader",
1150
1151
  className: "type-meta ds:text-center ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-medium)]",
1151
- children: S
1152
+ children: b
1152
1153
  },
1153
- `wd-${b}`
1154
+ `wd-${f}`
1154
1155
  ))
1155
1156
  }
1156
1157
  ),
1157
- Array.from({ length: 6 }, (S, b) => /* @__PURE__ */ a(
1158
+ Array.from({ length: 6 }, (b, f) => /* @__PURE__ */ s(
1158
1159
  "div",
1159
1160
  {
1160
1161
  role: "row",
1161
1162
  className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1162
- children: u.slice(b * 7, b * 7 + 7).map((r, O) => {
1163
- const D = b * 7 + O, y = ye(r, c), I = y && v(r), F = t ? Ke(r, ae(t)) : !1, A = y ? F ? "selected" : I ? "available" : "unavailable" : "outside", Z = w ? Ke(w, r) : !1, E = (() => {
1163
+ children: u.slice(f * 7, f * 7 + 7).map((r, _) => {
1164
+ const M = f * 7 + _, y = ke(r, m), C = y && N(r), B = t ? Ue(r, K(t)) : !1, O = y ? B ? "selected" : C ? "available" : "unavailable" : "outside", Z = x ? Ue(x, r) : !1, E = (() => {
1164
1165
  try {
1165
1166
  return new Intl.DateTimeFormat(i, {
1166
1167
  dateStyle: "full"
1167
1168
  }).format(r);
1168
1169
  } catch {
1169
- return xe(r, "PPP");
1170
+ return Ne(r, "PPP");
1170
1171
  }
1171
1172
  })();
1172
- return /* @__PURE__ */ a(
1173
+ return /* @__PURE__ */ s(
1173
1174
  "button",
1174
1175
  {
1175
1176
  type: "button",
1176
1177
  role: "gridcell",
1177
1178
  "aria-label": E,
1178
- "aria-selected": F || void 0,
1179
- "aria-disabled": !I || void 0,
1179
+ "aria-selected": B || void 0,
1180
+ "aria-disabled": !C || void 0,
1180
1181
  tabIndex: Z ? 0 : -1,
1181
- disabled: !I,
1182
+ disabled: !C,
1182
1183
  onClick: () => {
1183
- I && s(Oe(r));
1184
+ C && a(fe(r));
1184
1185
  },
1185
- onKeyDown: (z) => N(z, r),
1186
- className: Ma({ state: A }),
1187
- children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: r.getDate() })
1186
+ onKeyDown: (z) => D(z, r),
1187
+ className: Pa({ state: O }),
1188
+ children: /* @__PURE__ */ s("span", { "aria-hidden": "true", children: r.getDate() })
1188
1189
  },
1189
- `mg-cell-${D}`
1190
+ `mg-cell-${M}`
1190
1191
  );
1191
1192
  })
1192
1193
  },
1193
- `mg-row-${b}`
1194
+ `mg-row-${f}`
1194
1195
  ))
1195
1196
  ]
1196
1197
  }
1197
1198
  )
1198
1199
  ] });
1199
1200
  }
1200
- const Da = Ie(
1201
+ const Ra = we(
1201
1202
  [
1202
1203
  "ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
1203
1204
  "ds:min-h-[var(--min-target-size)]",
@@ -1223,109 +1224,109 @@ const Da = Ie(
1223
1224
  defaultVariants: { state: "idle" }
1224
1225
  }
1225
1226
  );
1226
- function Ta({
1227
+ function Va({
1227
1228
  services: e,
1228
1229
  selectedServiceId: t,
1229
- onSelect: s
1230
+ onSelect: a
1230
1231
  }) {
1231
- const { t: i } = _(), n = Ue(), [o, m] = q(() => {
1232
+ const { t: i } = A(), n = Xe(), [o, l] = j(() => {
1232
1233
  if (t) {
1233
- const f = e.findIndex((u) => u.id === t);
1234
- if (f >= 0) return f;
1234
+ const p = e.findIndex((u) => u.id === t);
1235
+ if (p >= 0) return p;
1235
1236
  }
1236
1237
  return 0;
1237
- }), c = se(/* @__PURE__ */ new Map()), d = ie((f) => {
1238
+ }), m = te(/* @__PURE__ */ new Map()), d = q((p) => {
1238
1239
  var u;
1239
- (u = c.current.get(f)) == null || u.focus();
1240
- }, []), p = ie(
1241
- (f, u, x) => {
1240
+ (u = m.current.get(p)) == null || u.focus();
1241
+ }, []), c = q(
1242
+ (p, u, S) => {
1242
1243
  const k = e.length;
1243
1244
  if (k !== 0)
1244
- switch (f.key) {
1245
+ switch (p.key) {
1245
1246
  case "ArrowDown":
1246
1247
  case "ArrowRight": {
1247
- f.preventDefault();
1248
+ p.preventDefault();
1248
1249
  const h = (u + 1) % k;
1249
- m(h), d(h);
1250
+ l(h), d(h);
1250
1251
  break;
1251
1252
  }
1252
1253
  case "ArrowUp":
1253
1254
  case "ArrowLeft": {
1254
- f.preventDefault();
1255
+ p.preventDefault();
1255
1256
  const h = (u - 1 + k) % k;
1256
- m(h), d(h);
1257
+ l(h), d(h);
1257
1258
  break;
1258
1259
  }
1259
1260
  case "Home": {
1260
- f.preventDefault(), m(0), d(0);
1261
+ p.preventDefault(), l(0), d(0);
1261
1262
  break;
1262
1263
  }
1263
1264
  case "End": {
1264
- f.preventDefault();
1265
+ p.preventDefault();
1265
1266
  const h = k - 1;
1266
- m(h), d(h);
1267
+ l(h), d(h);
1267
1268
  break;
1268
1269
  }
1269
1270
  case "Enter":
1270
1271
  case " ": {
1271
- f.preventDefault(), s(x);
1272
+ p.preventDefault(), a(S);
1272
1273
  break;
1273
1274
  }
1274
1275
  }
1275
1276
  },
1276
- [e.length, d, s]
1277
+ [e.length, d, a]
1277
1278
  );
1278
- return e.length === 0 ? null : /* @__PURE__ */ a(
1279
+ return e.length === 0 ? null : /* @__PURE__ */ s(
1279
1280
  "div",
1280
1281
  {
1281
1282
  role: "radiogroup",
1282
1283
  "aria-label": i("booking.serviceListLabel"),
1283
1284
  id: n,
1284
1285
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1285
- children: e.map((f, u) => {
1286
- const x = t === f.id, k = o === u, h = i("booking.serviceCardLabel", {
1287
- label: f.label,
1288
- duration: f.durationMin
1289
- }), v = wa(f);
1290
- return /* @__PURE__ */ g(
1286
+ children: e.map((p, u) => {
1287
+ const S = t === p.id, k = o === u, h = i("booking.serviceCardLabel", {
1288
+ label: p.label,
1289
+ duration: p.durationMin
1290
+ }), N = Ba(p);
1291
+ return /* @__PURE__ */ v(
1291
1292
  "button",
1292
1293
  {
1293
- ref: (w) => {
1294
- w ? c.current.set(u, w) : c.current.delete(u);
1294
+ ref: (x) => {
1295
+ x ? m.current.set(u, x) : m.current.delete(u);
1295
1296
  },
1296
1297
  type: "button",
1297
1298
  role: "radio",
1298
- "aria-checked": x,
1299
+ "aria-checked": S,
1299
1300
  "aria-label": h,
1300
1301
  tabIndex: k ? 0 : -1,
1301
- onClick: () => s(f.id),
1302
- onFocus: () => m(u),
1303
- onKeyDown: (w) => p(w, u, f.id),
1304
- className: Da({
1305
- state: x ? "selected" : "idle"
1302
+ onClick: () => a(p.id),
1303
+ onFocus: () => l(u),
1304
+ onKeyDown: (x) => c(x, u, p.id),
1305
+ className: Ra({
1306
+ state: S ? "selected" : "idle"
1306
1307
  }),
1307
1308
  children: [
1308
- /* @__PURE__ */ a(
1309
+ /* @__PURE__ */ s(
1309
1310
  "span",
1310
1311
  {
1311
1312
  "aria-hidden": "true",
1312
1313
  className: "ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[var(--primary)]/10 ds:text-[var(--primary)]",
1313
- children: v
1314
+ children: N
1314
1315
  }
1315
1316
  ),
1316
- /* @__PURE__ */ g("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1317
- /* @__PURE__ */ a("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: f.label }),
1318
- /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", { minutes: f.durationMin }) })
1317
+ /* @__PURE__ */ v("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1318
+ /* @__PURE__ */ s("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: p.label }),
1319
+ /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", { minutes: p.durationMin }) })
1319
1320
  ] })
1320
1321
  ]
1321
1322
  },
1322
- f.id
1323
+ p.id
1323
1324
  );
1324
1325
  })
1325
1326
  }
1326
1327
  );
1327
1328
  }
1328
- const _a = Ie(
1329
+ const La = we(
1329
1330
  [
1330
1331
  "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
1331
1332
  "ds:min-h-[var(--min-target-size)]",
@@ -1351,100 +1352,100 @@ const _a = Ie(
1351
1352
  defaultVariants: { state: "idle" }
1352
1353
  }
1353
1354
  );
1354
- function Aa(e) {
1355
- const [t] = e.split(":").map((i) => parseInt(i, 10)), s = Number.isFinite(t) ? t : 0;
1356
- return s < 12 ? "morning" : s < 17 ? "afternoon" : "evening";
1355
+ function Fa(e) {
1356
+ const [t] = e.split(":").map((i) => parseInt(i, 10)), a = Number.isFinite(t) ? t : 0;
1357
+ return a < 12 ? "morning" : a < 17 ? "afternoon" : "evening";
1357
1358
  }
1358
- const Ba = {
1359
- morning: _t,
1360
- afternoon: oa,
1361
- evening: Tt
1359
+ const $a = {
1360
+ morning: Vt,
1361
+ afternoon: pa,
1362
+ evening: Rt
1362
1363
  };
1363
- function st({
1364
+ function za({
1364
1365
  date: e,
1365
1366
  slots: t,
1366
- selectedSlotKey: s,
1367
+ selectedSlotKey: a,
1367
1368
  onSelect: i,
1368
1369
  loading: n,
1369
1370
  locale: o
1370
1371
  }) {
1371
- const { t: m } = _(), c = C(() => {
1372
+ const { t: l } = A(), m = w(() => {
1372
1373
  try {
1373
1374
  return new Intl.DateTimeFormat(o, {
1374
1375
  weekday: "long",
1375
1376
  day: "numeric",
1376
1377
  month: "long"
1377
- }).format(ae(e));
1378
+ }).format(K(e));
1378
1379
  } catch {
1379
1380
  return e;
1380
1381
  }
1381
- }, [e, o]), d = C(() => {
1382
+ }, [e, o]), d = w(() => {
1382
1383
  const u = {
1383
1384
  morning: [],
1384
1385
  afternoon: [],
1385
1386
  evening: []
1386
1387
  };
1387
- for (const x of t)
1388
- u[Aa(x.time)].push(x);
1388
+ for (const S of t)
1389
+ u[Fa(S.time)].push(S);
1389
1390
  return u;
1390
- }, [t]), p = t.filter((u) => u.available).length, f = ["morning", "afternoon", "evening"];
1391
- return n ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1392
- /* @__PURE__ */ a(Se, { variant: "text", width: "60%" }),
1393
- [0, 1].map((u) => /* @__PURE__ */ a(
1391
+ }, [t]), c = t.filter((u) => u.available).length, p = ["morning", "afternoon", "evening"];
1392
+ return n ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1393
+ /* @__PURE__ */ s(Ie, { variant: "text", width: "60%" }),
1394
+ [0, 1].map((u) => /* @__PURE__ */ s(
1394
1395
  "div",
1395
1396
  {
1396
1397
  className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
1397
- children: [0, 1, 2].map((x) => /* @__PURE__ */ a(Se, { variant: "rounded", height: "44px" }, x))
1398
+ children: [0, 1, 2].map((S) => /* @__PURE__ */ s(Ie, { variant: "rounded", height: "44px" }, S))
1398
1399
  },
1399
1400
  u
1400
1401
  ))
1401
- ] }) : p === 0 ? /* @__PURE__ */ a(Ye, { variant: "no-results", title: m("booking.noSlotsForDate") }) : /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1402
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1403
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1404
- /* @__PURE__ */ a(
1405
- qt,
1402
+ ] }) : c === 0 ? /* @__PURE__ */ s(Qe, { variant: "no-results", title: l("booking.noSlotsForDate") }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1403
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1404
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1405
+ /* @__PURE__ */ s(
1406
+ Jt,
1406
1407
  {
1407
1408
  "aria-hidden": "true",
1408
1409
  className: "ds:size-4 ds:text-[color:var(--accent)]"
1409
1410
  }
1410
1411
  ),
1411
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: c })
1412
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m })
1412
1413
  ] }),
1413
- /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: m("booking.slotsAvailable", { count: p }) })
1414
+ /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: l("booking.slotsAvailable", { count: c }) })
1414
1415
  ] }),
1415
- f.map((u) => {
1416
- const x = d[u];
1417
- if (x.length === 0) return null;
1418
- const k = Ba[u];
1419
- return /* @__PURE__ */ g(
1416
+ p.map((u) => {
1417
+ const S = d[u];
1418
+ if (S.length === 0) return null;
1419
+ const k = $a[u];
1420
+ return /* @__PURE__ */ v(
1420
1421
  "div",
1421
1422
  {
1422
1423
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1423
1424
  children: [
1424
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
1425
- /* @__PURE__ */ a(k, { "aria-hidden": "true", className: "ds:size-3.5" }),
1426
- /* @__PURE__ */ a("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: m(`booking.timeOfDay.${u}`) })
1425
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
1426
+ /* @__PURE__ */ s(k, { "aria-hidden": "true", className: "ds:size-3.5" }),
1427
+ /* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: l(`booking.timeOfDay.${u}`) })
1427
1428
  ] }),
1428
- /* @__PURE__ */ a(
1429
+ /* @__PURE__ */ s(
1429
1430
  "div",
1430
1431
  {
1431
1432
  role: "group",
1432
- "aria-label": m(`booking.timeOfDay.${u}`),
1433
+ "aria-label": l(`booking.timeOfDay.${u}`),
1433
1434
  className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
1434
- children: x.map((h) => {
1435
- const v = h.key === s, w = h.available ? v ? "selected" : "idle" : "unavailable";
1436
- return /* @__PURE__ */ a(
1435
+ children: S.map((h) => {
1436
+ const N = h.key === a, x = h.available ? N ? "selected" : "idle" : "unavailable";
1437
+ return /* @__PURE__ */ s(
1437
1438
  "button",
1438
1439
  {
1439
1440
  type: "button",
1440
1441
  "data-slot-id": h.key,
1441
1442
  disabled: !h.available,
1442
- "aria-pressed": v,
1443
- "aria-label": m("booking.slotAvailableLabel", {
1443
+ "aria-pressed": N,
1444
+ "aria-label": l("booking.slotAvailableLabel", {
1444
1445
  time: h.time
1445
1446
  }),
1446
1447
  onClick: () => h.available && i(h),
1447
- className: _a({ state: w }),
1448
+ className: La({ state: x }),
1448
1449
  children: h.time
1449
1450
  },
1450
1451
  h.key
@@ -1459,197 +1460,316 @@ function st({
1459
1460
  })
1460
1461
  ] });
1461
1462
  }
1462
- function it({ value: e, onChange: t }) {
1463
- const { t: s } = _(), i = [
1464
- { value: "private", label: s("booking.insurance.private") },
1465
- { value: "public", label: s("booking.insurance.public") }
1463
+ const Se = 4;
1464
+ function Ka({
1465
+ availableDates: e,
1466
+ availableSlots: t,
1467
+ value: a,
1468
+ onChange: i,
1469
+ onDateSelect: n,
1470
+ loadingDates: o,
1471
+ loadingSlots: l,
1472
+ locale: m
1473
+ }) {
1474
+ const d = w(() => Ve(/* @__PURE__ */ new Date()), []), [c, p] = j(() => {
1475
+ if (a.date) {
1476
+ const f = Ve(K(a.date));
1477
+ if (!pe(d, f)) return f;
1478
+ }
1479
+ if (e.length > 0) {
1480
+ const f = Ve(K(e[0]));
1481
+ if (pe(f, d)) return f;
1482
+ }
1483
+ return d;
1484
+ }), u = w(
1485
+ () => Le(c, Se - 1),
1486
+ [c]
1487
+ ), S = w(() => Array.from({ length: Se }, (f, r) => {
1488
+ const _ = Le(c, r), M = fe(_), C = (t[M] ?? []).map((B) => ({
1489
+ id: B.key,
1490
+ // SlotGrid formats `start` as a time via Intl.DateTimeFormat —
1491
+ // compose a full ISO from the column's date + the slot's HH:mm
1492
+ // so the locale-formatter has a real timestamp to work with.
1493
+ start: `${M}T${B.time}:00`,
1494
+ available: B.available
1495
+ }));
1496
+ return { date: M, slots: C };
1497
+ }), [c, t]), k = pe(c, d), h = w(
1498
+ () => e.some((f) => pe(K(f), u)),
1499
+ [e, u]
1500
+ ), N = q(() => {
1501
+ p((f) => {
1502
+ const r = Ot(f, Se);
1503
+ return pe(d, r) ? d : r;
1504
+ });
1505
+ }, [d]), x = q(() => {
1506
+ p((f) => Le(f, Se));
1507
+ }, []), D = q(
1508
+ (f, r) => {
1509
+ const _ = typeof r.date == "string" ? r.date : fe(r.date);
1510
+ i({
1511
+ ...nt(Me(a, _), f.id)
1512
+ }), n == null || n(_);
1513
+ },
1514
+ [i, n, a]
1515
+ );
1516
+ return /* @__PURE__ */ s(
1517
+ At,
1518
+ {
1519
+ days: S,
1520
+ state: o || l ? "loading" : "default",
1521
+ selectedSlotId: a.slotKey,
1522
+ maxInitialSlotsPerDay: 6,
1523
+ locale: m,
1524
+ hasPrevious: k,
1525
+ hasNext: h,
1526
+ onSlotSelect: D,
1527
+ onPreviousDays: N,
1528
+ onNextDays: x
1529
+ }
1530
+ );
1531
+ }
1532
+ function rt(e) {
1533
+ const {
1534
+ inputs: t,
1535
+ value: a,
1536
+ onChange: i,
1537
+ onDateSelect: n,
1538
+ loadingDates: o,
1539
+ loadingSlots: l,
1540
+ locale: m,
1541
+ datePickerStyle: d
1542
+ } = e;
1543
+ return d === "four-day-grid" ? /* @__PURE__ */ s(
1544
+ Ka,
1545
+ {
1546
+ availableDates: t.availableDates,
1547
+ availableSlots: t.availableSlots,
1548
+ value: a,
1549
+ onChange: i,
1550
+ onDateSelect: n,
1551
+ loadingDates: o,
1552
+ loadingSlots: l,
1553
+ locale: m
1554
+ }
1555
+ ) : /* @__PURE__ */ s(
1556
+ Ea,
1557
+ {
1558
+ availableDates: t.availableDates,
1559
+ selectedDate: a.date,
1560
+ onSelectDate: (c) => {
1561
+ i(Me(a, c)), n == null || n(c);
1562
+ },
1563
+ locale: m,
1564
+ loading: o ?? l
1565
+ }
1566
+ );
1567
+ }
1568
+ function dt(e) {
1569
+ const { inputs: t, value: a, onChange: i, loadingSlots: n, locale: o, datePickerStyle: l } = e;
1570
+ return l === "four-day-grid" || !a.date ? null : /* @__PURE__ */ s(
1571
+ za,
1572
+ {
1573
+ date: a.date,
1574
+ slots: t.availableSlots[a.date] ?? [],
1575
+ selectedSlotKey: a.slotKey,
1576
+ onSelect: (m) => i(nt(a, m.key)),
1577
+ loading: n,
1578
+ locale: o
1579
+ }
1580
+ );
1581
+ }
1582
+ function lt({ value: e, onChange: t }) {
1583
+ const { t: a } = A(), i = [
1584
+ { value: "private", label: a("booking.insurance.private") },
1585
+ { value: "public", label: a("booking.insurance.public") }
1466
1586
  ];
1467
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1468
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: s("booking.insurance.heading") }),
1469
- /* @__PURE__ */ a(
1470
- we,
1587
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1588
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: a("booking.insurance.heading") }),
1589
+ /* @__PURE__ */ s(
1590
+ Ce,
1471
1591
  {
1472
1592
  options: i,
1473
1593
  value: e ?? "",
1474
1594
  onValueChange: (n) => {
1475
1595
  (n === "private" || n === "public") && t(n);
1476
1596
  },
1477
- placeholder: s("booking.insurance.placeholder"),
1478
- "aria-label": s("booking.insurance.heading")
1597
+ placeholder: a("booking.insurance.placeholder"),
1598
+ "aria-label": a("booking.insurance.heading")
1479
1599
  }
1480
1600
  )
1481
1601
  ] });
1482
1602
  }
1483
- function nt({ specialties: e, value: t, onChange: s }) {
1484
- const { t: i } = _(), n = e.map((o) => ({
1603
+ function ct({ specialties: e, value: t, onChange: a }) {
1604
+ const { t: i } = A(), n = e.map((o) => ({
1485
1605
  value: o.id,
1486
1606
  label: o.label
1487
1607
  }));
1488
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1489
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.specialty.heading") }),
1490
- /* @__PURE__ */ a(
1491
- we,
1608
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1609
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.specialty.heading") }),
1610
+ /* @__PURE__ */ s(
1611
+ Ce,
1492
1612
  {
1493
1613
  options: n,
1494
1614
  value: t ?? "",
1495
- onValueChange: (o) => s(o),
1615
+ onValueChange: (o) => a(o),
1496
1616
  placeholder: i("booking.specialty.placeholder"),
1497
1617
  "aria-label": i("booking.specialty.heading")
1498
1618
  }
1499
1619
  )
1500
1620
  ] });
1501
1621
  }
1502
- function ot({ services: e, value: t, onChange: s, compact: i }) {
1503
- const { t: n } = _();
1622
+ function ut({ services: e, value: t, onChange: a, compact: i }) {
1623
+ const { t: n } = A();
1504
1624
  if (i) {
1505
- const o = e.map((m) => ({
1506
- value: m.id,
1507
- label: `${m.label} · ${n("booking.serviceSummary", {
1508
- minutes: m.durationMin
1625
+ const o = e.map((l) => ({
1626
+ value: l.id,
1627
+ label: `${l.label} · ${n("booking.serviceSummary", {
1628
+ minutes: l.durationMin
1509
1629
  })}`
1510
1630
  }));
1511
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1512
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1513
- /* @__PURE__ */ a(
1514
- we,
1631
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1632
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1633
+ /* @__PURE__ */ s(
1634
+ Ce,
1515
1635
  {
1516
1636
  options: o,
1517
1637
  value: t ?? "",
1518
- onValueChange: (m) => s(m),
1638
+ onValueChange: (l) => a(l),
1519
1639
  placeholder: n("booking.service.placeholder"),
1520
1640
  "aria-label": n("booking.service.heading")
1521
1641
  }
1522
1642
  )
1523
1643
  ] });
1524
1644
  }
1525
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1526
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1527
- /* @__PURE__ */ a(
1528
- Ta,
1645
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1646
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1647
+ /* @__PURE__ */ s(
1648
+ Va,
1529
1649
  {
1530
1650
  services: e,
1531
1651
  selectedServiceId: t,
1532
- onSelect: s
1652
+ onSelect: a
1533
1653
  }
1534
1654
  )
1535
1655
  ] });
1536
1656
  }
1537
- function rt({ operators: e, value: t, onChange: s }) {
1538
- const { t: i } = _(), n = [
1539
- { value: pe, label: i("booking.operator.all") },
1657
+ function mt({ operators: e, value: t, onChange: a }) {
1658
+ const { t: i } = A(), n = [
1659
+ { value: he, label: i("booking.operator.all") },
1540
1660
  ...e.map((o) => ({ value: o.id, label: o.name }))
1541
1661
  ];
1542
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1543
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.operator.heading") }),
1544
- /* @__PURE__ */ a(
1545
- we,
1662
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1663
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.operator.heading") }),
1664
+ /* @__PURE__ */ s(
1665
+ Ce,
1546
1666
  {
1547
1667
  options: n,
1548
- value: t ?? pe,
1549
- onValueChange: (o) => s(o),
1668
+ value: t ?? he,
1669
+ onValueChange: (o) => a(o),
1550
1670
  placeholder: i("booking.operator.placeholder"),
1551
1671
  "aria-label": i("booking.operator.heading")
1552
1672
  }
1553
1673
  )
1554
1674
  ] });
1555
1675
  }
1556
- function dt({
1676
+ function pt({
1557
1677
  customSlot: e
1558
1678
  }) {
1559
- const { t } = _();
1560
- return e ? /* @__PURE__ */ a(Y, { children: e }) : /* @__PURE__ */ g(L, { variant: "warning", children: [
1561
- /* @__PURE__ */ a(L.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
1562
- /* @__PURE__ */ a(L.Description, { children: t("booking.onboardingIncomplete.description") })
1679
+ const { t } = A();
1680
+ return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ v($, { variant: "warning", children: [
1681
+ /* @__PURE__ */ s($.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
1682
+ /* @__PURE__ */ s($.Description, { children: t("booking.onboardingIncomplete.description") })
1563
1683
  ] });
1564
1684
  }
1565
- function lt({
1685
+ function gt({
1566
1686
  nextAvailableDate: e,
1567
1687
  onJump: t,
1568
- locale: s
1688
+ locale: a
1569
1689
  }) {
1570
- const { t: i } = _(), n = C(() => {
1690
+ const { t: i } = A(), n = w(() => {
1571
1691
  try {
1572
- return new Intl.DateTimeFormat(s, { dateStyle: "long" }).format(
1573
- ae(e)
1692
+ return new Intl.DateTimeFormat(a, { dateStyle: "long" }).format(
1693
+ K(e)
1574
1694
  );
1575
1695
  } catch {
1576
1696
  return e;
1577
1697
  }
1578
- }, [e, s]);
1579
- return /* @__PURE__ */ g(L, { variant: "info", children: [
1580
- /* @__PURE__ */ a(L.Description, { children: i("booking.nextAvailable.description", { date: n }) }),
1581
- /* @__PURE__ */ a(L.Action, { children: /* @__PURE__ */ a(ne, { intent: "secondary", size: "sm", onClick: t, children: i("booking.nextAvailable.cta") }) })
1698
+ }, [e, a]);
1699
+ return /* @__PURE__ */ v($, { variant: "info", children: [
1700
+ /* @__PURE__ */ s($.Description, { children: i("booking.nextAvailable.description", { date: n }) }),
1701
+ /* @__PURE__ */ s($.Action, { children: /* @__PURE__ */ s(ae, { intent: "secondary", size: "sm", onClick: t, children: i("booking.nextAvailable.cta") }) })
1582
1702
  ] });
1583
1703
  }
1584
- function Oa({
1704
+ function ja({
1585
1705
  snapshot: e,
1586
1706
  operators: t,
1587
- specialties: s,
1707
+ specialties: a,
1588
1708
  services: i,
1589
1709
  locale: n,
1590
1710
  mode: o,
1591
- showModify: m,
1592
- onReset: c,
1711
+ showModify: l,
1712
+ onReset: m,
1593
1713
  onModify: d
1594
1714
  }) {
1595
- const { t: p } = _(), u = (e.details.confirmationChannels ?? ["email"]).map(
1596
- (N) => p(`booking.confirmation.channel.${N}`)
1597
- ), x = o === "demo" ? p("booking.success.descriptionDemo") : u.length > 1 ? p("booking.success.descriptionMultiple", {
1715
+ const { t: c } = A(), u = (e.details.confirmationChannels ?? ["email"]).map(
1716
+ (D) => c(`booking.confirmation.channel.${D}`)
1717
+ ), S = o === "demo" ? c("booking.success.descriptionDemo") : u.length > 1 ? c("booking.success.descriptionMultiple", {
1598
1718
  channels: u.join(" · ")
1599
- }) : p("booking.success.descriptionSingle", { channel: u[0] }), k = C(() => {
1719
+ }) : c("booking.success.descriptionSingle", { channel: u[0] }), k = w(() => {
1600
1720
  if (e.date)
1601
1721
  try {
1602
1722
  return new Intl.DateTimeFormat(n, {
1603
1723
  weekday: "long",
1604
1724
  day: "numeric",
1605
1725
  month: "long"
1606
- }).format(ae(e.date));
1726
+ }).format(K(e.date));
1607
1727
  } catch {
1608
1728
  return e.date;
1609
1729
  }
1610
- }, [e.date, n]), h = e.operatorId ? t.find((N) => N.id === e.operatorId) : void 0, v = e.specialtyId ? s.find((N) => N.id === e.specialtyId) : void 0, w = e.serviceId ? i.find((N) => N.id === e.serviceId) : void 0;
1611
- return /* @__PURE__ */ g(
1730
+ }, [e.date, n]), h = e.operatorId ? t.find((D) => D.id === e.operatorId) : void 0, N = e.specialtyId ? a.find((D) => D.id === e.specialtyId) : void 0, x = e.serviceId ? i.find((D) => D.id === e.serviceId) : void 0;
1731
+ return /* @__PURE__ */ v(
1612
1732
  "div",
1613
1733
  {
1614
1734
  "data-component": "booking-success",
1615
1735
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1616
1736
  children: [
1617
- /* @__PURE__ */ g(L, { variant: "success", children: [
1618
- /* @__PURE__ */ a(L.Title, { as: "h3", children: p("booking.success.heading") }),
1619
- /* @__PURE__ */ a(L.Description, { children: x })
1737
+ /* @__PURE__ */ v($, { variant: "success", children: [
1738
+ /* @__PURE__ */ s($.Title, { as: "h3", children: c("booking.success.heading") }),
1739
+ /* @__PURE__ */ s($.Description, { children: S })
1620
1740
  ] }),
1621
- /* @__PURE__ */ a("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ g("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
1622
- v ? /* @__PURE__ */ g(Y, { children: [
1623
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: p("booking.success.summarySpecialty") }),
1624
- /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: v.label })
1741
+ /* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ v("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
1742
+ N ? /* @__PURE__ */ v(W, { children: [
1743
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summarySpecialty") }),
1744
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: N.label })
1625
1745
  ] }) : null,
1626
- w ? /* @__PURE__ */ g(Y, { children: [
1627
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: p("booking.success.summaryService") }),
1628
- /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: w.label })
1746
+ x ? /* @__PURE__ */ v(W, { children: [
1747
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryService") }),
1748
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: x.label })
1629
1749
  ] }) : null,
1630
- k ? /* @__PURE__ */ g(Y, { children: [
1631
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: p("booking.success.summaryDate") }),
1632
- /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: k })
1750
+ k ? /* @__PURE__ */ v(W, { children: [
1751
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryDate") }),
1752
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: k })
1633
1753
  ] }) : null,
1634
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: p("booking.success.summaryTime") }),
1635
- /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: e.slot.time }),
1636
- h ? /* @__PURE__ */ g(Y, { children: [
1637
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: p("booking.success.summaryProvider") }),
1638
- /* @__PURE__ */ a("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: h.name })
1754
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryTime") }),
1755
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: e.slot.time }),
1756
+ h ? /* @__PURE__ */ v(W, { children: [
1757
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryProvider") }),
1758
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: h.name })
1639
1759
  ] }) : null
1640
1760
  ] }) }),
1641
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1642
- /* @__PURE__ */ a(ne, { intent: "secondary", size: "md", onClick: c, children: p("booking.success.bookAnother") }),
1643
- m ? /* @__PURE__ */ a(ne, { intent: "ghost", size: "md", onClick: d, children: p("booking.success.modifyBooking") }) : null
1761
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1762
+ /* @__PURE__ */ s(ae, { intent: "secondary", size: "md", onClick: m, children: c("booking.success.bookAnother") }),
1763
+ l ? /* @__PURE__ */ s(ae, { intent: "ghost", size: "md", onClick: d, children: c("booking.success.modifyBooking") }) : null
1644
1764
  ] })
1645
1765
  ]
1646
1766
  }
1647
1767
  );
1648
1768
  }
1649
- function ct({ customSlot: e }) {
1650
- const { t } = _();
1651
- return e ? /* @__PURE__ */ a(Y, { children: e }) : /* @__PURE__ */ a(
1652
- Ye,
1769
+ function ft({ customSlot: e }) {
1770
+ const { t } = A();
1771
+ return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ s(
1772
+ Qe,
1653
1773
  {
1654
1774
  variant: "no-results",
1655
1775
  title: t("booking.emptyServices.title"),
@@ -1657,200 +1777,192 @@ function ct({ customSlot: e }) {
1657
1777
  }
1658
1778
  );
1659
1779
  }
1660
- function Ea(e) {
1780
+ function qa(e) {
1661
1781
  const {
1662
1782
  cascade: t,
1663
- inputs: s,
1783
+ inputs: a,
1664
1784
  value: i,
1665
1785
  onChange: n,
1666
1786
  onSubmit: o,
1667
- emptyServicesSlot: m,
1668
- onboardingIncompleteSlot: c,
1787
+ emptyServicesSlot: l,
1788
+ onboardingIncompleteSlot: m,
1669
1789
  loadingDates: d,
1670
- loadingSlots: p,
1671
- onDateSelect: f,
1672
- submitting: u,
1673
- locale: x,
1674
- detailsProps: k
1675
- } = e, { t: h } = _();
1676
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1677
- t.gates.insurance ? /* @__PURE__ */ a(
1678
- it,
1790
+ loadingSlots: c,
1791
+ onDateSelect: p,
1792
+ datePickerStyle: u,
1793
+ submitting: S,
1794
+ locale: k,
1795
+ detailsProps: h
1796
+ } = e, { t: N } = A();
1797
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1798
+ t.gates.insurance ? /* @__PURE__ */ s(
1799
+ lt,
1679
1800
  {
1680
1801
  value: i.insuranceType,
1681
- onChange: (v) => n(Je(i, v))
1802
+ onChange: (x) => n(tt(i, x))
1682
1803
  }
1683
1804
  ) : null,
1684
- t.gates.specialty ? /* @__PURE__ */ a(
1685
- nt,
1805
+ t.gates.specialty ? /* @__PURE__ */ s(
1806
+ ct,
1686
1807
  {
1687
1808
  specialties: t.filtered.specialties,
1688
1809
  value: i.specialtyId,
1689
- onChange: (v) => n(Xe(i, v))
1810
+ onChange: (x) => n(at(i, x))
1690
1811
  }
1691
1812
  ) : null,
1692
- t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ a(ct, { customSlot: m }) : /* @__PURE__ */ a(
1693
- ot,
1813
+ t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ s(ft, { customSlot: l }) : /* @__PURE__ */ s(
1814
+ ut,
1694
1815
  {
1695
1816
  services: t.filtered.services,
1696
1817
  value: i.serviceId,
1697
- onChange: (v) => n(We(i, v))
1818
+ onChange: (x) => n(st(i, x))
1698
1819
  }
1699
1820
  ) : null,
1700
- t.gates.onboardingIncomplete ? /* @__PURE__ */ a(dt, { customSlot: c }) : null,
1701
- t.gates.operator ? /* @__PURE__ */ a(
1702
- rt,
1821
+ t.gates.onboardingIncomplete ? /* @__PURE__ */ s(pt, { customSlot: m }) : null,
1822
+ t.gates.operator ? /* @__PURE__ */ s(
1823
+ mt,
1703
1824
  {
1704
1825
  operators: t.filtered.operators,
1705
1826
  value: i.operatorId,
1706
- onChange: (v) => n(Qe(i, v))
1827
+ onChange: (x) => n(it(i, x))
1707
1828
  }
1708
1829
  ) : null,
1709
- t.gates.date ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1710
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: h("booking.date.heading") }),
1711
- s.availableDates.length === 0 && s.nextAvailableDate ? /* @__PURE__ */ a(
1712
- lt,
1830
+ t.gates.date ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1831
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: N("booking.date.heading") }),
1832
+ a.availableDates.length === 0 && a.nextAvailableDate ? /* @__PURE__ */ s(
1833
+ gt,
1713
1834
  {
1714
- nextAvailableDate: s.nextAvailableDate,
1715
- onJump: () => n(Ne(i, s.nextAvailableDate)),
1716
- locale: x
1835
+ nextAvailableDate: a.nextAvailableDate,
1836
+ onJump: () => n(Me(i, a.nextAvailableDate)),
1837
+ locale: k
1717
1838
  }
1718
- ) : /* @__PURE__ */ a(
1719
- at,
1720
- {
1721
- availableDates: s.availableDates,
1722
- selectedDate: i.date,
1723
- onSelectDate: (v) => {
1724
- n(Ne(i, v)), f == null || f(v);
1725
- },
1726
- locale: x,
1727
- loading: d ?? p
1728
- }
1729
- )
1839
+ ) : rt({
1840
+ inputs: a,
1841
+ value: i,
1842
+ onChange: n,
1843
+ onDateSelect: p,
1844
+ loadingDates: d,
1845
+ loadingSlots: c,
1846
+ locale: k,
1847
+ datePickerStyle: u
1848
+ })
1730
1849
  ] }) : null,
1731
- t.gates.slot && i.date ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1732
- /* @__PURE__ */ a("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: h("booking.slot.heading") }),
1733
- /* @__PURE__ */ a(
1734
- st,
1735
- {
1736
- date: i.date,
1737
- slots: s.availableSlots[i.date] ?? [],
1738
- selectedSlotKey: i.slotKey,
1739
- onSelect: (v) => n(et(i, v.key)),
1740
- loading: p,
1741
- locale: x
1742
- }
1743
- )
1850
+ t.gates.slot && i.date && u === "month-calendar" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1851
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: N("booking.slot.heading") }),
1852
+ dt({
1853
+ inputs: a,
1854
+ value: i,
1855
+ onChange: n,
1856
+ loadingSlots: c,
1857
+ locale: k,
1858
+ datePickerStyle: u
1859
+ })
1744
1860
  ] }) : null,
1745
- t.gates.details && t.selectedSlot ? /* @__PURE__ */ a(
1746
- Ve,
1861
+ t.gates.details && t.selectedSlot ? /* @__PURE__ */ s(
1862
+ ze,
1747
1863
  {
1748
- ...k,
1864
+ ...h,
1749
1865
  value: i.details ?? {},
1750
- onChange: (v) => n({ ...i, details: v }),
1866
+ onChange: (x) => n({ ...i, details: x }),
1751
1867
  onSubmit: o,
1752
- submitting: u,
1868
+ submitting: S,
1753
1869
  defaultPhoneCountry: e.policy.country
1754
1870
  }
1755
1871
  ) : null
1756
1872
  ] });
1757
1873
  }
1758
- function $(e, t, s = {}) {
1874
+ function F(e, t, a = {}) {
1759
1875
  const {
1760
1876
  cascade: i,
1761
1877
  inputs: n,
1762
1878
  value: o,
1763
- onChange: m,
1764
- onSubmit: c,
1879
+ onChange: l,
1880
+ onSubmit: m,
1765
1881
  emptyServicesSlot: d,
1766
- onboardingIncompleteSlot: p,
1767
- loadingDates: f,
1882
+ onboardingIncompleteSlot: c,
1883
+ loadingDates: p,
1768
1884
  loadingSlots: u,
1769
- onDateSelect: x,
1770
- submitting: k,
1771
- locale: h,
1772
- detailsProps: v,
1773
- policy: w
1885
+ onDateSelect: S,
1886
+ datePickerStyle: k,
1887
+ submitting: h,
1888
+ locale: N,
1889
+ detailsProps: x,
1890
+ policy: D
1774
1891
  } = t;
1775
1892
  switch (e) {
1776
1893
  case 1:
1777
- return /* @__PURE__ */ a(
1778
- it,
1894
+ return /* @__PURE__ */ s(
1895
+ lt,
1779
1896
  {
1780
1897
  value: o.insuranceType,
1781
- onChange: (N) => m(Je(o, N))
1898
+ onChange: (b) => l(tt(o, b))
1782
1899
  }
1783
1900
  );
1784
1901
  case 2:
1785
- return /* @__PURE__ */ a(
1786
- nt,
1902
+ return /* @__PURE__ */ s(
1903
+ ct,
1787
1904
  {
1788
1905
  specialties: i.filtered.specialties,
1789
1906
  value: o.specialtyId,
1790
- onChange: (N) => m(Xe(o, N))
1907
+ onChange: (b) => l(at(o, b))
1791
1908
  }
1792
1909
  );
1793
1910
  case 3:
1794
- return i.filtered.services.length === 0 ? /* @__PURE__ */ a(ct, { customSlot: d }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ a(dt, { customSlot: p }) : /* @__PURE__ */ a(
1795
- ot,
1911
+ return i.filtered.services.length === 0 ? /* @__PURE__ */ s(ft, { customSlot: d }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ s(pt, { customSlot: c }) : /* @__PURE__ */ s(
1912
+ ut,
1796
1913
  {
1797
1914
  services: i.filtered.services,
1798
1915
  value: o.serviceId,
1799
- onChange: (N) => m(We(o, N)),
1800
- compact: s.compactService
1916
+ onChange: (b) => l(st(o, b)),
1917
+ compact: a.compactService
1801
1918
  }
1802
1919
  );
1803
1920
  case 4:
1804
- return /* @__PURE__ */ a(
1805
- rt,
1921
+ return /* @__PURE__ */ s(
1922
+ mt,
1806
1923
  {
1807
1924
  operators: i.filtered.operators,
1808
1925
  value: o.operatorId,
1809
- onChange: (N) => m(Qe(o, N))
1926
+ onChange: (b) => l(it(o, b))
1810
1927
  }
1811
1928
  );
1812
1929
  case 5:
1813
- return n.availableDates.length === 0 && n.nextAvailableDate ? /* @__PURE__ */ a(
1814
- lt,
1930
+ return n.availableDates.length === 0 && n.nextAvailableDate ? /* @__PURE__ */ s(
1931
+ gt,
1815
1932
  {
1816
1933
  nextAvailableDate: n.nextAvailableDate,
1817
- onJump: () => m(Ne(o, n.nextAvailableDate)),
1818
- locale: h
1819
- }
1820
- ) : /* @__PURE__ */ a(
1821
- at,
1822
- {
1823
- availableDates: n.availableDates,
1824
- selectedDate: o.date,
1825
- onSelectDate: (N) => {
1826
- m(Ne(o, N)), x == null || x(N);
1827
- },
1828
- locale: h,
1829
- loading: f ?? u
1934
+ onJump: () => l(Me(o, n.nextAvailableDate)),
1935
+ locale: N
1830
1936
  }
1831
- );
1937
+ ) : rt({
1938
+ inputs: n,
1939
+ value: o,
1940
+ onChange: l,
1941
+ onDateSelect: S,
1942
+ loadingDates: p,
1943
+ loadingSlots: u,
1944
+ locale: N,
1945
+ datePickerStyle: k
1946
+ });
1832
1947
  case 6:
1833
- return o.date ? /* @__PURE__ */ a(
1834
- st,
1835
- {
1836
- date: o.date,
1837
- slots: n.availableSlots[o.date] ?? [],
1838
- selectedSlotKey: o.slotKey,
1839
- onSelect: (N) => m(et(o, N.key)),
1840
- loading: u,
1841
- locale: h
1842
- }
1843
- ) : null;
1948
+ return dt({
1949
+ inputs: n,
1950
+ value: o,
1951
+ onChange: l,
1952
+ loadingSlots: u,
1953
+ locale: N,
1954
+ datePickerStyle: k
1955
+ });
1844
1956
  case 7:
1845
- return i.selectedSlot ? /* @__PURE__ */ a(
1846
- Ve,
1957
+ return i.selectedSlot ? /* @__PURE__ */ s(
1958
+ ze,
1847
1959
  {
1848
- ...v,
1960
+ ...x,
1849
1961
  value: o.details ?? {},
1850
- onChange: (N) => m({ ...o, details: N }),
1851
- onSubmit: c,
1852
- submitting: k,
1853
- defaultPhoneCountry: w.country
1962
+ onChange: (b) => l({ ...o, details: b }),
1963
+ onSubmit: m,
1964
+ submitting: h,
1965
+ defaultPhoneCountry: D.country
1854
1966
  }
1855
1967
  ) : null;
1856
1968
  /* c8 ignore next 2 */
@@ -1858,9 +1970,9 @@ function $(e, t, s = {}) {
1858
1970
  return null;
1859
1971
  }
1860
1972
  }
1861
- function Re() {
1862
- const { t: e } = _();
1863
- return C(
1973
+ function Ke() {
1974
+ const { t: e } = A();
1975
+ return w(
1864
1976
  () => ({
1865
1977
  1: e("booking.insurance.heading"),
1866
1978
  2: e("booking.specialty.heading"),
@@ -1873,29 +1985,32 @@ function Re() {
1873
1985
  [e]
1874
1986
  );
1875
1987
  }
1876
- function Pa(e) {
1877
- const { cascade: t, value: s, activeStep: i, setActiveStep: n } = e, o = Re(), m = C(
1878
- () => t.visibleSteps.map((d) => ({
1879
- label: o[d],
1880
- summary: mt(d, s, t),
1881
- status: ge(d, s) && d < t.currentStep ? "completed" : void 0,
1882
- content: $(d, e, { compactService: !0 })
1988
+ function Ha(e) {
1989
+ const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, l = Ke(), m = w(
1990
+ () => o === "four-day-grid" ? t.visibleSteps.filter((p) => p !== 6) : t.visibleSteps,
1991
+ [t.visibleSteps, o]
1992
+ ), d = w(
1993
+ () => m.map((p) => ({
1994
+ label: l[p],
1995
+ summary: ht(p, a, t),
1996
+ status: ve(p, a) && p < t.currentStep ? "completed" : void 0,
1997
+ content: F(p, e, { compactService: !0 })
1883
1998
  })),
1884
- [t, s, o, e]
1999
+ [m, a, l, t, e]
1885
2000
  ), c = Math.max(0, t.visibleSteps.indexOf(i));
1886
- return /* @__PURE__ */ a(
1887
- It,
2001
+ return /* @__PURE__ */ s(
2002
+ _t,
1888
2003
  {
1889
2004
  activeStep: c,
1890
- steps: m,
1891
- onStepChange: (d) => {
1892
- const p = t.visibleSteps[d];
1893
- p && n(p);
2005
+ steps: d,
2006
+ onStepChange: (p) => {
2007
+ const u = t.visibleSteps[p];
2008
+ u && n(u);
1894
2009
  }
1895
2010
  }
1896
2011
  );
1897
2012
  }
1898
- function ge(e, t) {
2013
+ function ve(e, t) {
1899
2014
  switch (e) {
1900
2015
  case 1:
1901
2016
  return t.insuranceType !== void 0;
@@ -1913,55 +2028,55 @@ function ge(e, t) {
1913
2028
  return !1;
1914
2029
  }
1915
2030
  }
1916
- function mt(e, t, s) {
2031
+ function ht(e, t, a) {
1917
2032
  var i;
1918
- if (ge(e, t))
2033
+ if (ve(e, t))
1919
2034
  switch (e) {
1920
2035
  case 1:
1921
2036
  return t.insuranceType;
1922
2037
  case 2: {
1923
- const n = s.filtered.specialties.find(
2038
+ const n = a.filtered.specialties.find(
1924
2039
  (o) => o.id === t.specialtyId
1925
2040
  );
1926
2041
  return n == null ? void 0 : n.label;
1927
2042
  }
1928
2043
  case 3: {
1929
- const n = s.filtered.services.find(
2044
+ const n = a.filtered.services.find(
1930
2045
  (o) => o.id === t.serviceId
1931
2046
  );
1932
2047
  return n == null ? void 0 : n.label;
1933
2048
  }
1934
2049
  case 4: {
1935
- const n = Pe(t);
2050
+ const n = $e(t);
1936
2051
  if (!n) return;
1937
- const o = s.filtered.operators.find((m) => m.id === n);
2052
+ const o = a.filtered.operators.find((l) => l.id === n);
1938
2053
  return o == null ? void 0 : o.name;
1939
2054
  }
1940
2055
  case 5:
1941
2056
  return t.date;
1942
2057
  case 6:
1943
- return (i = s.selectedSlot) == null ? void 0 : i.time;
2058
+ return (i = a.selectedSlot) == null ? void 0 : i.time;
1944
2059
  case 7:
1945
2060
  return;
1946
2061
  }
1947
2062
  }
1948
- function Va(e) {
1949
- const { cascade: t, value: s, setActiveStep: i } = e, { t: n } = _(), o = Re(), m = t.visibleSteps.filter(
2063
+ function Ga(e) {
2064
+ const { cascade: t, value: a, setActiveStep: i } = e, { t: n } = A(), o = Ke(), l = t.visibleSteps.filter(
1950
2065
  (d) => d === 1 || d === 2 || d === 3 || d === 4
1951
- ), c = m.some(
1952
- (d) => !ge(d, s)
2066
+ ), m = l.some(
2067
+ (d) => !ve(d, a)
1953
2068
  );
1954
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1955
- c ? m.filter((d) => !ge(d, s)).slice(0, 1).map((d) => /* @__PURE__ */ a("div", { children: $(d, e, { compactService: !0 }) }, `csf-${d}`)) : /* @__PURE__ */ a(
2069
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2070
+ m ? l.filter((d) => !ve(d, a)).slice(0, 1).map((d) => /* @__PURE__ */ s("div", { children: F(d, e, { compactService: !0 }) }, `csf-${d}`)) : /* @__PURE__ */ s(
1956
2071
  "div",
1957
2072
  {
1958
2073
  role: "group",
1959
2074
  "aria-label": n("booking.regionLabel"),
1960
2075
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
1961
- children: m.map((d) => {
1962
- const p = mt(d, s, t);
1963
- return p ? /* @__PURE__ */ g(
1964
- ne,
2076
+ children: l.map((d) => {
2077
+ const c = ht(d, a, t);
2078
+ return c ? /* @__PURE__ */ v(
2079
+ ae,
1965
2080
  {
1966
2081
  intent: "tonal",
1967
2082
  size: "sm",
@@ -1969,7 +2084,7 @@ function Va(e) {
1969
2084
  children: [
1970
2085
  o[d],
1971
2086
  ": ",
1972
- p
2087
+ c
1973
2088
  ]
1974
2089
  },
1975
2090
  `csc-${d}`
@@ -1977,337 +2092,349 @@ function Va(e) {
1977
2092
  })
1978
2093
  }
1979
2094
  ),
1980
- !c && t.gates.date ? /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
1981
- /* @__PURE__ */ a("div", { className: "ds:min-w-0", children: $(5, e) }),
1982
- /* @__PURE__ */ a("div", { className: "ds:min-w-0", children: s.date ? $(6, e) : null })
1983
- ] }) : null,
1984
- t.gates.details ? /* @__PURE__ */ a("div", { children: $(7, e) }) : null
2095
+ !m && t.gates.date ? (
2096
+ // four-day-grid embeds slots inline with the day strip the
2097
+ // historic 2-col date|slot split collapses to a single column
2098
+ // so the picker spans the full width instead of orphaning an
2099
+ // empty right cell.
2100
+ e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s("div", { children: F(5, e) }) : /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
2101
+ /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: F(5, e) }),
2102
+ /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: a.date ? F(6, e) : null })
2103
+ ] })
2104
+ ) : null,
2105
+ t.gates.details ? /* @__PURE__ */ s("div", { children: F(7, e) }) : null
1985
2106
  ] });
1986
2107
  }
1987
- function Ra(e) {
1988
- const { cascade: t } = e, s = t.visibleSteps.filter(
2108
+ function Ua(e) {
2109
+ const { cascade: t } = e, a = t.visibleSteps.filter(
1989
2110
  (i) => i === 1 || i === 2 || i === 3 || i === 4
1990
2111
  );
1991
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1992
- /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
1993
- /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: s.map((i) => /* @__PURE__ */ a("div", { children: $(i, e, { compactService: !0 }) }, `fbf-${i}`)) }),
1994
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1995
- t.gates.date ? $(5, e) : null,
1996
- t.gates.slot && e.value.date ? $(6, e) : null
2112
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2113
+ /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
2114
+ /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: a.map((i) => /* @__PURE__ */ s("div", { children: F(i, e, { compactService: !0 }) }, `fbf-${i}`)) }),
2115
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2116
+ t.gates.date ? F(5, e) : null,
2117
+ t.gates.slot && e.value.date ? F(6, e) : null
1997
2118
  ] })
1998
2119
  ] }),
1999
- t.gates.details ? $(7, e) : null
2120
+ t.gates.details ? F(7, e) : null
2000
2121
  ] });
2001
2122
  }
2002
- function La(e) {
2003
- const { cascade: t, value: s, activeStep: i, setActiveStep: n } = e, { t: o } = _(), m = Re(), c = t.visibleSteps, d = Math.max(0, c.indexOf(i)), p = c.length, f = C(
2004
- () => c.map((k) => ({ label: m[k] })),
2005
- [c, m]
2006
- ), u = d > 0, x = d < p - 1 && ge(i, s);
2007
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2008
- /* @__PURE__ */ a(wt, { activeStep: d, steps: f }),
2009
- /* @__PURE__ */ a("div", { children: $(i, e, { compactService: !0 }) }),
2010
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2011
- /* @__PURE__ */ a(
2012
- ne,
2123
+ function Ya(e) {
2124
+ const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, { t: l } = A(), m = Ke(), d = w(
2125
+ () => o === "four-day-grid" ? t.visibleSteps.filter((h) => h !== 6) : t.visibleSteps,
2126
+ [t.visibleSteps, o]
2127
+ ), c = Math.max(0, d.indexOf(i)), p = d.length, u = w(
2128
+ () => d.map((h) => ({ label: m[h] })),
2129
+ [d, m]
2130
+ ), S = c > 0, k = c < p - 1 && ve(i, a);
2131
+ return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2132
+ /* @__PURE__ */ s(Tt, { activeStep: c, steps: u }),
2133
+ /* @__PURE__ */ s("div", { children: F(i, e, { compactService: !0 }) }),
2134
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2135
+ /* @__PURE__ */ s(
2136
+ ae,
2013
2137
  {
2014
2138
  intent: "ghost",
2015
2139
  size: "md",
2016
- disabled: !u,
2140
+ disabled: !S,
2017
2141
  onClick: () => {
2018
- const k = c[d - 1];
2019
- k && n(k);
2142
+ const h = d[c - 1];
2143
+ h && n(h);
2020
2144
  },
2021
- children: o("booking.actions.back")
2145
+ children: l("booking.actions.back")
2022
2146
  }
2023
2147
  ),
2024
- i < 7 ? /* @__PURE__ */ a(
2025
- ne,
2148
+ i < 7 ? /* @__PURE__ */ s(
2149
+ ae,
2026
2150
  {
2027
2151
  intent: "primary",
2028
2152
  size: "md",
2029
- disabled: !x,
2153
+ disabled: !k,
2030
2154
  onClick: () => {
2031
- const k = c[d + 1];
2032
- k && n(k);
2155
+ const h = d[c + 1];
2156
+ h && n(h);
2033
2157
  },
2034
- children: o("booking.actions.next")
2158
+ children: l("booking.actions.next")
2035
2159
  }
2036
2160
  ) : null
2037
2161
  ] })
2038
2162
  ] });
2039
2163
  }
2040
- const Fa = [], za = [], $a = Ge(
2164
+ const Wa = [], Za = [], Ja = Je(
2041
2165
  ({
2042
2166
  variant: e = "inline-list",
2043
2167
  country: t,
2044
2168
  // No default — the cascade engine treats `undefined` as "auto-on
2045
2169
  // when `specialties` has items" so consumers who pass specialty
2046
2170
  // data without the explicit flag still get the step.
2047
- useSpecialties: s,
2171
+ useSpecialties: a,
2048
2172
  allowOperatorSelection: i = !1,
2049
2173
  lockedOperatorId: n,
2050
2174
  autoSelectSingleService: o = !1,
2051
- specialties: m,
2052
- services: c,
2175
+ specialties: l,
2176
+ services: m,
2053
2177
  operators: d,
2054
- availableDates: p,
2055
- availableSlots: f,
2178
+ availableDates: c,
2179
+ availableSlots: p,
2056
2180
  nextAvailableDate: u,
2057
- requireCodiceFiscale: x,
2181
+ requireCodiceFiscale: S,
2058
2182
  requireDateOfBirth: k,
2059
2183
  requireInsuranceNumber: h,
2060
- showNote: v,
2061
- showReturningPatientFlag: w,
2062
- privacyPolicyUrl: N,
2063
- termsUrl: S,
2064
- validateCodiceFiscale: b,
2184
+ showNote: N,
2185
+ showReturningPatientFlag: x,
2186
+ privacyPolicyUrl: D,
2187
+ termsUrl: b,
2188
+ validateCodiceFiscale: f,
2065
2189
  validateInsuranceNumber: r,
2066
- confirmationChannels: O,
2067
- defaultConfirmationChannels: D,
2190
+ confirmationChannels: _,
2191
+ defaultConfirmationChannels: M,
2068
2192
  value: y,
2069
- onChange: I,
2070
- onSubmit: F,
2071
- onStepChange: A,
2193
+ onChange: C,
2194
+ onSubmit: B,
2195
+ onStepChange: O,
2072
2196
  onDateSelect: Z,
2073
- loadingDates: E,
2074
- loadingSlots: z,
2075
- submitting: H,
2076
- submitError: T,
2077
- mode: J = "live",
2078
- showModifyOnSuccess: K = !0,
2079
- surface: fe = "flat",
2080
- emptyServicesSlot: X,
2081
- onboardingIncompleteSlot: he,
2082
- "aria-label": W,
2083
- id: Q,
2084
- className: oe,
2085
- ...Ce
2086
- }, Me) => {
2087
- const { t: re, i18n: ve } = _(), V = e ?? "inline-list", ee = ve.language ?? "en", R = m ?? Fa, j = d ?? za;
2088
- te(() => {
2089
- const P = va(y, {
2090
- useSpecialties: s,
2197
+ datePickerStyle: E = "month-calendar",
2198
+ loadingDates: z,
2199
+ loadingSlots: G,
2200
+ submitting: T,
2201
+ submitError: J,
2202
+ mode: H = "live",
2203
+ showModifyOnSuccess: ne = !0,
2204
+ surface: se = "flat",
2205
+ emptyServicesSlot: be,
2206
+ onboardingIncompleteSlot: U,
2207
+ "aria-label": oe,
2208
+ id: X,
2209
+ className: De,
2210
+ ..._e
2211
+ }, Te) => {
2212
+ const { t: ie, i18n: Ae } = A(), R = e ?? "inline-list", Q = Ae.language ?? "en", L = l ?? Wa, g = d ?? Za;
2213
+ ee(() => {
2214
+ const V = Ia(y, {
2215
+ useSpecialties: a,
2091
2216
  lockedOperatorId: n,
2092
2217
  autoSelectSingleService: o,
2093
- specialties: R,
2094
- services: c
2218
+ specialties: L,
2219
+ services: m
2095
2220
  });
2096
- (P.specialtyId !== y.specialtyId || P.operatorId !== y.operatorId || P.serviceId !== y.serviceId) && I(P);
2221
+ (V.specialtyId !== y.specialtyId || V.operatorId !== y.operatorId || V.serviceId !== y.serviceId) && C(V);
2097
2222
  }, [
2098
2223
  n,
2099
- s,
2224
+ a,
2100
2225
  o,
2101
- R,
2102
- c
2226
+ L,
2227
+ m
2103
2228
  ]);
2104
- const l = C(
2105
- () => ha({
2229
+ const I = w(
2230
+ () => Na({
2106
2231
  country: t,
2107
- useSpecialties: s,
2232
+ useSpecialties: a,
2108
2233
  allowOperatorSelection: i,
2109
2234
  lockedOperatorId: n,
2110
- specialties: R,
2111
- services: c,
2112
- operators: j,
2113
- availableSlots: f,
2235
+ specialties: L,
2236
+ services: m,
2237
+ operators: g,
2238
+ availableSlots: p,
2114
2239
  value: y
2115
2240
  }),
2116
2241
  [
2117
2242
  t,
2118
- s,
2243
+ a,
2119
2244
  i,
2120
2245
  n,
2121
2246
  o,
2122
- R,
2247
+ L,
2248
+ m,
2249
+ g,
2123
2250
  c,
2124
- j,
2125
2251
  p,
2126
- f,
2127
2252
  y
2128
2253
  ]
2129
- ), [M, G] = q(
2130
- l.currentStep
2131
- ), Le = se(l.currentStep);
2132
- te(() => {
2133
- l.currentStep > Le.current && G(l.currentStep), Le.current = l.currentStep;
2134
- }, [l.currentStep]);
2135
- const [de, le] = q("idle"), [De, Te] = q(null), Fe = ie(
2136
- async (P) => {
2137
- if (!l.selectedSlot) return;
2138
- const Ae = {
2139
- slot: l.selectedSlot,
2254
+ ), [re, de] = j(
2255
+ I.currentStep
2256
+ ), je = te(I.currentStep);
2257
+ ee(() => {
2258
+ I.currentStep > je.current && de(I.currentStep), je.current = I.currentStep;
2259
+ }, [I.currentStep]);
2260
+ const [le, ce] = j("idle"), [Be, Oe] = j(null), qe = q(
2261
+ async (V) => {
2262
+ if (!I.selectedSlot) return;
2263
+ const Ee = {
2264
+ slot: I.selectedSlot,
2140
2265
  value: {
2141
2266
  ...y,
2142
- details: P,
2143
- operatorId: Pe(y) ?? y.operatorId
2267
+ details: V,
2268
+ operatorId: $e(y) ?? y.operatorId
2144
2269
  },
2145
- details: P
2270
+ details: V
2146
2271
  };
2147
- le("submitting");
2272
+ ce("submitting");
2148
2273
  try {
2149
- await F(Ae), Te({
2150
- slot: l.selectedSlot,
2151
- details: P,
2274
+ await B(Ee), Oe({
2275
+ slot: I.selectedSlot,
2276
+ details: V,
2152
2277
  specialtyId: y.specialtyId,
2153
2278
  serviceId: y.serviceId,
2154
2279
  insuranceType: y.insuranceType,
2155
- operatorId: Pe(y),
2280
+ operatorId: $e(y),
2156
2281
  date: y.date
2157
- }), le("success");
2282
+ }), ce("success");
2158
2283
  } catch {
2159
- throw le("error"), new Error("Booking submission failed");
2284
+ throw ce("error"), new Error("Booking submission failed");
2160
2285
  }
2161
2286
  },
2162
- [l.selectedSlot, F, y]
2163
- ), ce = se(null);
2164
- ft(Me, () => ce.current, []);
2165
- const me = de === "success" ? 8 : l.currentStep, ze = se(null);
2166
- te(() => {
2167
- if (me !== ze.current && (ze.current = me, A == null || A(me), me === 8 && ce.current))
2287
+ [I.selectedSlot, B, y]
2288
+ ), ue = te(null);
2289
+ kt(Te, () => ue.current, []);
2290
+ const me = le === "success" ? 8 : I.currentStep, He = te(null);
2291
+ ee(() => {
2292
+ if (me !== He.current && (He.current = me, O == null || O(me), me === 8 && ue.current))
2168
2293
  try {
2169
- ce.current.scrollIntoView({
2294
+ ue.current.scrollIntoView({
2170
2295
  behavior: "smooth",
2171
2296
  block: "start"
2172
2297
  });
2173
2298
  } catch {
2174
- ce.current.scrollIntoView();
2299
+ ue.current.scrollIntoView();
2175
2300
  }
2176
- }, [me, A]);
2177
- const _e = C(
2301
+ }, [me, O]);
2302
+ const Pe = w(
2178
2303
  () => ({
2179
- getVariant: () => V,
2304
+ getVariant: () => R,
2180
2305
  reset: () => {
2181
- I({}), Te(null), le("idle"), G(1);
2306
+ C({}), Oe(null), ce("idle"), de(1);
2182
2307
  },
2183
- goToStep: (P) => {
2184
- G(P);
2308
+ goToStep: (V) => {
2309
+ de(V);
2185
2310
  }
2186
2311
  }),
2187
- [V, I]
2312
+ [R, C]
2188
2313
  );
2189
- vt(la, _e, Q);
2190
- const ut = W ?? re("booking.regionLabel"), pt = C(() => de !== "success" || !De ? null : /* @__PURE__ */ a(
2191
- Oa,
2314
+ St(ha, Pe, X);
2315
+ const vt = oe ?? ie("booking.regionLabel"), bt = w(() => le !== "success" || !Be ? null : /* @__PURE__ */ s(
2316
+ ja,
2192
2317
  {
2193
- snapshot: De,
2194
- operators: j,
2195
- specialties: R,
2196
- services: c,
2197
- locale: ee,
2198
- mode: J,
2199
- showModify: K,
2200
- onReset: () => _e.reset(),
2318
+ snapshot: Be,
2319
+ operators: g,
2320
+ specialties: L,
2321
+ services: m,
2322
+ locale: Q,
2323
+ mode: H,
2324
+ showModify: ne,
2325
+ onReset: () => Pe.reset(),
2201
2326
  onModify: () => {
2202
- Te(null), le("idle"), G(7);
2327
+ Oe(null), ce("idle"), de(7);
2203
2328
  }
2204
2329
  }
2205
2330
  ), [
2206
- de,
2207
- De,
2208
- j,
2209
- R,
2210
- c,
2211
- ee,
2212
- J,
2213
- K,
2214
- _e
2215
- ]), gt = C(() => {
2216
- if (de === "success") return null;
2217
- const P = V === "accordion" ? Pa : V === "calendar" ? Va : V === "flexible" ? Ra : V === "progress" ? La : Ea, Ae = {
2218
- cascade: l,
2331
+ le,
2332
+ Be,
2333
+ g,
2334
+ L,
2335
+ m,
2336
+ Q,
2337
+ H,
2338
+ ne,
2339
+ Pe
2340
+ ]), yt = w(() => {
2341
+ if (le === "success") return null;
2342
+ const V = R === "accordion" ? Ha : R === "calendar" ? Ga : R === "flexible" ? Ua : R === "progress" ? Ya : qa, Ee = {
2343
+ cascade: I,
2219
2344
  inputs: {
2220
- specialties: R,
2221
- services: c,
2222
- operators: j,
2223
- availableDates: p,
2224
- availableSlots: f,
2345
+ specialties: L,
2346
+ services: m,
2347
+ operators: g,
2348
+ availableDates: c,
2349
+ availableSlots: p,
2225
2350
  nextAvailableDate: u
2226
2351
  },
2227
2352
  value: y,
2228
- onChange: I,
2229
- onSubmit: Fe,
2353
+ onChange: C,
2354
+ onSubmit: qe,
2230
2355
  policy: { country: t, lockedOperatorId: n },
2231
2356
  detailsProps: {
2232
- requireCodiceFiscale: x,
2357
+ requireCodiceFiscale: S,
2233
2358
  requireDateOfBirth: k,
2234
2359
  requireInsuranceNumber: h,
2235
2360
  insuranceType: y.insuranceType,
2236
- showNote: v,
2237
- showReturningPatientFlag: w,
2238
- privacyPolicyUrl: N,
2239
- termsUrl: S,
2240
- validateCodiceFiscale: b,
2361
+ showNote: N,
2362
+ showReturningPatientFlag: x,
2363
+ privacyPolicyUrl: D,
2364
+ termsUrl: b,
2365
+ validateCodiceFiscale: f,
2241
2366
  validateInsuranceNumber: r,
2242
- confirmationChannels: O,
2243
- defaultConfirmationChannels: D,
2244
- submitError: T
2367
+ confirmationChannels: _,
2368
+ defaultConfirmationChannels: M,
2369
+ submitError: J
2245
2370
  },
2246
- emptyServicesSlot: X,
2247
- onboardingIncompleteSlot: he,
2248
- loadingDates: E,
2249
- loadingSlots: z,
2371
+ emptyServicesSlot: be,
2372
+ onboardingIncompleteSlot: U,
2373
+ loadingDates: z,
2374
+ loadingSlots: G,
2250
2375
  onDateSelect: Z,
2251
- submitting: H,
2252
- locale: ee,
2253
- activeStep: M,
2254
- setActiveStep: G
2376
+ datePickerStyle: E,
2377
+ submitting: T,
2378
+ locale: Q,
2379
+ activeStep: re,
2380
+ setActiveStep: de
2255
2381
  };
2256
- return /* @__PURE__ */ a(P, { ...Ae });
2382
+ return /* @__PURE__ */ s(V, { ...Ee });
2257
2383
  }, [
2258
- de,
2259
- V,
2260
- l,
2384
+ le,
2261
2385
  R,
2386
+ I,
2387
+ L,
2388
+ m,
2389
+ g,
2262
2390
  c,
2263
- j,
2264
2391
  p,
2265
- f,
2266
2392
  u,
2267
2393
  y,
2268
- I,
2269
- Fe,
2394
+ C,
2395
+ qe,
2270
2396
  t,
2271
2397
  n,
2272
- x,
2398
+ S,
2273
2399
  k,
2274
2400
  h,
2275
- T,
2276
- v,
2277
- w,
2401
+ J,
2278
2402
  N,
2279
- S,
2403
+ x,
2404
+ D,
2280
2405
  b,
2406
+ f,
2281
2407
  r,
2282
- O,
2283
- D,
2284
- X,
2285
- he,
2286
- E,
2408
+ _,
2409
+ M,
2410
+ be,
2411
+ U,
2287
2412
  z,
2413
+ G,
2288
2414
  Z,
2289
- H,
2290
- ee,
2291
- M
2415
+ E,
2416
+ T,
2417
+ Q,
2418
+ re
2292
2419
  ]);
2293
- return /* @__PURE__ */ g(
2420
+ return /* @__PURE__ */ v(
2294
2421
  "div",
2295
2422
  {
2296
- ref: ce,
2423
+ ref: ue,
2297
2424
  role: "region",
2298
- "aria-label": ut,
2299
- id: Q,
2425
+ "aria-label": vt,
2426
+ id: X,
2300
2427
  "data-component": "booking",
2301
- "data-component-id": Q,
2302
- "data-variant": V,
2303
- className: Sa({
2304
- variant: V,
2305
- surface: fe,
2306
- className: oe
2428
+ "data-component-id": X,
2429
+ "data-variant": R,
2430
+ className: _a({
2431
+ variant: R,
2432
+ surface: se,
2433
+ className: De
2307
2434
  }),
2308
- ...Ce,
2435
+ ..._e,
2309
2436
  children: [
2310
- /* @__PURE__ */ g(
2437
+ /* @__PURE__ */ v(
2311
2438
  "div",
2312
2439
  {
2313
2440
  className: [
@@ -2319,22 +2446,22 @@ const Fa = [], za = [], $a = Ge(
2319
2446
  "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
2320
2447
  ].join(" "),
2321
2448
  children: [
2322
- /* @__PURE__ */ a("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: re("booking.regionLabel") }),
2323
- /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: re("booking.headingSubtitle") })
2449
+ /* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: ie("booking.regionLabel") }),
2450
+ /* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: ie("booking.headingSubtitle") })
2324
2451
  ]
2325
2452
  }
2326
2453
  ),
2327
- pt ?? gt
2454
+ bt ?? yt
2328
2455
  ]
2329
2456
  }
2330
2457
  );
2331
2458
  }
2332
2459
  );
2333
- $a.displayName = "Booking";
2460
+ Ja.displayName = "Booking";
2334
2461
  export {
2335
- $a as B,
2336
- Ee as C,
2337
- pe as O,
2338
- la as b
2462
+ Ja as B,
2463
+ Fe as C,
2464
+ he as O,
2465
+ ha as b
2339
2466
  };
2340
- //# sourceMappingURL=booking-CbdbYvWp.js.map
2467
+ //# sourceMappingURL=booking-x4GlW5cb.js.map