@alfadocs/ui-kit-debug 1.120.0 → 1.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/assets/map-pin@2x.png +0 -0
  2. package/assets/map-pin@2x.source.json +5 -0
  3. package/dist/_chunks/addDays-CuE8wLqb.js +9 -0
  4. package/dist/_chunks/addDays-CuE8wLqb.js.map +1 -0
  5. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js → anamnesis-summary-rows-CtcULkvc.js} +2 -2
  6. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js.map → anamnesis-summary-rows-CtcULkvc.js.map} +1 -1
  7. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js → antenatal-schedule-timeline-XHbig8On.js} +3 -3
  8. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js.map → antenatal-schedule-timeline-XHbig8On.js.map} +1 -1
  9. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js → appointment-timeline-Czd4PBkF.js} +2 -2
  10. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js.map → appointment-timeline-Czd4PBkF.js.map} +1 -1
  11. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js → balance-badge-cell-DtxbGJcA.js} +2 -2
  12. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js.map → balance-badge-cell-DtxbGJcA.js.map} +1 -1
  13. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js → bill-line-table-HrynB7ND.js} +2 -2
  14. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js.map → bill-line-table-HrynB7ND.js.map} +1 -1
  15. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js → calendar-appointment-editor-dialog-CiCmsBCH.js} +5 -5
  16. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js.map → calendar-appointment-editor-dialog-CiCmsBCH.js.map} +1 -1
  17. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js → cycle-calculator-WFhMfJHt.js} +4 -3
  18. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js.map → cycle-calculator-WFhMfJHt.js.map} +1 -1
  19. package/dist/_chunks/{data-grid-Bbf8t4z3.js → data-grid-C71BhGDw.js} +2 -2
  20. package/dist/_chunks/{data-grid-Bbf8t4z3.js.map → data-grid-C71BhGDw.js.map} +1 -1
  21. package/dist/_chunks/{date-picker-DBVTj6lO.js → date-picker-BmVBVpVu.js} +3 -3
  22. package/dist/_chunks/{date-picker-DBVTj6lO.js.map → date-picker-BmVBVpVu.js.map} +1 -1
  23. package/dist/_chunks/{date-picker-variants-J1EeAhIH.js → date-picker-variants-DmfVRNDB.js} +184 -188
  24. package/dist/_chunks/date-picker-variants-DmfVRNDB.js.map +1 -0
  25. package/dist/_chunks/{date-range-panel-CT6nXjRM.js → date-range-panel-CT9Pk-HF.js} +2 -2
  26. package/dist/_chunks/{date-range-panel-CT6nXjRM.js.map → date-range-panel-CT9Pk-HF.js.map} +1 -1
  27. package/dist/_chunks/{date-range-picker-PTRpDkXT.js → date-range-picker-2Up_FRrM.js} +40 -39
  28. package/dist/_chunks/{date-range-picker-PTRpDkXT.js.map → date-range-picker-2Up_FRrM.js.map} +1 -1
  29. package/dist/_chunks/{date-time-picker-CJnqiQoT.js → date-time-picker-C6b_Vymc.js} +2 -2
  30. package/dist/_chunks/{date-time-picker-CJnqiQoT.js.map → date-time-picker-C6b_Vymc.js.map} +1 -1
  31. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js → default-tabs-RvCI5uN0.js} +3 -3
  32. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js.map → default-tabs-RvCI5uN0.js.map} +1 -1
  33. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js → due-date-calculator-CALlODZe.js} +4 -4
  34. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js.map → due-date-calculator-CALlODZe.js.map} +1 -1
  35. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js → gestational-age-calculator-mB6brTlp.js} +5 -5
  36. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js.map → gestational-age-calculator-mB6brTlp.js.map} +1 -1
  37. package/dist/_chunks/{hcg-doubling-BjTa_77t.js → hcg-doubling-Dhdt3Jyd.js} +3 -3
  38. package/dist/_chunks/{hcg-doubling-BjTa_77t.js.map → hcg-doubling-Dhdt3Jyd.js.map} +1 -1
  39. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js → invoice-upload-list-C95s5Q7m.js} +3 -3
  40. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js.map → invoice-upload-list-C95s5Q7m.js.map} +1 -1
  41. package/dist/_chunks/{kit-extensions-C3oL0WTp.js → kit-extensions-DUaIYyMD.js} +4 -4
  42. package/dist/_chunks/{kit-extensions-C3oL0WTp.js.map → kit-extensions-DUaIYyMD.js.map} +1 -1
  43. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js → link-cell-renderer-BEaLczk2.js} +2 -2
  44. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js.map → link-cell-renderer-BEaLczk2.js.map} +1 -1
  45. package/dist/_chunks/{map-view-h6ngp2xi.js → map-view-QWdQLHi9.js} +543 -495
  46. package/dist/_chunks/map-view-QWdQLHi9.js.map +1 -0
  47. package/dist/_chunks/{parse-BLBWPIgE.js → parse-BFur8Byx.js} +2 -2
  48. package/dist/_chunks/{parse-BLBWPIgE.js.map → parse-BFur8Byx.js.map} +1 -1
  49. package/dist/_chunks/{patient-details-C4dHR4iu.js → patient-details-Cba9HQj_.js} +2 -2
  50. package/dist/_chunks/{patient-details-C4dHR4iu.js.map → patient-details-Cba9HQj_.js.map} +1 -1
  51. package/dist/_chunks/{patient-field-row-0QP8KCVp.js → patient-field-row-CtDihADs.js} +2 -2
  52. package/dist/_chunks/{patient-field-row-0QP8KCVp.js.map → patient-field-row-CtDihADs.js.map} +1 -1
  53. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js → patient-summary-card-DnLdbtsw.js} +2 -2
  54. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js.map → patient-summary-card-DnLdbtsw.js.map} +1 -1
  55. package/dist/_chunks/practice-results-BCLqPdgn.js +2683 -0
  56. package/dist/_chunks/practice-results-BCLqPdgn.js.map +1 -0
  57. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js → pregnancy-dating-BNI32qNw.js} +5 -5
  58. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js.map → pregnancy-dating-BNI32qNw.js.map} +1 -1
  59. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js → radiograph-panel.agent-B-r3BoqU.js} +3 -3
  60. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js.map → radiograph-panel.agent-B-r3BoqU.js.map} +1 -1
  61. package/dist/_chunks/{registration-form-CMXefBnC.js → registration-form-CwbhtKcy.js} +180 -165
  62. package/dist/_chunks/registration-form-CwbhtKcy.js.map +1 -0
  63. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js → reserved.agent-CCwsOb3M.js} +8 -7
  64. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js.map → reserved.agent-CCwsOb3M.js.map} +1 -1
  65. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js → send-registration-link-form-BjkXr0TD.js} +3 -3
  66. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js.map → send-registration-link-form-BjkXr0TD.js.map} +1 -1
  67. package/dist/_chunks/{slot-grid-b4eZXokb.js → slot-grid-DEZRB4Yb.js} +234 -207
  68. package/dist/_chunks/slot-grid-DEZRB4Yb.js.map +1 -0
  69. package/dist/_chunks/subDays-DC99JK7a.js +8 -0
  70. package/dist/_chunks/{subDays-Bsoy023P.js.map → subDays-DC99JK7a.js.map} +1 -1
  71. package/dist/_chunks/{task-editor-Czcx9B-3.js → task-editor-C05yx7JJ.js} +2 -2
  72. package/dist/_chunks/{task-editor-Czcx9B-3.js.map → task-editor-C05yx7JJ.js.map} +1 -1
  73. package/dist/_chunks/{toolbar-DoKcoE2q.js → toolbar-Dznu_Dou.js} +2 -2
  74. package/dist/_chunks/{toolbar-DoKcoE2q.js.map → toolbar-Dznu_Dou.js.map} +1 -1
  75. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js → use-appointment-details-read-Bm408XzX.js} +2 -2
  76. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js.map → use-appointment-details-read-Bm408XzX.js.map} +1 -1
  77. package/dist/_chunks/{workflow-webhook-action-dgUjv9T7.js → workflow-webhook-action-Cae02r_4.js} +264 -289
  78. package/dist/_chunks/workflow-webhook-action-Cae02r_4.js.map +1 -0
  79. package/dist/agent-catalog.json +3 -11
  80. package/dist/agent-i18n/en.json +1 -2
  81. package/dist/browser-support.js +1 -1
  82. package/dist/components/appointment-details-panel/index.js +1 -1
  83. package/dist/components/appointment-timeline/index.js +1 -1
  84. package/dist/components/bill-line-table/index.js +1 -1
  85. package/dist/components/bill-table/index.js +1 -1
  86. package/dist/components/booking/index.js +1 -1
  87. package/dist/components/cycle-calculator/index.js +1 -1
  88. package/dist/components/data-grid/index.js +2 -2
  89. package/dist/components/data-table/index.js +1 -1
  90. package/dist/components/date-picker/index.js +1 -1
  91. package/dist/components/date-range-picker/index.js +1 -1
  92. package/dist/components/date-time-picker/index.js +1 -1
  93. package/dist/components/due-date-calculator/index.js +2 -2
  94. package/dist/components/gestational-age-calculator/index.js +1 -1
  95. package/dist/components/hcg-doubling/index.js +1 -1
  96. package/dist/components/invoice-upload-list/index.js +1 -1
  97. package/dist/components/map-view/index.d.ts +1 -1
  98. package/dist/components/map-view/index.d.ts.map +1 -1
  99. package/dist/components/map-view/index.js +1 -1
  100. package/dist/components/map-view/map-view.d.ts +18 -0
  101. package/dist/components/map-view/map-view.d.ts.map +1 -1
  102. package/dist/components/patient-details/index.js +1 -1
  103. package/dist/components/patient-summary-card/index.js +1 -1
  104. package/dist/components/patient-table/index.js +1 -1
  105. package/dist/components/practice-results/index.js +1 -1
  106. package/dist/components/practice-results/practice-results-slot-card.d.ts +38 -0
  107. package/dist/components/practice-results/practice-results-slot-card.d.ts.map +1 -0
  108. package/dist/components/practice-results/practice-results.d.ts +32 -2
  109. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  110. package/dist/components/pregnancy-dating/index.js +1 -1
  111. package/dist/components/radiograph-panel/index.js +1 -1
  112. package/dist/components/rich-text-editor/index.js +1 -1
  113. package/dist/components/slot-grid/index.js +1 -1
  114. package/dist/components/slot-grid/slot-grid.d.ts +19 -0
  115. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  116. package/dist/components/task-editor/index.js +1 -1
  117. package/dist/core.css +1 -1
  118. package/dist/host-compat.css +9 -1
  119. package/dist/i18n/locales/ar.d.ts +7 -5
  120. package/dist/i18n/locales/ar.d.ts.map +1 -1
  121. package/dist/i18n/locales/ar.js +8 -6
  122. package/dist/i18n/locales/ar.js.map +1 -1
  123. package/dist/i18n/locales/de.d.ts +7 -5
  124. package/dist/i18n/locales/de.d.ts.map +1 -1
  125. package/dist/i18n/locales/de.js +8 -6
  126. package/dist/i18n/locales/de.js.map +1 -1
  127. package/dist/i18n/locales/el.d.ts +7 -5
  128. package/dist/i18n/locales/el.d.ts.map +1 -1
  129. package/dist/i18n/locales/el.js +8 -6
  130. package/dist/i18n/locales/el.js.map +1 -1
  131. package/dist/i18n/locales/en.d.ts +7 -5
  132. package/dist/i18n/locales/en.d.ts.map +1 -1
  133. package/dist/i18n/locales/en.js +7 -5
  134. package/dist/i18n/locales/en.js.map +1 -1
  135. package/dist/i18n/locales/es.d.ts +7 -5
  136. package/dist/i18n/locales/es.d.ts.map +1 -1
  137. package/dist/i18n/locales/es.js +8 -6
  138. package/dist/i18n/locales/es.js.map +1 -1
  139. package/dist/i18n/locales/fr.d.ts +7 -5
  140. package/dist/i18n/locales/fr.d.ts.map +1 -1
  141. package/dist/i18n/locales/fr.js +8 -6
  142. package/dist/i18n/locales/fr.js.map +1 -1
  143. package/dist/i18n/locales/hi.d.ts +7 -5
  144. package/dist/i18n/locales/hi.d.ts.map +1 -1
  145. package/dist/i18n/locales/hi.js +8 -6
  146. package/dist/i18n/locales/hi.js.map +1 -1
  147. package/dist/i18n/locales/it.d.ts +7 -5
  148. package/dist/i18n/locales/it.d.ts.map +1 -1
  149. package/dist/i18n/locales/it.js +8 -6
  150. package/dist/i18n/locales/it.js.map +1 -1
  151. package/dist/i18n/locales/ja.d.ts +7 -5
  152. package/dist/i18n/locales/ja.d.ts.map +1 -1
  153. package/dist/i18n/locales/ja.js +8 -6
  154. package/dist/i18n/locales/ja.js.map +1 -1
  155. package/dist/i18n/locales/nl.d.ts +7 -5
  156. package/dist/i18n/locales/nl.d.ts.map +1 -1
  157. package/dist/i18n/locales/nl.js +8 -6
  158. package/dist/i18n/locales/nl.js.map +1 -1
  159. package/dist/i18n/locales/pl.d.ts +7 -5
  160. package/dist/i18n/locales/pl.d.ts.map +1 -1
  161. package/dist/i18n/locales/pl.js +8 -6
  162. package/dist/i18n/locales/pl.js.map +1 -1
  163. package/dist/i18n/locales/pt.d.ts +7 -5
  164. package/dist/i18n/locales/pt.d.ts.map +1 -1
  165. package/dist/i18n/locales/pt.js +8 -6
  166. package/dist/i18n/locales/pt.js.map +1 -1
  167. package/dist/i18n/locales/ro.d.ts +7 -5
  168. package/dist/i18n/locales/ro.d.ts.map +1 -1
  169. package/dist/i18n/locales/ro.js +8 -6
  170. package/dist/i18n/locales/ro.js.map +1 -1
  171. package/dist/i18n/locales/ru.d.ts +7 -5
  172. package/dist/i18n/locales/ru.d.ts.map +1 -1
  173. package/dist/i18n/locales/ru.js +8 -6
  174. package/dist/i18n/locales/ru.js.map +1 -1
  175. package/dist/i18n/locales/sq.d.ts +7 -5
  176. package/dist/i18n/locales/sq.d.ts.map +1 -1
  177. package/dist/i18n/locales/sq.js +8 -6
  178. package/dist/i18n/locales/sq.js.map +1 -1
  179. package/dist/i18n/locales/sv.d.ts +7 -5
  180. package/dist/i18n/locales/sv.d.ts.map +1 -1
  181. package/dist/i18n/locales/sv.js +8 -6
  182. package/dist/i18n/locales/sv.js.map +1 -1
  183. package/dist/i18n/locales/tr.d.ts +7 -5
  184. package/dist/i18n/locales/tr.d.ts.map +1 -1
  185. package/dist/i18n/locales/tr.js +8 -6
  186. package/dist/i18n/locales/tr.js.map +1 -1
  187. package/dist/i18n/locales/zh.d.ts +7 -5
  188. package/dist/i18n/locales/zh.d.ts.map +1 -1
  189. package/dist/i18n/locales/zh.js +8 -6
  190. package/dist/i18n/locales/zh.js.map +1 -1
  191. package/dist/index.js +32 -32
  192. package/dist/locales/ar.json +8 -6
  193. package/dist/locales/de.json +8 -6
  194. package/dist/locales/el.json +8 -6
  195. package/dist/locales/en.json +7 -5
  196. package/dist/locales/es.json +8 -6
  197. package/dist/locales/fr.json +8 -6
  198. package/dist/locales/hi.json +8 -6
  199. package/dist/locales/it.json +8 -6
  200. package/dist/locales/ja.json +8 -6
  201. package/dist/locales/nl.json +8 -6
  202. package/dist/locales/pl.json +8 -6
  203. package/dist/locales/pt.json +8 -6
  204. package/dist/locales/ro.json +8 -6
  205. package/dist/locales/ru.json +8 -6
  206. package/dist/locales/sq.json +8 -6
  207. package/dist/locales/sv.json +8 -6
  208. package/dist/locales/tr.json +8 -6
  209. package/dist/locales/zh.json +8 -6
  210. package/dist/patterns/anamnesis/index.js +1 -1
  211. package/dist/patterns/calendar/index.js +1 -1
  212. package/dist/patterns/registration-form/index.js +1 -1
  213. package/dist/patterns/send-registration-link-form/index.js +1 -1
  214. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  215. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts.map +1 -1
  216. package/dist/tokens.css +1 -1
  217. package/package.json +1 -1
  218. package/dist/_chunks/date-picker-variants-J1EeAhIH.js.map +0 -1
  219. package/dist/_chunks/key-round-DIgsnJSg.js +0 -21
  220. package/dist/_chunks/key-round-DIgsnJSg.js.map +0 -1
  221. package/dist/_chunks/map-view-h6ngp2xi.js.map +0 -1
  222. package/dist/_chunks/practice-results-yCresv86.js +0 -2326
  223. package/dist/_chunks/practice-results-yCresv86.js.map +0 -1
  224. package/dist/_chunks/registration-form-CMXefBnC.js.map +0 -1
  225. package/dist/_chunks/slot-grid-b4eZXokb.js.map +0 -1
  226. package/dist/_chunks/subDays-Bsoy023P.js +0 -8
  227. package/dist/_chunks/workflow-webhook-action-dgUjv9T7.js.map +0 -1
@@ -1,2326 +0,0 @@
1
- import { jsx as n, jsxs as g, Fragment as Tt } from "react/jsx-runtime";
2
- import { forwardRef as Ot, useState as Z, useRef as T, useMemo as O, useImperativeHandle as Vt, useCallback as H, useEffect as J } from "react";
3
- import { c as W } from "./index-D2ZczOXr.js";
4
- import { useTranslation as L } from "react-i18next";
5
- import { A as pe } from "./alert-C4WKViaS.js";
6
- import { A as He } from "./avatar-Dp5apm1d.js";
7
- import { B as he } from "./button-DohK_Ak_.js";
8
- import { D as G } from "./dropdown-menu-Dw6sgQwJ.js";
9
- import { E as Bt } from "./empty-state-DwJ5YNzz.js";
10
- import { M as Dt, i as Fe } from "./map-view-h6ngp2xi.js";
11
- import { R as _e } from "./rating-CGYpg5dj.js";
12
- import { S as j } from "./sheet-uZZXaO_S.js";
13
- import { S as $t } from "./skeleton-tTWJpvAq.js";
14
- import { S as zt } from "./spinner-CoflYlEx.js";
15
- import { B as q } from "./badge-BUk4RjTS.js";
16
- import { u as Te } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
17
- import { u as Oe } from "./use-media-query-CcAx5SMM.js";
18
- import { m as Et } from "./motion-is-off-BvAuNV5O.js";
19
- import { l as Qe } from "./length-token-DwMnGEYT.js";
20
- import { b as Kt, a as Je } from "./format-price-CIX0YJZn.js";
21
- import { u as jt } from "./registry-DvAUVLHh.js";
22
- import { c as qt } from "./createLucideIcon-DhHxpK9K.js";
23
- import { R as Ut } from "./refresh-cw-DnI0cLFC.js";
24
- import { C as tt } from "./chevron-down-DWE7GSq9.js";
25
- import { L as nt } from "./languages-CGLX6Qpe.js";
26
- import { S as at } from "./shield-check-DCJALLVh.js";
27
- import { H as it } from "./heart--qCA4ffe.js";
28
- import { M as ge } from "./map-pin-BaY37-Km.js";
29
- import { C as Gt } from "./calendar-clock-hbObjfGY.js";
30
- import { C as Zt } from "./calendar-plus-BFrIRE4r.js";
31
- /**
32
- * @license lucide-react v1.22.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */
37
- const Wt = [
38
- [
39
- "path",
40
- {
41
- d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
42
- key: "169xi5"
43
- }
44
- ],
45
- ["path", { d: "M15 5.764v15", key: "1pn4in" }],
46
- ["path", { d: "M9 3.236v15", key: "1uimfh" }]
47
- ], Qt = qt("map", Wt), Jt = {
48
- id: "practice-results",
49
- // `scroll` backs scroll_to_result (light highlight, no selection). focus_pin
50
- // follows the pin-click rules: on a map variant at `lg` and up it chooses the
51
- // card and the choice persists until another pin, a card or the map is
52
- // clicked, so it is `select_single`; elsewhere it is a light highlight. The active variant is consumer-owned via props, so there is
53
- // no `view_change` action — variant is read-only state, not an operation; and
54
- // there is no in-component routing, so no `navigate`.
55
- capabilities: ["scroll", "select_single"],
56
- state: {
57
- variant: {
58
- type: "string",
59
- descriptionKey: "ui.agent.practiceResults.state.variant",
60
- description: "Active variant — one of `split-list-map`, `map-first`, `rich-cards`.",
61
- read: (e) => e.getVariant()
62
- }
63
- },
64
- actions: {
65
- scroll_to_result: {
66
- safety: "read",
67
- argsType: "{ id: string }",
68
- argsSchema: {
69
- type: "object",
70
- properties: {
71
- id: {
72
- type: "string",
73
- description: "Stable result id (the data-result-id of the card)."
74
- }
75
- },
76
- required: ["id"]
77
- },
78
- idempotent: !0,
79
- descriptionKey: "ui.agent.practiceResults.actions.scrollToResult",
80
- description: 'Scroll the result card with the given id into the visible viewport and give it a light highlight. It does not choose the card: no "Selected on the map" tag.',
81
- examples: [
82
- { args: { id: "practice-42" }, note: "Scroll to a specific result." }
83
- ],
84
- invoke: (e, t) => {
85
- e.scrollToResult(t.id);
86
- }
87
- },
88
- focus_pin: {
89
- safety: "read",
90
- argsType: "{ id: string }",
91
- argsSchema: {
92
- type: "object",
93
- properties: {
94
- id: {
95
- type: "string",
96
- description: "Stable result id whose map pin to choose."
97
- }
98
- },
99
- required: ["id"]
100
- },
101
- idempotent: !0,
102
- descriptionKey: "ui.agent.practiceResults.actions.focusPin",
103
- description: 'Choose the result with the given id as a pin click would. On a map variant at lg width and up the card gets the strong highlight and the "Selected on the map" tag, kept until another pin, a card or the map is clicked. On rich-cards or a narrow screen it gives a light highlight only.',
104
- examples: [
105
- {
106
- args: { id: "practice-42" },
107
- note: "Choose the matching result and pin, as a pin click does."
108
- }
109
- ],
110
- invoke: (e, t) => {
111
- e.focusPin(t.id);
112
- }
113
- }
114
- },
115
- domHooks: {
116
- root: {
117
- attr: "data-component",
118
- value: "practice-results",
119
- description: "Marks the PracticeResults root region. The headingLevel prop accepts 1 to 6 (default 2) for the optional results heading; use 1 when it is the page title. Card names and default error and empty-state titles use the next level, capped at 6."
120
- },
121
- instanceId: {
122
- attr: "data-component-id",
123
- sourceProp: "id",
124
- description: "Sourced from the id prop."
125
- },
126
- item: {
127
- attr: "data-result-id",
128
- description: 'Stable result id emitted on each rendered result card. Used by scroll_to_result / focus_pin to address a single result. The non-focusable card group is labelled by the practice-result-{id}-name heading, which contains data-component="practice-result-name-link": a visible link to result.href that navigates without firing onResultSelect or click telemetry. Each card also carries up to two CTA anchors: data-component="practice-result-open-cta" (practice page; absent when the consumer sets showCardOpenButton=false) and data-component="practice-result-book-cta" (booking flow; data-slot-aware="true" when it deep-links to a next slot). Card content carries its own read-only hooks: data-component="practice-result-tagline", data-component="practice-result-description", data-component="practice-result-latest-review" (the newest approved review as one truncated line under the rating, from latestReview; its text span carries the language of the review as lang; absent without latestReview), and data-component="practice-result-price" (the kit-formatted first-visit cost: firstVisitPrice supports fixed, from and range amounts plus an optional practice-written label; it takes precedence over the older firstVisitPriceCents fixed-price field. Absent when neither price is set).'
129
- }
130
- }
131
- }, Xt = 13, Xe = [
132
- "distance",
133
- "rating",
134
- "next-available",
135
- "price",
136
- "relevance"
137
- ];
138
- function st(e, t, i) {
139
- const s = `languages.${e}`;
140
- return i.exists(s) ? t(s) : e.toUpperCase();
141
- }
142
- function U(e, t) {
143
- if (typeof window > "u") return;
144
- const i = window.track;
145
- try {
146
- i == null || i(e, t);
147
- } catch {
148
- }
149
- }
150
- function ae(e, t, i, s) {
151
- const r = e.findIndex((o) => o.id === t);
152
- if (r < 0) return;
153
- const a = e[r];
154
- a && (U("serp_result_clicked", { resultId: t, source: i, position: r }), s(a, i));
155
- }
156
- function Yt(e, t) {
157
- const s = (t.lat - e.lat) * Math.PI / 180, r = (t.lng - e.lng) * Math.PI / 180, a = e.lat * Math.PI / 180, o = t.lat * Math.PI / 180, m = Math.sin(s / 2), d = Math.sin(r / 2), l = m * m + Math.cos(a) * Math.cos(o) * d * d;
158
- return 2 * 6371 * Math.asin(Math.min(1, Math.sqrt(l)));
159
- }
160
- function en(e, t, i) {
161
- var r;
162
- const s = [];
163
- for (const a of e) {
164
- const o = a.field ?? a.key, m = (((r = i == null ? void 0 : i[a.key]) == null ? void 0 : r.length) ?? 0) > 0, d = a.type === "boolean" || a.type !== "options" && a.options.length === 0 && (m || t.some(
165
- (l) => typeof l[o] == "boolean"
166
- ));
167
- !d && a.options.length === 0 || s.push({ ...a, boolean: d, booleanField: o });
168
- }
169
- return s;
170
- }
171
- function tn(e, t, i) {
172
- return !t || Object.keys(t).length === 0 ? e : e.filter((s) => {
173
- for (const r of i) {
174
- const a = t[r.key];
175
- if (!a || a.length === 0) continue;
176
- if (r.boolean) {
177
- if (s[r.booleanField] !== !0) return !1;
178
- continue;
179
- }
180
- const o = r.key === "insurance" ? s.insurances : r.key === "language" ? s.languages : s[r.key];
181
- if (!Array.isArray(o) || !(r.multi ? a.some((d) => o.includes(d)) : o.includes(a[0]))) return !1;
182
- }
183
- return !0;
184
- });
185
- }
186
- function nn(e) {
187
- const t = e.firstVisitPrice && Number.isFinite(e.firstVisitPrice.minCents) ? e.firstVisitPrice.minCents : e.firstVisitPriceCents;
188
- return t != null && Number.isFinite(t) && t >= 0 ? t : 1 / 0;
189
- }
190
- function an(e) {
191
- return e.firstVisitPrice && Number.isFinite(e.firstVisitPrice.minCents) ? e.firstVisitPrice.kind === "fixed" : !0;
192
- }
193
- function Ye(e, t) {
194
- return e == null && t == null ? 0 : e == null ? 1 : t == null ? -1 : e - t;
195
- }
196
- function sn(e, t, i) {
197
- const s = e.map((a) => {
198
- const o = a.location ? a.location.distanceKm ?? (i ? Yt(i, a.location) : void 0) : void 0;
199
- return {
200
- result: a,
201
- distanceKm: o,
202
- price: t === "price" ? nn(a) : void 0,
203
- fixed: t === "price" ? an(a) : !1
204
- };
205
- }), r = (a, o) => {
206
- var m, d, l, c;
207
- switch (t) {
208
- case "distance":
209
- return Ye(a.distanceKm, o.distanceKm);
210
- case "price": {
211
- const h = a.price ?? 1 / 0, p = o.price ?? 1 / 0;
212
- return h !== p ? h - p : h !== 1 / 0 && a.fixed !== o.fixed ? a.fixed ? -1 : 1 : Ye(a.distanceKm, o.distanceKm);
213
- }
214
- case "rating": {
215
- const h = ((m = a.result.rating) == null ? void 0 : m.value) ?? -1;
216
- return (((d = o.result.rating) == null ? void 0 : d.value) ?? -1) - h;
217
- }
218
- case "next-available": {
219
- const h = ((l = a.result.nextAvailableSlot) == null ? void 0 : l.dateTime) ?? "", p = ((c = o.result.nextAvailableSlot) == null ? void 0 : c.dateTime) ?? "";
220
- return !h && !p ? 0 : h ? p ? h.localeCompare(p) : -1 : 1;
221
- }
222
- case "relevance":
223
- default:
224
- return 0;
225
- }
226
- };
227
- return [...s].sort(r).map(
228
- ({ result: a, distanceKm: o }) => o != null && a.location ? {
229
- ...a,
230
- location: { ...a.location, distanceKm: o }
231
- } : a
232
- );
233
- }
234
- function rn(e) {
235
- let t = -1 / 0, i = 1 / 0, s = -1 / 0, r = 1 / 0, a = !1;
236
- for (const o of e) {
237
- if (!o.location) continue;
238
- a = !0;
239
- const { lat: m, lng: d } = o.location;
240
- m > t && (t = m), m < i && (i = m), d > s && (s = d), d < r && (r = d);
241
- }
242
- if (a)
243
- return { north: t, south: i, east: s, west: r };
244
- }
245
- const on = W(
246
- "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)] ds:gap-[var(--spacing-md)]",
247
- {
248
- variants: {
249
- variant: {
250
- "split-list-map": "",
251
- "map-first": "",
252
- "rich-cards": ""
253
- }
254
- },
255
- defaultVariants: { variant: "split-list-map" }
256
- }
257
- );
258
- function rt({
259
- heading: e,
260
- headingLevel: t,
261
- intro: i,
262
- totalCount: s,
263
- searchCentreLabel: r
264
- }) {
265
- const { t: a } = L("ui"), o = `h${t}`;
266
- if (!e && !i && s == null) return null;
267
- const m = s != null ? r ? a("practiceResults.results.heading", {
268
- count: s,
269
- place: r
270
- }) : a("practiceResults.results.summary", { count: s }) : void 0;
271
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
272
- e ? /* @__PURE__ */ n(o, { className: "type-title-section ds:m-0 ds:text-[var(--foreground)]", children: e }) : null,
273
- i ? /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: i }) : null,
274
- m ? /* @__PURE__ */ n(
275
- "p",
276
- {
277
- className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
278
- "aria-live": "polite",
279
- children: m
280
- }
281
- ) : null
282
- ] });
283
- }
284
- const ve = W(
285
- [
286
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
287
- "ds:min-h-[var(--min-target-size)]",
288
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
289
- "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
290
- "ds:rounded-[var(--radius-full)]",
291
- "type-label",
292
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
293
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
294
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
295
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
296
- ].join(" "),
297
- {
298
- variants: {
299
- state: {
300
- 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))]",
301
- active: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
302
- }
303
- },
304
- defaultVariants: { state: "idle" }
305
- }
306
- ), ln = W(
307
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
308
- {
309
- variants: {
310
- placement: {
311
- inline: "",
312
- // Floating chrome on map-first: soft `--popover` surface so chips
313
- // read over the map without losing contrast. Same surface as
314
- // dropdowns / sheets — themed and forced-colors safe.
315
- floating: [
316
- "ds:rounded-[var(--radius-full)]",
317
- "ds:bg-[var(--popover)] ds:shadow-[var(--shadow-md)]",
318
- "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
319
- "ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]"
320
- ].join(" ")
321
- }
322
- },
323
- defaultVariants: { placement: "inline" }
324
- }
325
- ), cn = W(
326
- [
327
- "ds:ms-[var(--spacing-xs)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
328
- "ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]",
329
- "type-label ds:text-[color:var(--muted-foreground)]",
330
- "ds:rounded-[var(--radius-sm)]",
331
- "ds:hover:text-[color:var(--foreground)]",
332
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
333
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
334
- ].join(" ")
335
- );
336
- function ot({
337
- facets: e,
338
- value: t,
339
- onChange: i,
340
- floating: s
341
- }) {
342
- const { t: r } = L("ui"), a = O(() => t ?? {}, [t]), o = O(
343
- () => Object.values(a).some((c) => c && c.length > 0),
344
- [a]
345
- ), m = (c, h) => {
346
- const p = { ...a };
347
- h.length === 0 ? delete p[c] : p[c] = h, i(p), U("serp_filter_changed", { key: c, values: h });
348
- }, d = (c) => {
349
- var p;
350
- const h = (((p = a[c]) == null ? void 0 : p.length) ?? 0) > 0;
351
- m(c, h ? [] : ["true"]);
352
- }, l = (c, h) => {
353
- const p = a[c.key] ?? [], x = p.includes(h);
354
- let b;
355
- c.multi ? b = x ? p.filter((w) => w !== h) : [...p, h] : b = x ? [] : [h], m(c.key, b);
356
- };
357
- return e.length === 0 ? null : /* @__PURE__ */ g(
358
- "div",
359
- {
360
- "data-component": "practice-results-filters",
361
- role: "group",
362
- "aria-label": r("practiceResults.filters.label"),
363
- className: ln({
364
- placement: s ? "floating" : "inline"
365
- }),
366
- children: [
367
- e.map((c) => {
368
- const h = c.boolean, p = a[c.key] ?? [], x = p.length > 0;
369
- if (h)
370
- return /* @__PURE__ */ n(
371
- "button",
372
- {
373
- type: "button",
374
- "aria-pressed": x,
375
- "aria-label": c.label,
376
- onClick: () => d(c.key),
377
- className: ve({
378
- state: x ? "active" : "idle"
379
- }),
380
- children: /* @__PURE__ */ n("span", { children: c.label })
381
- },
382
- c.key
383
- );
384
- const b = x ? ` (${p.length})` : "";
385
- return /* @__PURE__ */ g(G.Root, { children: [
386
- /* @__PURE__ */ n(G.Trigger, { asChild: !0, children: /* @__PURE__ */ g(
387
- "button",
388
- {
389
- type: "button",
390
- "aria-label": `${c.label}${b}`,
391
- className: ve({
392
- state: x ? "active" : "idle"
393
- }),
394
- children: [
395
- /* @__PURE__ */ g("span", { children: [
396
- c.label,
397
- b
398
- ] }),
399
- /* @__PURE__ */ n(
400
- tt,
401
- {
402
- "aria-hidden": "true",
403
- className: "ds:size-3.5 ds:shrink-0"
404
- }
405
- )
406
- ]
407
- }
408
- ) }),
409
- /* @__PURE__ */ n(G.Content, { sideOffset: 8, align: "start", children: c.options.map((w) => /* @__PURE__ */ n(
410
- G.CheckboxItem,
411
- {
412
- checked: p.includes(w.value),
413
- onSelect: (S) => {
414
- c.multi && S.preventDefault(), l(c, w.value);
415
- },
416
- children: w.label
417
- },
418
- w.value
419
- )) })
420
- ] }, c.key);
421
- }),
422
- o ? /* @__PURE__ */ n(
423
- "button",
424
- {
425
- type: "button",
426
- onClick: () => {
427
- i({}), U("serp_filter_changed", { key: "*", values: [] });
428
- },
429
- className: cn(),
430
- children: r("practiceResults.filters.clear")
431
- }
432
- ) : null
433
- ]
434
- }
435
- );
436
- }
437
- function Me({ value: e, options: t, onChange: i }) {
438
- const { t: s } = L("ui"), r = (a) => {
439
- switch (a) {
440
- case "distance":
441
- return s("practiceResults.sort.distance");
442
- case "rating":
443
- return s("practiceResults.sort.rating");
444
- case "next-available":
445
- return s("practiceResults.sort.nextAvailable");
446
- case "price":
447
- return s("practiceResults.sort.price");
448
- case "relevance":
449
- default:
450
- return s("practiceResults.sort.relevance");
451
- }
452
- };
453
- return /* @__PURE__ */ g(G.Root, { children: [
454
- /* @__PURE__ */ n(G.Trigger, { asChild: !0, children: /* @__PURE__ */ g(
455
- "button",
456
- {
457
- type: "button",
458
- "aria-label": `${s("practiceResults.sort.label")}: ${r(e)}`,
459
- className: ve({ state: "idle" }),
460
- children: [
461
- /* @__PURE__ */ g("span", { children: [
462
- s("practiceResults.sort.label"),
463
- ": ",
464
- r(e)
465
- ] }),
466
- /* @__PURE__ */ n(tt, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" })
467
- ]
468
- }
469
- ) }),
470
- /* @__PURE__ */ n(G.Content, { sideOffset: 8, align: "end", children: /* @__PURE__ */ n(
471
- G.RadioGroup,
472
- {
473
- value: e,
474
- onValueChange: (a) => {
475
- const o = a;
476
- o !== e && (i(o), U("serp_sort_changed", { sort: o }));
477
- },
478
- children: t.map((a) => /* @__PURE__ */ n(G.RadioItem, { value: a, children: r(a) }, a))
479
- }
480
- ) })
481
- ] });
482
- }
483
- function dn({ distanceKm: e }) {
484
- const { t, i18n: i } = L("ui"), s = O(() => {
485
- if (e < 1) return t("practiceResults.distance.below");
486
- const r = new Intl.NumberFormat(i.language, {
487
- maximumFractionDigits: 1
488
- }).format(e);
489
- return t("practiceResults.distance.km", { distance: r });
490
- }, [e, t, i.language]);
491
- return /* @__PURE__ */ n(q, { variant: "neutral", leading: /* @__PURE__ */ n(ge, { "aria-hidden": "true" }), children: s });
492
- }
493
- const Ie = W(
494
- [
495
- "ds:w-[12rem] ds:h-[8rem] ds:shrink-0",
496
- "ds:rounded-[var(--radius-md)] ds:overflow-hidden"
497
- ].join(" "),
498
- {
499
- variants: {
500
- state: {
501
- // Tonal address-block placeholder — renders the MapPin glyph
502
- // + address text on a `--muted` surface. Used when the consumer
503
- // hasn't provided `googleMapsApiKey`; carries the spatial cue
504
- // (location is here, even if we can't draw the map).
505
- placeholder: "ds:flex ds:flex-col ds:items-start ds:justify-end ds:gap-[var(--spacing-2xs)] ds:bg-[var(--muted)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-sm)]",
506
- image: "ds:[object-fit:cover]"
507
- }
508
- },
509
- defaultVariants: { state: "placeholder" }
510
- }
511
- );
512
- function un() {
513
- if (typeof document > "u") return "6761e5";
514
- const e = getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color").trim(), t = /^#?([0-9a-fA-F]{6})$/.exec(e);
515
- return t ? t[1] : "6761e5";
516
- }
517
- function et({
518
- address: e,
519
- addressLang: t
520
- }) {
521
- return /* @__PURE__ */ g(
522
- "div",
523
- {
524
- "aria-hidden": e ? void 0 : "true",
525
- className: Ie({ state: "placeholder" }),
526
- children: [
527
- /* @__PURE__ */ n(ge, { "aria-hidden": "true", className: "ds:size-5 ds:shrink-0" }),
528
- e ? /* @__PURE__ */ n(
529
- "span",
530
- {
531
- lang: t,
532
- dir: "auto",
533
- className: "type-meta ds:[overflow-wrap:anywhere]",
534
- children: e
535
- }
536
- ) : null
537
- ]
538
- }
539
- );
540
- }
541
- function mn({
542
- image: e,
543
- apiKey: t,
544
- center: i,
545
- zoom: s = 14,
546
- address: r,
547
- addressLang: a
548
- }) {
549
- const { t: o } = L("ui"), [m, d] = Z(null);
550
- if (e && m !== e.src)
551
- return /* @__PURE__ */ n(
552
- "img",
553
- {
554
- src: e.src,
555
- srcSet: e.srcSet,
556
- alt: "",
557
- loading: "lazy",
558
- decoding: "async",
559
- width: 240,
560
- height: 160,
561
- onError: () => d(e.src),
562
- className: Ie({ state: "image" })
563
- }
564
- );
565
- if (e)
566
- return /* @__PURE__ */ n(et, { address: r, addressLang: a });
567
- if (!t)
568
- return /* @__PURE__ */ n(et, { address: r, addressLang: a });
569
- const l = un(), c = `https://maps.googleapis.com/maps/api/staticmap?center=${i.lat},${i.lng}&zoom=${s}&size=240x160&scale=2&markers=color:0x${l}%7C${i.lat},${i.lng}&key=${encodeURIComponent(t)}`;
570
- return /* @__PURE__ */ n(
571
- "img",
572
- {
573
- src: c,
574
- alt: o("practiceResults.thumbnail.alt"),
575
- loading: "lazy",
576
- decoding: "async",
577
- width: 240,
578
- height: 160,
579
- className: Ie({ state: "image" })
580
- }
581
- );
582
- }
583
- function fn({ tagline: e, lang: t }) {
584
- return e ? /* @__PURE__ */ n(
585
- "span",
586
- {
587
- "data-component": "practice-result-tagline",
588
- lang: t,
589
- dir: "auto",
590
- className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[var(--foreground)]",
591
- children: e
592
- }
593
- ) : null;
594
- }
595
- function pn(e) {
596
- if (typeof e != "string") return;
597
- const t = e.trim().replace(/_/g, "-");
598
- if (t)
599
- try {
600
- return Intl.getCanonicalLocales(t)[0] ? t : void 0;
601
- } catch {
602
- return;
603
- }
604
- }
605
- function lt({
606
- review: e
607
- }) {
608
- const { t } = L("ui"), i = typeof (e == null ? void 0 : e.text) == "string" ? e.text.trim() : "";
609
- return !e || !i ? null : /* @__PURE__ */ g(
610
- "p",
611
- {
612
- "data-component": "practice-result-latest-review",
613
- className: "type-body-sm ds:m-0 ds:flex ds:min-w-0 ds:gap-[var(--spacing-xs)] ds:text-[var(--muted-foreground)]",
614
- children: [
615
- /* @__PURE__ */ n("span", { className: "ds:shrink-0", children: t("practiceResults.card.latestReview") }),
616
- " ",
617
- /* @__PURE__ */ n(
618
- "span",
619
- {
620
- lang: pn(e.lang),
621
- dir: "auto",
622
- className: "ds:min-w-0 ds:truncate",
623
- children: i
624
- }
625
- )
626
- ]
627
- }
628
- );
629
- }
630
- const hn = W(
631
- "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)] ds:whitespace-pre-line ds:break-words",
632
- {
633
- variants: {
634
- density: {
635
- compact: "ds:line-clamp-2",
636
- rich: "ds:line-clamp-3"
637
- }
638
- },
639
- defaultVariants: { density: "compact" }
640
- }
641
- );
642
- function ct({
643
- description: e,
644
- density: t,
645
- lang: i
646
- }) {
647
- return e ? /* @__PURE__ */ n(
648
- "p",
649
- {
650
- "data-component": "practice-result-description",
651
- lang: i,
652
- dir: "auto",
653
- className: hn({ density: t }),
654
- children: e
655
- }
656
- ) : null;
657
- }
658
- function gn(e, t, i, s) {
659
- if (e.kind === "fixed")
660
- return Kt(
661
- e.minCents,
662
- t,
663
- i,
664
- s("common.freeOfCharge")
665
- );
666
- const r = Je(e.minCents, t, i);
667
- return e.kind === "range" && e.maxCents != null && Number.isFinite(e.maxCents) && e.maxCents > e.minCents ? s("practiceResults.card.priceRange", {
668
- min: r,
669
- max: Je(e.maxCents, t, i)
670
- }) : s("practiceResults.card.priceFrom", { price: r });
671
- }
672
- const vn = W(
673
- "ds:min-w-0 ds:max-w-full ds:[overflow-wrap:anywhere]",
674
- {
675
- variants: {
676
- practiceWritten: { true: "ds:truncate" }
677
- }
678
- }
679
- );
680
- function bn({
681
- price: e,
682
- cents: t,
683
- currencyCode: i = "EUR"
684
- }) {
685
- var p;
686
- const { t: s, i18n: r } = L("ui"), a = e && Number.isFinite(e.minCents) ? e : void 0, o = (a == null ? void 0 : a.kind) ?? "fixed", m = (a == null ? void 0 : a.minCents) ?? t, d = a == null ? void 0 : a.maxCents, l = O(
687
- () => m == null ? void 0 : gn(
688
- { kind: o, minCents: m, maxCents: d },
689
- i,
690
- r.language ?? "en",
691
- s
692
- ),
693
- [o, m, d, i, r.language, s]
694
- );
695
- if (l === void 0) return null;
696
- const c = (p = a == null ? void 0 : a.label) == null ? void 0 : p.trim().replace(/:$/, "").trim(), h = c || s("practiceResults.card.firstVisitPrice");
697
- return /* @__PURE__ */ g(
698
- "span",
699
- {
700
- "data-component": "practice-result-price",
701
- className: "type-body-sm ds:flex ds:min-w-0 ds:max-w-full ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:text-start ds:text-[var(--muted-foreground)] ds:sm:@min-[280px]/result-heading:max-w-[45%] ds:sm:@min-[280px]/result-heading:items-end ds:sm:@min-[280px]/result-heading:text-end",
702
- children: [
703
- /* @__PURE__ */ n(
704
- "span",
705
- {
706
- dir: "auto",
707
- title: h,
708
- className: vn({
709
- practiceWritten: !!c
710
- }),
711
- children: h
712
- }
713
- ),
714
- /* @__PURE__ */ n("span", { className: "ds:sr-only", children: ": " }),
715
- /* @__PURE__ */ n(
716
- q,
717
- {
718
- variant: "accentSoft",
719
- size: "lg",
720
- dir: "auto",
721
- className: "ds:h-auto ds:min-h-6 ds:min-w-0 ds:max-w-full ds:whitespace-normal ds:[overflow-wrap:anywhere]",
722
- children: l
723
- }
724
- )
725
- ]
726
- }
727
- );
728
- }
729
- function Ve({ time: e }) {
730
- const { t } = L("ui");
731
- return /* @__PURE__ */ g("span", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
732
- /* @__PURE__ */ n(
733
- Gt,
734
- {
735
- "aria-hidden": "true",
736
- className: "ds:size-4 ds:text-[var(--primary)]"
737
- }
738
- ),
739
- t("practiceResults.nextSlot.summary", { time: e })
740
- ] });
741
- }
742
- function dt({
743
- result: e,
744
- openLabel: t,
745
- bookLabel: i,
746
- nextSlotText: s,
747
- onOpenClick: r,
748
- onBookClick: a
749
- }) {
750
- const { t: o } = L("ui"), m = e.nextAvailableSlot, d = (m == null ? void 0 : m.bookingHref) ?? e.bookingHref ?? e.href, l = m && s ? o("practiceResults.nextSlot.cta", { time: s }) : i;
751
- return /* @__PURE__ */ g("div", { className: "ds:mt-[var(--spacing-xs)] ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)]", children: [
752
- t !== void 0 ? /* @__PURE__ */ n(he, { intent: "secondary", size: "sm", asChild: !0, onClick: r, children: /* @__PURE__ */ g("a", { href: e.href, "data-component": "practice-result-open-cta", children: [
753
- t,
754
- " ",
755
- /* @__PURE__ */ n("span", { className: "ds:sr-only", children: e.name })
756
- ] }) }) : null,
757
- /* @__PURE__ */ n(
758
- he,
759
- {
760
- intent: "primary",
761
- size: "sm",
762
- asChild: !0,
763
- startIcon: /* @__PURE__ */ n(Zt, { "aria-hidden": "true" }),
764
- onClick: a,
765
- children: /* @__PURE__ */ g(
766
- "a",
767
- {
768
- href: d,
769
- "data-component": "practice-result-book-cta",
770
- "data-slot-aware": m ? "true" : void 0,
771
- children: [
772
- l,
773
- " ",
774
- /* @__PURE__ */ n("span", { className: "ds:sr-only", children: e.name })
775
- ]
776
- }
777
- )
778
- }
779
- )
780
- ] });
781
- }
782
- const ut = W(
783
- [
784
- "ds:@container/result-card ds:relative ds:flex ds:w-full ds:cursor-pointer",
785
- "ds:rounded-[var(--radius-lg)]",
786
- "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
787
- "ds:border ds:border-[color:var(--card-border)]",
788
- "ds:p-[var(--spacing-md)]",
789
- "ds:gap-[var(--spacing-md)]",
790
- "ds:transition-[box-shadow,border-color] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
791
- "ds:hover:shadow-[var(--shadow-md)]",
792
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
793
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
794
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
795
- // Use `data-highlighted` for the pin↔card sync visual so consumers
796
- // can override (e.g. dim siblings) without fighting the kit.
797
- "ds:data-[highlighted=true]:border-[color:var(--primary)]",
798
- "ds:data-[highlighted=true]:shadow-[var(--shadow-md)]",
799
- // HTP-7323: the card chosen by a pin click. Stronger than the hover
800
- // highlight: a brand border (one extra ring, no layout shift), a tinted
801
- // surface and the "Selected on the map" tag.
802
- "ds:data-[selected=true]:border-[color:var(--primary)]",
803
- "ds:data-[selected=true]:bg-[var(--primary-soft)]",
804
- "ds:data-[selected=true]:shadow-[0_0_0_1px_var(--primary),var(--shadow-md)]",
805
- // Extra room above the card when a pin click scrolls it to the top, for a
806
- // sticky header other than PublicHeader (which already sets the page's
807
- // `scroll-padding-block-start`). Default 0, so nothing is counted twice.
808
- "ds:[scroll-margin-block-start:var(--practice-results-scroll-offset,0)]",
809
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
810
- ].join(" "),
811
- {
812
- variants: {
813
- density: {
814
- compact: "",
815
- rich: "ds:p-[var(--spacing-lg)] ds:gap-[var(--spacing-lg)]"
816
- }
817
- },
818
- defaultVariants: { density: "compact" }
819
- }
820
- ), xn = W([
821
- "ds:text-[var(--foreground)] ds:no-underline ds:hover:underline",
822
- "ds:rounded-[var(--radius-xs)]",
823
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
824
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
825
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
826
- ]);
827
- function wn({
828
- result: e,
829
- headingLevel: t
830
- }) {
831
- const i = `h${$e(t)}`;
832
- return /* @__PURE__ */ n(
833
- i,
834
- {
835
- id: `practice-result-${e.id}-name`,
836
- dir: "auto",
837
- className: "type-title-card ds:m-0 ds:min-w-0 ds:[overflow-wrap:anywhere] ds:text-[var(--foreground)]",
838
- children: /* @__PURE__ */ n(
839
- "a",
840
- {
841
- href: e.href,
842
- dir: "auto",
843
- "data-component": "practice-result-name-link",
844
- className: xn(),
845
- children: e.name
846
- }
847
- )
848
- }
849
- );
850
- }
851
- function mt({
852
- result: e,
853
- headingLevel: t,
854
- selected: i = !1
855
- }) {
856
- var r, a;
857
- const { t: s } = L("ui");
858
- return /* @__PURE__ */ n(
859
- "div",
860
- {
861
- "data-component": "practice-result-heading",
862
- className: "ds:@container/result-heading ds:min-w-0 ds:flex-1",
863
- children: /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:sm:@min-[280px]/result-heading:flex-row ds:sm:@min-[280px]/result-heading:gap-[var(--spacing-md)]", children: [
864
- /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:w-full ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
865
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
866
- /* @__PURE__ */ n(wn, { result: e, headingLevel: t }),
867
- ((r = e.location) == null ? void 0 : r.distanceKm) != null ? /* @__PURE__ */ n(dn, { distanceKm: e.location.distanceKm }) : null,
868
- i ? /* @__PURE__ */ n(
869
- q,
870
- {
871
- variant: "brand",
872
- "data-component": "practice-result-selected-tag",
873
- leading: /* @__PURE__ */ n(ge, { "aria-hidden": "true" }),
874
- children: s("practiceResults.selectedOnMap")
875
- }
876
- ) : null
877
- ] }),
878
- e.subtitle ? /* @__PURE__ */ n("span", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: e.subtitle }) : null,
879
- /* @__PURE__ */ n(fn, { tagline: e.tagline, lang: e.contentLang }),
880
- (a = e.location) != null && a.address ? /* @__PURE__ */ g(
881
- "span",
882
- {
883
- "data-component": "practice-result-address",
884
- className: "type-meta ds:text-[var(--muted-foreground)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]",
885
- children: [
886
- /* @__PURE__ */ n(ge, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }),
887
- /* @__PURE__ */ n(
888
- "span",
889
- {
890
- lang: e.contentLang,
891
- dir: "auto",
892
- className: "ds:min-w-0 ds:[overflow-wrap:anywhere]",
893
- children: e.location.address
894
- }
895
- )
896
- ]
897
- }
898
- ) : null
899
- ] }),
900
- /* @__PURE__ */ n(
901
- bn,
902
- {
903
- price: e.firstVisitPrice,
904
- cents: e.firstVisitPriceCents,
905
- currencyCode: e.currencyCode
906
- }
907
- )
908
- ] })
909
- }
910
- );
911
- }
912
- function ft(e) {
913
- const t = e.target.closest(
914
- 'a, button, [role="button"], input, select, textarea, label'
915
- );
916
- return t !== null && t !== e.currentTarget && e.currentTarget.contains(t);
917
- }
918
- function be() {
919
- return !(typeof window.matchMedia == "function" && !window.matchMedia("(hover: hover)").matches);
920
- }
921
- function pt(e) {
922
- if (e)
923
- return (t) => {
924
- const i = document.activeElement;
925
- i && t.currentTarget.contains(i) && Fe(i) || e();
926
- };
927
- }
928
- function ht(e) {
929
- if (e)
930
- return (t) => {
931
- t.currentTarget.contains(t.relatedTarget) || e();
932
- };
933
- }
934
- function yn({
935
- result: e,
936
- headingLevel: t,
937
- highlighted: i,
938
- selected: s = !1,
939
- onSelect: r,
940
- onOpenClick: a,
941
- onHover: o,
942
- onLeave: m,
943
- density: d = "compact",
944
- openLabel: l,
945
- bookLabel: c,
946
- onBookClick: h,
947
- nextSlotText: p,
948
- maxInsuranceChips: x = 3,
949
- maxLanguageChips: b = 4,
950
- children: w
951
- }) {
952
- var v, D, Q, ee;
953
- const { t: S, i18n: M } = L("ui"), k = e.rating, I = (((v = e.languages) == null ? void 0 : v.length) ?? 0) > 0, P = (((D = e.insurances) == null ? void 0 : D.length) ?? 0) > 0, f = e.specializedInFearPatients, N = I || P || f, F = (e.languages ?? []).slice(0, b), V = (((Q = e.languages) == null ? void 0 : Q.length) ?? 0) - F.length, K = (e.insurances ?? []).slice(0, x), z = (((ee = e.insurances) == null ? void 0 : ee.length) ?? 0) - K.length;
954
- return (
955
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events -- card is role="group" by design (axe nested-interactive); click handler is mouse-only sync.
956
- /* @__PURE__ */ g(
957
- "div",
958
- {
959
- "data-component": "practice-result-card",
960
- "data-result-id": e.id,
961
- "data-highlighted": i ? "true" : "false",
962
- "data-selected": s ? "true" : "false",
963
- role: "group",
964
- "aria-labelledby": `practice-result-${e.id}-name`,
965
- onClick: (_) => {
966
- ft(_) || r();
967
- },
968
- onMouseEnter: () => o(be()),
969
- onFocus: (_) => o(Fe(_.target)),
970
- onMouseLeave: pt(m),
971
- onBlur: ht(m),
972
- className: ut({ density: d }),
973
- children: [
974
- /* @__PURE__ */ n(
975
- He,
976
- {
977
- src: e.imageUrl,
978
- alt: e.imageAlt,
979
- name: e.name,
980
- size: "lg",
981
- shape: "rounded",
982
- ratio: "4:3",
983
- width: 64,
984
- height: 48
985
- }
986
- ),
987
- /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
988
- /* @__PURE__ */ n(
989
- mt,
990
- {
991
- result: e,
992
- headingLevel: t,
993
- selected: s
994
- }
995
- ),
996
- k && k.count > 0 ? /* @__PURE__ */ n(
997
- _e,
998
- {
999
- value: k.value,
1000
- reviews: { count: k.count },
1001
- size: "sm"
1002
- }
1003
- ) : null,
1004
- /* @__PURE__ */ n(lt, { review: e.latestReview }),
1005
- N ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1006
- F.map((_) => /* @__PURE__ */ n(
1007
- q,
1008
- {
1009
- variant: "neutral",
1010
- leading: /* @__PURE__ */ n(nt, { "aria-hidden": "true" }),
1011
- children: st(_, S, M)
1012
- },
1013
- `lang-${_}`
1014
- )),
1015
- V > 0 ? /* @__PURE__ */ n(q, { variant: "neutral", children: `+${V}` }) : null,
1016
- K.map((_) => /* @__PURE__ */ n(
1017
- q,
1018
- {
1019
- variant: "info",
1020
- leading: /* @__PURE__ */ n(at, { "aria-hidden": "true" }),
1021
- children: _
1022
- },
1023
- `ins-${_}`
1024
- )),
1025
- z > 0 ? /* @__PURE__ */ n(q, { variant: "neutral", children: `+${z}` }) : null,
1026
- f ? /* @__PURE__ */ n(q, { variant: "info", leading: /* @__PURE__ */ n(it, { "aria-hidden": "true" }), children: S("practiceResults.fearPatient.label") }) : null
1027
- ] }) : null,
1028
- /* @__PURE__ */ n(
1029
- ct,
1030
- {
1031
- description: e.description,
1032
- density: "compact",
1033
- lang: e.contentLang
1034
- }
1035
- ),
1036
- e.nextAvailableSlot && p ? /* @__PURE__ */ n(Ve, { time: p }) : null,
1037
- w,
1038
- /* @__PURE__ */ n(
1039
- dt,
1040
- {
1041
- result: e,
1042
- openLabel: l,
1043
- bookLabel: c,
1044
- nextSlotText: p,
1045
- onOpenClick: a,
1046
- onBookClick: h
1047
- }
1048
- )
1049
- ] })
1050
- ]
1051
- }
1052
- )
1053
- );
1054
- }
1055
- function kn({
1056
- result: e,
1057
- headingLevel: t,
1058
- apiKey: i,
1059
- highlighted: s,
1060
- selected: r = !1,
1061
- onSelect: a,
1062
- onOpenClick: o,
1063
- onBookClick: m,
1064
- onHover: d,
1065
- onLeave: l,
1066
- openLabel: c,
1067
- bookLabel: h
1068
- }) {
1069
- var I, P;
1070
- const { t: p, i18n: x } = L("ui"), b = O(() => {
1071
- if (e.nextAvailableSlot)
1072
- try {
1073
- return new Intl.DateTimeFormat(x.language, {
1074
- weekday: "short",
1075
- hour: "numeric",
1076
- minute: "numeric"
1077
- }).format(new Date(e.nextAvailableSlot.dateTime));
1078
- } catch {
1079
- return e.nextAvailableSlot.dateTime;
1080
- }
1081
- }, [e.nextAvailableSlot, x.language]), w = (((I = e.languages) == null ? void 0 : I.length) ?? 0) > 0, S = (((P = e.insurances) == null ? void 0 : P.length) ?? 0) > 0, M = e.specializedInFearPatients, k = w || S || M;
1082
- return (
1083
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events -- card is role="group" by design (axe nested-interactive); click handler is mouse-only sync.
1084
- /* @__PURE__ */ g(
1085
- "div",
1086
- {
1087
- "data-component": "practice-result-card",
1088
- "data-result-id": e.id,
1089
- "data-density": "rich",
1090
- "data-highlighted": s ? "true" : "false",
1091
- "data-selected": r ? "true" : "false",
1092
- role: "group",
1093
- "aria-labelledby": `practice-result-${e.id}-name`,
1094
- onClick: (f) => {
1095
- ft(f) || a();
1096
- },
1097
- onMouseEnter: () => d(be()),
1098
- onFocus: (f) => d(Fe(f.target)),
1099
- onMouseLeave: pt(l),
1100
- onBlur: ht(l),
1101
- className: ut({ density: "rich" }),
1102
- children: [
1103
- e.location ? /* @__PURE__ */ n("div", { className: "ds:hidden ds:@min-[640px]/result-card:block", children: /* @__PURE__ */ n(
1104
- mn,
1105
- {
1106
- image: e.mapImage,
1107
- apiKey: i,
1108
- center: {
1109
- lat: e.location.lat,
1110
- lng: e.location.lng
1111
- },
1112
- address: e.location.address,
1113
- addressLang: e.contentLang
1114
- }
1115
- ) }) : null,
1116
- /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1117
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-md)]", children: [
1118
- /* @__PURE__ */ n(
1119
- He,
1120
- {
1121
- src: e.imageUrl,
1122
- alt: e.imageAlt,
1123
- name: e.name,
1124
- size: "md",
1125
- shape: "rounded",
1126
- ratio: "4:3",
1127
- width: 53,
1128
- height: 40
1129
- }
1130
- ),
1131
- /* @__PURE__ */ n(
1132
- mt,
1133
- {
1134
- result: e,
1135
- headingLevel: t,
1136
- selected: r
1137
- }
1138
- )
1139
- ] }),
1140
- e.rating && e.rating.count > 0 ? /* @__PURE__ */ n(
1141
- _e,
1142
- {
1143
- value: e.rating.value,
1144
- reviews: { count: e.rating.count },
1145
- size: "md"
1146
- }
1147
- ) : null,
1148
- /* @__PURE__ */ n(lt, { review: e.latestReview }),
1149
- k ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1150
- w ? (e.languages ?? []).map((f) => /* @__PURE__ */ n(
1151
- q,
1152
- {
1153
- variant: "neutral",
1154
- leading: /* @__PURE__ */ n(nt, { "aria-hidden": "true" }),
1155
- children: st(f, p, x)
1156
- },
1157
- `lang-${f}`
1158
- )) : null,
1159
- S ? (e.insurances ?? []).map((f) => /* @__PURE__ */ n(
1160
- q,
1161
- {
1162
- variant: "info",
1163
- leading: /* @__PURE__ */ n(at, { "aria-hidden": "true" }),
1164
- children: f
1165
- },
1166
- `ins-${f}`
1167
- )) : null,
1168
- M ? /* @__PURE__ */ n(q, { variant: "info", leading: /* @__PURE__ */ n(it, { "aria-hidden": "true" }), children: p("practiceResults.fearPatient.label") }) : null
1169
- ] }) : null,
1170
- /* @__PURE__ */ n(
1171
- ct,
1172
- {
1173
- description: e.description,
1174
- density: "rich",
1175
- lang: e.contentLang
1176
- }
1177
- ),
1178
- e.nextAvailableSlot && b ? /* @__PURE__ */ n(Ve, { time: b }) : null,
1179
- /* @__PURE__ */ n(
1180
- dt,
1181
- {
1182
- result: e,
1183
- openLabel: c,
1184
- bookLabel: h,
1185
- nextSlotText: b,
1186
- onOpenClick: o,
1187
- onBookClick: m
1188
- }
1189
- )
1190
- ] })
1191
- ]
1192
- }
1193
- )
1194
- );
1195
- }
1196
- function Be({
1197
- results: e,
1198
- headingLevel: t,
1199
- hoveredId: i,
1200
- selectedId: s,
1201
- softId: r,
1202
- onCardHover: a,
1203
- onCardLeave: o,
1204
- onCardSelect: m,
1205
- onCardOpenClick: d,
1206
- onCardBookClick: l,
1207
- openLabel: c,
1208
- bookLabel: h,
1209
- formatNextSlot: p,
1210
- onLoadMore: x,
1211
- loadingMore: b,
1212
- loadingSkeletons: w,
1213
- density: S = "compact",
1214
- apiKey: M,
1215
- containerRef: k
1216
- }) {
1217
- const { t: I } = L("ui"), P = T(null);
1218
- return J(() => {
1219
- if (!x) return;
1220
- const f = P.current;
1221
- if (!f || typeof IntersectionObserver > "u") return;
1222
- const N = new IntersectionObserver(
1223
- (F) => {
1224
- for (const V of F)
1225
- V.isIntersecting && (U("serp_load_more", {
1226
- currentCount: e.length
1227
- }), x());
1228
- },
1229
- { root: null, rootMargin: "200px" }
1230
- );
1231
- return N.observe(f), () => N.disconnect();
1232
- }, [x, e.length]), w ? /* @__PURE__ */ n(
1233
- "div",
1234
- {
1235
- role: "status",
1236
- "aria-live": "polite",
1237
- "aria-label": I("practiceResults.loading"),
1238
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1239
- children: Array.from({ length: 4 }).map((f, N) => /* @__PURE__ */ n(
1240
- $t,
1241
- {
1242
- variant: "rounded",
1243
- height: S === "rich" ? "11rem" : "7rem"
1244
- },
1245
- `pr-skel-${N}`
1246
- ))
1247
- }
1248
- ) : /* @__PURE__ */ g(
1249
- "div",
1250
- {
1251
- ref: k,
1252
- "data-component": "practice-results-list",
1253
- role: "list",
1254
- "aria-label": I("practiceResults.list.label"),
1255
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:overflow-y-auto",
1256
- children: [
1257
- e.map((f) => /* @__PURE__ */ n("div", { role: "listitem", children: S === "rich" ? /* @__PURE__ */ n(
1258
- kn,
1259
- {
1260
- result: f,
1261
- headingLevel: t,
1262
- apiKey: M,
1263
- highlighted: i === f.id || s === f.id || r === f.id,
1264
- selected: s === f.id,
1265
- onSelect: () => m(f.id),
1266
- onOpenClick: () => d(f.id),
1267
- onBookClick: () => l(f.id),
1268
- onHover: (N) => a(f.id, N),
1269
- onLeave: o,
1270
- openLabel: c,
1271
- bookLabel: h
1272
- }
1273
- ) : /* @__PURE__ */ n(
1274
- yn,
1275
- {
1276
- result: f,
1277
- headingLevel: t,
1278
- highlighted: i === f.id || s === f.id || r === f.id,
1279
- selected: s === f.id,
1280
- onSelect: () => m(f.id),
1281
- onOpenClick: () => d(f.id),
1282
- onBookClick: () => l(f.id),
1283
- onHover: (N) => a(f.id, N),
1284
- onLeave: o,
1285
- openLabel: c,
1286
- bookLabel: h,
1287
- nextSlotText: p(f)
1288
- }
1289
- ) }, f.id)),
1290
- x ? /* @__PURE__ */ n(
1291
- "div",
1292
- {
1293
- ref: P,
1294
- "aria-hidden": "true",
1295
- className: "ds:flex ds:items-center ds:justify-center ds:py-[var(--spacing-md)]",
1296
- children: b ? /* @__PURE__ */ n(zt, { size: "md", variant: "pulse" }) : /* @__PURE__ */ n("span", { className: "ds:size-1" })
1297
- }
1298
- ) : null
1299
- ]
1300
- }
1301
- );
1302
- }
1303
- function Cn({
1304
- result: e,
1305
- nextSlotText: t
1306
- }) {
1307
- const i = e.rating;
1308
- return /* @__PURE__ */ g(
1309
- "div",
1310
- {
1311
- "data-component": "practice-result-map-card",
1312
- className: "ds:flex ds:[inline-size:16rem] ds:max-w-full ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--card-border)] ds:bg-[var(--card)] ds:p-[var(--spacing-sm)] ds:text-[var(--card-foreground)] ds:shadow-[var(--shadow-lg)]",
1313
- children: [
1314
- /* @__PURE__ */ n(
1315
- He,
1316
- {
1317
- src: e.imageUrl,
1318
- name: e.name,
1319
- size: "lg",
1320
- shape: "rounded",
1321
- ratio: "4:3",
1322
- width: 64,
1323
- height: 48
1324
- }
1325
- ),
1326
- /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1327
- /* @__PURE__ */ n(
1328
- "span",
1329
- {
1330
- dir: "auto",
1331
- className: "type-title-card ds:min-w-0 ds:[overflow-wrap:anywhere] ds:text-[var(--foreground)]",
1332
- children: e.name
1333
- }
1334
- ),
1335
- i && i.count > 0 ? /* @__PURE__ */ n(
1336
- _e,
1337
- {
1338
- value: i.value,
1339
- reviews: { count: i.count },
1340
- size: "sm"
1341
- }
1342
- ) : null,
1343
- e.nextAvailableSlot && t ? /* @__PURE__ */ n(Ve, { time: t }) : null
1344
- ] })
1345
- ]
1346
- }
1347
- );
1348
- }
1349
- function Ae({
1350
- results: e,
1351
- searchCentre: t,
1352
- zoom: i,
1353
- apiKey: s,
1354
- mapId: r,
1355
- clusterMarkers: a,
1356
- hoveredId: o,
1357
- selectedId: m,
1358
- onMapClick: d,
1359
- showMarkerCard: l = !1,
1360
- formatNextSlot: c,
1361
- onPinHoverChange: h,
1362
- onPinClick: p,
1363
- onPinHover: x,
1364
- onPinFirstInteract: b,
1365
- onBoundsChange: w,
1366
- consentGranted: S,
1367
- onConsentRequest: M,
1368
- staticPreview: k,
1369
- mapHandleRef: I
1370
- }) {
1371
- const { t: P } = L("ui"), f = O(
1372
- () => e.filter(
1373
- (v) => !!v.location
1374
- ).map((v) => ({
1375
- id: v.id,
1376
- position: {
1377
- lat: v.location.lat,
1378
- lng: v.location.lng
1379
- },
1380
- label: v.name
1381
- })),
1382
- [e]
1383
- ), N = O(
1384
- () => f.map((v) => ({ ...v.position, id: v.id })),
1385
- [f]
1386
- ), F = O(
1387
- () => f.map((v) => v.id).sort().join("|"),
1388
- [f]
1389
- ), V = O(() => {
1390
- if (t) return t;
1391
- const v = rn(e);
1392
- return v ? {
1393
- lat: (v.north + v.south) / 2,
1394
- lng: (v.east + v.west) / 2
1395
- } : { lat: 45.4642, lng: 9.19 };
1396
- }, [e, t]), K = O(
1397
- () => l ? (v) => {
1398
- const D = e.find((Q) => Q.id === v);
1399
- return D ? /* @__PURE__ */ n(
1400
- Cn,
1401
- {
1402
- result: D,
1403
- nextSlotText: c == null ? void 0 : c(D)
1404
- }
1405
- ) : null;
1406
- } : void 0,
1407
- [l, c, e]
1408
- ), z = H(
1409
- (v, { userInteraction: D }) => {
1410
- w == null || w(v), D && U("serp_map_panned", { bounds: v });
1411
- },
1412
- [w]
1413
- );
1414
- return /* @__PURE__ */ n(
1415
- "div",
1416
- {
1417
- "data-component": "practice-results-map-panel",
1418
- className: "ds:relative ds:flex ds:size-full ds:min-h-[24rem] ds:flex-col",
1419
- children: /* @__PURE__ */ n(
1420
- Dt,
1421
- {
1422
- ref: I,
1423
- apiKey: s ?? "",
1424
- mapId: r,
1425
- clusterMarkers: a,
1426
- center: V,
1427
- zoom: i,
1428
- markers: f,
1429
- fitToPoints: N,
1430
- fitKey: F,
1431
- selectedMarkerId: m,
1432
- hoveredMarkerId: o,
1433
- renderMarkerCard: K,
1434
- onMarkerHover: l ? h : void 0,
1435
- consentGranted: !!S,
1436
- staticPreview: k,
1437
- onConsentRequest: M,
1438
- onBoundsChange: z,
1439
- onClusterClick: ({ count: v }) => U("serp_map_cluster_clicked", { count: v }),
1440
- onMarkerClick: (v) => {
1441
- if (v == null) {
1442
- d();
1443
- return;
1444
- }
1445
- x(v), b(v), p(v);
1446
- },
1447
- ariaLabel: P("practiceResults.map.label"),
1448
- size: "fill",
1449
- surface: "bordered",
1450
- className: "ds:size-full"
1451
- }
1452
- )
1453
- }
1454
- );
1455
- }
1456
- function De({
1457
- variantBodyProps: e
1458
- }) {
1459
- const {
1460
- facets: t,
1461
- value: i,
1462
- sortOptions: s,
1463
- onChange: r,
1464
- heading: a,
1465
- intro: o,
1466
- totalCount: m,
1467
- searchCentre: d
1468
- } = e;
1469
- return !a && !o && m == null && t.length === 0 && s.length === 0 ? null : /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1470
- /* @__PURE__ */ n(
1471
- rt,
1472
- {
1473
- heading: a,
1474
- headingLevel: e.headingLevel,
1475
- intro: o,
1476
- totalCount: m,
1477
- searchCentreLabel: d == null ? void 0 : d.label
1478
- }
1479
- ),
1480
- t.length > 0 ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1481
- /* @__PURE__ */ n(
1482
- ot,
1483
- {
1484
- facets: t,
1485
- value: i.facets,
1486
- onChange: (l) => r({ ...i, facets: l })
1487
- }
1488
- ),
1489
- s.length > 0 ? /* @__PURE__ */ n(
1490
- Me,
1491
- {
1492
- options: s,
1493
- value: i.sort ?? "relevance",
1494
- onChange: (l) => r({ ...i, sort: l })
1495
- }
1496
- ) : null
1497
- ] }) : s.length > 0 ? /* @__PURE__ */ n("div", { className: "ds:flex ds:justify-end", children: /* @__PURE__ */ n(
1498
- Me,
1499
- {
1500
- options: s,
1501
- value: i.sort ?? "relevance",
1502
- onChange: (l) => r({ ...i, sort: l })
1503
- }
1504
- ) }) : null
1505
- ] });
1506
- }
1507
- function $e(e) {
1508
- return Math.min(e + 1, 6);
1509
- }
1510
- function ze({
1511
- headingLevel: e
1512
- }) {
1513
- const { t } = L("ui");
1514
- return /* @__PURE__ */ n(
1515
- Bt,
1516
- {
1517
- variant: "no-results",
1518
- headingLevel: $e(e),
1519
- title: t("practiceResults.empty.title"),
1520
- description: t("practiceResults.empty.description")
1521
- }
1522
- );
1523
- }
1524
- function Ee({
1525
- onRetry: e,
1526
- headingLevel: t
1527
- }) {
1528
- const { t: i } = L("ui"), s = $e(t);
1529
- return /* @__PURE__ */ g(pe, { variant: "error", children: [
1530
- /* @__PURE__ */ n(pe.Title, { as: `h${s}`, children: i("practiceResults.error.title") }),
1531
- /* @__PURE__ */ n(pe.Description, { children: i("practiceResults.error.description") }),
1532
- e ? /* @__PURE__ */ n(pe.Action, { children: /* @__PURE__ */ n(
1533
- he,
1534
- {
1535
- intent: "secondary",
1536
- size: "sm",
1537
- startIcon: /* @__PURE__ */ n(Ut, { "aria-hidden": "true" }),
1538
- onClick: e,
1539
- children: i("practiceResults.error.retry")
1540
- }
1541
- ) }) : null
1542
- ] });
1543
- }
1544
- function Rn(e) {
1545
- const {
1546
- results: t,
1547
- apiKey: i,
1548
- mapId: s,
1549
- clusterMarkers: r,
1550
- zoom: a,
1551
- searchCentre: o,
1552
- onLoadMore: m,
1553
- loadingMore: d,
1554
- loadingSkeletons: l,
1555
- emptyResultsSlot: c,
1556
- errorSlot: h,
1557
- error: p,
1558
- onRetry: x,
1559
- hoveredId: b,
1560
- selectedId: w,
1561
- onCardHover: S,
1562
- onPinClick: M,
1563
- consentGranted: k,
1564
- onConsentRequest: I,
1565
- onBoundsChange: P,
1566
- listContainerRef: f
1567
- } = e, { t: N } = L("ui"), [F, V] = Z(!1), K = Oe("(min-width: 1024px)"), z = p ? h ?? /* @__PURE__ */ n(Ee, { onRetry: x, headingLevel: e.headingLevel }) : t.length === 0 && !l ? c ?? /* @__PURE__ */ n(ze, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
1568
- Be,
1569
- {
1570
- results: t,
1571
- headingLevel: e.headingLevel,
1572
- hoveredId: b,
1573
- selectedId: w,
1574
- softId: e.softId,
1575
- onCardHover: S,
1576
- onCardLeave: e.onCardLeave,
1577
- onCardSelect: e.onCardSelect,
1578
- onCardOpenClick: e.onCardOpenClick,
1579
- onCardBookClick: e.onCardBookClick,
1580
- openLabel: e.openLabel,
1581
- bookLabel: e.bookLabel,
1582
- formatNextSlot: e.formatNextSlot,
1583
- onLoadMore: m,
1584
- loadingMore: d,
1585
- loadingSkeletons: l,
1586
- density: "compact",
1587
- containerRef: f
1588
- }
1589
- );
1590
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1591
- /* @__PURE__ */ n(De, { variantBodyProps: e }),
1592
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:lg:grid ds:lg:grid-cols-[55fr_45fr] ds:lg:gap-[var(--spacing-lg)] ds:lg:items-start", children: [
1593
- /* @__PURE__ */ n("div", { className: "ds:min-w-0", children: z }),
1594
- /* @__PURE__ */ n("div", { className: "ds:hidden ds:lg:block ds:sticky ds:top-[var(--spacing-md)] ds:h-[40rem]", children: /* @__PURE__ */ n(
1595
- Ae,
1596
- {
1597
- results: t,
1598
- searchCentre: o,
1599
- zoom: a,
1600
- apiKey: i,
1601
- mapId: s,
1602
- clusterMarkers: r,
1603
- hoveredId: e.mapHoveredId,
1604
- selectedId: e.mapSelectedId,
1605
- onMapClick: e.onMapClick,
1606
- showMarkerCard: K,
1607
- formatNextSlot: e.formatNextSlot,
1608
- onPinHoverChange: e.onPinHoverChange,
1609
- onPinClick: (v) => {
1610
- ae(t, v, "pin", e.onResultSelect), M(v);
1611
- },
1612
- onPinHover: e.onPinHover,
1613
- onPinFirstInteract: e.onPinFirstInteract,
1614
- onBoundsChange: P,
1615
- consentGranted: k,
1616
- staticPreview: e.mapPreview,
1617
- onConsentRequest: I,
1618
- mapHandleRef: e.mapHandleRef
1619
- }
1620
- ) })
1621
- ] }),
1622
- /* @__PURE__ */ n("div", { className: "ds:flex ds:lg:hidden ds:sticky ds:bottom-[var(--spacing-md)] ds:justify-center", children: /* @__PURE__ */ n(
1623
- he,
1624
- {
1625
- intent: "primary",
1626
- size: "md",
1627
- startIcon: /* @__PURE__ */ n(Qt, { "aria-hidden": "true" }),
1628
- onClick: () => V(!0),
1629
- children: N("practiceResults.viewMap")
1630
- }
1631
- ) }),
1632
- /* @__PURE__ */ n(j.Root, { open: F, onOpenChange: V, children: /* @__PURE__ */ g(j.Content, { side: "bottom", size: "lg", children: [
1633
- /* @__PURE__ */ n(j.Header, { children: /* @__PURE__ */ n(j.Title, { children: N("practiceResults.map.label") }) }),
1634
- /* @__PURE__ */ g(j.Body, { children: [
1635
- /* @__PURE__ */ n(j.Description, { className: "ds:sr-only", children: N("practiceResults.sheet.description") }),
1636
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1637
- /* @__PURE__ */ n("div", { className: "ds:h-[24rem]", children: /* @__PURE__ */ n(
1638
- Ae,
1639
- {
1640
- results: t,
1641
- searchCentre: o,
1642
- zoom: a,
1643
- apiKey: i,
1644
- mapId: s,
1645
- clusterMarkers: r,
1646
- hoveredId: e.mapHoveredId,
1647
- selectedId: e.mapSelectedId,
1648
- onMapClick: e.onMapClick,
1649
- onPinClick: (v) => {
1650
- ae(t, v, "pin", e.onResultSelect), M(v);
1651
- },
1652
- onPinHover: e.onPinHover,
1653
- onPinFirstInteract: e.onPinFirstInteract,
1654
- onBoundsChange: P,
1655
- consentGranted: k,
1656
- staticPreview: e.mapPreview,
1657
- onConsentRequest: I,
1658
- mapHandleRef: e.mapHandleRef
1659
- }
1660
- ) }),
1661
- z
1662
- ] })
1663
- ] })
1664
- ] }) })
1665
- ] });
1666
- }
1667
- const Sn = {
1668
- peek: "sm",
1669
- half: "md",
1670
- full: "lg"
1671
- }, Y = [
1672
- "peek",
1673
- "half",
1674
- "full"
1675
- ];
1676
- function Nn({ value: e, onChange: t }) {
1677
- const { t: i, i18n: s } = L("ui"), r = s.dir() === "rtl", a = T(
1678
- /* @__PURE__ */ new Map()
1679
- ), o = H((d) => {
1680
- var l;
1681
- (l = a.current.get(d)) == null || l.focus();
1682
- }, []), m = H(
1683
- (d, l) => {
1684
- const c = Y.indexOf(l), h = Y.length, p = r ? "ArrowLeft" : "ArrowRight", x = r ? "ArrowRight" : "ArrowLeft";
1685
- let b = null;
1686
- switch (d.key) {
1687
- case p:
1688
- case "ArrowDown":
1689
- b = Y[(c + 1) % h];
1690
- break;
1691
- case x:
1692
- case "ArrowUp":
1693
- b = Y[(c - 1 + h) % h];
1694
- break;
1695
- case "Home":
1696
- b = Y[0];
1697
- break;
1698
- case "End":
1699
- b = Y[h - 1];
1700
- break;
1701
- default:
1702
- return;
1703
- }
1704
- d.preventDefault(), b && b !== l && t(b), b && o(b);
1705
- },
1706
- [o, r, t]
1707
- );
1708
- return /* @__PURE__ */ n(
1709
- "div",
1710
- {
1711
- role: "radiogroup",
1712
- "aria-label": i("practiceResults.sheet.snap.label"),
1713
- className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1714
- children: Y.map((d) => {
1715
- const l = e === d;
1716
- return /* @__PURE__ */ n(
1717
- "button",
1718
- {
1719
- ref: (c) => {
1720
- c ? a.current.set(d, c) : a.current.delete(d);
1721
- },
1722
- type: "button",
1723
- role: "radio",
1724
- "aria-checked": l,
1725
- "aria-label": i(`practiceResults.sheet.snap.${d}`),
1726
- tabIndex: l ? 0 : -1,
1727
- onClick: () => t(d),
1728
- onKeyDown: (c) => m(c, d),
1729
- className: ve({
1730
- state: l ? "active" : "idle"
1731
- }),
1732
- children: i(`practiceResults.sheet.snap.${d}`)
1733
- },
1734
- d
1735
- );
1736
- })
1737
- }
1738
- );
1739
- }
1740
- function Ln(e, t, i) {
1741
- const [s, r] = Z(null), [a, o] = Z(null);
1742
- return Te(() => {
1743
- const m = e.current;
1744
- if (!i || !m || typeof window > "u") {
1745
- r(null), o(null);
1746
- return;
1747
- }
1748
- let d = 0, l = null, c = null;
1749
- const h = () => {
1750
- const b = t.current;
1751
- r(b ? b.offsetHeight : null);
1752
- const w = m.querySelector(
1753
- '[data-testid="map-view-preview-plate"]'
1754
- ) ?? m.querySelector(
1755
- '[data-testid="map-view-consent-actions"]'
1756
- );
1757
- if (w !== c && (c && (l == null || l.unobserve(c)), w && (l == null || l.observe(w, { box: "border-box" })), c = w), !w) {
1758
- o(null);
1759
- return;
1760
- }
1761
- const S = w.getBoundingClientRect().bottom;
1762
- if (S <= 0) {
1763
- o(null);
1764
- return;
1765
- }
1766
- const M = window.innerHeight - S - Qe("--spacing-sm", m, 8);
1767
- o(
1768
- Math.max(
1769
- Math.round(M),
1770
- Qe("--min-target-size", m, 44) * 2
1771
- )
1772
- );
1773
- }, p = () => {
1774
- cancelAnimationFrame(d), d = requestAnimationFrame(h);
1775
- };
1776
- l = typeof ResizeObserver > "u" ? null : new ResizeObserver(p), h(), l == null || l.observe(m), t.current && (l == null || l.observe(t.current)), l == null || l.observe(document.body);
1777
- const x = new MutationObserver(p);
1778
- return x.observe(m, { childList: !0, subtree: !0 }), window.addEventListener("resize", p), window.addEventListener("scroll", p, { passive: !0 }), () => {
1779
- cancelAnimationFrame(d), l == null || l.disconnect(), x.disconnect(), window.removeEventListener("resize", p), window.removeEventListener("scroll", p);
1780
- };
1781
- }, [i, e, t]), i ? {
1782
- mapStyle: s === null ? void 0 : {
1783
- "--map-preview-inset-block-start": `calc(var(--spacing-md) + ${s}px + var(--spacing-xs))`
1784
- },
1785
- sheetStyle: a === null ? void 0 : {
1786
- "--map-first-sheet-max-block-size": `${a}px`
1787
- }
1788
- } : {};
1789
- }
1790
- function Pn(e) {
1791
- const {
1792
- results: t,
1793
- apiKey: i,
1794
- mapId: s,
1795
- clusterMarkers: r,
1796
- zoom: a,
1797
- searchCentre: o,
1798
- onLoadMore: m,
1799
- loadingMore: d,
1800
- loadingSkeletons: l,
1801
- emptyResultsSlot: c,
1802
- errorSlot: h,
1803
- error: p,
1804
- onRetry: x,
1805
- hoveredId: b,
1806
- selectedId: w,
1807
- onCardHover: S,
1808
- onPinClick: M,
1809
- consentGranted: k,
1810
- onConsentRequest: I,
1811
- onBoundsChange: P,
1812
- listContainerRef: f,
1813
- facets: N,
1814
- value: F,
1815
- onChange: V
1816
- } = e, { t: K } = L("ui"), [z, v] = Z(
1817
- () => e.mapPreview && !k ? "peek" : "half"
1818
- ), D = T(!1), Q = H((R) => {
1819
- D.current = !0, v(R);
1820
- }, []);
1821
- Te(() => {
1822
- k && !D.current && v((R) => R === "peek" ? "half" : R);
1823
- }, [k]);
1824
- const ee = Sn[z], _ = Oe("(min-width: 1024px)"), se = T(null), re = T(null), te = Ln(
1825
- se,
1826
- re,
1827
- !_ && !!e.mapPreview
1828
- ), oe = p ? h ?? /* @__PURE__ */ n(Ee, { onRetry: x, headingLevel: e.headingLevel }) : t.length === 0 && !l ? c ?? /* @__PURE__ */ n(ze, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
1829
- Be,
1830
- {
1831
- results: t,
1832
- headingLevel: e.headingLevel,
1833
- hoveredId: b,
1834
- selectedId: w,
1835
- softId: e.softId,
1836
- onCardHover: S,
1837
- onCardLeave: e.onCardLeave,
1838
- onCardSelect: e.onCardSelect,
1839
- onCardOpenClick: e.onCardOpenClick,
1840
- onCardBookClick: e.onCardBookClick,
1841
- openLabel: e.openLabel,
1842
- bookLabel: e.bookLabel,
1843
- formatNextSlot: e.formatNextSlot,
1844
- onLoadMore: m,
1845
- loadingMore: d,
1846
- loadingSkeletons: l,
1847
- density: "compact",
1848
- apiKey: i,
1849
- containerRef: f
1850
- }
1851
- ), le = /* @__PURE__ */ n(
1852
- Ae,
1853
- {
1854
- results: t,
1855
- searchCentre: o,
1856
- zoom: a,
1857
- apiKey: i,
1858
- mapId: s,
1859
- clusterMarkers: r,
1860
- hoveredId: e.mapHoveredId,
1861
- selectedId: e.mapSelectedId,
1862
- onMapClick: e.onMapClick,
1863
- showMarkerCard: _,
1864
- formatNextSlot: e.formatNextSlot,
1865
- onPinHoverChange: e.onPinHoverChange,
1866
- onPinClick: (R) => {
1867
- ae(t, R, "pin", e.onResultSelect), M(R);
1868
- },
1869
- onPinHover: e.onPinHover,
1870
- onPinFirstInteract: e.onPinFirstInteract,
1871
- onBoundsChange: P,
1872
- consentGranted: k,
1873
- staticPreview: e.mapPreview,
1874
- onConsentRequest: I,
1875
- mapHandleRef: e.mapHandleRef
1876
- }
1877
- ), xe = N.length > 0 ? /* @__PURE__ */ n(
1878
- "div",
1879
- {
1880
- ref: re,
1881
- className: "ds:absolute ds:start-[var(--spacing-md)] ds:top-[var(--spacing-md)] ds:max-w-[calc(100%-var(--spacing-lg))]",
1882
- children: /* @__PURE__ */ n(
1883
- ot,
1884
- {
1885
- facets: N,
1886
- value: F.facets,
1887
- onChange: (R) => V({ ...F, facets: R }),
1888
- floating: !0
1889
- }
1890
- )
1891
- }
1892
- ) : null;
1893
- return /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: _ ? (
1894
- // Desktop: 65/35 map left + cards rail right. NO Sheet (the
1895
- // Sheet would portal to body and occlude the desktop layout
1896
- // regardless of the parent's `lg:hidden` class).
1897
- //
1898
- // 0.33.8: filters move from floating-over-the-map to an
1899
- // inline `<HeaderRow>` above the grid (parity with
1900
- // split-list-map). Floating chips read as ad-hoc on a real
1901
- // Google tile and are easy to miss; an inline row sits in
1902
- // the visual flow as a deliberate refinement control.
1903
- //
1904
- // 0.33.8: dropped `h-[calc(100dvh - chrome)] min-h-[40rem]`
1905
- // on both columns + `overflow-y-auto` on the list rail. The
1906
- // viewport-fill + internal scroll created a double-scroll
1907
- // experience — patients scrolled the page AND the rail. Now
1908
- // the map column is `lg:sticky lg:h-[44rem]` (stays visible
1909
- // as the patient scrolls cards) and the rail renders at
1910
- // natural height. Single page scroll.
1911
- /* @__PURE__ */ g(Tt, { children: [
1912
- /* @__PURE__ */ n(De, { variantBodyProps: e }),
1913
- /* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-[65fr_35fr] ds:gap-[var(--spacing-lg)] ds:items-start", children: [
1914
- /* @__PURE__ */ n("div", { className: "ds:sticky ds:top-[var(--spacing-md)] ds:h-[44rem]", children: le }),
1915
- /* @__PURE__ */ n("div", { className: "ds:min-w-0", children: oe })
1916
- ] })
1917
- ] })
1918
- ) : (
1919
- // Mobile: full-bleed map + persistent bottom sheet defaulting to
1920
- // 'half' state. No X close button — the sheet is core to the
1921
- // layout, not dismissible. Patient cycles peek / half / full
1922
- // via the snap radiogroup at the top of the sheet body. Filters
1923
- // stay floating on mobile — the full-bleed map IS the viewport
1924
- // chrome, so floating chips are the only place for them.
1925
- /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1926
- /* @__PURE__ */ n(
1927
- rt,
1928
- {
1929
- heading: e.heading,
1930
- headingLevel: e.headingLevel,
1931
- intro: e.intro,
1932
- totalCount: e.totalCount,
1933
- searchCentreLabel: o == null ? void 0 : o.label
1934
- }
1935
- ),
1936
- /* @__PURE__ */ g(
1937
- "div",
1938
- {
1939
- ref: se,
1940
- className: "ds:relative ds:h-[60vh] ds:min-h-[20rem]",
1941
- style: te.mapStyle,
1942
- children: [
1943
- le,
1944
- xe
1945
- ]
1946
- }
1947
- ),
1948
- /* @__PURE__ */ n(j.Root, { open: !0, modal: !1, children: /* @__PURE__ */ n(
1949
- j.Content,
1950
- {
1951
- side: "bottom",
1952
- size: ee,
1953
- className: "ds:max-h-[var(--map-first-sheet-max-block-size,100dvh)] ds:[&_[data-radix-scroll-area-viewport]]:overscroll-contain",
1954
- style: te.sheetStyle,
1955
- onEscapeKeyDown: (R) => R.preventDefault(),
1956
- onPointerDownOutside: (R) => R.preventDefault(),
1957
- onInteractOutside: (R) => R.preventDefault(),
1958
- onOpenAutoFocus: (R) => R.preventDefault(),
1959
- children: /* @__PURE__ */ g(j.Body, { children: [
1960
- /* @__PURE__ */ n(j.Description, { className: "ds:sr-only", children: K("practiceResults.sheet.descriptionMapFirst") }),
1961
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: [
1962
- /* @__PURE__ */ n(j.Title, { className: "type-title-card ds:m-0 ds:text-[var(--foreground)]", children: K("practiceResults.sheet.title", {
1963
- count: e.totalCount ?? t.length
1964
- }) }),
1965
- /* @__PURE__ */ n(
1966
- Nn,
1967
- {
1968
- value: z,
1969
- onChange: Q
1970
- }
1971
- )
1972
- ] }),
1973
- e.sortOptions.length > 0 ? /* @__PURE__ */ n("div", { className: "ds:pb-[var(--spacing-sm)]", children: /* @__PURE__ */ n(
1974
- Me,
1975
- {
1976
- options: e.sortOptions,
1977
- value: F.sort ?? "relevance",
1978
- onChange: (R) => V({ ...F, sort: R })
1979
- }
1980
- ) }) : null,
1981
- oe
1982
- ] })
1983
- }
1984
- ) })
1985
- ] })
1986
- ) });
1987
- }
1988
- function Mn(e) {
1989
- const {
1990
- results: t,
1991
- apiKey: i,
1992
- onLoadMore: s,
1993
- loadingMore: r,
1994
- loadingSkeletons: a,
1995
- emptyResultsSlot: o,
1996
- errorSlot: m,
1997
- error: d,
1998
- onRetry: l,
1999
- hoveredId: c,
2000
- selectedId: h,
2001
- onCardHover: p,
2002
- listContainerRef: x
2003
- } = e, b = d ? m ?? /* @__PURE__ */ n(Ee, { onRetry: l, headingLevel: e.headingLevel }) : t.length === 0 && !a ? o ?? /* @__PURE__ */ n(ze, { headingLevel: e.headingLevel }) : /* @__PURE__ */ n(
2004
- Be,
2005
- {
2006
- results: t,
2007
- headingLevel: e.headingLevel,
2008
- hoveredId: c,
2009
- selectedId: h,
2010
- softId: e.softId,
2011
- onCardHover: p,
2012
- onCardLeave: e.onCardLeave,
2013
- onCardSelect: e.onCardSelect,
2014
- onCardOpenClick: e.onCardOpenClick,
2015
- onCardBookClick: e.onCardBookClick,
2016
- openLabel: e.openLabel,
2017
- bookLabel: e.bookLabel,
2018
- formatNextSlot: e.formatNextSlot,
2019
- onLoadMore: s,
2020
- loadingMore: r,
2021
- loadingSkeletons: a,
2022
- density: "rich",
2023
- apiKey: i,
2024
- containerRef: x
2025
- }
2026
- );
2027
- return /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2028
- /* @__PURE__ */ n(De, { variantBodyProps: e }),
2029
- b
2030
- ] });
2031
- }
2032
- const In = Ot(function({
2033
- variant: t = "split-list-map",
2034
- results: i,
2035
- contentLang: s,
2036
- totalCount: r,
2037
- searchCentre: a,
2038
- facets: o,
2039
- googleMapsApiKey: m,
2040
- mapId: d,
2041
- clusterMarkers: l = "auto",
2042
- defaultZoom: c = Xt,
2043
- onBoundsChange: h,
2044
- consentGranted: p,
2045
- onConsentRequest: x,
2046
- skipConsentGate: b = !1,
2047
- mapPreview: w,
2048
- onLoadMore: S,
2049
- loadingMore: M,
2050
- value: k,
2051
- onChange: I,
2052
- sortOptions: P,
2053
- onResultSelect: f,
2054
- loading: N,
2055
- emptyResultsSlot: F,
2056
- errorSlot: V,
2057
- error: K,
2058
- onRetry: z,
2059
- heading: v,
2060
- headingLevel: D = 2,
2061
- intro: Q,
2062
- cardOpenButtonLabel: ee,
2063
- cardBookButtonLabel: _,
2064
- showCardOpenButton: se = !0,
2065
- "aria-label": re,
2066
- id: te,
2067
- className: oe,
2068
- ...le
2069
- }, xe) {
2070
- const { t: R, i18n: Ke } = L("ui"), [ie, $] = Z(null), [je, ne] = Z(null), [we, E] = Z(null), [ye, gt] = Z(null), B = Oe("(min-width: 1024px)"), ce = T(/* @__PURE__ */ new Set()), ke = T(/* @__PURE__ */ new Set()), vt = T(null), de = T(null), Ce = O(
2071
- () => ({
2072
- getVariant: () => t,
2073
- scrollToResult: (u) => {
2074
- const C = de.current;
2075
- if (!C) return;
2076
- const y = C.querySelector(
2077
- `[data-component="practice-result-card"][data-result-id="${CSS.escape(u)}"]`
2078
- );
2079
- y && (y.scrollIntoView({ behavior: "smooth", block: "nearest" }), B || $(null), E(u));
2080
- },
2081
- focusPin: (u) => {
2082
- B && t !== "rich-cards" ? (E(null), ne(u)) : (B || $(null), E(u));
2083
- }
2084
- }),
2085
- [t, B]
2086
- );
2087
- Vt(xe, () => Ce, [Ce]), jt(Jt, Ce, te);
2088
- const bt = se ? ee ?? R("practiceResults.card.open") : void 0, xt = _ ?? R("practiceResults.card.book"), wt = H(
2089
- (u) => {
2090
- if (u.nextAvailableSlot)
2091
- try {
2092
- return new Intl.DateTimeFormat(Ke.language, {
2093
- weekday: "short",
2094
- hour: "numeric",
2095
- minute: "numeric"
2096
- }).format(new Date(u.nextAvailableSlot.dateTime));
2097
- } catch {
2098
- return u.nextAvailableSlot.dateTime;
2099
- }
2100
- },
2101
- [Ke.language]
2102
- ), qe = T(null);
2103
- J(() => {
2104
- qe.current !== t && (qe.current = t, U("serp_variant_exposed", {
2105
- variant: t,
2106
- totalCount: r ?? i.length
2107
- }), ce.current = /* @__PURE__ */ new Set(), ke.current = /* @__PURE__ */ new Set());
2108
- }, [t]);
2109
- const Re = T(!1), Se = O(
2110
- () => en(o ?? [], i, k.facets),
2111
- [o, i, k.facets]
2112
- ), ue = O(
2113
- () => P ? Xe.filter((u) => P.includes(u)) : Xe,
2114
- [P]
2115
- ), me = a ? "distance" : "relevance", Ue = k.sort ?? me, Ne = ue.includes(Ue) ? Ue : ue.includes(me) ? me : ue[0] ?? me, A = O(() => {
2116
- const u = tn(i, k.facets, Se);
2117
- return sn(u, Ne, a);
2118
- }, [i, k.facets, Se, Ne, a]), yt = O(
2119
- () => s ? A.map(
2120
- (u) => u.contentLang ? u : { ...u, contentLang: s }
2121
- ) : A,
2122
- [A, s]
2123
- );
2124
- J(() => {
2125
- const u = A.length === 0;
2126
- u && !Re.current ? (U("serp_empty_results", {
2127
- appliedFacets: k.facets ?? {}
2128
- }), Re.current = !0) : u || (Re.current = !1);
2129
- }, [A.length, k.facets]), J(() => {
2130
- const u = new Set(A.map((y) => y.id)), C = (y) => y !== null && u.has(y) ? y : null;
2131
- $(C), ne(C), E(C);
2132
- }, [A]), J(() => {
2133
- $(null), ne(null), E(null);
2134
- }, [t]);
2135
- const X = T(null), Ge = T(null);
2136
- J(
2137
- () => () => {
2138
- X.current && clearTimeout(X.current);
2139
- },
2140
- []
2141
- );
2142
- const Le = H((u) => {
2143
- ce.current.has(u) || Ge.current === u && X.current || (X.current && clearTimeout(X.current), Ge.current = u, X.current = setTimeout(() => {
2144
- ce.current.has(u) || (ce.current.add(u), U("serp_result_hovered_card", { resultId: u })), X.current = null;
2145
- }, 500));
2146
- }, []), kt = H(
2147
- (u, C) => {
2148
- Le(u), C && ($(u), E(null));
2149
- },
2150
- [Le]
2151
- ), Ct = H(() => $(null), []);
2152
- J(() => {
2153
- if (ie === null) return;
2154
- const u = (C) => {
2155
- C.key === "Escape" && $(null);
2156
- };
2157
- return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
2158
- }, [ie]);
2159
- const Rt = H(
2160
- (u, C, y) => {
2161
- if (!C) {
2162
- $((fe) => fe === u ? null : fe);
2163
- return;
2164
- }
2165
- B && (y === "pointer" && !be() || ($(u), E(null)));
2166
- },
2167
- [B]
2168
- ), Ze = T(B);
2169
- J(() => {
2170
- Ze.current && !B && $(null), Ze.current = B;
2171
- }, [B]);
2172
- const St = H(() => {
2173
- ne(null), E(null);
2174
- }, []), Nt = H(
2175
- (u) => {
2176
- var C;
2177
- if (!B) {
2178
- const y = (C = de.current) == null ? void 0 : C.querySelector(
2179
- `[data-component="practice-result-card"][data-result-id="${CSS.escape(u)}"]`
2180
- );
2181
- $(null), E(u), y == null || y.scrollIntoView({ behavior: "smooth", block: "nearest" });
2182
- return;
2183
- }
2184
- E(null), ne(u), gt((y) => ({ id: u, n: ((y == null ? void 0 : y.n) ?? 0) + 1 }));
2185
- },
2186
- [B]
2187
- );
2188
- Te(() => {
2189
- if (!ye) return;
2190
- const u = de.current, C = u == null ? void 0 : u.querySelector(
2191
- `[data-component="practice-result-card"][data-result-id="${CSS.escape(ye.id)}"]`
2192
- );
2193
- C == null || C.scrollIntoView({
2194
- behavior: Et(C) ? "instant" : "smooth",
2195
- block: "start"
2196
- });
2197
- }, [ye]);
2198
- const Lt = H((u) => {
2199
- ke.current.has(u) || (ke.current.add(u), U("serp_result_hovered_pin", { resultId: u }));
2200
- }, []), We = T(null), Pt = H(
2201
- (u) => {
2202
- ne(null), be() ? (E(null), $(u)) : ($(null), E(u));
2203
- const C = A.find((y) => y.id === u);
2204
- if (C) {
2205
- if (C.location) {
2206
- const y = We.current;
2207
- y == null || y.panTo({
2208
- lat: C.location.lat,
2209
- lng: C.location.lng
2210
- }), y == null || y.setZoom(16);
2211
- }
2212
- ae(A, u, "card", f);
2213
- }
2214
- },
2215
- [A, f]
2216
- ), Mt = H(
2217
- (u) => {
2218
- ae(
2219
- A,
2220
- u,
2221
- "open-button",
2222
- f
2223
- );
2224
- },
2225
- [A, f]
2226
- ), It = H(
2227
- (u) => {
2228
- ae(
2229
- A,
2230
- u,
2231
- "book-button",
2232
- f
2233
- );
2234
- },
2235
- [A, f]
2236
- ), At = !!N && i.length === 0, Ht = H(
2237
- (u, C) => {
2238
- const y = A.find((fe) => fe.id === u.id);
2239
- f(y ?? u, C);
2240
- },
2241
- [A, f]
2242
- ), Pe = {
2243
- results: yt,
2244
- totalCount: r,
2245
- searchCentre: a,
2246
- facets: Se,
2247
- value: { ...k, sort: Ne },
2248
- sortOptions: ue,
2249
- onChange: I,
2250
- onResultSelect: Ht,
2251
- onLoadMore: S,
2252
- loadingMore: M,
2253
- apiKey: m,
2254
- mapId: d,
2255
- clusterMarkers: l,
2256
- zoom: c,
2257
- // 0.31.4: when `skipConsentGate` is true the kit synthesises
2258
- // `consentGranted=true` for every internal MapView; the consumer's
2259
- // CMP at the page level is responsible for whether the Google Maps
2260
- // loader script is present at all. `onConsentRequest` is dropped
2261
- // because no placeholder renders — nothing to fire it from.
2262
- consentGranted: b ? !0 : p,
2263
- onConsentRequest: b ? void 0 : x,
2264
- mapPreview: w,
2265
- onBoundsChange: h,
2266
- loadingSkeletons: At,
2267
- emptyResultsSlot: F,
2268
- errorSlot: V,
2269
- error: K,
2270
- onRetry: z,
2271
- heading: v,
2272
- headingLevel: D,
2273
- intro: Q,
2274
- hoveredId: ie,
2275
- selectedId: je,
2276
- softId: we,
2277
- mapHoveredId: B ? ie : null,
2278
- mapSelectedId: B ? je ?? we : ie ?? we,
2279
- onCardHover: kt,
2280
- onCardLeave: Ct,
2281
- onPinHover: Le,
2282
- onPinHoverChange: Rt,
2283
- onMapClick: St,
2284
- onPinClick: Nt,
2285
- onPinFirstInteract: Lt,
2286
- onCardSelect: Pt,
2287
- onCardOpenClick: Mt,
2288
- onCardBookClick: It,
2289
- openLabel: bt,
2290
- bookLabel: xt,
2291
- formatNextSlot: wt,
2292
- listContainerRef: vt,
2293
- mapHandleRef: We
2294
- }, Ft = (() => {
2295
- switch (t) {
2296
- case "map-first":
2297
- return /* @__PURE__ */ n(Pn, { ...Pe });
2298
- case "rich-cards":
2299
- return /* @__PURE__ */ n(Mn, { ...Pe });
2300
- case "split-list-map":
2301
- default:
2302
- return /* @__PURE__ */ n(Rn, { ...Pe });
2303
- }
2304
- })(), _t = re ?? R("practiceResults.regionLabel");
2305
- return /* @__PURE__ */ n(
2306
- "div",
2307
- {
2308
- ref: de,
2309
- role: "region",
2310
- "aria-label": _t,
2311
- id: te,
2312
- "data-component": "practice-results",
2313
- "data-component-id": te,
2314
- "data-variant": t,
2315
- className: on({ variant: t, className: oe }),
2316
- ...le,
2317
- children: Ft
2318
- }
2319
- );
2320
- });
2321
- In.displayName = "PracticeResults";
2322
- export {
2323
- In as P,
2324
- Jt as p
2325
- };
2326
- //# sourceMappingURL=practice-results-yCresv86.js.map