@alfadocs/ui-kit 0.25.2 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/_chunks/booking-Bw9eOU4k.js +2292 -0
  2. package/dist/_chunks/{calendar-9eOXumpH.js → calendar-WWNx448i.js} +10 -9
  3. package/dist/_chunks/{contact-card-CeEfEAxh.js → contact-card-DYbp--s-.js} +2 -2
  4. package/dist/_chunks/{header-B8V_sNPy.js → header-CkMb1TZS.js} +23 -23
  5. package/dist/_chunks/heart-pulse-CvuyFKHB.js +21 -0
  6. package/dist/_chunks/{link-DmM5IevO.js → link-DrD_cRUg.js} +50 -45
  7. package/dist/_chunks/parseISO-Dk4xa7q6.js +120 -0
  8. package/dist/_chunks/patient-search-DuSoGG2t.js +1113 -0
  9. package/dist/_chunks/{patient-shell-Bq8CjRYF.js → patient-shell-CAXYzbRw.js} +2 -2
  10. package/dist/_chunks/public-footer.agent-DivkKdG4.js +537 -0
  11. package/dist/_chunks/reviews-panel-CFttsfuC.js +513 -0
  12. package/dist/_chunks/slot-grid-B2zprPcv.js +387 -0
  13. package/dist/_chunks/stethoscope-DT5qCW8Y.js +18 -0
  14. package/dist/agent-catalog.json +117 -22
  15. package/dist/components/booking/booking-types.d.ts +167 -0
  16. package/dist/components/booking/booking.agent.d.ts +1 -1
  17. package/dist/components/booking/booking.d.ts +4 -89
  18. package/dist/components/booking/cascade.d.ts +96 -0
  19. package/dist/components/booking/details-form.d.ts +39 -0
  20. package/dist/components/booking/index.d.ts +2 -1
  21. package/dist/components/booking/index.js +5 -3
  22. package/dist/components/calendar/index.js +1 -1
  23. package/dist/components/checkbox/checkbox.d.ts +6 -2
  24. package/dist/components/contact-card/index.js +1 -1
  25. package/dist/components/header/index.js +1 -1
  26. package/dist/components/index.d.ts +3 -0
  27. package/dist/components/link/index.js +1 -1
  28. package/dist/components/link/link.d.ts +7 -0
  29. package/dist/components/patient-search/index.d.ts +4 -0
  30. package/dist/components/patient-search/index.js +6 -0
  31. package/dist/components/patient-search/patient-search.agent.d.ts +4 -0
  32. package/dist/components/patient-search/patient-search.d.ts +112 -0
  33. package/dist/components/public-footer/index.d.ts +6 -0
  34. package/dist/components/public-footer/index.js +10 -0
  35. package/dist/components/public-footer/legal-urls.d.ts +18 -0
  36. package/dist/components/public-footer/public-footer.agent.d.ts +4 -0
  37. package/dist/components/public-footer/public-footer.d.ts +58 -0
  38. package/dist/components/public-footer/socials.d.ts +9 -0
  39. package/dist/components/reviews-panel/index.d.ts +4 -0
  40. package/dist/components/reviews-panel/index.js +6 -0
  41. package/dist/components/reviews-panel/reviews-panel.agent.d.ts +4 -0
  42. package/dist/components/reviews-panel/reviews-panel.d.ts +76 -0
  43. package/dist/components/slot-grid/index.js +1 -1
  44. package/dist/i18n/config.js +3994 -38
  45. package/dist/i18n/locales/ar.d.ts +221 -0
  46. package/dist/i18n/locales/de.d.ts +221 -0
  47. package/dist/i18n/locales/el.d.ts +221 -0
  48. package/dist/i18n/locales/es.d.ts +221 -0
  49. package/dist/i18n/locales/fr.d.ts +221 -0
  50. package/dist/i18n/locales/hi.d.ts +221 -0
  51. package/dist/i18n/locales/ja.d.ts +221 -0
  52. package/dist/i18n/locales/nl.d.ts +221 -0
  53. package/dist/i18n/locales/pl.d.ts +221 -0
  54. package/dist/i18n/locales/pt.d.ts +221 -0
  55. package/dist/i18n/locales/ro.d.ts +221 -0
  56. package/dist/i18n/locales/ru.d.ts +221 -0
  57. package/dist/i18n/locales/sq.d.ts +221 -0
  58. package/dist/i18n/locales/sv.d.ts +221 -0
  59. package/dist/i18n/locales/tr.d.ts +221 -0
  60. package/dist/i18n/locales/zh.d.ts +221 -0
  61. package/dist/i18n/resources.d.ts +442 -0
  62. package/dist/index.js +351 -336
  63. package/dist/locales/ar.json +222 -1
  64. package/dist/locales/de.json +222 -1
  65. package/dist/locales/el.json +222 -1
  66. package/dist/locales/en.json +222 -1
  67. package/dist/locales/es.json +222 -1
  68. package/dist/locales/fr.json +222 -1
  69. package/dist/locales/hi.json +222 -1
  70. package/dist/locales/it.json +222 -1
  71. package/dist/locales/ja.json +222 -1
  72. package/dist/locales/nl.json +222 -1
  73. package/dist/locales/pl.json +222 -1
  74. package/dist/locales/pt.json +222 -1
  75. package/dist/locales/ro.json +222 -1
  76. package/dist/locales/ru.json +222 -1
  77. package/dist/locales/sq.json +222 -1
  78. package/dist/locales/sv.json +222 -1
  79. package/dist/locales/tr.json +222 -1
  80. package/dist/locales/zh.json +222 -1
  81. package/dist/patterns/patient-shell/index.js +1 -1
  82. package/dist/tokens.css +1 -1
  83. package/package.json +17 -1
  84. package/dist/_chunks/booking-CXngC-1u.js +0 -1743
  85. package/dist/_chunks/slot-grid-DoodeQGZ.js +0 -502
  86. package/dist/_chunks/stethoscope-B8kpbtjh.js +0 -35
@@ -0,0 +1,1113 @@
1
+ import { jsx as a, jsxs as _ } from "react/jsx-runtime";
2
+ import { forwardRef as le, useRef as S, useEffect as B, useMemo as Y, useImperativeHandle as ue, useState as W, useCallback as z, useId as fe } from "react";
3
+ import { c as D } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as A } from "react-i18next";
5
+ import { A as re } from "./autocomplete-CUh0f7Dj.js";
6
+ import { B as pe } from "./button-DD_0Xdmr.js";
7
+ import { C as M } from "./card-DKTMLVrw.js";
8
+ import { S as me } from "./slider-CfEzeseL.js";
9
+ import { A as ee } from "./alert-ywPR59NE.js";
10
+ import { D as K } from "./dropdown-menu-DZxwF23X.js";
11
+ import { u as he } from "./registry-C9nwlNyL.js";
12
+ import { S as ne } from "./search-BonnQsHv.js";
13
+ import { X as ie } from "./x-CCcI3eJp.js";
14
+ import { c as ve } from "./createLucideIcon-CrFbzy84.js";
15
+ import { M as ge } from "./map-pin-B8STOPMJ.js";
16
+ import { S as be } from "./stethoscope-DT5qCW8Y.js";
17
+ import { C as ye } from "./chevron-down-BX_NP2Yh.js";
18
+ /**
19
+ * @license lucide-react v1.8.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ const xe = [
25
+ ["line", { x1: "2", x2: "5", y1: "12", y2: "12", key: "bvdh0s" }],
26
+ ["line", { x1: "19", x2: "22", y1: "12", y2: "12", key: "1tbv5k" }],
27
+ ["line", { x1: "12", x2: "12", y1: "2", y2: "5", key: "11lu5j" }],
28
+ ["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }],
29
+ ["circle", { cx: "12", cy: "12", r: "7", key: "fim9np" }],
30
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
31
+ ], we = ve("locate-fixed", xe), _e = {
32
+ id: "patient-search",
33
+ capabilities: ["navigate", "view_change"],
34
+ state: {
35
+ variant: {
36
+ type: "string",
37
+ descriptionKey: "ui.agent.patientSearch.state.variant",
38
+ description: "Active variant — one of `who-where`, `who-where-when`, `faceted`, `discovery`.",
39
+ read: (e) => e.getVariant()
40
+ }
41
+ },
42
+ actions: {
43
+ reset: {
44
+ safety: "write",
45
+ descriptionKey: "ui.agent.patientSearch.actions.reset",
46
+ description: "Clear the current selection (WHO, WHERE, WHEN, facets, geo) via the consumer-owned onChange.",
47
+ invoke: (e) => {
48
+ e.reset();
49
+ }
50
+ },
51
+ focus_primary: {
52
+ safety: "read",
53
+ descriptionKey: "ui.agent.patientSearch.actions.focusPrimary",
54
+ description: "Move keyboard focus to the most-relevant field for the current variant.",
55
+ invoke: (e) => {
56
+ e.focusPrimary();
57
+ }
58
+ }
59
+ },
60
+ domHooks: {
61
+ root: {
62
+ attr: "data-component",
63
+ value: "patient-search",
64
+ description: "Marks the PatientSearch root region."
65
+ },
66
+ instanceId: {
67
+ attr: "data-component-id",
68
+ sourceProp: "id",
69
+ description: "Sourced from the id prop."
70
+ }
71
+ }
72
+ };
73
+ function w(e, s) {
74
+ if (typeof window > "u") return;
75
+ const t = window.track;
76
+ try {
77
+ t == null || t(e, s);
78
+ } catch {
79
+ }
80
+ }
81
+ const j = [
82
+ "today",
83
+ "tomorrow",
84
+ "this_week",
85
+ "anytime"
86
+ ], L = [1, 5, 10, 25, 50], oe = 5, de = 200;
87
+ function Se(e) {
88
+ let s = 0, t = Number.POSITIVE_INFINITY;
89
+ return L.forEach((c, h) => {
90
+ const v = Math.abs(c - e);
91
+ v < t && (t = v, s = h);
92
+ }), s;
93
+ }
94
+ const Ne = D(
95
+ "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
96
+ {
97
+ variants: {
98
+ variant: {
99
+ "who-where": "ds:gap-[var(--spacing-md)]",
100
+ "who-where-when": "ds:gap-[var(--spacing-md)]",
101
+ faceted: "ds:gap-[var(--spacing-md)]",
102
+ discovery: "ds:gap-[var(--spacing-lg)]"
103
+ }
104
+ },
105
+ defaultVariants: { variant: "who-where" }
106
+ }
107
+ );
108
+ function H({
109
+ value: e,
110
+ onChange: s,
111
+ loadObjects: t,
112
+ onObjectSelect: c,
113
+ inputRef: h
114
+ }) {
115
+ var o, f, p, y;
116
+ const { t: v } = A(), [g, u] = W(((o = e.object) == null ? void 0 : o.label) ?? ""), x = S((f = e.object) == null ? void 0 : f.value);
117
+ B(() => {
118
+ var m, i, N;
119
+ ((m = e.object) == null ? void 0 : m.value) !== x.current && (x.current = (i = e.object) == null ? void 0 : i.value, u(((N = e.object) == null ? void 0 : N.label) ?? ""));
120
+ }, [(p = e.object) == null ? void 0 : p.value, (y = e.object) == null ? void 0 : y.label]);
121
+ const n = z(
122
+ async (m, { signal: i }) => await t(m, { signal: i }),
123
+ [t]
124
+ ), l = (m) => {
125
+ const i = {
126
+ value: m.value,
127
+ label: m.label,
128
+ description: m.description,
129
+ __payload: m.__payload
130
+ };
131
+ u(i.label), x.current = i.value, s({ ...e, object: i }), w("patient_search_object_selected", {
132
+ value: i.value,
133
+ type: i.__payload && typeof i.__payload == "object" ? i.__payload.type : void 0
134
+ }), c == null || c(i);
135
+ }, r = S(!1);
136
+ return /* @__PURE__ */ a(
137
+ "div",
138
+ {
139
+ "data-component": "patient-search-field",
140
+ "data-field": "who",
141
+ onFocus: () => {
142
+ r.current || (r.current = !0, w("patient_search_object_focused"));
143
+ },
144
+ onBlur: (m) => {
145
+ m.currentTarget && !m.currentTarget.contains(m.relatedTarget) && (r.current = !1);
146
+ },
147
+ children: /* @__PURE__ */ a(
148
+ re,
149
+ {
150
+ ref: h,
151
+ value: g,
152
+ onChange: (m) => {
153
+ u(m), e.object && m !== e.object.label && (x.current = void 0, s({ ...e, object: void 0 }));
154
+ },
155
+ onSelect: l,
156
+ loadOptions: n,
157
+ debounceMs: de,
158
+ placeholder: v("patientSearch.who.placeholder"),
159
+ "aria-label": v("patientSearch.who.label"),
160
+ startAdornment: /* @__PURE__ */ a(ne, { "aria-hidden": "true" })
161
+ }
162
+ )
163
+ }
164
+ );
165
+ }
166
+ const ae = [
167
+ "ds:inline-flex ds:items-center ds:justify-center",
168
+ "ds:size-8 ds:rounded-[var(--radius-sm)]",
169
+ "ds:text-[color:var(--muted-foreground)] ds:hover:text-[color:var(--primary)]",
170
+ "ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,transparent)]",
171
+ "ds:aria-pressed:text-[color:var(--primary)]",
172
+ "ds:aria-pressed:bg-[color-mix(in_srgb,var(--primary)_12%,transparent)]",
173
+ "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
174
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
175
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
176
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
177
+ ].join(" ");
178
+ function $({
179
+ value: e,
180
+ onChange: s,
181
+ loadPlaces: t,
182
+ onPlaceSelect: c,
183
+ inputRef: h,
184
+ defaultRadiusKm: v = oe,
185
+ reverseGeocode: g
186
+ }) {
187
+ var T, O, E, V;
188
+ const { t: u } = A(), [x, n] = W(((T = e.place) == null ? void 0 : T.label) ?? ""), l = S((O = e.place) == null ? void 0 : O.value), r = e.geo ? "granted" : "pristine", [o, f] = W(r), [p, y] = W(
189
+ () => {
190
+ var d;
191
+ return Se(((d = e.geo) == null ? void 0 : d.radiusKm) ?? v);
192
+ }
193
+ );
194
+ B(() => {
195
+ var d, b, k;
196
+ ((d = e.place) == null ? void 0 : d.value) !== l.current && (l.current = (b = e.place) == null ? void 0 : b.value, n(((k = e.place) == null ? void 0 : k.label) ?? ""));
197
+ }, [(E = e.place) == null ? void 0 : E.value, (V = e.place) == null ? void 0 : V.label]);
198
+ const m = z(
199
+ async (d, { signal: b }) => await t(d, { signal: b }),
200
+ [t]
201
+ ), i = (d) => {
202
+ const b = {
203
+ value: d.value,
204
+ label: d.label,
205
+ lat: d.lat,
206
+ lng: d.lng
207
+ };
208
+ n(b.label), l.current = b.value, s({ ...e, place: b, geo: void 0 }), o === "granted" && f("pristine"), w("patient_search_place_selected", { value: b.value }), c == null || c(b);
209
+ }, N = () => {
210
+ if (typeof window > "u" || !(navigator != null && navigator.geolocation)) {
211
+ f("denied"), w("patient_search_geo_denied", { reason: "unsupported" });
212
+ return;
213
+ }
214
+ f("requesting"), w("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
215
+ async (d) => {
216
+ const { latitude: b, longitude: k } = d.coords;
217
+ let X;
218
+ try {
219
+ X = await (g == null ? void 0 : g(b, k));
220
+ } catch {
221
+ X = void 0;
222
+ }
223
+ const J = L[p] ?? v, Z = X ?? u("patientSearch.geo.fallbackLabel"), ce = {
224
+ value: `geo:${b.toFixed(4)},${k.toFixed(4)}`,
225
+ label: Z,
226
+ lat: b,
227
+ lng: k
228
+ };
229
+ s({
230
+ ...e,
231
+ place: ce,
232
+ geo: {
233
+ lat: b,
234
+ lng: k,
235
+ radiusKm: J,
236
+ label: Z
237
+ }
238
+ }), f("granted"), w("patient_search_geo_granted", { radiusKm: J });
239
+ },
240
+ () => {
241
+ f("denied"), w("patient_search_geo_denied", { reason: "user" });
242
+ },
243
+ { enableHighAccuracy: !1, maximumAge: 6e4, timeout: 1e4 }
244
+ );
245
+ }, F = () => {
246
+ s({ ...e, geo: void 0, place: void 0 }), n(""), l.current = void 0, f("pristine");
247
+ }, U = (d) => {
248
+ const b = L[d] ?? v;
249
+ e.geo && s({ ...e, geo: { ...e.geo, radiusKm: b } }), w("patient_search_radius_changed", { radiusKm: b });
250
+ }, G = (d) => {
251
+ const b = L[Math.round(d)] ?? v;
252
+ return u("patientSearch.geo.radiusFormat", { km: b });
253
+ }, R = o === "granted" && !!e.geo, Q = o === "requesting", C = o === "denied", P = S(!1), I = C ? null : /* @__PURE__ */ _("span", { className: "ds:absolute ds:end-[var(--spacing-xs)] ds:top-1/2 ds:-translate-y-1/2 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
254
+ R ? /* @__PURE__ */ a(
255
+ "button",
256
+ {
257
+ type: "button",
258
+ "aria-label": u("patientSearch.geo.clear"),
259
+ onClick: F,
260
+ className: ae,
261
+ children: /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-4" })
262
+ }
263
+ ) : null,
264
+ /* @__PURE__ */ a(
265
+ "button",
266
+ {
267
+ type: "button",
268
+ "aria-label": u("patientSearch.geo.cta"),
269
+ "aria-pressed": R || void 0,
270
+ disabled: Q,
271
+ onClick: R ? F : N,
272
+ className: ae,
273
+ children: /* @__PURE__ */ a(we, { "aria-hidden": "true", className: "ds:size-4" })
274
+ }
275
+ )
276
+ ] });
277
+ return /* @__PURE__ */ _(
278
+ "div",
279
+ {
280
+ "data-component": "patient-search-field",
281
+ "data-field": "where",
282
+ onFocus: () => {
283
+ P.current || (P.current = !0, w("patient_search_place_focused"));
284
+ },
285
+ onBlur: (d) => {
286
+ d.currentTarget && !d.currentTarget.contains(d.relatedTarget) && (P.current = !1);
287
+ },
288
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
289
+ children: [
290
+ /* @__PURE__ */ _("div", { className: "ds:relative", children: [
291
+ /* @__PURE__ */ a(
292
+ re,
293
+ {
294
+ ref: h,
295
+ value: x,
296
+ onChange: (d) => {
297
+ n(d), e.place && d !== e.place.label && (l.current = void 0, s({ ...e, place: void 0, geo: void 0 }), o === "granted" && f("pristine"));
298
+ },
299
+ onSelect: i,
300
+ loadOptions: m,
301
+ debounceMs: de,
302
+ placeholder: u("patientSearch.where.placeholder"),
303
+ "aria-label": u("patientSearch.where.label"),
304
+ startAdornment: /* @__PURE__ */ a(ge, { "aria-hidden": "true" }),
305
+ endAdornment: C ? void 0 : (
306
+ // Decorative spacer — reserves inline-end room so the typed
307
+ // text doesn't run under the absolutely-positioned overlay.
308
+ // Autocomplete wraps endAdornment in `aria-hidden`, which is
309
+ // correct for this empty span. Granted-state shows an extra
310
+ // clear-X chip, so the spacer doubles in width when granted.
311
+ /* @__PURE__ */ a(
312
+ "span",
313
+ {
314
+ "aria-hidden": "true",
315
+ className: R ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
316
+ }
317
+ )
318
+ )
319
+ }
320
+ ),
321
+ I
322
+ ] }),
323
+ R ? (
324
+ // Slider marks render with `translate(-50%)` so half of each
325
+ // end-mark ("1" and "50" labels) sits outside the slider's
326
+ // bounding box. The parent Card uses `overflow: hidden`, which
327
+ // would clip them — the inline padding pulls the rail inset by
328
+ // half a label width so the overhang lands inside the card.
329
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-md)]", children: [
330
+ /* @__PURE__ */ a(
331
+ "span",
332
+ {
333
+ id: "patient-search-radius-label",
334
+ className: "type-meta ds:text-[color:var(--muted-foreground)]",
335
+ children: u("patientSearch.geo.radius")
336
+ }
337
+ ),
338
+ /* @__PURE__ */ a(
339
+ me,
340
+ {
341
+ value: [p],
342
+ min: 0,
343
+ max: L.length - 1,
344
+ step: 1,
345
+ marks: L.map((d, b) => ({
346
+ value: b,
347
+ label: `${d}`
348
+ })),
349
+ formatValue: G,
350
+ alwaysShowValue: !0,
351
+ "aria-labelledby": "patient-search-radius-label",
352
+ onValueChange: (d) => y(d[0] ?? 0),
353
+ onValueCommit: (d) => U(d[0] ?? 0)
354
+ }
355
+ )
356
+ ] })
357
+ ) : null,
358
+ C ? (
359
+ // Alert defaults to `role="status"` + `aria-live="polite"` for the
360
+ // `info` variant — the user hears why the field reverted to plain
361
+ // text when their browser blocked the geolocation prompt.
362
+ /* @__PURE__ */ a(ee, { variant: "info", children: /* @__PURE__ */ a(ee.Description, { children: u("patientSearch.geo.denied") }) })
363
+ ) : null
364
+ ]
365
+ }
366
+ );
367
+ }
368
+ const ke = D(
369
+ [
370
+ "ds:inline-flex ds:items-center ds:justify-center",
371
+ "ds:min-h-[var(--min-target-size)]",
372
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
373
+ "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
374
+ "ds:rounded-[var(--radius-full)]",
375
+ "type-label ds:font-[var(--font-weight-medium)]",
376
+ "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
377
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
378
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
379
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
380
+ ].join(" "),
381
+ {
382
+ variants: {
383
+ state: {
384
+ idle: "ds:bg-[var(--secondary)] ds:text-[var(--foreground)] ds:border ds:border-[color:var(--border)] ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,var(--secondary))]",
385
+ selected: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
386
+ }
387
+ },
388
+ defaultVariants: { state: "idle" }
389
+ }
390
+ );
391
+ function Re({ value: e, onChange: s }) {
392
+ const { t, i18n: c } = A(), h = fe(), v = c.dir() === "rtl", g = S(/* @__PURE__ */ new Map()), u = z((r) => {
393
+ var o;
394
+ (o = g.current.get(r)) == null || o.focus();
395
+ }, []), x = z(
396
+ (r, o) => {
397
+ const f = j.indexOf(o), p = j.length, y = v ? "ArrowLeft" : "ArrowRight", m = v ? "ArrowRight" : "ArrowLeft";
398
+ switch (r.key) {
399
+ case y:
400
+ case "ArrowDown": {
401
+ r.preventDefault();
402
+ const i = j[(f + 1) % p];
403
+ s(i), w("patient_search_when_selected", { when: i }), u(i);
404
+ break;
405
+ }
406
+ case m:
407
+ case "ArrowUp": {
408
+ r.preventDefault();
409
+ const i = j[(f - 1 + p) % p];
410
+ s(i), w("patient_search_when_selected", { when: i }), u(i);
411
+ break;
412
+ }
413
+ case "Home": {
414
+ r.preventDefault();
415
+ const i = j[0];
416
+ s(i), w("patient_search_when_selected", { when: i }), u(i);
417
+ break;
418
+ }
419
+ case "End": {
420
+ r.preventDefault();
421
+ const i = j[p - 1];
422
+ s(i), w("patient_search_when_selected", { when: i }), u(i);
423
+ break;
424
+ }
425
+ }
426
+ },
427
+ [u, v, s]
428
+ ), n = e ?? "anytime", l = {
429
+ today: "patientSearch.when.today",
430
+ tomorrow: "patientSearch.when.tomorrow",
431
+ this_week: "patientSearch.when.thisWeek",
432
+ anytime: "patientSearch.when.anytime"
433
+ };
434
+ return /* @__PURE__ */ a(
435
+ "div",
436
+ {
437
+ role: "radiogroup",
438
+ "aria-label": t("patientSearch.when.label"),
439
+ id: h,
440
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
441
+ children: j.map((r) => {
442
+ const o = e === r, f = n === r, p = t(l[r]);
443
+ return /* @__PURE__ */ a(
444
+ "button",
445
+ {
446
+ type: "button",
447
+ role: "radio",
448
+ "aria-checked": o,
449
+ "aria-label": p,
450
+ tabIndex: f ? 0 : -1,
451
+ ref: (y) => {
452
+ y ? g.current.set(r, y) : g.current.delete(r);
453
+ },
454
+ onClick: () => {
455
+ s(r), w("patient_search_when_selected", { when: r });
456
+ },
457
+ onKeyDown: (y) => x(y, r),
458
+ className: ke({
459
+ state: o ? "selected" : "idle"
460
+ }),
461
+ children: p
462
+ },
463
+ r
464
+ );
465
+ })
466
+ }
467
+ );
468
+ }
469
+ const te = D(
470
+ [
471
+ "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
472
+ "ds:min-h-[var(--min-target-size)]",
473
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
474
+ "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
475
+ "ds:rounded-[var(--radius-full)]",
476
+ "type-label",
477
+ "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
478
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
479
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
480
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
481
+ ].join(" "),
482
+ {
483
+ variants: {
484
+ // Matches the WHEN chip strip's `selected` look — solid primary fill,
485
+ // primary-foreground text, transparent border. The earlier
486
+ // `color-mix(primary 12% / secondary)` tint read as a washed-out
487
+ // colour over the grey input row and didn't visually signal "this
488
+ // filter is active" with enough weight. Solid fill matches the kit's
489
+ // toggle-button precedent (SuggestionChip's `suggestion` intent + the
490
+ // ServiceGrid radio's selected state in Booking).
491
+ state: {
492
+ idle: "ds:bg-[var(--secondary)] ds:text-[var(--foreground)] ds:border ds:border-[color:var(--border)] ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,var(--secondary))]",
493
+ active: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
494
+ }
495
+ },
496
+ defaultVariants: { state: "idle" }
497
+ }
498
+ );
499
+ function je({ facets: e, value: s, onChange: t }) {
500
+ const { t: c } = A(), h = Y(() => s ?? {}, [s]), v = Y(
501
+ () => Object.values(h).some((n) => n && n.length > 0),
502
+ [h]
503
+ ), g = (n, l) => {
504
+ const r = { ...h };
505
+ l.length === 0 ? delete r[n] : r[n] = l, t(r), w("patient_search_facet_changed", { key: n, values: l });
506
+ }, u = (n) => {
507
+ var r;
508
+ const l = (((r = h[n]) == null ? void 0 : r.length) ?? 0) > 0;
509
+ g(n, l ? [] : ["true"]);
510
+ }, x = (n, l) => {
511
+ const r = h[n.key] ?? [], o = r.includes(l);
512
+ let f;
513
+ n.multi ? f = o ? r.filter((p) => p !== l) : [...r, l] : f = o ? [] : [l], g(n.key, f);
514
+ };
515
+ return /* @__PURE__ */ _(
516
+ "div",
517
+ {
518
+ role: "group",
519
+ "aria-label": c("patientSearch.facets.label"),
520
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
521
+ children: [
522
+ e.map((n) => {
523
+ const l = n.options.length === 0, r = h[n.key] ?? [], o = r.length > 0;
524
+ if (l)
525
+ return /* @__PURE__ */ a(
526
+ "button",
527
+ {
528
+ type: "button",
529
+ "aria-pressed": o,
530
+ "aria-label": n.label,
531
+ onClick: () => u(n.key),
532
+ className: te({
533
+ state: o ? "active" : "idle"
534
+ }),
535
+ children: /* @__PURE__ */ a("span", { children: n.label })
536
+ },
537
+ n.key
538
+ );
539
+ const f = o ? ` (${r.length})` : "";
540
+ return /* @__PURE__ */ _(K.Root, { children: [
541
+ /* @__PURE__ */ a(K.Trigger, { asChild: !0, children: /* @__PURE__ */ _(
542
+ "button",
543
+ {
544
+ type: "button",
545
+ "aria-label": `${n.label}${f}`,
546
+ className: te({
547
+ state: o ? "active" : "idle"
548
+ }),
549
+ children: [
550
+ /* @__PURE__ */ _("span", { children: [
551
+ n.label,
552
+ f
553
+ ] }),
554
+ /* @__PURE__ */ a(
555
+ ye,
556
+ {
557
+ "aria-hidden": "true",
558
+ className: "ds:size-3.5 ds:shrink-0"
559
+ }
560
+ )
561
+ ]
562
+ }
563
+ ) }),
564
+ /* @__PURE__ */ a(K.Content, { sideOffset: 8, align: "start", children: n.options.map((p) => /* @__PURE__ */ a(
565
+ K.CheckboxItem,
566
+ {
567
+ checked: r.includes(p.value),
568
+ onSelect: (y) => {
569
+ n.multi && y.preventDefault(), x(n, p.value);
570
+ },
571
+ children: p.label
572
+ },
573
+ p.value
574
+ )) })
575
+ ] }, n.key);
576
+ }),
577
+ v ? /* @__PURE__ */ _(
578
+ "button",
579
+ {
580
+ type: "button",
581
+ onClick: () => {
582
+ t({}), w("patient_search_facet_changed", { key: "*", values: [] });
583
+ },
584
+ className: [
585
+ "ds:ms-[var(--spacing-xs)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
586
+ "ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]",
587
+ "type-label ds:text-[color:var(--muted-foreground)]",
588
+ "ds:rounded-[var(--radius-sm)]",
589
+ "ds:hover:text-[color:var(--foreground)]",
590
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
591
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
592
+ ].join(" "),
593
+ children: [
594
+ /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-3.5" }),
595
+ c("patientSearch.facets.clear")
596
+ ]
597
+ }
598
+ ) : null
599
+ ]
600
+ }
601
+ );
602
+ }
603
+ const se = ["violet", "purple", "magenta", "blue"], Ae = D(
604
+ [
605
+ "ds:relative ds:flex ds:h-full ds:flex-col ds:gap-[var(--spacing-sm)]",
606
+ "ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
607
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
608
+ "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
609
+ "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
610
+ "ds:border ds:border-[color:var(--card-border)]",
611
+ "ds:shadow-[var(--shadow-sm)]",
612
+ "ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
613
+ "ds:motion-safe:hover:-translate-y-0.5",
614
+ "ds:hover:shadow-[var(--shadow-md)]",
615
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
616
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
617
+ "ds:no-underline"
618
+ ].join(" ")
619
+ ), Ce = D(
620
+ "ds:absolute ds:inset-inline-0 ds:top-0 ds:h-[3px] ds:pointer-events-none",
621
+ {
622
+ variants: {
623
+ accent: {
624
+ violet: "ds:bg-[var(--color-violet-500)]",
625
+ purple: "ds:bg-[var(--color-purple-500)]",
626
+ magenta: "ds:bg-[var(--color-magenta-500)]",
627
+ blue: "ds:bg-[var(--color-blue-500)]"
628
+ }
629
+ },
630
+ defaultVariants: { accent: "violet" }
631
+ }
632
+ ), Te = D(
633
+ "ds:inline-flex ds:size-9 ds:items-center ds:justify-center ds:rounded-[var(--radius-md)]",
634
+ {
635
+ variants: {
636
+ accent: {
637
+ violet: "ds:bg-[color-mix(in_srgb,var(--color-violet-500)_12%,var(--background))] ds:text-[var(--color-violet-700)]",
638
+ purple: "ds:bg-[color-mix(in_srgb,var(--color-purple-500)_12%,var(--background))] ds:text-[var(--color-purple-700)]",
639
+ magenta: "ds:bg-[color-mix(in_srgb,var(--color-magenta-500)_12%,var(--background))] ds:text-[var(--color-magenta-700)]",
640
+ blue: "ds:bg-[color-mix(in_srgb,var(--color-blue-500)_12%,var(--background))] ds:text-[var(--color-blue-700)]"
641
+ }
642
+ },
643
+ defaultVariants: { accent: "violet" }
644
+ }
645
+ );
646
+ function Ee(e, s) {
647
+ return e && e !== "auto" ? e : se[s % se.length];
648
+ }
649
+ function Le({ cards: e }) {
650
+ const { t: s } = A();
651
+ return e.length === 0 ? /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: s("patientSearch.discovery.empty") }) : /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
652
+ /* @__PURE__ */ a("h3", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: s("patientSearch.discovery.heading") }),
653
+ /* @__PURE__ */ a(
654
+ "ul",
655
+ {
656
+ className: [
657
+ "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)]",
658
+ "ds:md:grid-cols-2 ds:lg:grid-cols-3",
659
+ "ds:m-0 ds:p-0 ds:list-none"
660
+ ].join(" "),
661
+ children: e.map((t, c) => {
662
+ const h = Ee(t.accent, c);
663
+ return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ _(
664
+ "a",
665
+ {
666
+ href: t.href,
667
+ "data-component": "patient-search-card",
668
+ "data-card-id": t.id,
669
+ "aria-label": t.description ? `${t.label} — ${t.description}` : t.label,
670
+ onClick: () => w("patient_search_discovery_card_clicked", {
671
+ cardId: t.id
672
+ }),
673
+ className: Ae(),
674
+ children: [
675
+ /* @__PURE__ */ a(
676
+ "span",
677
+ {
678
+ "aria-hidden": "true",
679
+ className: Ce({ accent: h })
680
+ }
681
+ ),
682
+ /* @__PURE__ */ _("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
683
+ /* @__PURE__ */ a(
684
+ "span",
685
+ {
686
+ "aria-hidden": "true",
687
+ className: Te({ accent: h }),
688
+ children: t.icon ?? /* @__PURE__ */ a(be, { className: "ds:size-4", "aria-hidden": "true" })
689
+ }
690
+ ),
691
+ t.badge ? (
692
+ // The badge sits inside a softly-tinted accent bubble
693
+ // (15% accent + 85% background). The text colour must
694
+ // contrast with that mix, not with the accent's canonical
695
+ // foreground — `--accent-foreground` is calibrated against
696
+ // the 100% accent surface and fails AA on the 15% tint.
697
+ // Use `--foreground` which contrasts with the
698
+ // mostly-background mix in both light and dark themes.
699
+ /* @__PURE__ */ a("span", { className: "type-meta ds:ms-auto ds:inline-flex ds:items-center ds:rounded-[var(--radius-full)] ds:bg-[color-mix(in_srgb,var(--accent)_15%,var(--background))] ds:text-[color:var(--foreground)] ds:font-[var(--font-weight-semibold)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: t.badge })
700
+ ) : null
701
+ ] }),
702
+ /* @__PURE__ */ a("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: t.label }),
703
+ t.description ? /* @__PURE__ */ a("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: t.description }) : null
704
+ ]
705
+ }
706
+ ) }, t.id);
707
+ })
708
+ }
709
+ )
710
+ ] });
711
+ }
712
+ function De(e) {
713
+ if (e.object || e.place || e.geo || e.when && e.when !== "anytime") return !0;
714
+ if (e.facets) {
715
+ for (const s of Object.values(e.facets))
716
+ if (s && s.length > 0) return !0;
717
+ }
718
+ return !1;
719
+ }
720
+ function q({
721
+ value: e,
722
+ variant: s,
723
+ submitting: t,
724
+ submitLabel: c,
725
+ allowEmptySubmit: h,
726
+ onSubmit: v
727
+ }) {
728
+ const { t: g } = A(), u = t || !h && !De(e), x = c ?? g("patientSearch.submit.cta");
729
+ return /* @__PURE__ */ a(
730
+ pe,
731
+ {
732
+ type: "button",
733
+ intent: "primary",
734
+ size: "lg",
735
+ startIcon: /* @__PURE__ */ a(ne, { "aria-hidden": "true" }),
736
+ loading: t,
737
+ disabled: u,
738
+ onClick: () => {
739
+ w("patient_search_submitted", {
740
+ variant: s,
741
+ hasObject: !!e.object,
742
+ hasPlace: !!e.place,
743
+ hasGeo: !!e.geo,
744
+ when: e.when,
745
+ facetKeys: e.facets ? Object.keys(e.facets) : []
746
+ }), v(e);
747
+ },
748
+ children: x
749
+ }
750
+ );
751
+ }
752
+ function Pe(e) {
753
+ const {
754
+ variant: s,
755
+ value: t,
756
+ onChange: c,
757
+ onSubmit: h,
758
+ loadObjects: v,
759
+ loadPlaces: g,
760
+ onObjectSelect: u,
761
+ onPlaceSelect: x,
762
+ submitting: n,
763
+ submitLabel: l,
764
+ allowEmptySubmit: r,
765
+ whoRef: o,
766
+ whereRef: f,
767
+ defaultRadiusKm: p,
768
+ reverseGeocode: y,
769
+ cardLabel: m
770
+ } = e;
771
+ return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": m, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:md:flex-row ds:md:items-center", children: [
772
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
773
+ H,
774
+ {
775
+ value: t,
776
+ onChange: c,
777
+ loadObjects: v,
778
+ onObjectSelect: u,
779
+ inputRef: o
780
+ }
781
+ ) }),
782
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
783
+ $,
784
+ {
785
+ value: t,
786
+ onChange: c,
787
+ loadPlaces: g,
788
+ onPlaceSelect: x,
789
+ defaultRadiusKm: p,
790
+ reverseGeocode: y,
791
+ inputRef: f
792
+ }
793
+ ) }),
794
+ /* @__PURE__ */ a(
795
+ q,
796
+ {
797
+ value: t,
798
+ variant: s,
799
+ submitting: n,
800
+ submitLabel: l,
801
+ allowEmptySubmit: r,
802
+ onSubmit: h
803
+ }
804
+ )
805
+ ] }) });
806
+ }
807
+ function Ie(e) {
808
+ const {
809
+ variant: s,
810
+ value: t,
811
+ onChange: c,
812
+ onSubmit: h,
813
+ loadObjects: v,
814
+ loadPlaces: g,
815
+ onObjectSelect: u,
816
+ onPlaceSelect: x,
817
+ submitting: n,
818
+ submitLabel: l,
819
+ allowEmptySubmit: r,
820
+ whoRef: o,
821
+ whereRef: f,
822
+ defaultRadiusKm: p,
823
+ reverseGeocode: y,
824
+ cardLabel: m
825
+ } = e;
826
+ return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": m, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
827
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-center", children: [
828
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
829
+ H,
830
+ {
831
+ value: t,
832
+ onChange: c,
833
+ loadObjects: v,
834
+ onObjectSelect: u,
835
+ inputRef: o
836
+ }
837
+ ) }),
838
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
839
+ $,
840
+ {
841
+ value: t,
842
+ onChange: c,
843
+ loadPlaces: g,
844
+ onPlaceSelect: x,
845
+ defaultRadiusKm: p,
846
+ reverseGeocode: y,
847
+ inputRef: f
848
+ }
849
+ ) }),
850
+ /* @__PURE__ */ a(
851
+ q,
852
+ {
853
+ value: t,
854
+ variant: s,
855
+ submitting: n,
856
+ submitLabel: l,
857
+ allowEmptySubmit: r,
858
+ onSubmit: h
859
+ }
860
+ )
861
+ ] }),
862
+ /* @__PURE__ */ a(
863
+ Re,
864
+ {
865
+ value: t.when,
866
+ onChange: (i) => c({ ...t, when: i })
867
+ }
868
+ )
869
+ ] }) });
870
+ }
871
+ function Oe(e) {
872
+ const {
873
+ variant: s,
874
+ value: t,
875
+ onChange: c,
876
+ onSubmit: h,
877
+ loadObjects: v,
878
+ loadPlaces: g,
879
+ onObjectSelect: u,
880
+ onPlaceSelect: x,
881
+ facets: n,
882
+ submitting: l,
883
+ submitLabel: r,
884
+ allowEmptySubmit: o,
885
+ whoRef: f,
886
+ whereRef: p,
887
+ defaultRadiusKm: y,
888
+ reverseGeocode: m,
889
+ cardLabel: i
890
+ } = e;
891
+ return /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": i, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
892
+ /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-center", children: [
893
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
894
+ H,
895
+ {
896
+ value: t,
897
+ onChange: c,
898
+ loadObjects: v,
899
+ onObjectSelect: u,
900
+ inputRef: f
901
+ }
902
+ ) }),
903
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
904
+ $,
905
+ {
906
+ value: t,
907
+ onChange: c,
908
+ loadPlaces: g,
909
+ onPlaceSelect: x,
910
+ defaultRadiusKm: y,
911
+ reverseGeocode: m,
912
+ inputRef: p
913
+ }
914
+ ) }),
915
+ /* @__PURE__ */ a(
916
+ q,
917
+ {
918
+ value: t,
919
+ variant: s,
920
+ submitting: l,
921
+ submitLabel: r,
922
+ allowEmptySubmit: o,
923
+ onSubmit: h
924
+ }
925
+ )
926
+ ] }),
927
+ n && n.length > 0 ? /* @__PURE__ */ a(
928
+ je,
929
+ {
930
+ facets: n,
931
+ value: t.facets,
932
+ onChange: (N) => c({ ...t, facets: N })
933
+ }
934
+ ) : null
935
+ ] }) });
936
+ }
937
+ function Ve(e) {
938
+ const {
939
+ variant: s,
940
+ value: t,
941
+ onChange: c,
942
+ onSubmit: h,
943
+ loadObjects: v,
944
+ loadPlaces: g,
945
+ onObjectSelect: u,
946
+ onPlaceSelect: x,
947
+ discoveryCards: n,
948
+ submitting: l,
949
+ submitLabel: r,
950
+ allowEmptySubmit: o,
951
+ whoRef: f,
952
+ whereRef: p,
953
+ defaultRadiusKm: y,
954
+ reverseGeocode: m,
955
+ cardLabel: i
956
+ } = e;
957
+ return /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
958
+ /* @__PURE__ */ a(M, { variant: "elevated", "aria-label": i, children: /* @__PURE__ */ _("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:md:flex-row ds:md:items-stretch", children: [
959
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
960
+ H,
961
+ {
962
+ value: t,
963
+ onChange: c,
964
+ loadObjects: v,
965
+ onObjectSelect: u,
966
+ inputRef: f
967
+ }
968
+ ) }),
969
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
970
+ $,
971
+ {
972
+ value: t,
973
+ onChange: c,
974
+ loadPlaces: g,
975
+ onPlaceSelect: x,
976
+ defaultRadiusKm: y,
977
+ reverseGeocode: m,
978
+ inputRef: p
979
+ }
980
+ ) }),
981
+ /* @__PURE__ */ a(
982
+ q,
983
+ {
984
+ value: t,
985
+ variant: s,
986
+ submitting: l,
987
+ submitLabel: r,
988
+ allowEmptySubmit: o,
989
+ onSubmit: h
990
+ }
991
+ )
992
+ ] }) }),
993
+ /* @__PURE__ */ a(Le, { cards: n })
994
+ ] });
995
+ }
996
+ const Be = le(function({
997
+ variant: s,
998
+ loadObjects: t,
999
+ loadPlaces: c,
1000
+ onObjectSelect: h,
1001
+ onPlaceSelect: v,
1002
+ facets: g,
1003
+ defaultRadiusKm: u = oe,
1004
+ reverseGeocode: x,
1005
+ discoveryCards: n,
1006
+ countryCode: l,
1007
+ value: r,
1008
+ onChange: o,
1009
+ onSubmit: f,
1010
+ submitting: p,
1011
+ submitLabel: y,
1012
+ allowEmptySubmit: m,
1013
+ "aria-label": i,
1014
+ id: N,
1015
+ className: F,
1016
+ ...U
1017
+ }, G) {
1018
+ const { t: R } = A(), Q = S(null), C = S(null), P = S(null), I = S(!1);
1019
+ B(() => {
1020
+ if (!I.current && s === "who-where-when") {
1021
+ if (r.when !== void 0) {
1022
+ I.current = !0;
1023
+ return;
1024
+ }
1025
+ I.current = !0, o({ ...r, when: "anytime" });
1026
+ }
1027
+ }, [s]);
1028
+ const T = S(!1);
1029
+ B(() => {
1030
+ if (!T.current && s === "faceted") {
1031
+ if (r.facets !== void 0) {
1032
+ T.current = !0;
1033
+ return;
1034
+ }
1035
+ T.current = !0, o({ ...r, facets: {} });
1036
+ }
1037
+ }, [s]);
1038
+ const O = S(null);
1039
+ B(() => {
1040
+ O.current !== s && (O.current = s, w("patient_search_variant_exposed", { variant: s, country: l }));
1041
+ }, [s, l]);
1042
+ const E = Y(
1043
+ () => ({
1044
+ getVariant: () => s,
1045
+ reset: () => {
1046
+ o({});
1047
+ },
1048
+ focusPrimary: () => {
1049
+ requestAnimationFrame(() => {
1050
+ var k;
1051
+ (k = C.current) == null || k.focus();
1052
+ });
1053
+ }
1054
+ }),
1055
+ [s, o]
1056
+ );
1057
+ ue(G, () => E, [E]), he(_e, E, N);
1058
+ const V = i ?? R("patientSearch.regionLabel"), d = {
1059
+ variant: s,
1060
+ value: r,
1061
+ onChange: o,
1062
+ onSubmit: f,
1063
+ loadObjects: t,
1064
+ loadPlaces: c,
1065
+ onObjectSelect: h,
1066
+ onPlaceSelect: v,
1067
+ facets: g,
1068
+ defaultRadiusKm: u,
1069
+ reverseGeocode: x,
1070
+ discoveryCards: n ?? [],
1071
+ submitting: p,
1072
+ submitLabel: y,
1073
+ allowEmptySubmit: m,
1074
+ whoRef: C,
1075
+ whereRef: P,
1076
+ cardLabel: V
1077
+ }, b = (() => {
1078
+ switch (s) {
1079
+ case "who-where":
1080
+ return /* @__PURE__ */ a(Pe, { ...d });
1081
+ case "who-where-when":
1082
+ return /* @__PURE__ */ a(Ie, { ...d });
1083
+ case "faceted":
1084
+ return /* @__PURE__ */ a(Oe, { ...d });
1085
+ case "discovery":
1086
+ return /* @__PURE__ */ a(Ve, { ...d });
1087
+ /* c8 ignore next 2 */
1088
+ default:
1089
+ return null;
1090
+ }
1091
+ })();
1092
+ return /* @__PURE__ */ a(
1093
+ "div",
1094
+ {
1095
+ ref: Q,
1096
+ role: "region",
1097
+ "aria-label": V,
1098
+ id: N,
1099
+ "data-component": "patient-search",
1100
+ "data-component-id": N,
1101
+ "data-variant": s,
1102
+ className: Ne({ variant: s, className: F }),
1103
+ ...U,
1104
+ children: b
1105
+ }
1106
+ );
1107
+ });
1108
+ Be.displayName = "PatientSearch";
1109
+ export {
1110
+ Be as P,
1111
+ _e as p
1112
+ };
1113
+ //# sourceMappingURL=patient-search-DuSoGG2t.js.map