@alfadocs/ui-kit 1.116.0 → 1.117.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 (252) hide show
  1. package/dist/_chunks/accessible-target-D3j6F-AG.js +7 -0
  2. package/dist/_chunks/{actions-cell-renderer-DzHxDyI7.js → actions-cell-renderer-DTaIQKp9.js} +3 -3
  3. package/dist/_chunks/{address-autocomplete-DC-H-MZw.js → address-autocomplete-Bnc9ieKO.js} +2 -2
  4. package/dist/_chunks/{address-fields-BFVCtfP2.js → address-fields-RIaGnpnm.js} +2 -2
  5. package/dist/_chunks/{anamnesis-card-Ddnrdfx3.js → anamnesis-card-sUFT0dpF.js} +2 -2
  6. package/dist/_chunks/{anamnesis-summary-card-S1H_AARG.js → anamnesis-summary-card-BtFPpegp.js} +2 -2
  7. package/dist/_chunks/{anamnesis-summary-rows-gEXqU5i5.js → anamnesis-summary-rows-BbAREK-3.js} +5 -5
  8. package/dist/_chunks/{antenatal-schedule-timeline-va9zx7tJ.js → antenatal-schedule-timeline-86YVlMYJ.js} +2 -2
  9. package/dist/_chunks/{appointment-card-BMZoXaGx.js → appointment-card-0PebvrOS.js} +2 -2
  10. package/dist/_chunks/{appointment-peek-B1CCv-7J.js → appointment-peek-DdUhqfEi.js} +2 -2
  11. package/dist/_chunks/{appointment-timeline-0k4LxODn.js → appointment-timeline-CC7nmBOH.js} +3 -3
  12. package/dist/_chunks/{appointment-tray-DIxpgIXM.js → appointment-tray-B04zKY7g.js} +2 -2
  13. package/dist/_chunks/{balance-badge-cell-L7bD0Nsh.js → balance-badge-cell-DPjab0eJ.js} +4 -4
  14. package/dist/_chunks/{bill-line-table-WEIRDcv6.js → bill-line-table-vCnVo7_a.js} +10 -8
  15. package/dist/_chunks/{bishop-score-QJu-sM1y.js → bishop-score-CKztphVz.js} +2 -2
  16. package/dist/_chunks/{bmi-calculator-BjUfXqcY.js → bmi-calculator-rri5vvMt.js} +2 -2
  17. package/dist/_chunks/{button-group-BvU9vRnX.js → button-group-B2MJo0Se.js} +2 -2
  18. package/dist/_chunks/{calendar-appointment-editor-dialog-DqZMb4yd.js → calendar-appointment-editor-dialog-BEmBcb61.js} +13 -13
  19. package/dist/_chunks/{card-DVO3x8E-.js → card-n6W6LW-N.js} +78 -47
  20. package/dist/_chunks/{care-plan-card-CfV8jiF0.js → care-plan-card-bGTIliXc.js} +2 -2
  21. package/dist/_chunks/{care-plan-entry-card-Bt01kyTl.js → care-plan-entry-card-cdojypxu.js} +2 -2
  22. package/dist/_chunks/{chart-BSx8cfMm.js → chart-Aue_2dMb.js} +2 -2
  23. package/dist/_chunks/{clinical-note-card-Zz5_GEz-.js → clinical-note-card-DHn5W_bv.js} +2 -2
  24. package/dist/_chunks/{connection-status-DjarASoU.js → connection-status-DWClakYw.js} +2 -2
  25. package/dist/_chunks/{contact-card-Cv-Nwvac.js → contact-card-CGpbYuxl.js} +2 -2
  26. package/dist/_chunks/{contact-profile-card-BRCHbQ3-.js → contact-profile-card-BubJPyRB.js} +2 -2
  27. package/dist/_chunks/{cycle-calculator-Brd0PP4U.js → cycle-calculator-C8nWAeTk.js} +2 -2
  28. package/dist/_chunks/{dashboard-grid-3aidD-IQ.js → dashboard-grid-CaxgaEgI.js} +2 -2
  29. package/dist/_chunks/{data-grid-ByhrYGVw.js → data-grid-DiBSbN2Y.js} +7 -3
  30. package/dist/_chunks/{data-table-B47iw2CO.js → data-table-DhYx-hCD.js} +3 -3
  31. package/dist/_chunks/{date-range-panel-B-DUtfw3.js → date-range-panel-CT6nXjRM.js} +2 -2
  32. package/dist/_chunks/{default-tabs-BQcSqcNG.js → default-tabs-CD285u0C.js} +6 -6
  33. package/dist/_chunks/{document-preview-B_JGHsEW.js → document-preview-BWDTCEHI.js} +3 -3
  34. package/dist/_chunks/{dropdown-menu-Dmbak7q6.js → dropdown-menu-Dw6sgQwJ.js} +86 -74
  35. package/dist/_chunks/{due-date-calculator-DzIQXEX5.js → due-date-calculator-c1NJPw9F.js} +3 -3
  36. package/dist/_chunks/{editable-currency-cell-renderer-p-Q1UkZS.js → editable-currency-cell-renderer-BlK-8A7b.js} +2 -2
  37. package/dist/_chunks/{entity-summary-DGCBQDt1.js → entity-summary-BanguTa6.js} +2 -2
  38. package/dist/_chunks/{face-scheme-CEjJUnNe.js → face-scheme-Bt07zQJU.js} +4 -4
  39. package/dist/_chunks/{fetal-weight-CJTlfh_k.js → fetal-weight-D0KofJJw.js} +2 -2
  40. package/dist/_chunks/{file-manager-DEe51ZDe.js → file-manager-CV1_GtjC.js} +4 -4
  41. package/dist/_chunks/{finished-terminal-BKTFUk3S.js → finished-terminal-FR8uc_Ws.js} +2 -2
  42. package/dist/_chunks/{forgot-password-form-Bc_UPax6.js → forgot-password-form-YvI9vX-G.js} +2 -2
  43. package/dist/_chunks/{gestational-age-calculator-60y1RyQL.js → gestational-age-calculator-Cg4Gq42R.js} +3 -3
  44. package/dist/_chunks/{hcg-doubling-BUZQkSYC.js → hcg-doubling-BjTa_77t.js} +2 -2
  45. package/dist/_chunks/{header-settings-DNgvO8fS.js → header-settings-DsvheAOt.js} +160 -147
  46. package/dist/_chunks/{heatmap-tn1WxoMT.js → heatmap-BurtKmeu.js} +3 -3
  47. package/dist/_chunks/{icon-button-group-Ca2VkXy5.js → icon-button-group-BKtkVZ1W.js} +2 -2
  48. package/dist/_chunks/{kit-extensions-BFfLg7c-.js → kit-extensions-C3oL0WTp.js} +7 -7
  49. package/dist/_chunks/{link-cell-renderer-D-Io828l.js → link-cell-renderer-NFNGdAGt.js} +2 -2
  50. package/dist/_chunks/{login-dev-card-CPndtWdz.js → login-dev-card-Dz3ezx1o.js} +2 -2
  51. package/dist/_chunks/map-view-Frj8vE7n.js +1105 -0
  52. package/dist/_chunks/{maps-core-gate-DkNqGkm3.js → maps-core-gate-Dgs7jXxy.js} +6 -6
  53. package/dist/_chunks/{marketplace-app-shell-CBHNg8x-.js → marketplace-app-shell-BOBWmzoT.js} +6 -6
  54. package/dist/_chunks/{muscle-scheme-7UsRsCHP.js → muscle-scheme-C9dnSxzw.js} +2 -2
  55. package/dist/_chunks/{notes-panel-DexbfrFo.js → notes-panel-CHR-Jv6N.js} +4 -4
  56. package/dist/_chunks/{notification-card-CPW4poUr.js → notification-card-DRMv2_pW.js} +20 -20
  57. package/dist/_chunks/{notification-tray-CQK3lw87.js → notification-tray-mlCfxNRH.js} +2 -2
  58. package/dist/_chunks/{operator-hero-BWayX73x.js → operator-hero-CnfWckNQ.js} +2 -2
  59. package/dist/_chunks/{parts-CtcTW1PN.js → parts-CcyRkB8t.js} +2 -2
  60. package/dist/_chunks/{patient-details-PJ0Y__7t.js → patient-details-C4dHR4iu.js} +2 -2
  61. package/dist/_chunks/{patient-search-Bdx_Ob3y.js → patient-search-D_S7joff.js} +3 -3
  62. package/dist/_chunks/{patient-summary-card-BOfXDP8a.js → patient-summary-card-x0-AhCyC.js} +2 -2
  63. package/dist/_chunks/{payment-automation-upsell-D7yaD4u1.js → payment-automation-upsell-CGdG2Mwk.js} +2 -2
  64. package/dist/_chunks/{payment-request-card-_04afZEx.js → payment-request-card-CEIalOtr.js} +2 -2
  65. package/dist/_chunks/{periodontal-chart-Bjz7O4wT.js → periodontal-chart-DqHrQY4e.js} +2 -2
  66. package/dist/_chunks/{periodontal-chart-card-CxEXHl2x.js → periodontal-chart-card-q9WSHRC2.js} +2 -2
  67. package/dist/_chunks/{periodontal-diagnosis-DnZuZD14.js → periodontal-diagnosis-CJPWluQU.js} +2 -2
  68. package/dist/_chunks/{periodontal-risk-chart-BBPB9wf1.js → periodontal-risk-chart-CKkyOROk.js} +2 -2
  69. package/dist/_chunks/{practice-profile-hero-Cw4NZp0A.js → practice-profile-hero-BFS6lO2a.js} +2 -2
  70. package/dist/_chunks/{practice-results-CrBjScXX.js → practice-results-CzHWprX4.js} +922 -787
  71. package/dist/_chunks/{pregnancy-dating-Bg_VUPwl.js → pregnancy-dating-BO6diQMZ.js} +3 -3
  72. package/dist/_chunks/{pregnancy-weight-gain-B-eXFdmq.js → pregnancy-weight-gain-DkGcEc_l.js} +2 -2
  73. package/dist/_chunks/{privacy-mask-BlJK51MD.js → privacy-mask-DJ1gee4c.js} +2 -2
  74. package/dist/_chunks/{registration-form-DW-0X7S4.js → registration-form-CMXefBnC.js} +2 -2
  75. package/dist/_chunks/{reserved.agent-C1zRHaya.js → reserved.agent-TaZfI3yj.js} +3 -3
  76. package/dist/_chunks/{reset-password-form-C93SH0Tx.js → reset-password-form-D_TePSM1.js} +2 -2
  77. package/dist/_chunks/{reviews-panel-CfJPEkH7.js → reviews-panel-CdHUSndF.js} +2 -2
  78. package/dist/_chunks/{rich-text-editor-r80Zw8ll.js → rich-text-editor-CMPA5Wgy.js} +2 -2
  79. package/dist/_chunks/{row-actions-Df7TJbNR.js → row-actions-Dpf9CrCP.js} +4 -4
  80. package/dist/_chunks/{section-card-DFr2wGal.js → section-card-CYfeQ6EQ.js} +2 -2
  81. package/dist/_chunks/{send-registration-link-form-DWxWa_cJ.js → send-registration-link-form-DuZQuKnI.js} +2 -2
  82. package/dist/_chunks/{signature-request-CgvjLic3.js → signature-request-Dzs0jZsd.js} +2 -2
  83. package/dist/_chunks/{tab-bar-DTn8pHqH.js → tab-bar-CF8R38Og.js} +2 -2
  84. package/dist/_chunks/{tabs-CsmgkiG6.js → tabs-P4qFmxk5.js} +2 -2
  85. package/dist/_chunks/{task-editor-DgUjtqpX.js → task-editor-WdDCqbIL.js} +3 -3
  86. package/dist/_chunks/{tasks-panel-B5Nsf10r.js → tasks-panel-DBSm3WjK.js} +2 -2
  87. package/dist/_chunks/{theme-toggle-DfvdEg_V.js → theme-toggle-CeKl8f_f.js} +3 -3
  88. package/dist/_chunks/{timeline-AMqE-c2T.js → timeline-DXko0M1t.js} +2 -2
  89. package/dist/_chunks/{token-insert-menu-BdcmK5Um.js → token-insert-menu-BrK5NQIq.js} +2 -2
  90. package/dist/_chunks/{toolbar-DbUQBrq4.js → toolbar-z8vXnpXz.js} +3 -3
  91. package/dist/_chunks/{tooth-scheme-LTkT4EXd.js → tooth-scheme-DHRxV2sE.js} +2 -2
  92. package/dist/_chunks/{use-appointment-details-read-_r7cjTtm.js → use-appointment-details-read-B-SXnszJ.js} +8 -8
  93. package/dist/_chunks/{workflow-map-D-u8_YSr.js → workflow-map-DCjkRuS_.js} +3 -3
  94. package/dist/_chunks/{workflow-status-fykpTxfb.js → workflow-status-D0avpoeS.js} +2 -2
  95. package/dist/_chunks/{workflow-webhook-action-DM3W8XZE.js → workflow-webhook-action-dgUjv9T7.js} +3 -3
  96. package/dist/agent-catalog.json +1 -1
  97. package/dist/browser-support.js +2 -0
  98. package/dist/components/_shared/accessible-target.d.ts +7 -0
  99. package/dist/components/_shared/focus-visible.d.ts +8 -0
  100. package/dist/components/address-autocomplete/index.js +1 -1
  101. package/dist/components/address-fields/index.js +1 -1
  102. package/dist/components/anamnesis-card/index.js +1 -1
  103. package/dist/components/anamnesis-summary-card/index.js +1 -1
  104. package/dist/components/appointment-card/index.js +2 -2
  105. package/dist/components/appointment-details-panel/index.js +1 -1
  106. package/dist/components/appointment-peek/index.js +1 -1
  107. package/dist/components/appointment-timeline/index.js +1 -1
  108. package/dist/components/bill-line-table/bill-line-table.columns.d.ts +5 -3
  109. package/dist/components/bill-line-table/bill-line-table.variants.d.ts +3 -1
  110. package/dist/components/bill-line-table/index.js +1 -1
  111. package/dist/components/bill-table/index.js +1 -1
  112. package/dist/components/bishop-score/index.js +1 -1
  113. package/dist/components/bmi-calculator/index.js +1 -1
  114. package/dist/components/booking/index.js +1 -1
  115. package/dist/components/button-group/index.js +1 -1
  116. package/dist/components/card/card.d.ts +9 -2
  117. package/dist/components/card/index.js +1 -1
  118. package/dist/components/care-plan-card/index.js +1 -1
  119. package/dist/components/care-plan-entry-card/index.js +1 -1
  120. package/dist/components/chart/index.js +1 -1
  121. package/dist/components/clinical-note-card/index.js +1 -1
  122. package/dist/components/connection-status/index.js +1 -1
  123. package/dist/components/contact-card/index.js +1 -1
  124. package/dist/components/contact-profile-card/index.js +1 -1
  125. package/dist/components/cycle-calculator/index.js +1 -1
  126. package/dist/components/dashboard-grid/index.js +1 -1
  127. package/dist/components/data-grid/index.js +2 -2
  128. package/dist/components/data-table/index.js +4 -4
  129. package/dist/components/document-preview/index.js +1 -1
  130. package/dist/components/dropdown-menu/index.js +1 -1
  131. package/dist/components/due-date-calculator/index.js +2 -2
  132. package/dist/components/entity-summary/index.js +1 -1
  133. package/dist/components/face-scheme/index.js +1 -1
  134. package/dist/components/fetal-weight/index.js +1 -1
  135. package/dist/components/file-manager/index.js +1 -1
  136. package/dist/components/finished-terminal/index.js +1 -1
  137. package/dist/components/gestational-age-calculator/index.js +1 -1
  138. package/dist/components/hcg-doubling/index.js +1 -1
  139. package/dist/components/header-settings/header-settings.d.ts +7 -3
  140. package/dist/components/header-settings/index.js +1 -1
  141. package/dist/components/heatmap/index.js +1 -1
  142. package/dist/components/icon-button-group/index.js +1 -1
  143. package/dist/components/map-view/index.d.ts +1 -1
  144. package/dist/components/map-view/index.js +1 -1
  145. package/dist/components/map-view/map-view.d.ts +48 -0
  146. package/dist/components/muscle-scheme/index.js +1 -1
  147. package/dist/components/notes-panel/index.js +1 -1
  148. package/dist/components/notification-card/index.js +1 -1
  149. package/dist/components/notification-card/notification-card.d.ts +2 -1
  150. package/dist/components/notification-tray/index.js +1 -1
  151. package/dist/components/operator-hero/index.js +1 -1
  152. package/dist/components/patient-details/index.js +1 -1
  153. package/dist/components/patient-search/index.js +1 -1
  154. package/dist/components/patient-summary-card/index.js +1 -1
  155. package/dist/components/patient-table/index.js +1 -1
  156. package/dist/components/payment-card/index.js +1 -1
  157. package/dist/components/periodontal-chart/index.js +1 -1
  158. package/dist/components/periodontal-chart-card/index.js +1 -1
  159. package/dist/components/periodontal-diagnosis/index.js +1 -1
  160. package/dist/components/periodontal-risk-chart/index.js +1 -1
  161. package/dist/components/practice-profile-hero/index.js +1 -1
  162. package/dist/components/practice-results/index.js +1 -1
  163. package/dist/components/practice-results/practice-results.d.ts +20 -0
  164. package/dist/components/pregnancy-dating/index.js +1 -1
  165. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  166. package/dist/components/reviews-panel/index.js +1 -1
  167. package/dist/components/rich-text-editor/index.js +2 -2
  168. package/dist/components/row-actions/index.js +1 -1
  169. package/dist/components/section-card/index.js +1 -1
  170. package/dist/components/skeleton-scheme/index.js +1 -1
  171. package/dist/components/tab-bar/index.js +1 -1
  172. package/dist/components/tabs/index.js +1 -1
  173. package/dist/components/task-editor/index.js +1 -1
  174. package/dist/components/tasks-panel/index.js +1 -1
  175. package/dist/components/theme-toggle/index.js +1 -1
  176. package/dist/components/timeline/index.js +1 -1
  177. package/dist/components/token-insert-menu/index.js +1 -1
  178. package/dist/components/tooth-scheme/index.js +1 -1
  179. package/dist/components/workflow/index.js +1 -1
  180. package/dist/components/workflow-status/index.js +1 -1
  181. package/dist/core.css +1 -1
  182. package/dist/host-compat.css +4 -1
  183. package/dist/i18n/locales/ar.d.ts +14 -0
  184. package/dist/i18n/locales/ar.js +14 -0
  185. package/dist/i18n/locales/de.d.ts +14 -0
  186. package/dist/i18n/locales/de.js +14 -0
  187. package/dist/i18n/locales/el.d.ts +14 -0
  188. package/dist/i18n/locales/el.js +14 -0
  189. package/dist/i18n/locales/en.d.ts +14 -0
  190. package/dist/i18n/locales/en.js +14 -0
  191. package/dist/i18n/locales/es.d.ts +14 -0
  192. package/dist/i18n/locales/es.js +14 -0
  193. package/dist/i18n/locales/fr.d.ts +14 -0
  194. package/dist/i18n/locales/fr.js +14 -0
  195. package/dist/i18n/locales/hi.d.ts +14 -0
  196. package/dist/i18n/locales/hi.js +14 -0
  197. package/dist/i18n/locales/it.d.ts +14 -0
  198. package/dist/i18n/locales/it.js +14 -0
  199. package/dist/i18n/locales/ja.d.ts +14 -0
  200. package/dist/i18n/locales/ja.js +14 -0
  201. package/dist/i18n/locales/nl.d.ts +14 -0
  202. package/dist/i18n/locales/nl.js +14 -0
  203. package/dist/i18n/locales/pl.d.ts +14 -0
  204. package/dist/i18n/locales/pl.js +14 -0
  205. package/dist/i18n/locales/pt.d.ts +14 -0
  206. package/dist/i18n/locales/pt.js +14 -0
  207. package/dist/i18n/locales/ro.d.ts +14 -0
  208. package/dist/i18n/locales/ro.js +14 -0
  209. package/dist/i18n/locales/ru.d.ts +14 -0
  210. package/dist/i18n/locales/ru.js +14 -0
  211. package/dist/i18n/locales/sq.d.ts +14 -0
  212. package/dist/i18n/locales/sq.js +14 -0
  213. package/dist/i18n/locales/sv.d.ts +14 -0
  214. package/dist/i18n/locales/sv.js +14 -0
  215. package/dist/i18n/locales/tr.d.ts +14 -0
  216. package/dist/i18n/locales/tr.js +14 -0
  217. package/dist/i18n/locales/zh.d.ts +14 -0
  218. package/dist/i18n/locales/zh.js +14 -0
  219. package/dist/index.js +89 -89
  220. package/dist/locales/ar.json +14 -0
  221. package/dist/locales/de.json +14 -0
  222. package/dist/locales/el.json +14 -0
  223. package/dist/locales/en.json +14 -0
  224. package/dist/locales/es.json +14 -0
  225. package/dist/locales/fr.json +14 -0
  226. package/dist/locales/hi.json +14 -0
  227. package/dist/locales/it.json +14 -0
  228. package/dist/locales/ja.json +14 -0
  229. package/dist/locales/nl.json +14 -0
  230. package/dist/locales/pl.json +14 -0
  231. package/dist/locales/pt.json +14 -0
  232. package/dist/locales/ro.json +14 -0
  233. package/dist/locales/ru.json +14 -0
  234. package/dist/locales/sq.json +14 -0
  235. package/dist/locales/sv.json +14 -0
  236. package/dist/locales/tr.json +14 -0
  237. package/dist/locales/zh.json +14 -0
  238. package/dist/patterns/anamnesis/index.js +1 -1
  239. package/dist/patterns/calendar/index.js +1 -1
  240. package/dist/patterns/forgot-password-form/index.js +1 -1
  241. package/dist/patterns/login-form/index.js +1 -1
  242. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  243. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  244. package/dist/patterns/registration-form/index.js +1 -1
  245. package/dist/patterns/reset-password-form/index.js +1 -1
  246. package/dist/patterns/send-registration-link-form/index.js +1 -1
  247. package/dist/patterns/signature-request/index.js +1 -1
  248. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  249. package/dist/tokens.css +1 -1
  250. package/package.json +6 -3
  251. package/dist/_chunks/accessible-target-Bs9ELM3l.js +0 -6
  252. package/dist/_chunks/map-view-Bny79cWa.js +0 -856
@@ -1,856 +0,0 @@
1
- import { jsx as l, jsxs as T } from "react/jsx-runtime";
2
- import { forwardRef as xe, useMemo as V, useRef as k, useId as Ce, useState as N, useEffect as x, useCallback as _, useImperativeHandle as Le, useLayoutEffect as Ee } from "react";
3
- import { createPortal as Ve } from "react-dom";
4
- import { c as S } from "./index-D2ZczOXr.js";
5
- import { useTranslation as q } from "react-i18next";
6
- import { M as Ie, A as Pe, a as _e, b as Te, P as oe, c as Ne, u as Se, d as ie, e as $ } from "./maps-core-gate-DkNqGkm3.js";
7
- import { B as Ge } from "./button-DohK_Ak_.js";
8
- import { S as Re } from "./skeleton-tTWJpvAq.js";
9
- import { V as Ae } from "./visually-hidden-BHxEUGyT.js";
10
- import { E as Ze } from "./error-boundary-tAn_GuCu.js";
11
- import { u as Oe } from "./registry-DvAUVLHh.js";
12
- import { l as je } from "./length-token-DwMnGEYT.js";
13
- import { M as De } from "./map-pin-BaY37-Km.js";
14
- import { E as He } from "./external-link-CY6zAXXU.js";
15
- const $e = {
16
- id: "map-view",
17
- // pan → scroll (viewport move); set_zoom → set_value; select_marker → pick
18
- // (NON-persisting marker focus, no value state slot).
19
- capabilities: ["scroll", "set_value", "pick"],
20
- // Every action routes through the imperative bridge, which only exists
21
- // once the map has loaded: consent granted (the default is
22
- // `consentGranted={false}`) and Google Maps finished loading. Until then
23
- // all three actions are silent no-ops. `consentGranted` says whether the
24
- // gate is passed, and a null `center` after it means the map is still
25
- // loading. `center` / `zoom` are read off the live
26
- // map because Google clamps zoom and animates pans, so requested is not
27
- // applied; `selectedMarkerId` is the only confirmation the host accepted
28
- // a `select_marker` proposal.
29
- //
30
- // A9: marker ids only (`MapMarker.id` is a stable opaque id). Never
31
- // `MapMarker.label`, never the `address` prop (consumer-supplied free
32
- // text, PII in any patient-address deployment), never `apiKey`.
33
- state: {
34
- consentGranted: {
35
- type: "boolean",
36
- descriptionKey: "ui.agent.mapView.state.consentGranted",
37
- description: "True when the GDPR consent gate has been passed. Read this FIRST: while it is false every action is a silent no-op against a placeholder, and nothing else in the surface says so. When it is true but `center` is still null, Google Maps is loading; wait for `center` before acting.",
38
- read: (e) => e.isConsentGranted()
39
- },
40
- markerCount: {
41
- type: "number",
42
- descriptionKey: "ui.agent.mapView.state.markerCount",
43
- description: "Number of markers the consumer passed. Zero means there is nothing for `select_marker` to select. A count only — no ids, labels or positions.",
44
- read: (e) => e.getMarkerCount()
45
- },
46
- selectedMarkerId: {
47
- type: "string | null",
48
- descriptionKey: "ui.agent.mapView.state.selectedMarkerId",
49
- description: "Id of the marker the host currently holds as selected, or null. Selection is fully controlled by the consumer, so `select_marker` only proposes — this slot is the only way to see whether the proposal was accepted.",
50
- read: (e) => e.getSelectedMarkerId()
51
- },
52
- center: {
53
- type: "{ lat: number; lng: number } | null",
54
- descriptionKey: "ui.agent.mapView.state.center",
55
- description: "Live map centre in lat/lng, or null until the map has loaded (consent not granted, or Google Maps still loading). The read-back for `pan_to`, and the sign that the map is ready.",
56
- read: (e) => e.getCenter()
57
- },
58
- zoom: {
59
- type: "number | null",
60
- descriptionKey: "ui.agent.mapView.state.zoom",
61
- description: "Live zoom level, or null until the map has loaded. Google clamps zoom to the map type's range, so this is not necessarily the value last passed to `set_zoom`.",
62
- read: (e) => e.getZoom()
63
- }
64
- },
65
- actions: {
66
- pan_to: {
67
- // Ephemeral viewport move, no data loss → read.
68
- safety: "read",
69
- argsType: "{ position: { lat: number; lng: number } }",
70
- argsSchema: {
71
- type: "object",
72
- properties: {
73
- position: {
74
- type: "object",
75
- properties: {
76
- lat: { type: "number", description: "Latitude in degrees." },
77
- lng: { type: "number", description: "Longitude in degrees." }
78
- },
79
- required: ["lat", "lng"]
80
- }
81
- },
82
- required: ["position"]
83
- },
84
- idempotent: !0,
85
- descriptionKey: "ui.agent.mapView.actions.panTo",
86
- description: "Pan the map to a new centre without changing zoom. Read the `center` slot back to confirm — Google animates the pan, so the applied centre settles after the call.",
87
- errors: [
88
- "Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading)."
89
- ],
90
- invoke: (e, o) => {
91
- e.panTo(o.position);
92
- }
93
- },
94
- set_zoom: {
95
- // Ephemeral viewport zoom, no data loss → read.
96
- safety: "read",
97
- argsType: "{ zoom: number }",
98
- argsSchema: {
99
- type: "object",
100
- properties: {
101
- zoom: {
102
- type: "number",
103
- description: "Zoom level, typical range 1–20."
104
- }
105
- },
106
- required: ["zoom"]
107
- },
108
- idempotent: !0,
109
- descriptionKey: "ui.agent.mapView.actions.setZoom",
110
- description: "Set the map zoom level (typical range 1–20). Read the `zoom` slot back — Google clamps the request to the map type’s supported range, so requested and applied can differ.",
111
- errors: [
112
- "Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).",
113
- "Requested zoom is clamped to the map type's range; `zoom` reports what was actually applied."
114
- ],
115
- invoke: (e, o) => {
116
- e.setZoom(o.zoom);
117
- }
118
- },
119
- select_marker: {
120
- // Ephemeral marker focus, no data loss → read.
121
- safety: "read",
122
- argsType: "{ id: string | null }",
123
- argsSchema: {
124
- type: "object",
125
- properties: {
126
- id: {
127
- type: ["string", "null"],
128
- description: "Marker id to select, or null to clear the selection."
129
- }
130
- },
131
- required: ["id"]
132
- },
133
- idempotent: !0,
134
- descriptionKey: "ui.agent.mapView.actions.selectMarker",
135
- description: "Propose a marker selection by id, or pass null to clear it. Fires the host's `onMarkerClick`; selection is controlled by the host, so read the `selectedMarkerId` slot back to see whether it accepted.",
136
- errors: [
137
- "Silent no-op until the map has loaded: while `consentGranted` is false (only the consent placeholder shows) or while `center` is still null (Google Maps is loading).",
138
- "The host owns `selectedMarkerId` and may ignore the proposal; `selectedMarkerId` is unchanged when it does."
139
- ],
140
- invoke: (e, o) => {
141
- e.selectMarker(o.id);
142
- }
143
- }
144
- },
145
- domHooks: {
146
- root: {
147
- attr: "data-component",
148
- value: "map-view",
149
- description: "Marks the element as a kit MapView."
150
- },
151
- instanceId: {
152
- attr: "data-component-id",
153
- sourceProp: "id",
154
- description: "Sourced from the id prop."
155
- }
156
- }
157
- }, Ke = S(
158
- ["ds:relative ds:overflow-hidden ds:block", "ds:bg-[var(--muted)]"].join(" "),
159
- {
160
- variants: {
161
- size: {
162
- sm: "ds:[--map-block-size:14rem]",
163
- md: "ds:[--map-block-size:20rem]",
164
- lg: "ds:[--map-block-size:28rem]",
165
- // `fill` defers sizing to the parent. The outer takes
166
- // `block-size: 100%` so the inner (also 100%) has something
167
- // to inherit from. Use inside a viewport-locked column —
168
- // `<PracticeResults variant="map-first">` wires this through
169
- // automatically; standalone consumers must give the parent
170
- // a constrained block-size or the map collapses to 0.
171
- fill: "ds:[block-size:100%]"
172
- },
173
- surface: {
174
- bordered: "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
175
- elevated: "ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)] ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)]",
176
- bare: "ds:rounded-none ds:border-0"
177
- }
178
- },
179
- defaultVariants: { size: "md", surface: "bordered" }
180
- }
181
- ), We = S("ds:block ds:w-full", {
182
- variants: {
183
- size: {
184
- sm: "ds:[block-size:var(--map-block-size)]",
185
- md: "ds:[block-size:var(--map-block-size)]",
186
- lg: "ds:[block-size:var(--map-block-size)]",
187
- fill: "ds:[block-size:100%]"
188
- }
189
- },
190
- defaultVariants: { size: "md" }
191
- }), qe = S(
192
- [
193
- "ds:absolute ds:inset-0",
194
- "ds:flex ds:flex-col ds:items-center ds:justify-center",
195
- "ds:gap-[var(--spacing-sm)]",
196
- "ds:p-[var(--spacing-md)]",
197
- "ds:bg-[var(--muted)] ds:text-[var(--foreground)]",
198
- "ds:text-center"
199
- ].join(" ")
200
- ), Be = S("type-heading-3 ds:m-0"), se = S(
201
- "type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0"
202
- );
203
- function Fe({
204
- onHandleReady: e,
205
- onMarkerSelect: o,
206
- onCameraMove: r
207
- }) {
208
- const a = $();
209
- return x(() => {
210
- if (a)
211
- return e({
212
- panTo: (t) => {
213
- r(), a.panTo(t);
214
- },
215
- setZoom: (t) => {
216
- r(), a.setZoom(t);
217
- },
218
- jumpTo: (t, i) => {
219
- r(), a.moveCamera({ center: t, zoom: i });
220
- },
221
- selectMarker: (t) => o(t),
222
- // Read straight off the live map: Google clamps `setZoom` to the
223
- // map type's range and animates `panTo`, so requested and applied
224
- // are not the same value.
225
- getCenter: () => {
226
- var t;
227
- return ((t = a.getCenter()) == null ? void 0 : t.toJSON()) ?? null;
228
- },
229
- getZoom: () => a.getZoom() ?? null
230
- }), () => e(null);
231
- }, [a, e, o, r]), null;
232
- }
233
- function Je({
234
- onBoundsChange: e,
235
- userInteraction: o
236
- }) {
237
- const r = $(), a = k(e);
238
- return a.current = e, x(() => {
239
- if (!r) return;
240
- const t = r.getDiv();
241
- let i = null;
242
- const d = () => {
243
- o.current = {
244
- pendingInput: !1,
245
- moved: !1,
246
- programmatic: !1
247
- };
248
- };
249
- d();
250
- let h;
251
- const u = /* @__PURE__ */ new Set(), m = (n) => {
252
- if (n instanceof PointerEvent && n.pointerType === "touch" && (n.type === "pointerdown" && u.add(n.pointerId), n.type === "pointerup" || n.type === "pointercancel")) {
253
- u.delete(n.pointerId);
254
- return;
255
- }
256
- if (n instanceof PointerEvent && n.type === "pointermove" && n.buttons === 0 && n.pointerType !== "touch" || n instanceof KeyboardEvent && ![
257
- "ArrowUp",
258
- "ArrowDown",
259
- "ArrowLeft",
260
- "ArrowRight",
261
- "+",
262
- "=",
263
- "-",
264
- "_",
265
- "Enter",
266
- " ",
267
- "PageUp",
268
- "PageDown"
269
- ].includes(n.key))
270
- return;
271
- const p = document.fullscreenElement, v = !!(p && (p.contains(t) || t.contains(p)));
272
- let b = n.type === "dblclick";
273
- n instanceof PointerEvent && n.type === "pointermove" && (b = n.pointerType !== "touch" || u.size >= 2 || v), n.type === "touchmove" && (b = n.touches.length >= 2 || v), n instanceof KeyboardEvent && (b = n.key !== "Enter" && n.key !== " "), n instanceof WheelEvent && (b = n.ctrlKey || n.metaKey || v), n.type === "click" && (b = n.target instanceof Element && n.target.closest('button, [role="button"]') != null), b && (o.current.programmatic = !1), o.current.pendingInput = !0, clearTimeout(h), h = setTimeout(() => {
274
- o.current.pendingInput = !1;
275
- }, 250);
276
- }, f = () => {
277
- o.current.pendingInput && !o.current.programmatic && (o.current.moved = !0);
278
- }, g = () => {
279
- var E, P;
280
- const n = (E = r.getBounds()) == null ? void 0 : E.toJSON(), p = (P = r.getCenter()) == null ? void 0 : P.toJSON(), v = r.getZoom(), b = o.current.moved;
281
- if (d(), clearTimeout(h), !n || !p || v == null) return;
282
- const z = !i || Object.keys(n).some(
283
- (G) => n[G] !== i.bounds[G]
284
- ), I = i != null && (v !== i.zoom || p.lat !== i.center.lat || p.lng !== i.center.lng);
285
- i = { bounds: n, center: p, zoom: v }, z && a.current(n, { userInteraction: b && I });
286
- }, c = [
287
- "pointerdown",
288
- "pointermove",
289
- "pointerup",
290
- "pointercancel",
291
- "touchstart",
292
- "touchmove",
293
- "click",
294
- "dblclick",
295
- "wheel",
296
- "keydown"
297
- ];
298
- c.forEach(
299
- (n) => t.addEventListener(n, m, { capture: !0, passive: !0 })
300
- );
301
- const w = [
302
- r.addListener("dragstart", () => {
303
- o.current.programmatic = !1, o.current.moved = !0;
304
- }),
305
- r.addListener("center_changed", f),
306
- r.addListener("zoom_changed", f),
307
- r.addListener("idle", g)
308
- ];
309
- return g(), () => {
310
- w.forEach((n) => n.remove()), c.forEach(
311
- (n) => t.removeEventListener(n, m, !0)
312
- ), clearTimeout(h), d();
313
- };
314
- }, [r, o]), null;
315
- }
316
- function Ue(e, o) {
317
- const r = $(), [a, t] = N(null), { lat: i, lng: d } = o;
318
- return x(() => {
319
- if (!r || typeof r.getCenter != "function") return;
320
- const h = () => {
321
- var p, v;
322
- const m = (p = r.getCenter()) == null ? void 0 : p.toJSON(), f = r.getZoom(), g = (v = r.getDiv) == null ? void 0 : v.call(r);
323
- if (!m || f == null || !g) {
324
- t(null);
325
- return;
326
- }
327
- const c = g.clientWidth, w = g.clientHeight, n = le * 2 ** f;
328
- t({
329
- id: e,
330
- width: c,
331
- height: w,
332
- x: c / 2 + (d - m.lng) / 360 * n,
333
- y: w / 2 - (H(i) - H(m.lat)) * n / (2 * Math.PI)
334
- });
335
- };
336
- h();
337
- const u = ["bounds_changed", "zoom_changed", "center_changed", "idle"].flatMap(
338
- (m) => typeof r.addListener == "function" ? [r.addListener(m, h)] : []
339
- );
340
- return () => u.forEach((m) => m.remove());
341
- }, [r, e, i, d]), (a == null ? void 0 : a.id) === e ? a : null;
342
- }
343
- function Xe({
344
- marker: e,
345
- frame: o,
346
- direction: r,
347
- children: a
348
- }) {
349
- const t = Ue(e.id, e.position);
350
- return !t || !o ? null : Ve(
351
- /* @__PURE__ */ l(et, { anchor: t, direction: r, children: a }),
352
- o
353
- );
354
- }
355
- const Ye = 52, Qe = 12, D = 8;
356
- function et({
357
- anchor: e,
358
- children: o,
359
- direction: r
360
- }) {
361
- const a = k(null), [t, i] = N(
362
- null
363
- );
364
- if (Ee(() => {
365
- const n = a.current;
366
- n && i(
367
- (p) => (p == null ? void 0 : p.width) === n.offsetWidth && p.height === n.offsetHeight ? p : { width: n.offsetWidth, height: n.offsetHeight }
368
- );
369
- }, [o, e.id]), !(e.x >= 0 && e.x <= e.width && e.y >= 0 && e.y <= e.height)) return null;
370
- const h = (t == null ? void 0 : t.width) ?? 0, u = (t == null ? void 0 : t.height) ?? 0, m = Math.max(D, e.width - h - D), f = Math.min(Math.max(e.x - h / 2, D), m), g = e.y - Ye - u, c = g < D, w = c ? e.y + Qe : g;
371
- return (
372
- // The layer is `ltr` because the map is geographic: x is always measured
373
- // from the physical left. The card inside takes the page direction.
374
- /* @__PURE__ */ l(
375
- "div",
376
- {
377
- dir: "ltr",
378
- "aria-hidden": "true",
379
- "data-component": "map-view-marker-card-layer",
380
- className: "ds:pointer-events-none ds:absolute ds:inset-0 ds:overflow-hidden",
381
- children: /* @__PURE__ */ l(
382
- "div",
383
- {
384
- ref: a,
385
- "data-component": "map-view-marker-card",
386
- "data-marker-id": e.id,
387
- "data-placement": c ? "below" : "above",
388
- style: {
389
- "--marker-card-x": `${f}px`,
390
- "--marker-card-y": `${w}px`
391
- },
392
- "data-measured": t ? "true" : "false",
393
- className: "ds:absolute ds:[inset-inline-start:var(--marker-card-x)] ds:[inset-block-start:var(--marker-card-y)] ds:[inline-size:max-content] ds:[max-inline-size:calc(100%-var(--spacing-md))] ds:data-[measured=false]:invisible",
394
- children: /* @__PURE__ */ l("div", { dir: r, children: o })
395
- }
396
- )
397
- }
398
- )
399
- );
400
- }
401
- const le = 256, tt = (e) => e * Math.PI / 180;
402
- function H(e) {
403
- const o = Math.min(Math.max(Math.sin(tt(e)), -0.9999), 0.9999);
404
- return Math.log((1 + o) / (1 - o)) / 2;
405
- }
406
- const nt = (e) => Math.atan(Math.sinh(e)) * 180 / Math.PI;
407
- function rt(e) {
408
- let o = -90, r = 90, a = -180, t = 180;
409
- for (const { lat: i, lng: d } of e)
410
- o = Math.max(o, i), r = Math.min(r, i), a = Math.max(a, d), t = Math.min(t, d);
411
- return { north: o, south: r, east: a, west: t };
412
- }
413
- function ot(e, o, r, a, t) {
414
- const { north: i, south: d, east: h, west: u } = rt(e);
415
- if (i === d && h === u)
416
- return { center: { lat: i, lng: h }, zoom: t };
417
- const m = H(i), f = H(d), g = {
418
- lat: nt((m + f) / 2),
419
- lng: (h + u) / 2
420
- }, c = (n, p) => p > 0 ? Math.log2(Math.max(n, 1) / le / p) : t, w = Math.min(
421
- c(o - 2 * a, (h - u) / 360),
422
- c(r - 2 * a, (m - f) / (2 * Math.PI)),
423
- t
424
- );
425
- return { center: g, zoom: Math.max(0, Math.floor(w)) };
426
- }
427
- const ce = ({ id: e, lat: o, lng: r }) => e != null ? `id:${e}` : `at:${o},${r}`;
428
- function st({
429
- points: e,
430
- fitKey: o,
431
- maxZoom: r,
432
- onCameraMove: a
433
- }) {
434
- const t = $(), i = k(null), d = k(!1), h = k(null);
435
- return x(() => {
436
- if (!t) return;
437
- const u = () => {
438
- var n;
439
- const f = h.current, g = (n = t.getCenter()) == null ? void 0 : n.toJSON(), c = t.getZoom();
440
- f != null && c === f.zoom && g != null && Math.abs(g.lat - f.center.lat) < 1e-6 && Math.abs(g.lng - f.center.lng) < 1e-6 || (d.current = !0);
441
- }, m = [
442
- t.addListener("dragstart", () => {
443
- d.current = !0;
444
- }),
445
- t.addListener("center_changed", u),
446
- t.addListener("zoom_changed", u)
447
- ];
448
- return () => m.forEach((f) => f.remove());
449
- }, [t]), x(() => {
450
- var v;
451
- if (!t) return;
452
- const u = ((v = i.current) == null ? void 0 : v.map) === t ? i.current : null;
453
- if ((u == null ? void 0 : u.key) === o) return;
454
- const m = new Set(e.map(ce)), f = (b, z) => {
455
- h.current = { center: b, zoom: z }, a(), t.moveCamera({ center: b, zoom: z }), d.current = !1;
456
- };
457
- if (e.length === 0) {
458
- i.current = { map: t, key: o, points: m };
459
- return;
460
- }
461
- if (u != null && u.points.size > 0 && [...u.points].every((b) => m.has(b)) && d.current) {
462
- i.current = { map: t, key: o, points: m };
463
- return;
464
- }
465
- const c = t.getDiv();
466
- if (!(c instanceof Element)) return;
467
- const w = () => {
468
- i.current = { map: t, key: o, points: m };
469
- const b = Math.min(
470
- je("--spacing-2xl", c, 48),
471
- c.clientWidth / 4,
472
- c.clientHeight / 4
473
- ), { center: z, zoom: I } = ot(
474
- e,
475
- c.clientWidth,
476
- c.clientHeight,
477
- b,
478
- r
479
- );
480
- f(z, I);
481
- }, n = () => c.clientWidth > 0 && c.clientHeight > 0;
482
- if (n() || typeof ResizeObserver > "u") {
483
- w();
484
- return;
485
- }
486
- const p = new ResizeObserver(() => {
487
- n() && (p.disconnect(), w());
488
- });
489
- return p.observe(c), () => p.disconnect();
490
- }, [t, o, e, r, a]), null;
491
- }
492
- const de = (e) => {
493
- var o, r;
494
- return typeof ((r = (o = globalThis.google) == null ? void 0 : o.maps) == null ? void 0 : r[e]) == "function";
495
- };
496
- function ue() {
497
- const { t: e } = q("ui");
498
- return /* @__PURE__ */ T(
499
- "div",
500
- {
501
- role: "status",
502
- "data-testid": "map-view-loading",
503
- className: "ds:[inline-size:100%] ds:[block-size:100%]",
504
- children: [
505
- /* @__PURE__ */ l(Re, { variant: "rectangular", width: "100%", height: "100%" }),
506
- /* @__PURE__ */ l(Ae, { children: e("common.loading") })
507
- ]
508
- }
509
- );
510
- }
511
- function at({ children: e }) {
512
- const o = Se();
513
- return ie("maps") || !o || de("Map") ? e : /* @__PURE__ */ l(ue, {});
514
- }
515
- function it({ children: e }) {
516
- return ie("marker") || de("Marker") ? e : null;
517
- }
518
- function ae({
519
- address: e,
520
- contentLang: o,
521
- description: r,
522
- onLoadMap: a,
523
- openInGoogleMapsHref: t,
524
- consentCta: i
525
- }) {
526
- const { t: d } = q("ui");
527
- return /* @__PURE__ */ T("div", { className: qe(), "data-testid": "map-view-consent", children: [
528
- /* @__PURE__ */ l(
529
- De,
530
- {
531
- "aria-hidden": "true",
532
- className: "ds:size-6 ds:text-[var(--muted-foreground)]"
533
- }
534
- ),
535
- /* @__PURE__ */ l("p", { className: Be(), children: d("mapView.consentTitle") }),
536
- e ? /* @__PURE__ */ l(
537
- "p",
538
- {
539
- className: se(),
540
- "data-testid": "map-view-address",
541
- lang: o,
542
- children: e
543
- }
544
- ) : null,
545
- /* @__PURE__ */ l("p", { className: se(), children: r }),
546
- /* @__PURE__ */ T("div", { className: "ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center", children: [
547
- i ?? /* @__PURE__ */ l(
548
- Ge,
549
- {
550
- type: "button",
551
- intent: "primary",
552
- size: "sm",
553
- onClick: a,
554
- "data-testid": "map-view-load-cta",
555
- children: d("mapView.consentCta")
556
- }
557
- ),
558
- /* @__PURE__ */ T(
559
- "a",
560
- {
561
- href: t,
562
- target: "_blank",
563
- rel: "noopener noreferrer",
564
- className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary-readable)] ds:underline ds:underline-offset-2",
565
- children: [
566
- d("mapView.openInGoogleMaps"),
567
- /* @__PURE__ */ l(He, { "aria-hidden": "true", className: "ds:size-3" })
568
- ]
569
- }
570
- )
571
- ] })
572
- ] });
573
- }
574
- const lt = xe(
575
- ({
576
- id: e,
577
- apiKey: o,
578
- center: r,
579
- zoom: a = 15,
580
- markers: t,
581
- selectedMarkerId: i,
582
- hoveredMarkerId: d,
583
- renderMarkerCard: h,
584
- onMarkerClick: u,
585
- onBoundsChange: m,
586
- consentGranted: f = !1,
587
- onConsentRequest: g,
588
- address: c,
589
- contentLang: w,
590
- consentDescription: n,
591
- consentCta: p,
592
- mapId: v,
593
- size: b,
594
- surface: z,
595
- ariaLabel: I,
596
- fitToPoints: E,
597
- fitKey: P,
598
- fitMaxZoom: G = 15,
599
- className: pe,
600
- ...me
601
- }, he) => {
602
- const { t: R, i18n: B } = q("ui"), A = V(() => E ?? [], [E]), fe = V(
603
- () => P ?? A.map((s) => `${ce(s)}@${s.lat},${s.lng}`).sort().join("|"),
604
- [P, A]
605
- ), C = A.length > 0, F = k(C), J = Ce(), ge = V(
606
- () => `map-${J.replace(/[^a-zA-Z0-9-_]/g, "")}`,
607
- [J]
608
- ), [U, ye] = N(!1);
609
- x(() => {
610
- if (typeof window > "u") return;
611
- const s = window.matchMedia("(prefers-reduced-motion: reduce)"), y = () => ye(s.matches);
612
- return y(), s.addEventListener("change", y), () => s.removeEventListener("change", y);
613
- }, []);
614
- const X = V(() => `https://www.google.com/maps/search/?api=1&query=${c ? encodeURIComponent(c) : `${r.lat},${r.lng}`}`, [c, r.lat, r.lng]), M = k(null), Y = k({
615
- pendingInput: !1,
616
- moved: !1,
617
- programmatic: !1
618
- }), Z = _(() => {
619
- Y.current = {
620
- pendingInput: !1,
621
- moved: !1,
622
- programmatic: !0
623
- };
624
- }, []), O = _(
625
- (s) => {
626
- Z(), u == null || u(s);
627
- },
628
- [Z, u]
629
- ), [be, ve] = N(null), K = V(
630
- () => d != null && h ? (t ?? []).find((s) => s.id === d) ?? null : null,
631
- [d, h, t]
632
- ), we = _((s) => {
633
- M.current = s;
634
- }, []), Q = k(!1), ee = k(null), te = k(0), j = _(
635
- () => ({
636
- panTo: (s) => {
637
- var y;
638
- return (y = M.current) == null ? void 0 : y.panTo(s);
639
- },
640
- setZoom: (s) => {
641
- var y;
642
- return (y = M.current) == null ? void 0 : y.setZoom(s);
643
- },
644
- selectMarker: (s) => {
645
- var y;
646
- return (y = M.current) == null ? void 0 : y.selectMarker(s);
647
- },
648
- // Without `isConsentGranted` an agent has no way to learn that
649
- // its pan / zoom / select was swallowed by the GDPR gate rather
650
- // than applied: under the default (`consentGranted={false}`) the
651
- // whole Maps subtree is unmounted and every action optional-chains
652
- // into nothing.
653
- isConsentGranted: () => Q.current,
654
- getCenter: () => {
655
- var s;
656
- return ((s = M.current) == null ? void 0 : s.getCenter()) ?? null;
657
- },
658
- getZoom: () => {
659
- var s;
660
- return ((s = M.current) == null ? void 0 : s.getZoom()) ?? null;
661
- },
662
- getSelectedMarkerId: () => ee.current,
663
- getMarkerCount: () => te.current
664
- }),
665
- []
666
- );
667
- Le(he, j, [j]);
668
- const ke = V(
669
- () => j(),
670
- [j]
671
- );
672
- Oe($e, ke, e), x(() => {
673
- var y, L;
674
- const s = F.current && !C;
675
- if (F.current = C, !C) {
676
- if (s) {
677
- (y = M.current) == null || y.jumpTo(r, a);
678
- return;
679
- }
680
- U || (L = M.current) == null || L.panTo(r);
681
- }
682
- }, [r.lat, r.lng, U, C]), x(() => {
683
- var s;
684
- C || (s = M.current) == null || s.setZoom(a);
685
- }, [a, C]);
686
- const [Me, ne] = N(!1), re = f || Me;
687
- Q.current = re, ee.current = i ?? null, te.current = (t ?? []).length;
688
- const ze = _(() => {
689
- if (g) {
690
- g(), ne(!0);
691
- return;
692
- }
693
- ne(!0);
694
- }, [g]);
695
- return /* @__PURE__ */ l(
696
- "div",
697
- {
698
- className: Ke({ size: b, surface: z, className: pe }),
699
- "data-component": "map-view",
700
- "data-component-id": e ?? ge,
701
- role: "region",
702
- "aria-label": I ?? R("mapView.label"),
703
- ...me,
704
- children: /* @__PURE__ */ l(
705
- "div",
706
- {
707
- ref: ve,
708
- className: We({ size: b, className: "ds:relative" }),
709
- children: re ? (
710
- // A provider failure shows the consent placeholder (its "Open in
711
- // Google Maps" link needs no script) with "Load map" as the
712
- // retry, instead of unmounting the host's React tree. The gate
713
- // starts the provider only once Google's `core` and `maps`
714
- // libraries have arrived.
715
- /* @__PURE__ */ l(
716
- Ze,
717
- {
718
- fallback: ({ reset: s }) => /* @__PURE__ */ l(
719
- ae,
720
- {
721
- address: c,
722
- contentLang: w,
723
- description: n ?? R("mapView.consentDescription"),
724
- onLoadMap: s,
725
- consentCta: void 0,
726
- openInGoogleMapsHref: X
727
- }
728
- ),
729
- children: /* @__PURE__ */ l(Ie, { libraries: ["maps"], pending: /* @__PURE__ */ l(ue, {}), children: /* @__PURE__ */ l(
730
- Pe,
731
- {
732
- apiKey: o,
733
- language: B.language,
734
- children: /* @__PURE__ */ l(at, { children: /* @__PURE__ */ T(
735
- _e,
736
- {
737
- defaultCenter: r,
738
- defaultZoom: a,
739
- mapId: v,
740
- gestureHandling: "cooperative",
741
- disableDefaultUI: !1,
742
- onClick: () => O(null),
743
- className: "ds:[inline-size:100%] ds:[block-size:100%]",
744
- children: [
745
- /* @__PURE__ */ l(
746
- Fe,
747
- {
748
- onHandleReady: we,
749
- onMarkerSelect: O,
750
- onCameraMove: Z
751
- }
752
- ),
753
- m ? /* @__PURE__ */ l(
754
- Je,
755
- {
756
- onBoundsChange: m,
757
- userInteraction: Y
758
- }
759
- ) : null,
760
- E ? /* @__PURE__ */ l(
761
- st,
762
- {
763
- points: A,
764
- fitKey: fe,
765
- maxZoom: G,
766
- onCameraMove: Z
767
- }
768
- ) : null,
769
- K && h ? /* @__PURE__ */ l(
770
- Xe,
771
- {
772
- marker: K,
773
- frame: be,
774
- direction: B.dir(),
775
- children: h(K.id)
776
- }
777
- ) : null,
778
- /* @__PURE__ */ l(it, { children: (t ?? []).map((s) => {
779
- const y = i != null && i === s.id, L = d != null && d === s.id, W = R("mapView.markerLabel", {
780
- label: s.label ?? s.id
781
- });
782
- return v ? /* @__PURE__ */ l(
783
- Te,
784
- {
785
- position: s.position,
786
- title: W,
787
- "aria-label": W,
788
- "data-selected": y ? "true" : "false",
789
- "data-hovered": L ? "true" : "false",
790
- zIndex: L ? 1e3 : y ? 500 : void 0,
791
- onClick: () => O(s.id),
792
- children: L ? (
793
- // Hovered pin: larger, deep ink body with a
794
- // white ring. Theme-invariant, because the
795
- // tiles do not follow the kit theme: one of
796
- // body and ring clears 3:1 on any map style.
797
- // Not `--accent`, which failed contrast.
798
- /* @__PURE__ */ l(
799
- oe,
800
- {
801
- scale: 1.4,
802
- background: "var(--map-marker-hover-color)",
803
- borderColor: "var(--map-marker-hover-ring)",
804
- glyphColor: "var(--map-marker-hover-ring)"
805
- }
806
- )
807
- ) : /* @__PURE__ */ l(
808
- oe,
809
- {
810
- background: "var(--primary)",
811
- borderColor: "var(--primary)",
812
- glyphColor: "var(--primary-foreground)"
813
- }
814
- )
815
- },
816
- s.id
817
- ) : /* @__PURE__ */ l(
818
- Ne,
819
- {
820
- position: s.position,
821
- title: W,
822
- zIndex: L ? 1e3 : y ? 500 : void 0,
823
- onClick: () => O(s.id)
824
- },
825
- s.id
826
- );
827
- }) })
828
- ]
829
- }
830
- ) })
831
- }
832
- ) })
833
- }
834
- )
835
- ) : /* @__PURE__ */ l(
836
- ae,
837
- {
838
- address: c,
839
- contentLang: w,
840
- description: n ?? R("mapView.consentDescription"),
841
- onLoadMap: ze,
842
- consentCta: p,
843
- openInGoogleMapsHref: X
844
- }
845
- )
846
- }
847
- )
848
- }
849
- );
850
- }
851
- );
852
- lt.displayName = "MapView";
853
- export {
854
- lt as M
855
- };
856
- //# sourceMappingURL=map-view-Bny79cWa.js.map