@alfadocs/ui-kit 1.48.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-C4h0xMGi.js → agenda-card-CjjxlA9K.js} +2 -2
- package/dist/_chunks/{agenda-tray-DNZYW2xt.js → agenda-tray-BhZASyJm.js} +2 -2
- package/dist/_chunks/{alia-sidebar-Crn8OGPF.js → alia-sidebar-Dx-oeOV2.js} +3 -3
- package/dist/_chunks/{appointment-card-CvGU0QP6.js → appointment-card-BgLpE6T5.js} +2 -2
- package/dist/_chunks/{appointment-peek--dmWznLZ.js → appointment-peek-BDiCIBb-.js} +2 -2
- package/dist/_chunks/{appointment-timeline-y9uYZMUd.js → appointment-timeline-wQ-PdkFV.js} +2 -2
- package/dist/_chunks/{appointment-tray-BTecNeSb.js → appointment-tray-D7Gt6m8x.js} +2 -2
- package/dist/_chunks/{avatar-CkDeQOSI.js → avatar-BVvjKNTp.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-CA0YNJMR.js → balance-badge-cell-klaxFNL_.js} +3 -3
- package/dist/_chunks/{booking-BQYFDcrz.js → booking-BF9pVa2n.js} +377 -381
- package/dist/_chunks/{calendar-DjoJ9ovF.js → calendar-Bt44KMNO.js} +3 -2
- package/dist/_chunks/calendar-workspace-C_eXL1by.js +10464 -0
- package/dist/_chunks/{chat-message-Co_NRGM4.js → chat-message-B4ihjNy3.js} +2 -2
- package/dist/_chunks/{clinical-note-card-DYDQ3q2x.js → clinical-note-card-B7s5BtEl.js} +2 -2
- package/dist/_chunks/{data-table-DWOSxlsy.js → data-table-CrI3_bjH.js} +411 -410
- package/dist/_chunks/{dependent-selector-BR_8D2Qu.js → dependent-selector-58hTg5rB.js} +2 -2
- package/dist/_chunks/{entity-summary-Ckz_U00H.js → entity-summary-CFJfBdVP.js} +2 -2
- package/dist/_chunks/{file-manager-CqgxLqoA.js → file-manager-C6QQPQV5.js} +2 -2
- package/dist/_chunks/link-cell-renderer-CkNbUsBM.js +867 -0
- package/dist/_chunks/{marketplace-app-shell-Dehuxbi-.js → marketplace-app-shell-1uKqs4gD.js} +2 -2
- package/dist/_chunks/{message-card-DKOtnBHy.js → message-card-C2zsvyj0.js} +2 -2
- package/dist/_chunks/{message-tray-COMEtmyr.js → message-tray-CMlmxdH2.js} +2 -2
- package/dist/_chunks/{notes-panel-BiOxZL_0.js → notes-panel-xxpFt-I1.js} +2 -2
- package/dist/_chunks/{operator-hero-5061fkY5.js → operator-hero-DyrNLoRO.js} +2 -2
- package/dist/_chunks/{patient-details-C23Hdm8v.js → patient-details-tTlvrJSU.js} +2 -2
- package/dist/_chunks/{patient-summary-card-C36L3h7h.js → patient-summary-card-DQ__6DR-.js} +2 -2
- package/dist/_chunks/{practice-profile-hero-CPy5h2yI.js → practice-profile-hero-B-WcJYNH.js} +2 -2
- package/dist/_chunks/{practice-results-t2BHht91.js → practice-results-EKRiqWtQ.js} +2 -2
- package/dist/_chunks/{signature-request-15D363w5.js → signature-request-BUGeG8oD.js} +2 -2
- package/dist/_chunks/{task-card-CTTQfPS6.js → task-card-jaOhnj_q.js} +31 -30
- package/dist/_chunks/{task-tray-JA-qp_pB.js → task-tray-HHyxi9ga.js} +2 -2
- package/dist/_chunks/{tasks-panel-C_dVDQKJ.js → tasks-panel-DbSjq_mz.js} +2 -2
- package/dist/_chunks/{timeline-61AihzYz.js → timeline-ChY7iZrs.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-D2FH-cHF.js → use-appointment-details-read-5-hV-2xA.js} +4 -4
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/booking/cascade.d.ts +5 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/data-table/filters/number-filter.d.ts +26 -12
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-card/task-card.d.ts +3 -2
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +19 -14
- package/dist/i18n/locales/ar.js +19 -14
- package/dist/i18n/locales/de.d.ts +19 -14
- package/dist/i18n/locales/de.js +19 -14
- package/dist/i18n/locales/el.d.ts +19 -14
- package/dist/i18n/locales/el.js +19 -14
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.js +6 -0
- package/dist/i18n/locales/es.d.ts +19 -14
- package/dist/i18n/locales/es.js +19 -14
- package/dist/i18n/locales/fr.d.ts +19 -14
- package/dist/i18n/locales/fr.js +19 -14
- package/dist/i18n/locales/hi.d.ts +19 -14
- package/dist/i18n/locales/hi.js +19 -14
- package/dist/i18n/locales/it.d.ts +5 -0
- package/dist/i18n/locales/it.js +6 -0
- package/dist/i18n/locales/ja.d.ts +19 -14
- package/dist/i18n/locales/ja.js +19 -14
- package/dist/i18n/locales/nl.d.ts +19 -14
- package/dist/i18n/locales/nl.js +19 -14
- package/dist/i18n/locales/pl.d.ts +19 -14
- package/dist/i18n/locales/pl.js +19 -14
- package/dist/i18n/locales/pt.d.ts +19 -14
- package/dist/i18n/locales/pt.js +19 -14
- package/dist/i18n/locales/ro.d.ts +19 -14
- package/dist/i18n/locales/ro.js +19 -14
- package/dist/i18n/locales/ru.d.ts +19 -14
- package/dist/i18n/locales/ru.js +19 -14
- package/dist/i18n/locales/sq.d.ts +19 -14
- package/dist/i18n/locales/sq.js +19 -14
- package/dist/i18n/locales/sv.d.ts +19 -14
- package/dist/i18n/locales/sv.js +19 -14
- package/dist/i18n/locales/tr.d.ts +19 -14
- package/dist/i18n/locales/tr.js +19 -14
- package/dist/i18n/locales/zh.d.ts +19 -14
- package/dist/i18n/locales/zh.js +19 -14
- package/dist/index.js +34 -34
- package/dist/locales/ar.json +19 -14
- package/dist/locales/de.json +19 -14
- package/dist/locales/el.json +19 -14
- package/dist/locales/en.json +5 -0
- package/dist/locales/es.json +19 -14
- package/dist/locales/fr.json +19 -14
- package/dist/locales/hi.json +19 -14
- package/dist/locales/it.json +5 -0
- package/dist/locales/ja.json +19 -14
- package/dist/locales/nl.json +19 -14
- package/dist/locales/pl.json +19 -14
- package/dist/locales/pt.json +19 -14
- package/dist/locales/ro.json +19 -14
- package/dist/locales/ru.json +19 -14
- package/dist/locales/sq.json +19 -14
- package/dist/locales/sv.json +19 -14
- package/dist/locales/tr.json +19 -14
- package/dist/locales/zh.json +19 -14
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +10 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +4 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +12 -12
- package/dist/_chunks/calendar-workspace-D8zX9JWm.js +0 -10423
- package/dist/_chunks/link-cell-renderer-Tswqf6BT.js +0 -778
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as b, jsx as s, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Zt, useId as gt, useRef as
|
|
2
|
+
import { forwardRef as Zt, useId as gt, useRef as L, useState as ie, useCallback as ke, useEffect as z, useMemo as M, useImperativeHandle as Ds } from "react";
|
|
3
3
|
import { c as ht } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as q, Trans as Ms } from "react-i18next";
|
|
5
5
|
import { u as Ts } from "./registry-DvAUVLHh.js";
|
|
@@ -18,8 +18,8 @@ import { a as st } from "./format-price-DAbh61Lz.js";
|
|
|
18
18
|
import { B as Qt } from "./badge-BAkd6_Pj.js";
|
|
19
19
|
import { I as qt } from "./icon-button-CY7GU_Se.js";
|
|
20
20
|
import { S as vt } from "./select-upNAltly.js";
|
|
21
|
-
import { C as
|
|
22
|
-
import { M as
|
|
21
|
+
import { C as Ct } from "./combobox-B_rLwmSv.js";
|
|
22
|
+
import { M as At } from "./multi-select-N4Smh-gj.js";
|
|
23
23
|
import { S as mt } from "./skeleton-B1KTdJ4N.js";
|
|
24
24
|
import { E as es } from "./empty-state-DTBZ1ENT.js";
|
|
25
25
|
import { S as Ls } from "./stepper-accordion-jMR8NaOB.js";
|
|
@@ -32,7 +32,7 @@ import { w as ts, c as Je, a as xt, i as $s, s as tt, l as Ks, x as dt } from ".
|
|
|
32
32
|
import { s as zs } from "./subDays-HPvBuvq3.js";
|
|
33
33
|
import { C as js } from "./chevron-left-B8cOyH-V.js";
|
|
34
34
|
import { C as qs } from "./chevron-right-I9AeSxH2.js";
|
|
35
|
-
import { c as
|
|
35
|
+
import { c as ge } from "./createLucideIcon-DhHxpK9K.js";
|
|
36
36
|
import { M as Js, S as Hs } from "./sun-Bj9Mr553.js";
|
|
37
37
|
import { S as Gs } from "./stethoscope-sZXGC43m.js";
|
|
38
38
|
import { H as Us } from "./heart-pulse-BCppJyN2.js";
|
|
@@ -55,7 +55,7 @@ const en = [
|
|
|
55
55
|
key: "169zse"
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
|
-
], tn =
|
|
58
|
+
], tn = ge("activity", en);
|
|
59
59
|
/**
|
|
60
60
|
* @license lucide-react v1.22.0 - ISC
|
|
61
61
|
*
|
|
@@ -70,7 +70,7 @@ const sn = [
|
|
|
70
70
|
key: "w610uw"
|
|
71
71
|
}
|
|
72
72
|
]
|
|
73
|
-
], nn =
|
|
73
|
+
], nn = ge("bone", sn);
|
|
74
74
|
/**
|
|
75
75
|
* @license lucide-react v1.22.0 - ISC
|
|
76
76
|
*
|
|
@@ -86,7 +86,7 @@ const an = [
|
|
|
86
86
|
["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
|
|
87
87
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
88
88
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
89
|
-
], rn =
|
|
89
|
+
], rn = ge("brain", an);
|
|
90
90
|
/**
|
|
91
91
|
* @license lucide-react v1.22.0 - ISC
|
|
92
92
|
*
|
|
@@ -102,7 +102,7 @@ const on = [
|
|
|
102
102
|
["path", { d: "M13 18H7", key: "bb0bb7" }],
|
|
103
103
|
["path", { d: "M7 14h.01", key: "1qa3f1" }],
|
|
104
104
|
["path", { d: "M17 18h.01", key: "1bdyru" }]
|
|
105
|
-
], dn =
|
|
105
|
+
], dn = ge("calendar-range", on);
|
|
106
106
|
/**
|
|
107
107
|
* @license lucide-react v1.22.0 - ISC
|
|
108
108
|
*
|
|
@@ -112,7 +112,7 @@ const on = [
|
|
|
112
112
|
const cn = [
|
|
113
113
|
["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" }],
|
|
114
114
|
["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
|
|
115
|
-
], ln =
|
|
115
|
+
], ln = ge("ear", cn);
|
|
116
116
|
/**
|
|
117
117
|
* @license lucide-react v1.22.0 - ISC
|
|
118
118
|
*
|
|
@@ -126,7 +126,7 @@ const un = [
|
|
|
126
126
|
["path", { d: "M9 14h2", key: "197e7h" }],
|
|
127
127
|
["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
|
|
128
128
|
["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
|
|
129
|
-
], pn =
|
|
129
|
+
], pn = ge("microscope", un);
|
|
130
130
|
/**
|
|
131
131
|
* @license lucide-react v1.22.0 - ISC
|
|
132
132
|
*
|
|
@@ -139,7 +139,7 @@ const mn = [
|
|
|
139
139
|
{ 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" }
|
|
140
140
|
],
|
|
141
141
|
["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
|
|
142
|
-
], fn =
|
|
142
|
+
], fn = ge("pill", mn);
|
|
143
143
|
/**
|
|
144
144
|
* @license lucide-react v1.22.0 - ISC
|
|
145
145
|
*
|
|
@@ -152,7 +152,7 @@ const gn = [
|
|
|
152
152
|
["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
|
|
153
153
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
154
154
|
["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
|
|
155
|
-
], hn =
|
|
155
|
+
], hn = ge("scissors", gn);
|
|
156
156
|
/**
|
|
157
157
|
* @license lucide-react v1.22.0 - ISC
|
|
158
158
|
*
|
|
@@ -164,7 +164,7 @@ const vn = [
|
|
|
164
164
|
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
|
|
165
165
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
166
166
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
167
|
-
], bn =
|
|
167
|
+
], bn = ge("smile", vn);
|
|
168
168
|
/**
|
|
169
169
|
* @license lucide-react v1.22.0 - ISC
|
|
170
170
|
*
|
|
@@ -180,7 +180,7 @@ const yn = [
|
|
|
180
180
|
["path", { d: "M22 22H2", key: "19qnx5" }],
|
|
181
181
|
["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
|
|
182
182
|
["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
|
|
183
|
-
], kn =
|
|
183
|
+
], kn = ge("sunset", yn);
|
|
184
184
|
/**
|
|
185
185
|
* @license lucide-react v1.22.0 - ISC
|
|
186
186
|
*
|
|
@@ -194,7 +194,7 @@ const Sn = [
|
|
|
194
194
|
["path", { d: "m9 11 4 4", key: "rovt3i" }],
|
|
195
195
|
["path", { d: "m5 19-3 3", key: "59f2uf" }],
|
|
196
196
|
["path", { d: "m14 4 6 6", key: "yqp9t2" }]
|
|
197
|
-
], Ht =
|
|
197
|
+
], Ht = ge("syringe", Sn);
|
|
198
198
|
function xn(e, t, n) {
|
|
199
199
|
return ts(e, -1, n);
|
|
200
200
|
}
|
|
@@ -277,22 +277,22 @@ const In = {
|
|
|
277
277
|
"email",
|
|
278
278
|
"whatsapp",
|
|
279
279
|
"sms"
|
|
280
|
-
],
|
|
280
|
+
], ye = "all", Nn = "de";
|
|
281
281
|
function wn(e) {
|
|
282
282
|
const t = e.lockedOperatorId;
|
|
283
283
|
return [...t ? e.operatorsByService ? e.specialties.filter(
|
|
284
284
|
(i) => e.services.some(
|
|
285
285
|
(a) => {
|
|
286
|
-
var
|
|
287
|
-
return a.specialtyId === i.id && ((
|
|
286
|
+
var o;
|
|
287
|
+
return a.specialtyId === i.id && ((o = a.operatorIds) == null ? void 0 : o.includes(t));
|
|
288
288
|
}
|
|
289
289
|
)
|
|
290
290
|
) : e.specialties.filter((i) => {
|
|
291
291
|
var a;
|
|
292
292
|
return (a = i.operatorIds) == null ? void 0 : a.includes(t);
|
|
293
293
|
}) : e.specialties].sort((i, a) => {
|
|
294
|
-
const
|
|
295
|
-
return
|
|
294
|
+
const o = i.sequenceNumber ?? Number.POSITIVE_INFINITY, c = a.sequenceNumber ?? Number.POSITIVE_INFINITY;
|
|
295
|
+
return o - c;
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
function Cn(e) {
|
|
@@ -303,7 +303,7 @@ function Cn(e) {
|
|
|
303
303
|
return (a = i.operatorIds) == null ? void 0 : a.includes(e.lockedOperatorId);
|
|
304
304
|
}
|
|
305
305
|
)), e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) {
|
|
306
|
-
const i =
|
|
306
|
+
const i = _e(e.value);
|
|
307
307
|
i.length > 0 && (t = t.filter(
|
|
308
308
|
(a) => a.specialtyId !== void 0 && i.includes(a.specialtyId)
|
|
309
309
|
));
|
|
@@ -311,31 +311,31 @@ function Cn(e) {
|
|
|
311
311
|
return t;
|
|
312
312
|
}
|
|
313
313
|
function An(e) {
|
|
314
|
-
const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, n =
|
|
314
|
+
const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, n = Ce(e.value);
|
|
315
315
|
if ((!t || e.operatorsByService) && n.length > 0)
|
|
316
316
|
return e.operators.filter(
|
|
317
317
|
(i) => {
|
|
318
318
|
var a;
|
|
319
|
-
return (a = i.appointmentBookingReasonIds) == null ? void 0 : a.some((
|
|
319
|
+
return (a = i.appointmentBookingReasonIds) == null ? void 0 : a.some((o) => n.includes(o));
|
|
320
320
|
}
|
|
321
321
|
);
|
|
322
322
|
if (t) {
|
|
323
|
-
const i =
|
|
323
|
+
const i = _e(e.value);
|
|
324
324
|
if (i.length > 0)
|
|
325
325
|
return e.operators.filter(
|
|
326
326
|
(a) => {
|
|
327
|
-
var
|
|
328
|
-
return (
|
|
327
|
+
var o;
|
|
328
|
+
return (o = a.specialtyIds) == null ? void 0 : o.some((c) => i.includes(c));
|
|
329
329
|
}
|
|
330
330
|
);
|
|
331
331
|
}
|
|
332
332
|
return [];
|
|
333
333
|
}
|
|
334
334
|
function Dn(e, t) {
|
|
335
|
-
const n = e.country === Nn, i = !n || e.value.insuranceType !== void 0,
|
|
335
|
+
const n = e.country === Nn, i = !n || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, c = _e(e.value).length > 0, f = !o || c, u = Ce(e.value).length > 0, g = !f || u, r = t.operators, p = !!e.allowOperatorSelection && g && u && !e.lockedOperatorId && r.length > 1, m = g && u, y = (!m || e.value.date !== void 0) && e.value.date !== void 0, _ = (!y || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, I = u && r.length === 0;
|
|
336
336
|
return {
|
|
337
337
|
insurance: n,
|
|
338
|
-
specialty:
|
|
338
|
+
specialty: o,
|
|
339
339
|
service: f,
|
|
340
340
|
operator: p,
|
|
341
341
|
date: m,
|
|
@@ -346,35 +346,47 @@ function Dn(e, t) {
|
|
|
346
346
|
}
|
|
347
347
|
function Mn(e, t) {
|
|
348
348
|
const n = [];
|
|
349
|
-
t.insurance && n.push(1), t.specialty && n.push(2), n.push(3), t.operator && n.push(4), n.push(5), n.push(6), n.push(7)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
2: Ce(e.value).length > 0,
|
|
354
|
-
3: Se(e.value).length > 0,
|
|
355
|
-
4: e.value.operatorId !== void 0 || e.value.operatorIds !== void 0 && e.value.operatorIds.length > 0,
|
|
356
|
-
5: e.value.date !== void 0,
|
|
357
|
-
6: e.value.slotKey !== void 0,
|
|
358
|
-
7: !1
|
|
359
|
-
// details fulfilment is owned by the form's own validation
|
|
360
|
-
};
|
|
361
|
-
return {
|
|
362
|
-
currentStep: n.find((r) => !i[r]) ?? 7,
|
|
349
|
+
return t.insurance && n.push(1), t.specialty && n.push(2), n.push(3), t.operator && n.push(4), n.push(5), n.push(6), n.push(7), {
|
|
350
|
+
currentStep: n.find(
|
|
351
|
+
(a) => !we(a, e.value)
|
|
352
|
+
) ?? 7,
|
|
363
353
|
visibleSteps: n
|
|
364
354
|
};
|
|
365
355
|
}
|
|
356
|
+
function we(e, t) {
|
|
357
|
+
switch (e) {
|
|
358
|
+
case 1:
|
|
359
|
+
return t.insuranceType !== void 0;
|
|
360
|
+
// 0.34.0: array-or-single — satisfied when EITHER form is present.
|
|
361
|
+
case 2:
|
|
362
|
+
return _e(t).length > 0;
|
|
363
|
+
case 3:
|
|
364
|
+
return Ce(t).length > 0;
|
|
365
|
+
// Always satisfied, like its gate: "no preference" is a valid answer,
|
|
366
|
+
// whether it is the `'all'` sentinel or an empty multi-select.
|
|
367
|
+
case 4:
|
|
368
|
+
return !0;
|
|
369
|
+
case 5:
|
|
370
|
+
return t.date !== void 0;
|
|
371
|
+
case 6:
|
|
372
|
+
return t.slotKey !== void 0;
|
|
373
|
+
// Details fulfilment is owned by the form's own validation.
|
|
374
|
+
case 7:
|
|
375
|
+
return !1;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
366
378
|
function Tn(e) {
|
|
367
379
|
const t = {
|
|
368
380
|
specialties: wn(e),
|
|
369
381
|
services: Cn(e),
|
|
370
382
|
operators: An(e)
|
|
371
383
|
}, n = Dn(e, t), { currentStep: i, visibleSteps: a } = Mn(e, n);
|
|
372
|
-
let
|
|
384
|
+
let o;
|
|
373
385
|
if (e.value.date && e.value.slotKey) {
|
|
374
386
|
const g = e.availableSlots[e.value.date];
|
|
375
|
-
g && (
|
|
387
|
+
g && (o = g.find((r) => r.key === e.value.slotKey));
|
|
376
388
|
}
|
|
377
|
-
const c =
|
|
389
|
+
const c = Ce(e.value), l = c.length > 0 ? e.services.find((g) => g.id === c[0]) : void 0, f = _e(e.value).length > 0, u = c.length > 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!n.insurance || e.value.insuranceType !== void 0) && (!n.specialty || f);
|
|
378
390
|
return {
|
|
379
391
|
gates: n,
|
|
380
392
|
filtered: t,
|
|
@@ -383,7 +395,7 @@ function Tn(e) {
|
|
|
383
395
|
visibleSteps: a,
|
|
384
396
|
isReadyToSubmit: u,
|
|
385
397
|
durationMin: l == null ? void 0 : l.durationMin,
|
|
386
|
-
selectedSlot:
|
|
398
|
+
selectedSlot: o
|
|
387
399
|
};
|
|
388
400
|
}
|
|
389
401
|
function ss(e, t) {
|
|
@@ -434,7 +446,7 @@ function as(e, t) {
|
|
|
434
446
|
// Default the operator to the "All operators" sentinel so a patient
|
|
435
447
|
// who doesn't care about picking lands on a satisfied step 4 without
|
|
436
448
|
// any further input.
|
|
437
|
-
operatorId: t ?
|
|
449
|
+
operatorId: t ? ye : void 0,
|
|
438
450
|
operatorIds: void 0,
|
|
439
451
|
date: void 0,
|
|
440
452
|
slotKey: void 0,
|
|
@@ -447,7 +459,7 @@ function rs(e, t) {
|
|
|
447
459
|
...e,
|
|
448
460
|
serviceId: void 0,
|
|
449
461
|
serviceIds: t,
|
|
450
|
-
operatorId: n ?
|
|
462
|
+
operatorId: n ? ye : void 0,
|
|
451
463
|
operatorIds: void 0,
|
|
452
464
|
date: void 0,
|
|
453
465
|
slotKey: void 0,
|
|
@@ -474,13 +486,13 @@ function ds(e, t) {
|
|
|
474
486
|
details: void 0
|
|
475
487
|
};
|
|
476
488
|
}
|
|
477
|
-
function
|
|
489
|
+
function _e(e) {
|
|
478
490
|
return e.specialtyIds && e.specialtyIds.length > 0 ? e.specialtyIds : e.specialtyId ? [e.specialtyId] : [];
|
|
479
491
|
}
|
|
480
|
-
function
|
|
492
|
+
function Ce(e) {
|
|
481
493
|
return e.serviceIds && e.serviceIds.length > 0 ? e.serviceIds : e.serviceId ? [e.serviceId] : [];
|
|
482
494
|
}
|
|
483
|
-
function
|
|
495
|
+
function wt(e) {
|
|
484
496
|
return e.operatorIds && e.operatorIds.length > 0 ? e.operatorIds : e.operatorId ? [e.operatorId] : [];
|
|
485
497
|
}
|
|
486
498
|
function bt(e, t) {
|
|
@@ -501,15 +513,15 @@ function cs(e, t) {
|
|
|
501
513
|
function On(e, t) {
|
|
502
514
|
let n = e;
|
|
503
515
|
if (t.lockedOperatorId && n.operatorId !== t.lockedOperatorId && (n = { ...n, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && n.specialtyId === void 0 && n.specialtyIds === void 0 && (n = { ...n, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
|
|
504
|
-
const a =
|
|
516
|
+
const a = _e(n), o = a.length > 0 ? t.services.filter(
|
|
505
517
|
(c) => c.specialtyId && a.includes(c.specialtyId)
|
|
506
518
|
) : t.services;
|
|
507
|
-
|
|
519
|
+
o.length === 1 && n.serviceId === void 0 && n.serviceIds === void 0 && (n = { ...n, serviceId: o[0].id }, n.operatorId === void 0 && n.operatorIds === void 0 && (n = { ...n, operatorId: ye }));
|
|
508
520
|
}
|
|
509
521
|
return n;
|
|
510
522
|
}
|
|
511
523
|
function ls(e) {
|
|
512
|
-
if (e.operatorId && e.operatorId !==
|
|
524
|
+
if (e.operatorId && e.operatorId !== ye)
|
|
513
525
|
return e.operatorId;
|
|
514
526
|
}
|
|
515
527
|
function Bn(e) {
|
|
@@ -527,11 +539,11 @@ function _n(e, t, n) {
|
|
|
527
539
|
return Nt.filter(
|
|
528
540
|
(u) => n.includes(u) && a.has(u)
|
|
529
541
|
);
|
|
530
|
-
const
|
|
531
|
-
a.has("email") &&
|
|
542
|
+
const o = [];
|
|
543
|
+
a.has("email") && o.push("email");
|
|
532
544
|
const c = Bn(t), l = a.has("whatsapp");
|
|
533
|
-
l && c &&
|
|
534
|
-
const f = new Set(
|
|
545
|
+
l && c && o.push("whatsapp"), !l && a.has("sms") && o.push("sms");
|
|
546
|
+
const f = new Set(o);
|
|
535
547
|
return Nt.filter((u) => f.has(u));
|
|
536
548
|
}
|
|
537
549
|
const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 300, ct = { state: "idle" }, Dt = Zt(
|
|
@@ -541,13 +553,13 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
541
553
|
onSubmit: n,
|
|
542
554
|
requireCodiceFiscale: i = !1,
|
|
543
555
|
requireDateOfBirth: a = !1,
|
|
544
|
-
requireInsuranceNumber:
|
|
556
|
+
requireInsuranceNumber: o = !1,
|
|
545
557
|
insuranceType: c,
|
|
546
558
|
showNote: l = !1,
|
|
547
559
|
showReturningPatientFlag: f = !1,
|
|
548
560
|
privacyPolicyUrl: u,
|
|
549
561
|
termsUrl: g,
|
|
550
|
-
payment:
|
|
562
|
+
payment: r,
|
|
551
563
|
paymentTermsUrl: p,
|
|
552
564
|
paymentBlocked: m = !1,
|
|
553
565
|
criticalInformationToAccept: S,
|
|
@@ -561,10 +573,10 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
561
573
|
submitError: A
|
|
562
574
|
}, h) => {
|
|
563
575
|
var Ue, me;
|
|
564
|
-
const { t: d, i18n: T } = q(), F = gt(), V =
|
|
576
|
+
const { t: d, i18n: T } = q(), F = gt(), V = L(!1), [D, O] = ie(!1), [J, Q] = ie(!1), Ae = _ || D, [ae, Z] = ie(ct), [ue, he] = ie(ct), [K, Re] = ie({}), se = ke(
|
|
565
577
|
(k) => Re(($) => ({ ...$, [k]: !0 })),
|
|
566
578
|
[]
|
|
567
|
-
), H =
|
|
579
|
+
), H = L(null), re = L(
|
|
568
580
|
null
|
|
569
581
|
);
|
|
570
582
|
z(
|
|
@@ -578,25 +590,25 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
578
590
|
Q(!1), t({ ...e, ...k });
|
|
579
591
|
},
|
|
580
592
|
[e, t]
|
|
581
|
-
), oe =
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
593
|
+
), oe = r ? JSON.stringify([
|
|
594
|
+
r.serviceId,
|
|
595
|
+
r.kind,
|
|
596
|
+
r.amountCents,
|
|
597
|
+
r.currencyCode,
|
|
586
598
|
p
|
|
587
599
|
]) : void 0, [$e, De] = ie(
|
|
588
600
|
() => e.paymentAccepted ? oe : void 0
|
|
589
|
-
), Me =
|
|
601
|
+
), Me = L(oe), Ee = !!(r && e.paymentAccepted && $e === oe);
|
|
590
602
|
z(() => {
|
|
591
|
-
Me.current !== oe && (Me.current = oe, De(void 0), e.paymentAccepted !== void 0 && P({ paymentAccepted:
|
|
592
|
-
}, [oe,
|
|
593
|
-
const G =
|
|
603
|
+
Me.current !== oe && (Me.current = oe, De(void 0), e.paymentAccepted !== void 0 && P({ paymentAccepted: r ? !1 : void 0 }));
|
|
604
|
+
}, [oe, r, P, e.paymentAccepted]);
|
|
605
|
+
const G = r ? st(r.amountCents, r.currencyCode, T.language) : "", pe = p && /^https?:\/\//i.test(p) ? p : void 0, Te = M(
|
|
594
606
|
() => us(x),
|
|
595
607
|
[x]
|
|
596
|
-
),
|
|
608
|
+
), ve = !r && !m && Te.length >= 2, nt = L(!1);
|
|
597
609
|
z(() => {
|
|
598
|
-
if (
|
|
599
|
-
if (!
|
|
610
|
+
if (r || m) return;
|
|
611
|
+
if (!ve) {
|
|
600
612
|
e.confirmationChannels !== void 0 && P({ confirmationChannels: void 0 });
|
|
601
613
|
return;
|
|
602
614
|
}
|
|
@@ -611,8 +623,8 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
611
623
|
);
|
|
612
624
|
nt.current = !0, P({ confirmationChannels: k });
|
|
613
625
|
}, [
|
|
614
|
-
|
|
615
|
-
|
|
626
|
+
ve,
|
|
627
|
+
r,
|
|
616
628
|
m,
|
|
617
629
|
Te,
|
|
618
630
|
e.mobilePhone,
|
|
@@ -621,7 +633,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
621
633
|
const Ke = M(
|
|
622
634
|
() => e.confirmationChannels ?? [],
|
|
623
635
|
[e.confirmationChannels]
|
|
624
|
-
), ee =
|
|
636
|
+
), ee = ve && Ke.length === 0;
|
|
625
637
|
z(() => {
|
|
626
638
|
const k = e.codiceFiscale;
|
|
627
639
|
if (!i || !y || !k) {
|
|
@@ -656,20 +668,20 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
656
668
|
$ = !1, H.current && clearTimeout(H.current);
|
|
657
669
|
};
|
|
658
670
|
}, [i, y, e.codiceFiscale, d]);
|
|
659
|
-
const Le =
|
|
671
|
+
const Le = o && c === "public";
|
|
660
672
|
z(() => {
|
|
661
673
|
const k = e.insuranceNumber;
|
|
662
674
|
if (!Le || !N || !k) {
|
|
663
|
-
|
|
675
|
+
he(ct);
|
|
664
676
|
return;
|
|
665
677
|
}
|
|
666
|
-
|
|
678
|
+
he({ state: "pending" }), re.current && clearTimeout(re.current), re.current = setTimeout(() => {
|
|
667
679
|
N(k).then(
|
|
668
|
-
($) =>
|
|
680
|
+
($) => he(
|
|
669
681
|
$.valid ? { state: "valid" } : { state: "invalid", hint: $.hint }
|
|
670
682
|
)
|
|
671
683
|
).catch(
|
|
672
|
-
() =>
|
|
684
|
+
() => he({
|
|
673
685
|
state: "invalid",
|
|
674
686
|
hint: d("booking.details.insuranceNumber.unavailable")
|
|
675
687
|
})
|
|
@@ -682,7 +694,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
682
694
|
), Oe = M(
|
|
683
695
|
() => !!(e.mobilePhone && e.mobilePhone.length >= 6),
|
|
684
696
|
[e.mobilePhone]
|
|
685
|
-
),
|
|
697
|
+
), Se = M(() => {
|
|
686
698
|
var k, $;
|
|
687
699
|
return !(!((k = e.firstName) != null && k.trim()) || !(($ = e.lastName) != null && $.trim()) || !te || !Oe || i && (ae.state !== "valid" || ae.value !== e.codiceFiscale) || a && !e.dateOfBirth || Le && ue.state !== "valid");
|
|
688
700
|
}, [
|
|
@@ -698,7 +710,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
698
710
|
e.dateOfBirth,
|
|
699
711
|
Le,
|
|
700
712
|
ue.state
|
|
701
|
-
]),
|
|
713
|
+
]), xe = S != null && S.trim() ? S : void 0, R = xe !== void 0, ze = !R || !!e.criticalInformationAccepted, je = !!(e.privacyConsent && e.termsConsent && ze), it = !ve || Ke.length > 0, ne = Se && je && it && (!r || Ee) && !m && !Ae, Ie = async (k) => {
|
|
702
714
|
if (k.preventDefault(), Re({
|
|
703
715
|
firstName: !0,
|
|
704
716
|
lastName: !0,
|
|
@@ -717,8 +729,8 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
717
729
|
termsConsent: !0,
|
|
718
730
|
// Only present when the service carried text to accept — a
|
|
719
731
|
// reason without it leaves the key out of the payload entirely.
|
|
720
|
-
...
|
|
721
|
-
...
|
|
732
|
+
...R ? { criticalInformationAccepted: !0 } : {},
|
|
733
|
+
...r ? { paymentAccepted: !0 } : {},
|
|
722
734
|
codiceFiscale: e.codiceFiscale,
|
|
723
735
|
dateOfBirth: e.dateOfBirth,
|
|
724
736
|
insuranceNumber: e.insuranceNumber,
|
|
@@ -727,7 +739,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
727
739
|
// Only include when the picker was visible; otherwise the single
|
|
728
740
|
// implicit channel is inferred backend-side from the practice
|
|
729
741
|
// config.
|
|
730
|
-
confirmationChannels:
|
|
742
|
+
confirmationChannels: ve ? Ke : void 0
|
|
731
743
|
};
|
|
732
744
|
V.current = !0, O(!0), Q(!1);
|
|
733
745
|
try {
|
|
@@ -771,7 +783,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
771
783
|
ref: h,
|
|
772
784
|
id: F,
|
|
773
785
|
noValidate: !0,
|
|
774
|
-
onSubmit:
|
|
786
|
+
onSubmit: Ie,
|
|
775
787
|
"aria-busy": Ae || void 0,
|
|
776
788
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
777
789
|
children: [
|
|
@@ -932,7 +944,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
932
944
|
label: d("booking.details.returningPatient.label")
|
|
933
945
|
}
|
|
934
946
|
) : null,
|
|
935
|
-
|
|
947
|
+
xe !== void 0 ? /* @__PURE__ */ b(
|
|
936
948
|
"div",
|
|
937
949
|
{
|
|
938
950
|
"data-component": "booking-critical-information",
|
|
@@ -948,7 +960,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
948
960
|
children: d("booking.details.criticalInformation.heading")
|
|
949
961
|
}
|
|
950
962
|
),
|
|
951
|
-
/* @__PURE__ */ s("p", { className: "type-body-sm ds:m-0 ds:whitespace-pre-wrap ds:break-words ds:text-[var(--foreground)]", children:
|
|
963
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:m-0 ds:whitespace-pre-wrap ds:break-words ds:text-[var(--foreground)]", children: xe }),
|
|
952
964
|
/* @__PURE__ */ s(
|
|
953
965
|
et,
|
|
954
966
|
{
|
|
@@ -971,7 +983,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
971
983
|
]
|
|
972
984
|
}
|
|
973
985
|
) : null,
|
|
974
|
-
|
|
986
|
+
r ? /* @__PURE__ */ b(
|
|
975
987
|
"div",
|
|
976
988
|
{
|
|
977
989
|
"data-component": "booking-payment-notice",
|
|
@@ -1051,7 +1063,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
1051
1063
|
}
|
|
1052
1064
|
)
|
|
1053
1065
|
] }),
|
|
1054
|
-
|
|
1066
|
+
ve ? /* @__PURE__ */ s(
|
|
1055
1067
|
"div",
|
|
1056
1068
|
{
|
|
1057
1069
|
"data-component": "booking-confirmation-channels",
|
|
@@ -1086,7 +1098,7 @@ const Gt = 500, Rn = /^[A-Z0-9]{16}$/, En = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ut = 3
|
|
|
1086
1098
|
type: "submit",
|
|
1087
1099
|
disabled: !ne,
|
|
1088
1100
|
startIcon: Ae ? /* @__PURE__ */ s(Xt, { variant: "pulse", size: "sm" }) : void 0,
|
|
1089
|
-
children:
|
|
1101
|
+
children: r ? d("booking.payment.submit", { amount: G }) : d("booking.details.submit")
|
|
1090
1102
|
}
|
|
1091
1103
|
)
|
|
1092
1104
|
]
|
|
@@ -1109,15 +1121,15 @@ function Mt(e) {
|
|
|
1109
1121
|
}
|
|
1110
1122
|
function Ln(e, t, n) {
|
|
1111
1123
|
const i = e.filter(
|
|
1112
|
-
(
|
|
1124
|
+
(o) => t.includes(o.id)
|
|
1113
1125
|
), a = (n == null ? void 0 : n.serviceId) ?? (t.length === 1 ? t[0] : void 0);
|
|
1114
1126
|
if (a) {
|
|
1115
|
-
const
|
|
1116
|
-
if (!
|
|
1117
|
-
const c = Mt(
|
|
1118
|
-
return { payment: c, blocked: !!(
|
|
1127
|
+
const o = i.find((l) => l.id === a);
|
|
1128
|
+
if (!o) return { blocked: !0 };
|
|
1129
|
+
const c = Mt(o);
|
|
1130
|
+
return { payment: c, blocked: !!(o.payment && !c) };
|
|
1119
1131
|
}
|
|
1120
|
-
return { blocked: i.some((
|
|
1132
|
+
return { blocked: i.some((o) => !!o.payment) };
|
|
1121
1133
|
}
|
|
1122
1134
|
function lt(e) {
|
|
1123
1135
|
return e ? JSON.stringify([
|
|
@@ -1133,26 +1145,26 @@ function Pn({
|
|
|
1133
1145
|
availableSlots: n,
|
|
1134
1146
|
onSubmit: i,
|
|
1135
1147
|
onChange: a,
|
|
1136
|
-
paymentState:
|
|
1148
|
+
paymentState: o,
|
|
1137
1149
|
submitting: c,
|
|
1138
1150
|
paymentTermsUrl: l,
|
|
1139
1151
|
renderPayment: f
|
|
1140
1152
|
}) {
|
|
1141
|
-
var Z, ue,
|
|
1153
|
+
var Z, ue, he;
|
|
1142
1154
|
const u = JSON.stringify([
|
|
1143
1155
|
t.insuranceType,
|
|
1144
1156
|
t.specialtyId,
|
|
1145
1157
|
t.specialtyIds,
|
|
1146
|
-
|
|
1158
|
+
Ce(t),
|
|
1147
1159
|
t.operatorId,
|
|
1148
1160
|
t.operatorIds,
|
|
1149
1161
|
t.date,
|
|
1150
1162
|
t.slotKey
|
|
1151
|
-
]), g =
|
|
1163
|
+
]), g = L(
|
|
1152
1164
|
void 0
|
|
1153
1165
|
), p = (t.date ? (Z = n[t.date]) == null ? void 0 : Z.find((K) => K.key === t.slotKey) : void 0) ?? (((ue = g.current) == null ? void 0 : ue.selection) === u ? g.current.slot : void 0), m = Ln(
|
|
1154
1166
|
e,
|
|
1155
|
-
|
|
1167
|
+
Ce(t),
|
|
1156
1168
|
p
|
|
1157
1169
|
), S = m.blocked || !!(m.payment && !f), y = JSON.stringify([
|
|
1158
1170
|
u,
|
|
@@ -1160,7 +1172,7 @@ function Pn({
|
|
|
1160
1172
|
lt(m.payment),
|
|
1161
1173
|
l,
|
|
1162
1174
|
S
|
|
1163
|
-
]), N = m.payment ? JSON.stringify([lt(m.payment), l]) : "", _ =
|
|
1175
|
+
]), N = m.payment ? JSON.stringify([lt(m.payment), l]) : "", _ = L(void 0), I = !!((he = t.details) != null && he.paymentAccepted);
|
|
1164
1176
|
z(() => {
|
|
1165
1177
|
if (!I) _.current = void 0;
|
|
1166
1178
|
else if (N) _.current === void 0 ? _.current = N : _.current !== N && (_.current = void 0, a({
|
|
@@ -1169,9 +1181,9 @@ function Pn({
|
|
|
1169
1181
|
}));
|
|
1170
1182
|
else return;
|
|
1171
1183
|
}, [I, N, a, t]);
|
|
1172
|
-
const v =
|
|
1184
|
+
const v = L(y);
|
|
1173
1185
|
v.current = y;
|
|
1174
|
-
const [x, w] = ie({ status: "idle" }), A =
|
|
1186
|
+
const [x, w] = ie({ status: "idle" }), A = L(0), h = L(!1), d = L(!0), T = L(!1), F = L(void 0), V = L(y);
|
|
1175
1187
|
z(() => (d.current = !0, () => {
|
|
1176
1188
|
d.current = !1, A.current += 1;
|
|
1177
1189
|
}), []);
|
|
@@ -1180,8 +1192,8 @@ function Pn({
|
|
|
1180
1192
|
V.current === y || T.current || D || (V.current = y, A.current += 1, h.current = !1, w({ status: "idle" }));
|
|
1181
1193
|
}, [y, D]);
|
|
1182
1194
|
const O = D || V.current === y ? x.session : void 0, J = M(
|
|
1183
|
-
() => O && (
|
|
1184
|
-
[O,
|
|
1195
|
+
() => O && (o == null ? void 0 : o.sessionId) === O.id ? o : O ? { sessionId: O.id, status: "ready" } : void 0,
|
|
1196
|
+
[O, o]
|
|
1185
1197
|
);
|
|
1186
1198
|
O && J && "phase" in J && J.phase === "completion" && (F.current = O.id);
|
|
1187
1199
|
const Q = M(
|
|
@@ -1348,7 +1360,7 @@ function qn({
|
|
|
1348
1360
|
locale: i,
|
|
1349
1361
|
loading: a
|
|
1350
1362
|
}) {
|
|
1351
|
-
const { t:
|
|
1363
|
+
const { t: o } = q(), c = M(() => t ? tt(le(t)) : e.length > 0 ? tt(le(e[0])) : tt(/* @__PURE__ */ new Date()), [t, e]), [l, f] = ie(c), [u, g] = ie(null), r = M(() => {
|
|
1352
1364
|
const I = tt(l), v = Ks(l), x = I.getDay(), w = v.getDate(), A = [];
|
|
1353
1365
|
for (let h = x; h > 0; h -= 1) {
|
|
1354
1366
|
const d = new Date(I);
|
|
@@ -1389,11 +1401,11 @@ function qn({
|
|
|
1389
1401
|
), N = M(() => {
|
|
1390
1402
|
if (u) return u;
|
|
1391
1403
|
if (t) return le(t);
|
|
1392
|
-
const I =
|
|
1404
|
+
const I = r.find(
|
|
1393
1405
|
(v) => dt(v, l) && y(v)
|
|
1394
1406
|
);
|
|
1395
|
-
return I || (
|
|
1396
|
-
}, [u, t,
|
|
1407
|
+
return I || (r.find((v) => dt(v, l)) ?? null);
|
|
1408
|
+
}, [u, t, r, l, y]), _ = ke(
|
|
1397
1409
|
(I, v) => {
|
|
1398
1410
|
let x = null;
|
|
1399
1411
|
switch (I.key) {
|
|
@@ -1432,7 +1444,7 @@ function qn({
|
|
|
1432
1444
|
{
|
|
1433
1445
|
role: "status",
|
|
1434
1446
|
"aria-live": "polite",
|
|
1435
|
-
"aria-label":
|
|
1447
|
+
"aria-label": o("common.loading"),
|
|
1436
1448
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1437
1449
|
children: [
|
|
1438
1450
|
/* @__PURE__ */ s(mt, { variant: "text", width: "40%" }),
|
|
@@ -1445,7 +1457,7 @@ function qn({
|
|
|
1445
1457
|
qt,
|
|
1446
1458
|
{
|
|
1447
1459
|
icon: /* @__PURE__ */ s(js, {}),
|
|
1448
|
-
"aria-label":
|
|
1460
|
+
"aria-label": o("booking.previousMonth"),
|
|
1449
1461
|
size: "sm",
|
|
1450
1462
|
intent: "ghost",
|
|
1451
1463
|
flipIconInRtl: !0,
|
|
@@ -1466,7 +1478,7 @@ function qn({
|
|
|
1466
1478
|
qt,
|
|
1467
1479
|
{
|
|
1468
1480
|
icon: /* @__PURE__ */ s(qs, {}),
|
|
1469
|
-
"aria-label":
|
|
1481
|
+
"aria-label": o("booking.nextMonth"),
|
|
1470
1482
|
size: "sm",
|
|
1471
1483
|
intent: "ghost",
|
|
1472
1484
|
flipIconInRtl: !0,
|
|
@@ -1480,7 +1492,7 @@ function qn({
|
|
|
1480
1492
|
"div",
|
|
1481
1493
|
{
|
|
1482
1494
|
role: "grid",
|
|
1483
|
-
"aria-label":
|
|
1495
|
+
"aria-label": o("booking.monthGridLabel"),
|
|
1484
1496
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
1485
1497
|
children: [
|
|
1486
1498
|
/* @__PURE__ */ s(
|
|
@@ -1504,7 +1516,7 @@ function qn({
|
|
|
1504
1516
|
{
|
|
1505
1517
|
role: "row",
|
|
1506
1518
|
className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
|
|
1507
|
-
children:
|
|
1519
|
+
children: r.slice(v * 7, v * 7 + 7).map((x, w) => {
|
|
1508
1520
|
const A = v * 7 + w, h = dt(x, l), d = h && y(x), T = t ? Jt(x, le(t)) : !1, F = h ? T ? "selected" : d ? "available" : "unavailable" : "outside", V = N ? Jt(N, x) : !1, D = (() => {
|
|
1509
1521
|
try {
|
|
1510
1522
|
return new Intl.DateTimeFormat(i, {
|
|
@@ -1573,47 +1585,47 @@ function Hn({
|
|
|
1573
1585
|
selectedServiceId: t,
|
|
1574
1586
|
onSelect: n
|
|
1575
1587
|
}) {
|
|
1576
|
-
const { t: i, i18n: a } = q(),
|
|
1588
|
+
const { t: i, i18n: a } = q(), o = gt(), [c, l] = ie(() => {
|
|
1577
1589
|
if (t) {
|
|
1578
|
-
const
|
|
1579
|
-
if (
|
|
1590
|
+
const r = e.findIndex((p) => p.id === t);
|
|
1591
|
+
if (r >= 0) return r;
|
|
1580
1592
|
}
|
|
1581
1593
|
return 0;
|
|
1582
|
-
}), f =
|
|
1594
|
+
}), f = L(/* @__PURE__ */ new Map()), u = ke((r) => {
|
|
1583
1595
|
var p;
|
|
1584
|
-
(p = f.current.get(
|
|
1596
|
+
(p = f.current.get(r)) == null || p.focus();
|
|
1585
1597
|
}, []), g = ke(
|
|
1586
|
-
(
|
|
1598
|
+
(r, p, m) => {
|
|
1587
1599
|
const S = e.length;
|
|
1588
1600
|
if (S !== 0)
|
|
1589
|
-
switch (
|
|
1601
|
+
switch (r.key) {
|
|
1590
1602
|
case "ArrowDown":
|
|
1591
1603
|
case "ArrowRight": {
|
|
1592
|
-
|
|
1604
|
+
r.preventDefault();
|
|
1593
1605
|
const y = (p + 1) % S;
|
|
1594
1606
|
l(y), u(y);
|
|
1595
1607
|
break;
|
|
1596
1608
|
}
|
|
1597
1609
|
case "ArrowUp":
|
|
1598
1610
|
case "ArrowLeft": {
|
|
1599
|
-
|
|
1611
|
+
r.preventDefault();
|
|
1600
1612
|
const y = (p - 1 + S) % S;
|
|
1601
1613
|
l(y), u(y);
|
|
1602
1614
|
break;
|
|
1603
1615
|
}
|
|
1604
1616
|
case "Home": {
|
|
1605
|
-
|
|
1617
|
+
r.preventDefault(), l(0), u(0);
|
|
1606
1618
|
break;
|
|
1607
1619
|
}
|
|
1608
1620
|
case "End": {
|
|
1609
|
-
|
|
1621
|
+
r.preventDefault();
|
|
1610
1622
|
const y = S - 1;
|
|
1611
1623
|
l(y), u(y);
|
|
1612
1624
|
break;
|
|
1613
1625
|
}
|
|
1614
1626
|
case "Enter":
|
|
1615
1627
|
case " ": {
|
|
1616
|
-
|
|
1628
|
+
r.preventDefault(), n(m);
|
|
1617
1629
|
break;
|
|
1618
1630
|
}
|
|
1619
1631
|
}
|
|
@@ -1625,22 +1637,22 @@ function Hn({
|
|
|
1625
1637
|
{
|
|
1626
1638
|
role: "radiogroup",
|
|
1627
1639
|
"aria-label": i("booking.serviceListLabel"),
|
|
1628
|
-
id:
|
|
1640
|
+
id: o,
|
|
1629
1641
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1630
|
-
children: e.map((
|
|
1631
|
-
const m = t ===
|
|
1642
|
+
children: e.map((r, p) => {
|
|
1643
|
+
const m = t === r.id, S = c === p, y = Mt(r), N = r.payment ? y ? i(`booking.payment.${y.kind}`, {
|
|
1632
1644
|
amount: st(
|
|
1633
1645
|
y.amountCents,
|
|
1634
1646
|
y.currencyCode,
|
|
1635
1647
|
a.language
|
|
1636
1648
|
)
|
|
1637
|
-
}) : i("booking.payment.unavailable") : ps(
|
|
1638
|
-
label:
|
|
1649
|
+
}) : i("booking.payment.unavailable") : ps(r), _ = N ? i("booking.serviceCardLabelPrice", {
|
|
1650
|
+
label: r.label,
|
|
1639
1651
|
price: N
|
|
1640
1652
|
}) : i("booking.serviceCardLabel", {
|
|
1641
|
-
label:
|
|
1642
|
-
duration:
|
|
1643
|
-
}), I = Kn(
|
|
1653
|
+
label: r.label,
|
|
1654
|
+
duration: r.durationMin
|
|
1655
|
+
}), I = Kn(r);
|
|
1644
1656
|
return /* @__PURE__ */ b(
|
|
1645
1657
|
"button",
|
|
1646
1658
|
{
|
|
@@ -1652,9 +1664,9 @@ function Hn({
|
|
|
1652
1664
|
"aria-checked": m,
|
|
1653
1665
|
"aria-label": _,
|
|
1654
1666
|
tabIndex: S ? 0 : -1,
|
|
1655
|
-
onClick: () => n(
|
|
1667
|
+
onClick: () => n(r.id),
|
|
1656
1668
|
onFocus: () => l(p),
|
|
1657
|
-
onKeyDown: (v) => g(v, p,
|
|
1669
|
+
onKeyDown: (v) => g(v, p, r.id),
|
|
1658
1670
|
className: Jn({
|
|
1659
1671
|
state: m ? "selected" : "idle"
|
|
1660
1672
|
}),
|
|
@@ -1668,9 +1680,9 @@ function Hn({
|
|
|
1668
1680
|
}
|
|
1669
1681
|
),
|
|
1670
1682
|
/* @__PURE__ */ b("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
1671
|
-
/* @__PURE__ */ s("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children:
|
|
1683
|
+
/* @__PURE__ */ s("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: r.label }),
|
|
1672
1684
|
N ? null : /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", {
|
|
1673
|
-
minutes:
|
|
1685
|
+
minutes: r.durationMin
|
|
1674
1686
|
}) })
|
|
1675
1687
|
] }),
|
|
1676
1688
|
N ? /* @__PURE__ */ s(
|
|
@@ -1683,7 +1695,7 @@ function Hn({
|
|
|
1683
1695
|
) : null
|
|
1684
1696
|
]
|
|
1685
1697
|
},
|
|
1686
|
-
|
|
1698
|
+
r.id
|
|
1687
1699
|
);
|
|
1688
1700
|
})
|
|
1689
1701
|
}
|
|
@@ -1730,11 +1742,11 @@ function Wn({
|
|
|
1730
1742
|
selectedSlotKey: n,
|
|
1731
1743
|
onSelect: i,
|
|
1732
1744
|
loading: a,
|
|
1733
|
-
locale:
|
|
1745
|
+
locale: o
|
|
1734
1746
|
}) {
|
|
1735
1747
|
const { t: c } = q(), l = M(() => {
|
|
1736
1748
|
try {
|
|
1737
|
-
return new Intl.DateTimeFormat(
|
|
1749
|
+
return new Intl.DateTimeFormat(o, {
|
|
1738
1750
|
weekday: "long",
|
|
1739
1751
|
day: "numeric",
|
|
1740
1752
|
month: "long"
|
|
@@ -1742,25 +1754,25 @@ function Wn({
|
|
|
1742
1754
|
} catch {
|
|
1743
1755
|
return e;
|
|
1744
1756
|
}
|
|
1745
|
-
}, [e,
|
|
1746
|
-
const
|
|
1757
|
+
}, [e, o]), f = M(() => {
|
|
1758
|
+
const r = {
|
|
1747
1759
|
morning: [],
|
|
1748
1760
|
afternoon: [],
|
|
1749
1761
|
evening: []
|
|
1750
1762
|
};
|
|
1751
1763
|
for (const p of t)
|
|
1752
|
-
|
|
1753
|
-
return
|
|
1754
|
-
}, [t]), u = t.filter((
|
|
1764
|
+
r[Un(p.time)].push(p);
|
|
1765
|
+
return r;
|
|
1766
|
+
}, [t]), u = t.filter((r) => r.available).length, g = ["morning", "afternoon", "evening"];
|
|
1755
1767
|
return a ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1756
1768
|
/* @__PURE__ */ s(mt, { variant: "text", width: "60%" }),
|
|
1757
|
-
[0, 1].map((
|
|
1769
|
+
[0, 1].map((r) => /* @__PURE__ */ s(
|
|
1758
1770
|
"div",
|
|
1759
1771
|
{
|
|
1760
1772
|
className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
|
|
1761
1773
|
children: [0, 1, 2].map((p) => /* @__PURE__ */ s(mt, { variant: "rounded", height: "44px" }, p))
|
|
1762
1774
|
},
|
|
1763
|
-
|
|
1775
|
+
r
|
|
1764
1776
|
))
|
|
1765
1777
|
] }) : u === 0 ? /* @__PURE__ */ s(es, { variant: "no-results", title: c("booking.noSlotsForDate") }) : /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1766
1778
|
/* @__PURE__ */ b("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
@@ -1776,10 +1788,10 @@ function Wn({
|
|
|
1776
1788
|
] }),
|
|
1777
1789
|
/* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: c("booking.slotsAvailable", { count: u }) })
|
|
1778
1790
|
] }),
|
|
1779
|
-
g.map((
|
|
1780
|
-
const p = f[
|
|
1791
|
+
g.map((r) => {
|
|
1792
|
+
const p = f[r];
|
|
1781
1793
|
if (p.length === 0) return null;
|
|
1782
|
-
const m = Yn[
|
|
1794
|
+
const m = Yn[r];
|
|
1783
1795
|
return /* @__PURE__ */ b(
|
|
1784
1796
|
"div",
|
|
1785
1797
|
{
|
|
@@ -1787,13 +1799,13 @@ function Wn({
|
|
|
1787
1799
|
children: [
|
|
1788
1800
|
/* @__PURE__ */ b("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
|
|
1789
1801
|
/* @__PURE__ */ s(m, { "aria-hidden": "true", className: "ds:size-3.5" }),
|
|
1790
|
-
/* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: c(`booking.timeOfDay.${
|
|
1802
|
+
/* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: c(`booking.timeOfDay.${r}`) })
|
|
1791
1803
|
] }),
|
|
1792
1804
|
/* @__PURE__ */ s(
|
|
1793
1805
|
"div",
|
|
1794
1806
|
{
|
|
1795
1807
|
role: "group",
|
|
1796
|
-
"aria-label": c(`booking.timeOfDay.${
|
|
1808
|
+
"aria-label": c(`booking.timeOfDay.${r}`),
|
|
1797
1809
|
className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
|
|
1798
1810
|
children: p.map((S) => {
|
|
1799
1811
|
const y = S.key === n, N = S.available ? y ? "selected" : "idle" : "unavailable";
|
|
@@ -1818,7 +1830,7 @@ function Wn({
|
|
|
1818
1830
|
)
|
|
1819
1831
|
]
|
|
1820
1832
|
},
|
|
1821
|
-
|
|
1833
|
+
r
|
|
1822
1834
|
);
|
|
1823
1835
|
})
|
|
1824
1836
|
] });
|
|
@@ -1830,13 +1842,13 @@ function Zn({
|
|
|
1830
1842
|
value: n,
|
|
1831
1843
|
onChange: i,
|
|
1832
1844
|
onDateSelect: a,
|
|
1833
|
-
onWindowChange:
|
|
1845
|
+
onWindowChange: o,
|
|
1834
1846
|
loadingDates: c,
|
|
1835
1847
|
loadingSlots: l,
|
|
1836
1848
|
locale: f,
|
|
1837
1849
|
agentIdBase: u
|
|
1838
1850
|
}) {
|
|
1839
|
-
const g = M(() => qe(/* @__PURE__ */ new Date()), []), [
|
|
1851
|
+
const g = M(() => qe(/* @__PURE__ */ new Date()), []), [r, p] = ie(() => {
|
|
1840
1852
|
if (n.date) {
|
|
1841
1853
|
const d = qe(le(n.date));
|
|
1842
1854
|
if (!Je(g, d)) return d;
|
|
@@ -1847,10 +1859,10 @@ function Zn({
|
|
|
1847
1859
|
}
|
|
1848
1860
|
return g;
|
|
1849
1861
|
}), m = M(
|
|
1850
|
-
() => xt(
|
|
1851
|
-
[
|
|
1862
|
+
() => xt(r, ut - 1),
|
|
1863
|
+
[r]
|
|
1852
1864
|
), S = M(() => Array.from({ length: ut }, (d, T) => {
|
|
1853
|
-
const F = xt(
|
|
1865
|
+
const F = xt(r, T), V = Fe(F), O = (t[V] ?? []).map((J) => ({
|
|
1854
1866
|
id: J.key,
|
|
1855
1867
|
// SlotGrid formats `start` as a time via Intl.DateTimeFormat —
|
|
1856
1868
|
// compose a full ISO from the column's date + the slot's HH:mm
|
|
@@ -1859,7 +1871,7 @@ function Zn({
|
|
|
1859
1871
|
available: J.available
|
|
1860
1872
|
}));
|
|
1861
1873
|
return { date: V, slots: O };
|
|
1862
|
-
}), [
|
|
1874
|
+
}), [r, t]), y = Je(r, g), N = !0, _ = ke(() => {
|
|
1863
1875
|
p((d) => {
|
|
1864
1876
|
const T = zs(d, ut);
|
|
1865
1877
|
return Je(g, T) ? g : T;
|
|
@@ -1872,11 +1884,11 @@ function Zn({
|
|
|
1872
1884
|
const d = qe(le(e[0]));
|
|
1873
1885
|
!Je(d, g) || e.some((F) => {
|
|
1874
1886
|
const V = qe(le(F));
|
|
1875
|
-
return !Je(V, m) && !$s(V,
|
|
1887
|
+
return !Je(V, m) && !$s(V, r);
|
|
1876
1888
|
}) || p(d);
|
|
1877
1889
|
}, [e]), z(() => {
|
|
1878
|
-
|
|
1879
|
-
}, [
|
|
1890
|
+
o == null || o(Fe(r), Fe(m));
|
|
1891
|
+
}, [r, m, o]);
|
|
1880
1892
|
const v = ke(
|
|
1881
1893
|
(d, T) => {
|
|
1882
1894
|
const F = typeof T.date == "string" ? T.date : Fe(T.date);
|
|
@@ -1919,7 +1931,7 @@ function ms(e) {
|
|
|
1919
1931
|
value: n,
|
|
1920
1932
|
onChange: i,
|
|
1921
1933
|
onDateSelect: a,
|
|
1922
|
-
onWindowChange:
|
|
1934
|
+
onWindowChange: o,
|
|
1923
1935
|
loadingDates: c,
|
|
1924
1936
|
loadingSlots: l,
|
|
1925
1937
|
locale: f,
|
|
@@ -1934,7 +1946,7 @@ function ms(e) {
|
|
|
1934
1946
|
value: n,
|
|
1935
1947
|
onChange: i,
|
|
1936
1948
|
onDateSelect: a,
|
|
1937
|
-
onWindowChange:
|
|
1949
|
+
onWindowChange: o,
|
|
1938
1950
|
loadingDates: c,
|
|
1939
1951
|
loadingSlots: l,
|
|
1940
1952
|
locale: f,
|
|
@@ -1945,8 +1957,8 @@ function ms(e) {
|
|
|
1945
1957
|
{
|
|
1946
1958
|
availableDates: t.availableDates,
|
|
1947
1959
|
selectedDate: n.date,
|
|
1948
|
-
onSelectDate: (
|
|
1949
|
-
i(bt(n,
|
|
1960
|
+
onSelectDate: (r) => {
|
|
1961
|
+
i(bt(n, r)), a == null || a(r);
|
|
1950
1962
|
},
|
|
1951
1963
|
locale: f,
|
|
1952
1964
|
loading: c ?? l
|
|
@@ -1954,7 +1966,7 @@ function ms(e) {
|
|
|
1954
1966
|
);
|
|
1955
1967
|
}
|
|
1956
1968
|
function fs(e) {
|
|
1957
|
-
const { inputs: t, value: n, onChange: i, loadingSlots: a, locale:
|
|
1969
|
+
const { inputs: t, value: n, onChange: i, loadingSlots: a, locale: o, datePickerStyle: c } = e;
|
|
1958
1970
|
return c === "four-day-grid" || !n.date ? null : /* @__PURE__ */ s(
|
|
1959
1971
|
Wn,
|
|
1960
1972
|
{
|
|
@@ -1963,7 +1975,7 @@ function fs(e) {
|
|
|
1963
1975
|
selectedSlotKey: n.slotKey,
|
|
1964
1976
|
onSelect: (l) => i(cs(n, l.key)),
|
|
1965
1977
|
loading: a,
|
|
1966
|
-
locale:
|
|
1978
|
+
locale: o
|
|
1967
1979
|
}
|
|
1968
1980
|
);
|
|
1969
1981
|
}
|
|
@@ -1994,16 +2006,16 @@ function hs({
|
|
|
1994
2006
|
valueIds: n,
|
|
1995
2007
|
onChange: i,
|
|
1996
2008
|
onChangeIds: a,
|
|
1997
|
-
pickerStyle:
|
|
2009
|
+
pickerStyle: o = "select"
|
|
1998
2010
|
}) {
|
|
1999
2011
|
const { t: c } = q(), l = e.map((u) => ({
|
|
2000
2012
|
value: u.id,
|
|
2001
2013
|
label: u.label
|
|
2002
2014
|
})), f = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: c("booking.specialty.heading") });
|
|
2003
|
-
return
|
|
2015
|
+
return o === "multi-select" && a ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2004
2016
|
f,
|
|
2005
2017
|
/* @__PURE__ */ s(
|
|
2006
|
-
|
|
2018
|
+
At,
|
|
2007
2019
|
{
|
|
2008
2020
|
options: l,
|
|
2009
2021
|
value: n ?? [],
|
|
@@ -2013,10 +2025,10 @@ function hs({
|
|
|
2013
2025
|
allowClear: !0
|
|
2014
2026
|
}
|
|
2015
2027
|
)
|
|
2016
|
-
] }) :
|
|
2028
|
+
] }) : o === "combobox" ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2017
2029
|
f,
|
|
2018
2030
|
/* @__PURE__ */ s(
|
|
2019
|
-
|
|
2031
|
+
Ct,
|
|
2020
2032
|
{
|
|
2021
2033
|
options: l,
|
|
2022
2034
|
value: t ?? "",
|
|
@@ -2046,10 +2058,10 @@ function vs({
|
|
|
2046
2058
|
valueIds: n,
|
|
2047
2059
|
onChange: i,
|
|
2048
2060
|
onChangeIds: a,
|
|
2049
|
-
pickerStyle:
|
|
2061
|
+
pickerStyle: o,
|
|
2050
2062
|
compact: c
|
|
2051
2063
|
}) {
|
|
2052
|
-
const { t: l, i18n: f } = q(), u =
|
|
2064
|
+
const { t: l, i18n: f } = q(), u = o ?? (c ? "select" : "cards"), g = e.map((p) => {
|
|
2053
2065
|
const m = Mt(p), S = p.payment ? m ? l(`booking.payment.${m.kind}`, {
|
|
2054
2066
|
amount: st(
|
|
2055
2067
|
m.amountCents,
|
|
@@ -2067,11 +2079,11 @@ function vs({
|
|
|
2067
2079
|
minutes: p.durationMin
|
|
2068
2080
|
})}`
|
|
2069
2081
|
};
|
|
2070
|
-
}),
|
|
2082
|
+
}), r = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: l("booking.service.heading") });
|
|
2071
2083
|
return u === "multi-select" && a ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2072
|
-
|
|
2084
|
+
r,
|
|
2073
2085
|
/* @__PURE__ */ s(
|
|
2074
|
-
|
|
2086
|
+
At,
|
|
2075
2087
|
{
|
|
2076
2088
|
options: g,
|
|
2077
2089
|
value: n ?? [],
|
|
@@ -2082,9 +2094,9 @@ function vs({
|
|
|
2082
2094
|
}
|
|
2083
2095
|
)
|
|
2084
2096
|
] }) : u === "combobox" ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2085
|
-
|
|
2097
|
+
r,
|
|
2086
2098
|
/* @__PURE__ */ s(
|
|
2087
|
-
|
|
2099
|
+
Ct,
|
|
2088
2100
|
{
|
|
2089
2101
|
options: g,
|
|
2090
2102
|
value: t ?? "",
|
|
@@ -2095,7 +2107,7 @@ function vs({
|
|
|
2095
2107
|
}
|
|
2096
2108
|
)
|
|
2097
2109
|
] }) : u === "select" ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2098
|
-
|
|
2110
|
+
r,
|
|
2099
2111
|
/* @__PURE__ */ s(
|
|
2100
2112
|
vt,
|
|
2101
2113
|
{
|
|
@@ -2107,7 +2119,7 @@ function vs({
|
|
|
2107
2119
|
}
|
|
2108
2120
|
)
|
|
2109
2121
|
] }) : /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2110
|
-
|
|
2122
|
+
r,
|
|
2111
2123
|
/* @__PURE__ */ s(
|
|
2112
2124
|
Hn,
|
|
2113
2125
|
{
|
|
@@ -2124,10 +2136,10 @@ function bs({
|
|
|
2124
2136
|
valueIds: n,
|
|
2125
2137
|
onChange: i,
|
|
2126
2138
|
onChangeIds: a,
|
|
2127
|
-
pickerStyle:
|
|
2139
|
+
pickerStyle: o = "select"
|
|
2128
2140
|
}) {
|
|
2129
2141
|
const { t: c } = q(), l = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: c("booking.operator.heading") });
|
|
2130
|
-
if (
|
|
2142
|
+
if (o === "multi-select" && a) {
|
|
2131
2143
|
const u = e.map((g) => ({
|
|
2132
2144
|
value: g.id,
|
|
2133
2145
|
label: g.name
|
|
@@ -2135,7 +2147,7 @@ function bs({
|
|
|
2135
2147
|
return /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2136
2148
|
l,
|
|
2137
2149
|
/* @__PURE__ */ s(
|
|
2138
|
-
|
|
2150
|
+
At,
|
|
2139
2151
|
{
|
|
2140
2152
|
options: u,
|
|
2141
2153
|
value: n ?? [],
|
|
@@ -2148,17 +2160,17 @@ function bs({
|
|
|
2148
2160
|
] });
|
|
2149
2161
|
}
|
|
2150
2162
|
const f = [
|
|
2151
|
-
{ value:
|
|
2163
|
+
{ value: ye, label: c("booking.operator.all") },
|
|
2152
2164
|
...e.map((u) => ({ value: u.id, label: u.name }))
|
|
2153
2165
|
];
|
|
2154
|
-
return
|
|
2166
|
+
return o === "combobox" ? /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
2155
2167
|
l,
|
|
2156
2168
|
/* @__PURE__ */ s(
|
|
2157
|
-
|
|
2169
|
+
Ct,
|
|
2158
2170
|
{
|
|
2159
2171
|
options: f,
|
|
2160
|
-
value: t ??
|
|
2161
|
-
onValueChange: (u) => i(u === "" ?
|
|
2172
|
+
value: t ?? ye,
|
|
2173
|
+
onValueChange: (u) => i(u === "" ? ye : u),
|
|
2162
2174
|
placeholder: c("booking.operator.placeholder"),
|
|
2163
2175
|
"aria-label": c("booking.operator.heading"),
|
|
2164
2176
|
clearable: !0
|
|
@@ -2170,7 +2182,7 @@ function bs({
|
|
|
2170
2182
|
vt,
|
|
2171
2183
|
{
|
|
2172
2184
|
options: f,
|
|
2173
|
-
value: t ??
|
|
2185
|
+
value: t ?? ye,
|
|
2174
2186
|
onValueChange: (u) => i(u),
|
|
2175
2187
|
placeholder: c("booking.operator.placeholder"),
|
|
2176
2188
|
"aria-label": c("booking.operator.heading")
|
|
@@ -2212,29 +2224,29 @@ function Xn({
|
|
|
2212
2224
|
operators: n,
|
|
2213
2225
|
specialties: i,
|
|
2214
2226
|
services: a,
|
|
2215
|
-
locale:
|
|
2227
|
+
locale: o,
|
|
2216
2228
|
mode: c,
|
|
2217
2229
|
showModify: l,
|
|
2218
2230
|
onReset: f,
|
|
2219
2231
|
onModify: u,
|
|
2220
2232
|
focusWasLost: g
|
|
2221
2233
|
}) {
|
|
2222
|
-
const { t:
|
|
2234
|
+
const { t: r } = q(), p = L(null);
|
|
2223
2235
|
z(() => {
|
|
2224
2236
|
const w = p.current, A = document.activeElement, h = w == null ? void 0 : w.closest('[data-component="booking"]');
|
|
2225
2237
|
!e || !w || (A && (h != null && h.contains(A)) || g()) && w.focus();
|
|
2226
2238
|
}, []);
|
|
2227
2239
|
const S = (t.details.confirmationChannels ?? ["email"]).map(
|
|
2228
|
-
(w) =>
|
|
2229
|
-
), y = e ? st(e.amountCents, e.currencyCode,
|
|
2240
|
+
(w) => r(`booking.confirmation.channel.${w}`)
|
|
2241
|
+
), y = e ? st(e.amountCents, e.currencyCode, o) : "", N = e ? r(
|
|
2230
2242
|
c === "demo" ? "booking.payment.paidDemo" : "booking.payment.paidBody",
|
|
2231
2243
|
{ amount: y }
|
|
2232
|
-
) : c === "demo" ?
|
|
2244
|
+
) : c === "demo" ? r("booking.success.descriptionDemo") : S.length > 1 ? r("booking.success.descriptionMultiple", {
|
|
2233
2245
|
channels: S.join(" · ")
|
|
2234
|
-
}) :
|
|
2246
|
+
}) : r("booking.success.descriptionSingle", { channel: S[0] }), _ = M(() => {
|
|
2235
2247
|
if (t.date)
|
|
2236
2248
|
try {
|
|
2237
|
-
return new Intl.DateTimeFormat(
|
|
2249
|
+
return new Intl.DateTimeFormat(o, {
|
|
2238
2250
|
weekday: "long",
|
|
2239
2251
|
day: "numeric",
|
|
2240
2252
|
month: "long"
|
|
@@ -2242,21 +2254,21 @@ function Xn({
|
|
|
2242
2254
|
} catch {
|
|
2243
2255
|
return t.date;
|
|
2244
2256
|
}
|
|
2245
|
-
}, [t.date,
|
|
2246
|
-
const A = (t.operatorIds && t.operatorIds.length > 0 ? t.operatorIds : t.operatorId ? [t.operatorId] : []).filter((h) => h !==
|
|
2257
|
+
}, [t.date, o]), I = M(() => {
|
|
2258
|
+
const A = (t.operatorIds && t.operatorIds.length > 0 ? t.operatorIds : t.operatorId ? [t.operatorId] : []).filter((h) => h !== ye).map((h) => {
|
|
2247
2259
|
var d;
|
|
2248
2260
|
return (d = n.find((T) => T.id === h)) == null ? void 0 : d.name;
|
|
2249
2261
|
}).filter((h) => h !== void 0);
|
|
2250
2262
|
if (A.length === 0) return "";
|
|
2251
2263
|
try {
|
|
2252
|
-
return new Intl.ListFormat(
|
|
2264
|
+
return new Intl.ListFormat(o === "en" ? "en-GB" : o, {
|
|
2253
2265
|
style: "long",
|
|
2254
2266
|
type: "conjunction"
|
|
2255
2267
|
}).format(A);
|
|
2256
2268
|
} catch {
|
|
2257
2269
|
return A.join(", ");
|
|
2258
2270
|
}
|
|
2259
|
-
}, [t.operatorIds, t.operatorId, n,
|
|
2271
|
+
}, [t.operatorIds, t.operatorId, n, o]), v = t.specialtyId ? i.find((w) => w.id === t.specialtyId) : void 0, x = t.serviceId ? a.find((w) => w.id === t.serviceId) : void 0;
|
|
2260
2272
|
return /* @__PURE__ */ b(
|
|
2261
2273
|
"div",
|
|
2262
2274
|
{
|
|
@@ -2271,7 +2283,7 @@ function Xn({
|
|
|
2271
2283
|
ref: p,
|
|
2272
2284
|
tabIndex: e ? -1 : void 0,
|
|
2273
2285
|
className: e ? ft : void 0,
|
|
2274
|
-
children:
|
|
2286
|
+
children: r(
|
|
2275
2287
|
e ? c === "demo" ? "booking.payment.paidDemoTitle" : "booking.payment.paidTitle" : "booking.success.heading"
|
|
2276
2288
|
)
|
|
2277
2289
|
}
|
|
@@ -2280,31 +2292,31 @@ function Xn({
|
|
|
2280
2292
|
] }),
|
|
2281
2293
|
/* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ b("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: [
|
|
2282
2294
|
e && c !== "demo" ? /* @__PURE__ */ b(ce, { children: [
|
|
2283
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2295
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.payment.summaryPaid") }),
|
|
2284
2296
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: y })
|
|
2285
2297
|
] }) : null,
|
|
2286
2298
|
v ? /* @__PURE__ */ b(ce, { children: [
|
|
2287
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2299
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summarySpecialty") }),
|
|
2288
2300
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: v.label })
|
|
2289
2301
|
] }) : null,
|
|
2290
2302
|
x ? /* @__PURE__ */ b(ce, { children: [
|
|
2291
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2303
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryService") }),
|
|
2292
2304
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: x.label })
|
|
2293
2305
|
] }) : null,
|
|
2294
2306
|
_ ? /* @__PURE__ */ b(ce, { children: [
|
|
2295
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2307
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryDate") }),
|
|
2296
2308
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: _ })
|
|
2297
2309
|
] }) : null,
|
|
2298
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2310
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryTime") }),
|
|
2299
2311
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: t.slot.time }),
|
|
2300
2312
|
I ? /* @__PURE__ */ b(ce, { children: [
|
|
2301
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
2313
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryProvider") }),
|
|
2302
2314
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: I })
|
|
2303
2315
|
] }) : null
|
|
2304
2316
|
] }) }),
|
|
2305
2317
|
/* @__PURE__ */ b("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
2306
|
-
/* @__PURE__ */ s(Ve, { intent: "secondary", size: "md", onClick: f, children:
|
|
2307
|
-
l ? /* @__PURE__ */ s(Ve, { intent: "ghost", size: "md", onClick: u, children:
|
|
2318
|
+
/* @__PURE__ */ s(Ve, { intent: "secondary", size: "md", onClick: f, children: r("booking.success.bookAnother") }),
|
|
2319
|
+
l ? /* @__PURE__ */ s(Ve, { intent: "ghost", size: "md", onClick: u, children: r("booking.success.modifyBooking") }) : null
|
|
2308
2320
|
] })
|
|
2309
2321
|
]
|
|
2310
2322
|
}
|
|
@@ -2356,13 +2368,13 @@ function ei(e) {
|
|
|
2356
2368
|
inputs: n,
|
|
2357
2369
|
value: i,
|
|
2358
2370
|
onChange: a,
|
|
2359
|
-
onSubmit:
|
|
2371
|
+
onSubmit: o,
|
|
2360
2372
|
emptyServicesSlot: c,
|
|
2361
2373
|
onboardingIncompleteSlot: l,
|
|
2362
2374
|
loadingDates: f,
|
|
2363
2375
|
loadingSlots: u,
|
|
2364
2376
|
onDateSelect: g,
|
|
2365
|
-
onWindowChange:
|
|
2377
|
+
onWindowChange: r,
|
|
2366
2378
|
datePickerStyle: p,
|
|
2367
2379
|
specialtyPickerStyle: m,
|
|
2368
2380
|
servicePickerStyle: S,
|
|
@@ -2437,7 +2449,7 @@ function ei(e) {
|
|
|
2437
2449
|
value: i,
|
|
2438
2450
|
onChange: a,
|
|
2439
2451
|
onDateSelect: g,
|
|
2440
|
-
onWindowChange:
|
|
2452
|
+
onWindowChange: r,
|
|
2441
2453
|
loadingDates: f,
|
|
2442
2454
|
loadingSlots: u,
|
|
2443
2455
|
locale: _,
|
|
@@ -2470,7 +2482,7 @@ function ei(e) {
|
|
|
2470
2482
|
...I,
|
|
2471
2483
|
value: i.details ?? {},
|
|
2472
2484
|
onChange: (d) => a({ ...i, details: d }),
|
|
2473
|
-
onSubmit:
|
|
2485
|
+
onSubmit: o,
|
|
2474
2486
|
submitting: N,
|
|
2475
2487
|
defaultPhoneCountry: e.policy.country
|
|
2476
2488
|
}
|
|
@@ -2481,13 +2493,13 @@ function fe(e, t, n = {}) {
|
|
|
2481
2493
|
const {
|
|
2482
2494
|
cascade: i,
|
|
2483
2495
|
inputs: a,
|
|
2484
|
-
value:
|
|
2496
|
+
value: o,
|
|
2485
2497
|
onChange: c,
|
|
2486
2498
|
onSubmit: l,
|
|
2487
2499
|
emptyServicesSlot: f,
|
|
2488
2500
|
onboardingIncompleteSlot: u,
|
|
2489
2501
|
loadingDates: g,
|
|
2490
|
-
loadingSlots:
|
|
2502
|
+
loadingSlots: r,
|
|
2491
2503
|
onDateSelect: p,
|
|
2492
2504
|
onWindowChange: m,
|
|
2493
2505
|
datePickerStyle: S,
|
|
@@ -2505,8 +2517,8 @@ function fe(e, t, n = {}) {
|
|
|
2505
2517
|
return /* @__PURE__ */ s(
|
|
2506
2518
|
gs,
|
|
2507
2519
|
{
|
|
2508
|
-
value:
|
|
2509
|
-
onChange: (h) => c(ss(
|
|
2520
|
+
value: o.insuranceType,
|
|
2521
|
+
onChange: (h) => c(ss(o, h))
|
|
2510
2522
|
}
|
|
2511
2523
|
);
|
|
2512
2524
|
case 2:
|
|
@@ -2514,10 +2526,10 @@ function fe(e, t, n = {}) {
|
|
|
2514
2526
|
hs,
|
|
2515
2527
|
{
|
|
2516
2528
|
specialties: i.filtered.specialties,
|
|
2517
|
-
value:
|
|
2518
|
-
valueIds:
|
|
2519
|
-
onChange: (h) => c(ns(
|
|
2520
|
-
onChangeIds: (h) => c(is(
|
|
2529
|
+
value: o.specialtyId,
|
|
2530
|
+
valueIds: o.specialtyIds,
|
|
2531
|
+
onChange: (h) => c(ns(o, h)),
|
|
2532
|
+
onChangeIds: (h) => c(is(o, h)),
|
|
2521
2533
|
pickerStyle: y
|
|
2522
2534
|
}
|
|
2523
2535
|
);
|
|
@@ -2526,10 +2538,10 @@ function fe(e, t, n = {}) {
|
|
|
2526
2538
|
vs,
|
|
2527
2539
|
{
|
|
2528
2540
|
services: i.filtered.services,
|
|
2529
|
-
value:
|
|
2530
|
-
valueIds:
|
|
2531
|
-
onChange: (h) => c(as(
|
|
2532
|
-
onChangeIds: (h) => c(rs(
|
|
2541
|
+
value: o.serviceId,
|
|
2542
|
+
valueIds: o.serviceIds,
|
|
2543
|
+
onChange: (h) => c(as(o, h)),
|
|
2544
|
+
onChangeIds: (h) => c(rs(o, h)),
|
|
2533
2545
|
pickerStyle: N,
|
|
2534
2546
|
compact: n.compactService
|
|
2535
2547
|
}
|
|
@@ -2539,10 +2551,10 @@ function fe(e, t, n = {}) {
|
|
|
2539
2551
|
bs,
|
|
2540
2552
|
{
|
|
2541
2553
|
operators: i.filtered.operators,
|
|
2542
|
-
value:
|
|
2543
|
-
valueIds:
|
|
2544
|
-
onChange: (h) => c(os(
|
|
2545
|
-
onChangeIds: (h) => c(ds(
|
|
2554
|
+
value: o.operatorId,
|
|
2555
|
+
valueIds: o.operatorIds,
|
|
2556
|
+
onChange: (h) => c(os(o, h)),
|
|
2557
|
+
onChangeIds: (h) => c(ds(o, h)),
|
|
2546
2558
|
pickerStyle: _
|
|
2547
2559
|
}
|
|
2548
2560
|
);
|
|
@@ -2551,17 +2563,17 @@ function fe(e, t, n = {}) {
|
|
|
2551
2563
|
Tt,
|
|
2552
2564
|
{
|
|
2553
2565
|
nextAvailableDate: a.nextAvailableDate,
|
|
2554
|
-
onJump: () => c(bt(
|
|
2566
|
+
onJump: () => c(bt(o, a.nextAvailableDate)),
|
|
2555
2567
|
locale: v
|
|
2556
2568
|
}
|
|
2557
2569
|
) : ms({
|
|
2558
2570
|
inputs: a,
|
|
2559
|
-
value:
|
|
2571
|
+
value: o,
|
|
2560
2572
|
onChange: c,
|
|
2561
2573
|
onDateSelect: p,
|
|
2562
2574
|
onWindowChange: m,
|
|
2563
2575
|
loadingDates: g,
|
|
2564
|
-
loadingSlots:
|
|
2576
|
+
loadingSlots: r,
|
|
2565
2577
|
locale: v,
|
|
2566
2578
|
datePickerStyle: S,
|
|
2567
2579
|
agentIdBase: A
|
|
@@ -2569,9 +2581,9 @@ function fe(e, t, n = {}) {
|
|
|
2569
2581
|
case 6:
|
|
2570
2582
|
return fs({
|
|
2571
2583
|
inputs: a,
|
|
2572
|
-
value:
|
|
2584
|
+
value: o,
|
|
2573
2585
|
onChange: c,
|
|
2574
|
-
loadingSlots:
|
|
2586
|
+
loadingSlots: r,
|
|
2575
2587
|
locale: v,
|
|
2576
2588
|
datePickerStyle: S
|
|
2577
2589
|
});
|
|
@@ -2580,8 +2592,8 @@ function fe(e, t, n = {}) {
|
|
|
2580
2592
|
Dt,
|
|
2581
2593
|
{
|
|
2582
2594
|
...x,
|
|
2583
|
-
value:
|
|
2584
|
-
onChange: (h) => c({ ...
|
|
2595
|
+
value: o.details ?? {},
|
|
2596
|
+
onChange: (h) => c({ ...o, details: h }),
|
|
2585
2597
|
onSubmit: l,
|
|
2586
2598
|
submitting: I,
|
|
2587
2599
|
defaultPhoneCountry: w.country
|
|
@@ -2611,10 +2623,10 @@ function He(e, t) {
|
|
|
2611
2623
|
return t === "four-day-grid" && e === 6 ? 5 : e;
|
|
2612
2624
|
}
|
|
2613
2625
|
function ti(e) {
|
|
2614
|
-
const { cascade: t, value: n, activeStep: i, setActiveStep: a, datePickerStyle:
|
|
2615
|
-
() => Ot(t.visibleSteps,
|
|
2616
|
-
[t.visibleSteps,
|
|
2617
|
-
), g = He(i,
|
|
2626
|
+
const { cascade: t, value: n, activeStep: i, setActiveStep: a, datePickerStyle: o } = e, c = yt(), { t: l } = q(), f = l("booking.operator.all"), u = M(
|
|
2627
|
+
() => Ot(t.visibleSteps, o),
|
|
2628
|
+
[t.visibleSteps, o]
|
|
2629
|
+
), g = He(i, o), r = Math.max(0, u.indexOf(g)), p = M(
|
|
2618
2630
|
() => u.map((m) => ({
|
|
2619
2631
|
label: c[m],
|
|
2620
2632
|
summary: xs(m, n, t, f),
|
|
@@ -2634,7 +2646,7 @@ function ti(e) {
|
|
|
2634
2646
|
return /* @__PURE__ */ s(
|
|
2635
2647
|
Ls,
|
|
2636
2648
|
{
|
|
2637
|
-
activeStep:
|
|
2649
|
+
activeStep: r,
|
|
2638
2650
|
steps: p,
|
|
2639
2651
|
onStepChange: (m) => {
|
|
2640
2652
|
const S = u[m];
|
|
@@ -2644,58 +2656,40 @@ function ti(e) {
|
|
|
2644
2656
|
);
|
|
2645
2657
|
}
|
|
2646
2658
|
function si(e, t, n) {
|
|
2647
|
-
return
|
|
2648
|
-
}
|
|
2649
|
-
function _e(e, t) {
|
|
2650
|
-
switch (e) {
|
|
2651
|
-
case 1:
|
|
2652
|
-
return t.insuranceType !== void 0;
|
|
2653
|
-
case 2:
|
|
2654
|
-
return Ce(t).length > 0;
|
|
2655
|
-
case 3:
|
|
2656
|
-
return Se(t).length > 0;
|
|
2657
|
-
case 4:
|
|
2658
|
-
return At(t).length > 0;
|
|
2659
|
-
case 5:
|
|
2660
|
-
return t.date !== void 0;
|
|
2661
|
-
case 6:
|
|
2662
|
-
return t.slotKey !== void 0;
|
|
2663
|
-
case 7:
|
|
2664
|
-
return !1;
|
|
2665
|
-
}
|
|
2659
|
+
return we(e, t) && e < n.currentStep ? "completed" : e <= n.currentStep ? "unlocked" : void 0;
|
|
2666
2660
|
}
|
|
2667
2661
|
function Yt(e, t) {
|
|
2668
|
-
return e !== 4 ?
|
|
2662
|
+
return e !== 4 ? we(e, t) : t.operatorIds && t.operatorIds.length > 0 ? !0 : ls(t) !== void 0;
|
|
2669
2663
|
}
|
|
2670
2664
|
function It(e, t) {
|
|
2671
2665
|
const n = e.map((i) => {
|
|
2672
2666
|
var a;
|
|
2673
|
-
return (a = t.find((
|
|
2667
|
+
return (a = t.find((o) => o.id === i)) == null ? void 0 : a.label;
|
|
2674
2668
|
}).filter((i) => i !== void 0);
|
|
2675
2669
|
return n.length > 0 ? n.join(", ") : void 0;
|
|
2676
2670
|
}
|
|
2677
2671
|
function xs(e, t, n, i) {
|
|
2678
2672
|
var a;
|
|
2679
|
-
if (
|
|
2673
|
+
if (we(e, t))
|
|
2680
2674
|
switch (e) {
|
|
2681
2675
|
case 1:
|
|
2682
2676
|
return t.insuranceType;
|
|
2683
2677
|
case 2:
|
|
2684
2678
|
return It(
|
|
2685
|
-
|
|
2679
|
+
_e(t),
|
|
2686
2680
|
n.filtered.specialties
|
|
2687
2681
|
);
|
|
2688
2682
|
case 3:
|
|
2689
|
-
return It(
|
|
2683
|
+
return It(Ce(t), n.filtered.services);
|
|
2690
2684
|
case 4: {
|
|
2691
|
-
const
|
|
2685
|
+
const c = wt(t).filter((f) => f !== ye), l = It(
|
|
2692
2686
|
c,
|
|
2693
2687
|
n.filtered.operators.map((f) => ({
|
|
2694
2688
|
id: f.id,
|
|
2695
2689
|
label: f.name
|
|
2696
2690
|
}))
|
|
2697
2691
|
);
|
|
2698
|
-
return l !== void 0 ? l :
|
|
2692
|
+
return l !== void 0 ? l : c.length === 0 ? i : void 0;
|
|
2699
2693
|
}
|
|
2700
2694
|
case 5:
|
|
2701
2695
|
return t.date;
|
|
@@ -2706,19 +2700,19 @@ function xs(e, t, n, i) {
|
|
|
2706
2700
|
}
|
|
2707
2701
|
}
|
|
2708
2702
|
function ni(e) {
|
|
2709
|
-
const { cascade: t, value: n, activeStep: i, setActiveStep: a } = e, { t:
|
|
2703
|
+
const { cascade: t, value: n, activeStep: i, setActiveStep: a } = e, { t: o } = q(), c = yt(), l = o("booking.operator.all"), f = `${gt()}-filter`, u = He(i, e.datePickerStyle), g = t.visibleSteps.filter(
|
|
2710
2704
|
(m) => m === 1 || m === 2 || m === 3 || m === 4
|
|
2711
|
-
),
|
|
2712
|
-
(m) => !
|
|
2705
|
+
), r = g.some(
|
|
2706
|
+
(m) => !we(m, n)
|
|
2713
2707
|
), p = g.some(
|
|
2714
2708
|
(m) => m === i
|
|
2715
|
-
) ? i : g.find((m) => !
|
|
2709
|
+
) ? i : g.find((m) => !we(m, n));
|
|
2716
2710
|
return /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2717
2711
|
g.length > 0 ? /* @__PURE__ */ s(
|
|
2718
2712
|
"div",
|
|
2719
2713
|
{
|
|
2720
2714
|
role: "group",
|
|
2721
|
-
"aria-label":
|
|
2715
|
+
"aria-label": o("booking.filtersLabel"),
|
|
2722
2716
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
2723
2717
|
children: g.map((m) => {
|
|
2724
2718
|
const S = xs(
|
|
@@ -2726,7 +2720,7 @@ function ni(e) {
|
|
|
2726
2720
|
n,
|
|
2727
2721
|
t,
|
|
2728
2722
|
l
|
|
2729
|
-
), y = m === p, N =
|
|
2723
|
+
), y = m === p, N = we(m, n);
|
|
2730
2724
|
return /* @__PURE__ */ s(
|
|
2731
2725
|
Ve,
|
|
2732
2726
|
{
|
|
@@ -2765,7 +2759,7 @@ function ni(e) {
|
|
|
2765
2759
|
children: fe(p, e, { compactService: !0 })
|
|
2766
2760
|
}
|
|
2767
2761
|
) : null,
|
|
2768
|
-
!
|
|
2762
|
+
!r && t.gates.date ? (
|
|
2769
2763
|
// four-day-grid embeds slots inline with the day strip — the
|
|
2770
2764
|
// historic 2-col date|slot split collapses to a single column
|
|
2771
2765
|
// so the picker spans the full width instead of orphaning an
|
|
@@ -2795,7 +2789,7 @@ function ni(e) {
|
|
|
2795
2789
|
] });
|
|
2796
2790
|
}
|
|
2797
2791
|
function ii(e) {
|
|
2798
|
-
const { cascade: t, datePickerStyle: n, activeStep: i } = e, a = He(i, n),
|
|
2792
|
+
const { cascade: t, datePickerStyle: n, activeStep: i } = e, a = He(i, n), o = t.visibleSteps.filter(
|
|
2799
2793
|
(l) => l === 1 || l === 2 || l === 3 || l === 4
|
|
2800
2794
|
);
|
|
2801
2795
|
return /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
@@ -2804,7 +2798,7 @@ function ii(e) {
|
|
|
2804
2798
|
{
|
|
2805
2799
|
className: n === "four-day-grid" ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2",
|
|
2806
2800
|
children: [
|
|
2807
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children:
|
|
2801
|
+
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: o.map((l) => /* @__PURE__ */ s(j, { step: l, active: l === a, children: fe(l, e, { compactService: !0 }) }, `fbf-${l}`)) }),
|
|
2808
2802
|
/* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2809
2803
|
t.gates.date ? /* @__PURE__ */ s(j, { step: 5, active: a === 5, children: fe(5, e) }) : null,
|
|
2810
2804
|
t.gates.slot && e.value.date && n === "month-calendar" ? /* @__PURE__ */ s(j, { step: 6, active: a === 6, children: fe(6, e) }) : null
|
|
@@ -2816,13 +2810,13 @@ function ii(e) {
|
|
|
2816
2810
|
] });
|
|
2817
2811
|
}
|
|
2818
2812
|
function ai(e) {
|
|
2819
|
-
const { cascade: t, value: n, activeStep: i, setActiveStep: a, datePickerStyle:
|
|
2820
|
-
() => Ot(t.visibleSteps,
|
|
2821
|
-
[t.visibleSteps,
|
|
2822
|
-
), u = He(i,
|
|
2813
|
+
const { cascade: t, value: n, activeStep: i, setActiveStep: a, datePickerStyle: o } = e, { t: c } = q(), l = yt(), f = M(
|
|
2814
|
+
() => Ot(t.visibleSteps, o),
|
|
2815
|
+
[t.visibleSteps, o]
|
|
2816
|
+
), u = He(i, o), g = Math.max(0, f.indexOf(u)), r = f.length, p = M(
|
|
2823
2817
|
() => f.map((N) => ({ label: l[N] })),
|
|
2824
2818
|
[f, l]
|
|
2825
|
-
), m = g > 0, S = u === 5 &&
|
|
2819
|
+
), m = g > 0, S = u === 5 && o === "four-day-grid", y = g < r - 1 && we(u, n) && (!S || we(6, n));
|
|
2826
2820
|
return /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2827
2821
|
/* @__PURE__ */ s(Ps, { activeStep: g, steps: p }),
|
|
2828
2822
|
/* @__PURE__ */ s(j, { step: u, active: !0, children: fe(u, e, { compactService: !0 }) }),
|
|
@@ -2870,13 +2864,13 @@ const di = Zt(
|
|
|
2870
2864
|
useSpecialties: n,
|
|
2871
2865
|
allowOperatorSelection: i = !1,
|
|
2872
2866
|
lockedOperatorId: a,
|
|
2873
|
-
operatorsByService:
|
|
2867
|
+
operatorsByService: o = !1,
|
|
2874
2868
|
autoSelectSingleService: c = !1,
|
|
2875
2869
|
specialties: l,
|
|
2876
2870
|
services: f,
|
|
2877
2871
|
operators: u,
|
|
2878
2872
|
availableDates: g,
|
|
2879
|
-
availableSlots:
|
|
2873
|
+
availableSlots: r,
|
|
2880
2874
|
nextAvailableDate: p,
|
|
2881
2875
|
requireCodiceFiscale: m,
|
|
2882
2876
|
requireDateOfBirth: S,
|
|
@@ -2901,7 +2895,7 @@ const di = Zt(
|
|
|
2901
2895
|
onWindowChange: ae,
|
|
2902
2896
|
datePickerStyle: Z = "month-calendar",
|
|
2903
2897
|
specialtyPickerStyle: ue,
|
|
2904
|
-
servicePickerStyle:
|
|
2898
|
+
servicePickerStyle: he,
|
|
2905
2899
|
operatorPickerStyle: K,
|
|
2906
2900
|
loadingDates: Re,
|
|
2907
2901
|
loadingSlots: se,
|
|
@@ -2916,17 +2910,17 @@ const di = Zt(
|
|
|
2916
2910
|
id: G,
|
|
2917
2911
|
className: pe,
|
|
2918
2912
|
onFocus: Te,
|
|
2919
|
-
onBlur:
|
|
2913
|
+
onBlur: ve,
|
|
2920
2914
|
...nt
|
|
2921
2915
|
}, Ke) => {
|
|
2922
2916
|
var Kt, zt;
|
|
2923
|
-
const { t: ee, i18n: Le } = q(), te = e ?? "inline-list", Oe = Le.language ?? "en",
|
|
2917
|
+
const { t: ee, i18n: Le } = q(), te = e ?? "inline-list", Oe = Le.language ?? "en", Se = l ?? ri, xe = u ?? oi;
|
|
2924
2918
|
z(() => {
|
|
2925
2919
|
const C = On(D, {
|
|
2926
2920
|
useSpecialties: n,
|
|
2927
2921
|
lockedOperatorId: a,
|
|
2928
2922
|
autoSelectSingleService: c,
|
|
2929
|
-
specialties:
|
|
2923
|
+
specialties: Se,
|
|
2930
2924
|
services: f
|
|
2931
2925
|
});
|
|
2932
2926
|
(C.specialtyId !== D.specialtyId || C.operatorId !== D.operatorId || C.serviceId !== D.serviceId) && O(C);
|
|
@@ -2934,20 +2928,20 @@ const di = Zt(
|
|
|
2934
2928
|
a,
|
|
2935
2929
|
n,
|
|
2936
2930
|
c,
|
|
2937
|
-
|
|
2931
|
+
Se,
|
|
2938
2932
|
f
|
|
2939
2933
|
]);
|
|
2940
|
-
const
|
|
2934
|
+
const R = M(
|
|
2941
2935
|
() => Tn({
|
|
2942
2936
|
country: t,
|
|
2943
2937
|
useSpecialties: n,
|
|
2944
2938
|
allowOperatorSelection: i,
|
|
2945
2939
|
lockedOperatorId: a,
|
|
2946
|
-
operatorsByService:
|
|
2947
|
-
specialties:
|
|
2940
|
+
operatorsByService: o,
|
|
2941
|
+
specialties: Se,
|
|
2948
2942
|
services: f,
|
|
2949
|
-
operators:
|
|
2950
|
-
availableSlots:
|
|
2943
|
+
operators: xe,
|
|
2944
|
+
availableSlots: r,
|
|
2951
2945
|
value: D
|
|
2952
2946
|
}),
|
|
2953
2947
|
[
|
|
@@ -2955,68 +2949,70 @@ const di = Zt(
|
|
|
2955
2949
|
n,
|
|
2956
2950
|
i,
|
|
2957
2951
|
a,
|
|
2958
|
-
|
|
2952
|
+
o,
|
|
2959
2953
|
c,
|
|
2960
|
-
|
|
2954
|
+
Se,
|
|
2961
2955
|
f,
|
|
2962
|
-
|
|
2956
|
+
xe,
|
|
2963
2957
|
g,
|
|
2964
|
-
|
|
2958
|
+
r,
|
|
2965
2959
|
D
|
|
2966
2960
|
]
|
|
2967
2961
|
), ze = M(
|
|
2968
2962
|
() => [
|
|
2969
2963
|
JSON.stringify(D.insuranceType),
|
|
2964
|
+
JSON.stringify(_e(D)),
|
|
2970
2965
|
JSON.stringify(Ce(D)),
|
|
2971
|
-
JSON.stringify(
|
|
2972
|
-
JSON.stringify(At(D)),
|
|
2966
|
+
JSON.stringify(wt(D)),
|
|
2973
2967
|
JSON.stringify(D.date),
|
|
2974
2968
|
JSON.stringify(D.slotKey)
|
|
2975
2969
|
],
|
|
2976
2970
|
[D]
|
|
2977
2971
|
), je = te === "progress", it = ke(
|
|
2978
2972
|
(C) => {
|
|
2979
|
-
if (
|
|
2980
|
-
|
|
2981
|
-
|
|
2973
|
+
if (C === 4 && R.visibleSteps.includes(4) && wt(D).length === 0)
|
|
2974
|
+
return Math.min(4, R.currentStep);
|
|
2975
|
+
if (!je) return R.currentStep;
|
|
2976
|
+
const B = R.visibleSteps.find(
|
|
2977
|
+
(E) => E > C && !Yt(E, D)
|
|
2982
2978
|
);
|
|
2983
|
-
return B === void 0 ?
|
|
2979
|
+
return B === void 0 ? R.currentStep : Math.min(B, R.currentStep);
|
|
2984
2980
|
},
|
|
2985
|
-
[je,
|
|
2986
|
-
), [ne,
|
|
2987
|
-
|
|
2988
|
-
), Ge =
|
|
2981
|
+
[je, R.visibleSteps, R.currentStep, D]
|
|
2982
|
+
), [ne, Ie] = ie(
|
|
2983
|
+
R.currentStep
|
|
2984
|
+
), Ge = L(ze), Ue = L(R.visibleSteps);
|
|
2989
2985
|
z(() => {
|
|
2990
2986
|
const C = Ge.current, B = Ue.current;
|
|
2991
|
-
Ge.current = ze, Ue.current =
|
|
2992
|
-
const
|
|
2987
|
+
Ge.current = ze, Ue.current = R.visibleSteps;
|
|
2988
|
+
const E = ze.findIndex(
|
|
2993
2989
|
(de, jt) => de !== C[jt]
|
|
2994
2990
|
);
|
|
2995
|
-
if (
|
|
2996
|
-
|
|
2991
|
+
if (E !== -1) {
|
|
2992
|
+
Ie(it(E + 1));
|
|
2997
2993
|
return;
|
|
2998
2994
|
}
|
|
2999
|
-
const W = je ?
|
|
2995
|
+
const W = je ? R.visibleSteps.find(
|
|
3000
2996
|
(de) => de < ne && !B.includes(de) && !Yt(de, D)
|
|
3001
2997
|
) : void 0;
|
|
3002
2998
|
if (W !== void 0) {
|
|
3003
|
-
|
|
2999
|
+
Ie(W);
|
|
3004
3000
|
return;
|
|
3005
3001
|
}
|
|
3006
|
-
|
|
3002
|
+
R.visibleSteps.includes(ne) || Ie(R.currentStep);
|
|
3007
3003
|
}, [
|
|
3008
3004
|
ze,
|
|
3009
3005
|
it,
|
|
3010
3006
|
je,
|
|
3011
|
-
|
|
3012
|
-
|
|
3007
|
+
R.currentStep,
|
|
3008
|
+
R.visibleSteps,
|
|
3013
3009
|
ne,
|
|
3014
3010
|
D
|
|
3015
3011
|
]);
|
|
3016
|
-
const me =
|
|
3017
|
-
() => Ot(
|
|
3018
|
-
[
|
|
3019
|
-
), $ = yt(), [Pe, Is] = ie(""), Ye =
|
|
3012
|
+
const me = L(null), k = M(
|
|
3013
|
+
() => Ot(R.visibleSteps, Z),
|
|
3014
|
+
[R.visibleSteps, Z]
|
|
3015
|
+
), $ = yt(), [Pe, Is] = ie(""), Ye = L(null), at = L(null);
|
|
3020
3016
|
z(() => {
|
|
3021
3017
|
const C = He(ne, Z);
|
|
3022
3018
|
if (at.current === null) {
|
|
@@ -3033,8 +3029,8 @@ const di = Zt(
|
|
|
3033
3029
|
label: $[C]
|
|
3034
3030
|
})
|
|
3035
3031
|
);
|
|
3036
|
-
const
|
|
3037
|
-
if (!
|
|
3032
|
+
const E = Ye.current;
|
|
3033
|
+
if (!E || E.isConnected) return;
|
|
3038
3034
|
const W = me.current;
|
|
3039
3035
|
if (!W) return;
|
|
3040
3036
|
const de = document.activeElement;
|
|
@@ -3053,27 +3049,27 @@ const di = Zt(
|
|
|
3053
3049
|
const U = Pn({
|
|
3054
3050
|
services: f,
|
|
3055
3051
|
value: D,
|
|
3056
|
-
availableSlots:
|
|
3052
|
+
availableSlots: r,
|
|
3057
3053
|
onSubmit: J,
|
|
3058
3054
|
onChange: O,
|
|
3059
3055
|
paymentState: w,
|
|
3060
3056
|
submitting: H,
|
|
3061
3057
|
paymentTermsUrl: x,
|
|
3062
3058
|
renderPayment: A
|
|
3063
|
-
}), Y = U.status, Bt = U.submit, kt =
|
|
3059
|
+
}), Y = U.status, Bt = U.submit, kt = L(U.reset);
|
|
3064
3060
|
kt.current = U.reset;
|
|
3065
|
-
const _t = gt(), Rt =
|
|
3061
|
+
const _t = gt(), Rt = L(null), Et = L(null), Lt = ((Kt = U.state) == null ? void 0 : Kt.status) === "failed", Pt = U.state && "phase" in U.state && U.state.phase === "completion";
|
|
3066
3062
|
z(() => {
|
|
3067
3063
|
var C, B;
|
|
3068
3064
|
if (Y === "payment") {
|
|
3069
|
-
const
|
|
3070
|
-
(!Pt || !
|
|
3065
|
+
const E = document.activeElement;
|
|
3066
|
+
(!Pt || !E || E === document.body || !((C = me.current) != null && C.contains(E))) && ((B = Rt.current) == null || B.focus());
|
|
3071
3067
|
}
|
|
3072
3068
|
}, [Y, Pt]), z(() => {
|
|
3073
3069
|
var C;
|
|
3074
3070
|
Y === "payment" && Lt && ((C = Et.current) == null || C.focus());
|
|
3075
3071
|
}, [Y, Lt]), Ds(Ke, () => me.current, []);
|
|
3076
|
-
const We = Y === "success" ? 8 : Y === "payment" ? 7 :
|
|
3072
|
+
const We = Y === "success" ? 8 : Y === "payment" ? 7 : R.currentStep, Ft = L(null);
|
|
3077
3073
|
z(() => {
|
|
3078
3074
|
if (We !== Ft.current && (Ft.current = We, Q == null || Q(We), We === 8 && me.current))
|
|
3079
3075
|
try {
|
|
@@ -3085,10 +3081,10 @@ const di = Zt(
|
|
|
3085
3081
|
me.current.scrollIntoView();
|
|
3086
3082
|
}
|
|
3087
3083
|
}, [We, Q]);
|
|
3088
|
-
const Ze =
|
|
3084
|
+
const Ze = L({ activeStep: ne, cascade: R, submitState: Y });
|
|
3089
3085
|
z(() => {
|
|
3090
|
-
Ze.current = { activeStep: ne, cascade:
|
|
3091
|
-
}, [ne,
|
|
3086
|
+
Ze.current = { activeStep: ne, cascade: R, submitState: Y };
|
|
3087
|
+
}, [ne, R, Y]);
|
|
3092
3088
|
const Vt = M(
|
|
3093
3089
|
() => ({
|
|
3094
3090
|
getVariant: () => te,
|
|
@@ -3097,47 +3093,47 @@ const di = Zt(
|
|
|
3097
3093
|
return C.submitState === "success" ? 8 : C.submitState === "payment" ? 7 : C.activeStep;
|
|
3098
3094
|
},
|
|
3099
3095
|
reset: () => {
|
|
3100
|
-
Ze.current.submitState !== "payment" && (O({}), kt.current(),
|
|
3096
|
+
Ze.current.submitState !== "payment" && (O({}), kt.current(), Ie(1));
|
|
3101
3097
|
},
|
|
3102
3098
|
goToStep: (C) => {
|
|
3103
|
-
const B = Ze.current,
|
|
3104
|
-
Ze.current = { ...B, activeStep: de },
|
|
3099
|
+
const B = Ze.current, E = B.cascade.visibleSteps.includes(C), W = B.cascade.currentStep, de = B.submitState === "payment" ? 7 : !E || C > W ? W : C;
|
|
3100
|
+
Ze.current = { ...B, activeStep: de }, Ie(de);
|
|
3105
3101
|
}
|
|
3106
3102
|
}),
|
|
3107
3103
|
[te, O]
|
|
3108
3104
|
);
|
|
3109
3105
|
Ts(In, Vt, G);
|
|
3110
|
-
const Ns = Ee ?? ee("booking.regionLabel"),
|
|
3106
|
+
const Ns = Ee ?? ee("booking.regionLabel"), Ne = U.snapshot, ws = Y === "success" && Ne ? /* @__PURE__ */ s(
|
|
3111
3107
|
Xn,
|
|
3112
3108
|
{
|
|
3113
|
-
payment:
|
|
3109
|
+
payment: Ne.payment,
|
|
3114
3110
|
snapshot: {
|
|
3115
|
-
...
|
|
3116
|
-
slot:
|
|
3117
|
-
details:
|
|
3118
|
-
serviceId: ((zt =
|
|
3111
|
+
...Ne.value,
|
|
3112
|
+
slot: Ne.slot,
|
|
3113
|
+
details: Ne.details,
|
|
3114
|
+
serviceId: ((zt = Ne.payment) == null ? void 0 : zt.serviceId) ?? Ne.slot.serviceId ?? Ne.value.serviceId
|
|
3119
3115
|
},
|
|
3120
|
-
operators:
|
|
3121
|
-
specialties:
|
|
3116
|
+
operators: xe,
|
|
3117
|
+
specialties: Se,
|
|
3122
3118
|
services: f,
|
|
3123
3119
|
locale: Oe,
|
|
3124
3120
|
mode: P,
|
|
3125
|
-
showModify: oe && !
|
|
3121
|
+
showModify: oe && !Ne.payment,
|
|
3126
3122
|
onReset: () => Vt.reset(),
|
|
3127
3123
|
focusWasLost: () => {
|
|
3128
3124
|
const C = Ye.current, B = document.activeElement;
|
|
3129
3125
|
return !!(C && !C.isConnected) && (!B || B === document.body);
|
|
3130
3126
|
},
|
|
3131
3127
|
onModify: () => {
|
|
3132
|
-
kt.current(),
|
|
3128
|
+
kt.current(), Ie(7);
|
|
3133
3129
|
}
|
|
3134
3130
|
}
|
|
3135
|
-
) : null, St = U.activeSession, Xe = U.state,
|
|
3131
|
+
) : null, St = U.activeSession, Xe = U.state, be = St && Xe ? { session: St, payment: St.payment, state: Xe } : void 0, Qe = Xe && "phase" in Xe && Xe.phase === "completion", Cs = Y === "payment" && be ? /* @__PURE__ */ b(
|
|
3136
3132
|
"section",
|
|
3137
3133
|
{
|
|
3138
3134
|
"aria-labelledby": _t,
|
|
3139
3135
|
"data-component": "booking-payment",
|
|
3140
|
-
"data-payment-status":
|
|
3136
|
+
"data-payment-status": be.state.status,
|
|
3141
3137
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
3142
3138
|
children: [
|
|
3143
3139
|
/* @__PURE__ */ s(
|
|
@@ -3154,8 +3150,8 @@ const di = Zt(
|
|
|
3154
3150
|
),
|
|
3155
3151
|
Qe ? null : /* @__PURE__ */ s("p", { className: "type-body ds:m-0", children: ee("booking.payment.noticeBody", {
|
|
3156
3152
|
amount: st(
|
|
3157
|
-
|
|
3158
|
-
|
|
3153
|
+
be.payment.amountCents,
|
|
3154
|
+
be.payment.currencyCode,
|
|
3159
3155
|
Oe
|
|
3160
3156
|
)
|
|
3161
3157
|
}) }),
|
|
@@ -3163,8 +3159,8 @@ const di = Zt(
|
|
|
3163
3159
|
"p",
|
|
3164
3160
|
{
|
|
3165
3161
|
role: "status",
|
|
3166
|
-
className:
|
|
3167
|
-
children:
|
|
3162
|
+
className: be.state.status === "processing" ? "type-body ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-sm)]" : "ds:sr-only",
|
|
3163
|
+
children: be.state.status === "processing" ? /* @__PURE__ */ b(ce, { children: [
|
|
3168
3164
|
/* @__PURE__ */ s(Xt, { variant: "pulse", size: "lg", "aria-hidden": "true" }),
|
|
3169
3165
|
/* @__PURE__ */ s("span", { children: ee(
|
|
3170
3166
|
Qe ? "booking.payment.confirming" : "booking.payment.processing"
|
|
@@ -3172,43 +3168,43 @@ const di = Zt(
|
|
|
3172
3168
|
] }) : null
|
|
3173
3169
|
}
|
|
3174
3170
|
),
|
|
3175
|
-
|
|
3171
|
+
be.state.status === "failed" ? /* @__PURE__ */ s(
|
|
3176
3172
|
X,
|
|
3177
3173
|
{
|
|
3178
3174
|
ref: Et,
|
|
3179
3175
|
variant: "error",
|
|
3180
3176
|
tabIndex: -1,
|
|
3181
3177
|
className: ft,
|
|
3182
|
-
children: /* @__PURE__ */ s(X.Description, { children:
|
|
3178
|
+
children: /* @__PURE__ */ s(X.Description, { children: be.state.error ?? ee(
|
|
3183
3179
|
Qe ? "booking.payment.completionFailed" : "booking.payment.failed"
|
|
3184
3180
|
) })
|
|
3185
3181
|
}
|
|
3186
3182
|
) : null,
|
|
3187
|
-
Qe ? h == null ? void 0 : h(
|
|
3183
|
+
Qe ? h == null ? void 0 : h(be) : A == null ? void 0 : A(be)
|
|
3188
3184
|
]
|
|
3189
3185
|
}
|
|
3190
3186
|
) : null, $t = M(() => {
|
|
3191
|
-
const C = new Set(
|
|
3187
|
+
const C = new Set(Ce(D)), B = f.filter((E) => C.has(E.id)).map((E) => {
|
|
3192
3188
|
var W;
|
|
3193
3189
|
return {
|
|
3194
|
-
label:
|
|
3195
|
-
text: ((W =
|
|
3190
|
+
label: E.label,
|
|
3191
|
+
text: ((W = E.criticalInformationToAccept) == null ? void 0 : W.trim()) ?? ""
|
|
3196
3192
|
};
|
|
3197
|
-
}).filter((
|
|
3193
|
+
}).filter((E) => E.text.length > 0);
|
|
3198
3194
|
if (B.length !== 0)
|
|
3199
|
-
return B.length === 1 ? B[0].text : B.map((
|
|
3195
|
+
return B.length === 1 ? B[0].text : B.map((E) => `${E.label}: ${E.text}`).join(`
|
|
3200
3196
|
|
|
3201
3197
|
`);
|
|
3202
3198
|
}, [f, D]), As = M(() => {
|
|
3203
3199
|
if (Y === "success" || Y === "payment") return null;
|
|
3204
3200
|
const C = te === "accordion" ? ti : te === "calendar" ? ni : te === "flexible" ? ii : te === "progress" ? ai : ei, B = {
|
|
3205
|
-
cascade:
|
|
3201
|
+
cascade: R,
|
|
3206
3202
|
inputs: {
|
|
3207
|
-
specialties:
|
|
3203
|
+
specialties: Se,
|
|
3208
3204
|
services: f,
|
|
3209
|
-
operators:
|
|
3205
|
+
operators: xe,
|
|
3210
3206
|
availableDates: g,
|
|
3211
|
-
availableSlots:
|
|
3207
|
+
availableSlots: r,
|
|
3212
3208
|
nextAvailableDate: p
|
|
3213
3209
|
},
|
|
3214
3210
|
value: D,
|
|
@@ -3242,12 +3238,12 @@ const di = Zt(
|
|
|
3242
3238
|
onWindowChange: ae,
|
|
3243
3239
|
datePickerStyle: Z,
|
|
3244
3240
|
specialtyPickerStyle: ue,
|
|
3245
|
-
servicePickerStyle:
|
|
3241
|
+
servicePickerStyle: he,
|
|
3246
3242
|
operatorPickerStyle: K,
|
|
3247
3243
|
submitting: H || Y === "submitting",
|
|
3248
3244
|
locale: Oe,
|
|
3249
3245
|
activeStep: ne,
|
|
3250
|
-
setActiveStep:
|
|
3246
|
+
setActiveStep: Ie,
|
|
3251
3247
|
agentIdBase: G
|
|
3252
3248
|
};
|
|
3253
3249
|
return /* @__PURE__ */ s(C, { ...B });
|
|
@@ -3258,12 +3254,12 @@ const di = Zt(
|
|
|
3258
3254
|
x,
|
|
3259
3255
|
ee,
|
|
3260
3256
|
te,
|
|
3261
|
-
|
|
3262
|
-
|
|
3257
|
+
R,
|
|
3258
|
+
Se,
|
|
3263
3259
|
f,
|
|
3264
|
-
|
|
3260
|
+
xe,
|
|
3265
3261
|
g,
|
|
3266
|
-
|
|
3262
|
+
r,
|
|
3267
3263
|
p,
|
|
3268
3264
|
D,
|
|
3269
3265
|
O,
|
|
@@ -3291,7 +3287,7 @@ const di = Zt(
|
|
|
3291
3287
|
ae,
|
|
3292
3288
|
Z,
|
|
3293
3289
|
ue,
|
|
3294
|
-
|
|
3290
|
+
he,
|
|
3295
3291
|
K,
|
|
3296
3292
|
H,
|
|
3297
3293
|
Oe,
|
|
@@ -3321,9 +3317,9 @@ const di = Zt(
|
|
|
3321
3317
|
const B = C.target;
|
|
3322
3318
|
window.setTimeout(() => {
|
|
3323
3319
|
var W;
|
|
3324
|
-
const
|
|
3325
|
-
Ye.current === B && B.isConnected && !(
|
|
3326
|
-
}),
|
|
3320
|
+
const E = document.activeElement;
|
|
3321
|
+
Ye.current === B && B.isConnected && !(E && ((W = me.current) != null && W.contains(E))) && (Ye.current = null);
|
|
3322
|
+
}), ve == null || ve(C);
|
|
3327
3323
|
},
|
|
3328
3324
|
...nt,
|
|
3329
3325
|
children: [
|
|
@@ -3356,7 +3352,7 @@ di.displayName = "Booking";
|
|
|
3356
3352
|
export {
|
|
3357
3353
|
di as B,
|
|
3358
3354
|
Nt as C,
|
|
3359
|
-
|
|
3355
|
+
ye as O,
|
|
3360
3356
|
In as b
|
|
3361
3357
|
};
|
|
3362
|
-
//# sourceMappingURL=booking-
|
|
3358
|
+
//# sourceMappingURL=booking-BF9pVa2n.js.map
|