@alfadocs/ui-kit-debug 1.128.0 → 1.130.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 (300) hide show
  1. package/dist/_chunks/{appointment-card-0PebvrOS.js → appointment-card-vbUsDh70.js} +49 -72
  2. package/dist/_chunks/appointment-card-vbUsDh70.js.map +1 -0
  3. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js → appointment-timeline-B5pfBl-b.js} +2 -2
  4. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js.map → appointment-timeline-B5pfBl-b.js.map} +1 -1
  5. package/dist/_chunks/{appointment-tray-B04zKY7g.js → appointment-tray-BhiXetjs.js} +2 -2
  6. package/dist/_chunks/{appointment-tray-B04zKY7g.js.map → appointment-tray-BhiXetjs.js.map} +1 -1
  7. package/dist/_chunks/{calendar-_sgjuH3L.js → calendar-DzR-vdJ5.js} +614 -563
  8. package/dist/_chunks/calendar-DzR-vdJ5.js.map +1 -0
  9. package/dist/_chunks/calendar-appointment-editor-dialog-CXch4Pmu.js +13663 -0
  10. package/dist/_chunks/calendar-appointment-editor-dialog-CXch4Pmu.js.map +1 -0
  11. package/dist/_chunks/{calendar-event-card-DXAYWH6k.js → calendar-event-card-BNEzkjm-.js} +142 -132
  12. package/dist/_chunks/calendar-event-card-BNEzkjm-.js.map +1 -0
  13. package/dist/_chunks/{care-plan-card-bGTIliXc.js → care-plan-card-CwgkImOD.js} +2 -2
  14. package/dist/_chunks/{care-plan-card-bGTIliXc.js.map → care-plan-card-CwgkImOD.js.map} +1 -1
  15. package/dist/_chunks/{care-plan-header-k8FslxsU.js → care-plan-header-Dx5OMkc9.js} +2 -2
  16. package/dist/_chunks/{care-plan-header-k8FslxsU.js.map → care-plan-header-Dx5OMkc9.js.map} +1 -1
  17. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js → clinical-note-card-pPaeWWnu.js} +2 -2
  18. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js.map → clinical-note-card-pPaeWWnu.js.map} +1 -1
  19. package/dist/_chunks/{contact-card-CGpbYuxl.js → contact-card-BSY2YpLZ.js} +2 -2
  20. package/dist/_chunks/{contact-card-CGpbYuxl.js.map → contact-card-BSY2YpLZ.js.map} +1 -1
  21. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js → contact-profile-card-CsZNMlws.js} +2 -2
  22. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js.map → contact-profile-card-CsZNMlws.js.map} +1 -1
  23. package/dist/_chunks/contact-round-DiSvB3LP.js +18 -0
  24. package/dist/_chunks/contact-round-DiSvB3LP.js.map +1 -0
  25. package/dist/_chunks/{default-tabs-DOuHEKI5.js → default-tabs-BnB6FUEW.js} +2 -2
  26. package/dist/_chunks/{default-tabs-DOuHEKI5.js.map → default-tabs-BnB6FUEW.js.map} +1 -1
  27. package/dist/_chunks/{entity-summary-BanguTa6.js → entity-summary-KHM0PnSI.js} +56 -68
  28. package/dist/_chunks/entity-summary-KHM0PnSI.js.map +1 -0
  29. package/dist/_chunks/file-pen-line-k4uMBM3h.js +29 -0
  30. package/dist/_chunks/file-pen-line-k4uMBM3h.js.map +1 -0
  31. package/dist/_chunks/{header-settings-DsvheAOt.js → header-settings-ZGvYAuKF.js} +101 -97
  32. package/dist/_chunks/header-settings-ZGvYAuKF.js.map +1 -0
  33. package/dist/_chunks/{info-tip-C-MPkShR.js → info-tip-B3cn3fY2.js} +2 -2
  34. package/dist/_chunks/{info-tip-C-MPkShR.js.map → info-tip-B3cn3fY2.js.map} +1 -1
  35. package/dist/_chunks/{link-DtCfnLnF.js → link-CeV7FoI6.js} +2 -2
  36. package/dist/_chunks/{link-DtCfnLnF.js.map → link-CeV7FoI6.js.map} +1 -1
  37. package/dist/_chunks/{marketplace-app-shell-BOBWmzoT.js → marketplace-app-shell-D_HA8CKx.js} +2 -2
  38. package/dist/_chunks/{marketplace-app-shell-BOBWmzoT.js.map → marketplace-app-shell-D_HA8CKx.js.map} +1 -1
  39. package/dist/_chunks/{nav-grid-D2xVcHTO.js → nav-grid-dEgDAri3.js} +2 -2
  40. package/dist/_chunks/{nav-grid-D2xVcHTO.js.map → nav-grid-dEgDAri3.js.map} +1 -1
  41. package/dist/_chunks/{note-attachment-cnj2JRrg.js → note-attachment-MNTIqdSz.js} +2 -2
  42. package/dist/_chunks/{note-attachment-cnj2JRrg.js.map → note-attachment-MNTIqdSz.js.map} +1 -1
  43. package/dist/_chunks/{note-timeline-BrjHBQfx.js → note-timeline-BQeW0VZY.js} +2 -2
  44. package/dist/_chunks/{note-timeline-BrjHBQfx.js.map → note-timeline-BQeW0VZY.js.map} +1 -1
  45. package/dist/_chunks/{notes-panel-n1JFNQ5u.js → notes-panel-DIY7eNsq.js} +2 -2
  46. package/dist/_chunks/{notes-panel-n1JFNQ5u.js.map → notes-panel-DIY7eNsq.js.map} +1 -1
  47. package/dist/_chunks/{patient-details-Cba9HQj_.js → patient-details-DBtEITfE.js} +2 -2
  48. package/dist/_chunks/{patient-details-Cba9HQj_.js.map → patient-details-DBtEITfE.js.map} +1 -1
  49. package/dist/_chunks/{patient-field-row-CtDihADs.js → patient-field-row-a5d4QijH.js} +2 -2
  50. package/dist/_chunks/{patient-field-row-CtDihADs.js.map → patient-field-row-a5d4QijH.js.map} +1 -1
  51. package/dist/_chunks/{patient-search-D_S7joff.js → patient-search-OAwFgOW3.js} +2 -2
  52. package/dist/_chunks/{patient-search-D_S7joff.js.map → patient-search-OAwFgOW3.js.map} +1 -1
  53. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js → patient-summary-card-BUcZ-gaL.js} +3 -3
  54. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js.map → patient-summary-card-BUcZ-gaL.js.map} +1 -1
  55. package/dist/_chunks/{payment-request-card-CEIalOtr.js → payment-request-card-Dv4WbRBe.js} +2 -2
  56. package/dist/_chunks/{payment-request-card-CEIalOtr.js.map → payment-request-card-Dv4WbRBe.js.map} +1 -1
  57. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js → product-hub-panel-a8wdVOUt.js} +2 -2
  58. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js.map → product-hub-panel-a8wdVOUt.js.map} +1 -1
  59. package/dist/_chunks/{public-footer-C8UIzqLJ.js → public-footer-D0cqScpz.js} +2 -2
  60. package/dist/_chunks/{public-footer-C8UIzqLJ.js.map → public-footer-D0cqScpz.js.map} +1 -1
  61. package/dist/_chunks/{signature-request-Dzs0jZsd.js → signature-request-DW2PSp66.js} +3 -3
  62. package/dist/_chunks/{signature-request-Dzs0jZsd.js.map → signature-request-DW2PSp66.js.map} +1 -1
  63. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js → signed-out-frame-Oa2e1yps.js} +2 -2
  64. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js.map → signed-out-frame-Oa2e1yps.js.map} +1 -1
  65. package/dist/_chunks/task-editor-CVRrDqpe.js +1256 -0
  66. package/dist/_chunks/task-editor-CVRrDqpe.js.map +1 -0
  67. package/dist/_chunks/{toast-BNoN8Qjh.js → toast-DQ1Zu1kk.js} +264 -251
  68. package/dist/_chunks/{toast-BNoN8Qjh.js.map → toast-DQ1Zu1kk.js.map} +1 -1
  69. package/dist/_chunks/{treatment-receipt-1VnuinhY.js → treatment-receipt-BZzwvsnY.js} +73 -56
  70. package/dist/_chunks/treatment-receipt-BZzwvsnY.js.map +1 -0
  71. package/dist/_chunks/use-appointment-details-read-BrykoTOR.js +2475 -0
  72. package/dist/_chunks/use-appointment-details-read-BrykoTOR.js.map +1 -0
  73. package/dist/_chunks/{whatsapp-button-DV9JFmtq.js → whatsapp-button-XbozeDl_.js} +32 -25
  74. package/dist/_chunks/whatsapp-button-XbozeDl_.js.map +1 -0
  75. package/dist/agent-catalog.json +49 -16
  76. package/dist/agent-i18n/en.json +5 -5
  77. package/dist/browser-support.js +1 -1
  78. package/dist/components/_shared/patient-picker.d.ts +10 -0
  79. package/dist/components/_shared/patient-picker.d.ts.map +1 -1
  80. package/dist/components/appointment-card/index.js +2 -2
  81. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +30 -1
  82. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts.map +1 -1
  83. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts +15 -0
  84. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts.map +1 -0
  85. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts +9 -0
  86. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts.map +1 -0
  87. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +12 -3
  88. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts.map +1 -1
  89. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +63 -1
  90. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts.map +1 -1
  91. package/dist/components/appointment-details-panel/index.d.ts +2 -1
  92. package/dist/components/appointment-details-panel/index.d.ts.map +1 -1
  93. package/dist/components/appointment-details-panel/index.js +5 -4
  94. package/dist/components/appointment-timeline/index.js +1 -1
  95. package/dist/components/bill-table/index.js +1 -1
  96. package/dist/components/calendar/calendar.d.ts +22 -0
  97. package/dist/components/calendar/calendar.d.ts.map +1 -1
  98. package/dist/components/calendar/index.js +1 -1
  99. package/dist/components/calendar-event-card/calendar-event-card.d.ts +8 -0
  100. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  101. package/dist/components/calendar-event-card/index.js +1 -1
  102. package/dist/components/care-plan-card/index.js +1 -1
  103. package/dist/components/care-plan-header/index.js +1 -1
  104. package/dist/components/clinical-note-card/index.js +1 -1
  105. package/dist/components/contact-card/index.js +1 -1
  106. package/dist/components/contact-profile-card/index.js +1 -1
  107. package/dist/components/entity-summary/index.js +1 -1
  108. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  109. package/dist/components/header-settings/index.js +1 -1
  110. package/dist/components/info-tip/index.js +1 -1
  111. package/dist/components/link/index.js +1 -1
  112. package/dist/components/nav-grid/index.js +1 -1
  113. package/dist/components/note-timeline/index.js +1 -1
  114. package/dist/components/notes-panel/index.js +1 -1
  115. package/dist/components/patient-details/index.js +1 -1
  116. package/dist/components/patient-search/index.js +1 -1
  117. package/dist/components/patient-summary-card/index.js +1 -1
  118. package/dist/components/payment-card/index.js +1 -1
  119. package/dist/components/product-hub-tray/index.js +1 -1
  120. package/dist/components/public-footer/index.js +1 -1
  121. package/dist/components/task-editor/index.js +1 -1
  122. package/dist/components/toast/index.js +1 -1
  123. package/dist/components/toast/toast.d.ts.map +1 -1
  124. package/dist/components/treatment-receipt/index.d.ts +2 -2
  125. package/dist/components/treatment-receipt/index.d.ts.map +1 -1
  126. package/dist/components/treatment-receipt/index.js +2 -1
  127. package/dist/components/treatment-receipt/treatment-receipt.d.ts +11 -1
  128. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -1
  129. package/dist/components/whatsapp-button/index.js +1 -1
  130. package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
  131. package/dist/core.css +1 -1
  132. package/dist/fullcalendar.css +5 -1
  133. package/dist/host-compat.css +4 -1
  134. package/dist/i18n/locales/ar.d.ts +119 -4
  135. package/dist/i18n/locales/ar.d.ts.map +1 -1
  136. package/dist/i18n/locales/ar.js +130 -15
  137. package/dist/i18n/locales/ar.js.map +1 -1
  138. package/dist/i18n/locales/de.d.ts +119 -4
  139. package/dist/i18n/locales/de.d.ts.map +1 -1
  140. package/dist/i18n/locales/de.js +130 -15
  141. package/dist/i18n/locales/de.js.map +1 -1
  142. package/dist/i18n/locales/el.d.ts +119 -4
  143. package/dist/i18n/locales/el.d.ts.map +1 -1
  144. package/dist/i18n/locales/el.js +130 -15
  145. package/dist/i18n/locales/el.js.map +1 -1
  146. package/dist/i18n/locales/en.d.ts +119 -4
  147. package/dist/i18n/locales/en.d.ts.map +1 -1
  148. package/dist/i18n/locales/en.js +122 -10
  149. package/dist/i18n/locales/en.js.map +1 -1
  150. package/dist/i18n/locales/es.d.ts +119 -4
  151. package/dist/i18n/locales/es.d.ts.map +1 -1
  152. package/dist/i18n/locales/es.js +130 -15
  153. package/dist/i18n/locales/es.js.map +1 -1
  154. package/dist/i18n/locales/fr.d.ts +119 -4
  155. package/dist/i18n/locales/fr.d.ts.map +1 -1
  156. package/dist/i18n/locales/fr.js +130 -15
  157. package/dist/i18n/locales/fr.js.map +1 -1
  158. package/dist/i18n/locales/hi.d.ts +119 -4
  159. package/dist/i18n/locales/hi.d.ts.map +1 -1
  160. package/dist/i18n/locales/hi.js +130 -15
  161. package/dist/i18n/locales/hi.js.map +1 -1
  162. package/dist/i18n/locales/it.d.ts +119 -4
  163. package/dist/i18n/locales/it.d.ts.map +1 -1
  164. package/dist/i18n/locales/it.js +130 -15
  165. package/dist/i18n/locales/it.js.map +1 -1
  166. package/dist/i18n/locales/ja.d.ts +119 -4
  167. package/dist/i18n/locales/ja.d.ts.map +1 -1
  168. package/dist/i18n/locales/ja.js +130 -15
  169. package/dist/i18n/locales/ja.js.map +1 -1
  170. package/dist/i18n/locales/nl.d.ts +119 -4
  171. package/dist/i18n/locales/nl.d.ts.map +1 -1
  172. package/dist/i18n/locales/nl.js +130 -15
  173. package/dist/i18n/locales/nl.js.map +1 -1
  174. package/dist/i18n/locales/pl.d.ts +119 -4
  175. package/dist/i18n/locales/pl.d.ts.map +1 -1
  176. package/dist/i18n/locales/pl.js +130 -15
  177. package/dist/i18n/locales/pl.js.map +1 -1
  178. package/dist/i18n/locales/pt.d.ts +119 -4
  179. package/dist/i18n/locales/pt.d.ts.map +1 -1
  180. package/dist/i18n/locales/pt.js +130 -15
  181. package/dist/i18n/locales/pt.js.map +1 -1
  182. package/dist/i18n/locales/ro.d.ts +119 -4
  183. package/dist/i18n/locales/ro.d.ts.map +1 -1
  184. package/dist/i18n/locales/ro.js +130 -15
  185. package/dist/i18n/locales/ro.js.map +1 -1
  186. package/dist/i18n/locales/ru.d.ts +119 -4
  187. package/dist/i18n/locales/ru.d.ts.map +1 -1
  188. package/dist/i18n/locales/ru.js +130 -15
  189. package/dist/i18n/locales/ru.js.map +1 -1
  190. package/dist/i18n/locales/sq.d.ts +119 -4
  191. package/dist/i18n/locales/sq.d.ts.map +1 -1
  192. package/dist/i18n/locales/sq.js +130 -15
  193. package/dist/i18n/locales/sq.js.map +1 -1
  194. package/dist/i18n/locales/sv.d.ts +119 -4
  195. package/dist/i18n/locales/sv.d.ts.map +1 -1
  196. package/dist/i18n/locales/sv.js +130 -15
  197. package/dist/i18n/locales/sv.js.map +1 -1
  198. package/dist/i18n/locales/tr.d.ts +119 -4
  199. package/dist/i18n/locales/tr.d.ts.map +1 -1
  200. package/dist/i18n/locales/tr.js +130 -15
  201. package/dist/i18n/locales/tr.js.map +1 -1
  202. package/dist/i18n/locales/zh.d.ts +119 -4
  203. package/dist/i18n/locales/zh.d.ts.map +1 -1
  204. package/dist/i18n/locales/zh.js +130 -15
  205. package/dist/i18n/locales/zh.js.map +1 -1
  206. package/dist/index.js +1112 -1107
  207. package/dist/locales/ar.json +130 -15
  208. package/dist/locales/de.json +130 -15
  209. package/dist/locales/el.json +130 -15
  210. package/dist/locales/en.json +122 -7
  211. package/dist/locales/es.json +130 -15
  212. package/dist/locales/fr.json +130 -15
  213. package/dist/locales/hi.json +130 -15
  214. package/dist/locales/it.json +130 -15
  215. package/dist/locales/ja.json +130 -15
  216. package/dist/locales/nl.json +130 -15
  217. package/dist/locales/pl.json +130 -15
  218. package/dist/locales/pt.json +130 -15
  219. package/dist/locales/ro.json +130 -15
  220. package/dist/locales/ru.json +130 -15
  221. package/dist/locales/sq.json +130 -15
  222. package/dist/locales/sv.json +130 -15
  223. package/dist/locales/tr.json +130 -15
  224. package/dist/locales/zh.json +130 -15
  225. package/dist/patterns/calendar/calendar-appointment-details.d.ts +83 -2
  226. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  227. package/dist/patterns/calendar/calendar-appointment-editor-dialog.d.ts.map +1 -1
  228. package/dist/patterns/calendar/calendar-archive.d.ts +12 -0
  229. package/dist/patterns/calendar/calendar-archive.d.ts.map +1 -0
  230. package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
  231. package/dist/patterns/calendar/calendar-care-rules.d.ts +19 -23
  232. package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -1
  233. package/dist/patterns/calendar/calendar-delete-confirm.d.ts +18 -0
  234. package/dist/patterns/calendar/calendar-delete-confirm.d.ts.map +1 -0
  235. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts +12 -0
  236. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts.map +1 -0
  237. package/dist/patterns/calendar/calendar-editor-guard.d.ts +12 -0
  238. package/dist/patterns/calendar/calendar-editor-guard.d.ts.map +1 -0
  239. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +13 -2
  240. package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -1
  241. package/dist/patterns/calendar/calendar-load-error.d.ts +11 -0
  242. package/dist/patterns/calendar/calendar-load-error.d.ts.map +1 -0
  243. package/dist/patterns/calendar/calendar-patient-locked.d.ts +13 -0
  244. package/dist/patterns/calendar/calendar-patient-locked.d.ts.map +1 -0
  245. package/dist/patterns/calendar/calendar-patient-picker.d.ts +6 -1
  246. package/dist/patterns/calendar/calendar-patient-picker.d.ts.map +1 -1
  247. package/dist/patterns/calendar/calendar-prompts.d.ts +11 -0
  248. package/dist/patterns/calendar/calendar-prompts.d.ts.map +1 -0
  249. package/dist/patterns/calendar/calendar-settings-ical.d.ts +11 -0
  250. package/dist/patterns/calendar/calendar-settings-ical.d.ts.map +1 -0
  251. package/dist/patterns/calendar/calendar-settings-overlay.d.ts +73 -0
  252. package/dist/patterns/calendar/calendar-settings-overlay.d.ts.map +1 -0
  253. package/dist/patterns/calendar/calendar-settings-panel.d.ts +62 -0
  254. package/dist/patterns/calendar/calendar-settings-panel.d.ts.map +1 -0
  255. package/dist/patterns/calendar/calendar-settings-practice.d.ts +20 -0
  256. package/dist/patterns/calendar/calendar-settings-practice.d.ts.map +1 -0
  257. package/dist/patterns/calendar/calendar-status-colours.d.ts +18 -0
  258. package/dist/patterns/calendar/calendar-status-colours.d.ts.map +1 -0
  259. package/dist/patterns/calendar/calendar-upcoming-panel.d.ts.map +1 -1
  260. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts +17 -2
  261. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
  262. package/dist/patterns/calendar/calendar-workspace.d.ts +285 -6
  263. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  264. package/dist/patterns/calendar/calendar-workspace.model.d.ts +103 -17
  265. package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
  266. package/dist/patterns/calendar/calendar.data.d.ts +9 -3
  267. package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
  268. package/dist/patterns/calendar/calendar.journey.d.ts +69 -5
  269. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  270. package/dist/patterns/calendar/calendar.model.d.ts +129 -22
  271. package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
  272. package/dist/patterns/calendar/calendar.preferences.d.ts +4 -0
  273. package/dist/patterns/calendar/calendar.preferences.d.ts.map +1 -1
  274. package/dist/patterns/calendar/calendar.sheets.d.ts +129 -18
  275. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  276. package/dist/patterns/calendar/calendar.surface.d.ts +64 -6
  277. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  278. package/dist/patterns/calendar/calendar.types.d.ts +231 -6
  279. package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
  280. package/dist/patterns/calendar/index.d.ts +9 -6
  281. package/dist/patterns/calendar/index.d.ts.map +1 -1
  282. package/dist/patterns/calendar/index.js +18 -15
  283. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  284. package/dist/patterns/signature-request/index.js +1 -1
  285. package/dist/patterns/signed-out-frame/index.js +1 -1
  286. package/dist/tokens.css +5 -1
  287. package/package.json +1 -1
  288. package/dist/_chunks/appointment-card-0PebvrOS.js.map +0 -1
  289. package/dist/_chunks/calendar-_sgjuH3L.js.map +0 -1
  290. package/dist/_chunks/calendar-appointment-editor-dialog-CGDDGMdo.js +0 -10974
  291. package/dist/_chunks/calendar-appointment-editor-dialog-CGDDGMdo.js.map +0 -1
  292. package/dist/_chunks/calendar-event-card-DXAYWH6k.js.map +0 -1
  293. package/dist/_chunks/entity-summary-BanguTa6.js.map +0 -1
  294. package/dist/_chunks/header-settings-DsvheAOt.js.map +0 -1
  295. package/dist/_chunks/task-editor-C05yx7JJ.js +0 -1218
  296. package/dist/_chunks/task-editor-C05yx7JJ.js.map +0 -1
  297. package/dist/_chunks/treatment-receipt-1VnuinhY.js.map +0 -1
  298. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js +0 -2198
  299. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js.map +0 -1
  300. package/dist/_chunks/whatsapp-button-DV9JFmtq.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendar-event-card-DXAYWH6k.js","sources":["../../src/components/_shared/contrast-warning.ts","../../src/components/calendar-event-card/calendar-event-card.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* Shared contrast guardrail — Calendar + CalendarEventCard */\n/* */\n/* The consuming app supplies runtime hex pairs at several surfaces: */\n/* - event.backgroundColor / event.textColor (+ event.borderColor) */\n/* - modeBannerColor / modeBannerTextColor */\n/* - resource.color / resource.shortTitleTextColor */\n/* */\n/* When the text half of the pair is also a hex (i.e. both halves come */\n/* from the caller), we can validate them synchronously and warn the */\n/* consuming-app developer during DEV if the pair fails WCAG AA normal */\n/* text (4.5:1). When only the background half is supplied, */\n/* `resolveInk` derives a provably AA-safe black/white ink for it. */\n/* Every helper is a no-op in production builds. */\n/* ------------------------------------------------------------------ */\n\n/* Module-level dedup set — keyed on the (bg, fg, context) tuple so the\n same bad pair moving around the calendar only warns once per session.\n Exposed via `resetContrastWarnings()` for test isolation. */\nconst warnedTuples = new Set<string>();\n\n/** Reset the dedup set — intended for use between tests. */\nexport function resetContrastWarnings(): void {\n warnedTuples.clear();\n}\n\n/**\n * Parse a 3-char or 6-char `#RRGGBB` hex string into a linear sRGB\n * triple in the [0,1] range. Returns `null` for any input the caller\n * can't parse (malformed prefix, bad length, non-hex characters) —\n * the helper stays silent in that case rather than emitting noise.\n */\nfunction parseHex(hex: string): [number, number, number] | null {\n if (typeof hex !== 'string') return null;\n const trimmed = hex.trim();\n if (!trimmed.startsWith('#')) return null;\n const body = trimmed.slice(1);\n let r: number;\n let g: number;\n let b: number;\n if (body.length === 3) {\n if (!/^[0-9a-f]{3}$/i.test(body)) return null;\n r = parseInt(body[0] + body[0], 16);\n g = parseInt(body[1] + body[1], 16);\n b = parseInt(body[2] + body[2], 16);\n } else if (body.length === 6) {\n if (!/^[0-9a-f]{6}$/i.test(body)) return null;\n r = parseInt(body.slice(0, 2), 16);\n g = parseInt(body.slice(2, 4), 16);\n b = parseInt(body.slice(4, 6), 16);\n } else {\n return null;\n }\n return [r / 255, g / 255, b / 255];\n}\n\n/**\n * WCAG 2.1 relative luminance. Each channel is gamma-corrected then\n * weighted against the CIE photopic sensitivity of the human eye.\n * https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n */\nfunction relativeLuminance([r, g, b]: [number, number, number]): number {\n const lin = (c: number): number =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);\n}\n\n/**\n * WCAG 2.1 contrast ratio. Always returns a value in [1, 21]; the\n * relative-luminance lighter-over-darker convention is applied here.\n */\nfunction contrastRatio(\n bg: [number, number, number],\n fg: [number, number, number],\n): number {\n const l1 = relativeLuminance(bg);\n const l2 = relativeLuminance(fg);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * DEV-only WCAG AA guardrail for caller-supplied hex pairs.\n *\n * - No-op when `import.meta.env.DEV` is false.\n * - No-op when either half of the pair is missing (the \"fg missing →\n * inherits DS token\" case is a docs concern; the DS token isn't a\n * hex at runtime so we can't check it here).\n * - No-op when either hex can't be parsed (silent — not the helper's\n * concern to police malformed input).\n * - Deduplicated by `(bgHex, fgHex, contextLabel)` tuple so moving a\n * ratio-bad event around the calendar doesn't spam the console.\n *\n * @param bgHex - Caller-supplied background hex (e.g. `'#c2185b'`)\n * @param fgHex - Caller-supplied foreground hex (e.g. `'#ffffff'`)\n * @param contextLabel - Short description for the warning (e.g. `'event e1'`).\n */\nexport function warnLowContrast(\n bgHex: string | undefined,\n fgHex: string | undefined,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (!bgHex || !fgHex) return;\n\n const bg = parseHex(bgHex);\n const fg = parseHex(fgHex);\n if (!bg || !fg) return;\n\n const ratio = contrastRatio(bg, fg);\n if (ratio >= 4.5) return;\n\n const key = `${bgHex}|${fgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n /* `bg` parsed successfully above, so `resolveInk(bgHex)` is guaranteed\n to produce a compliant ink — the omit-textColor hint is always valid\n at this point. */\n console.warn(\n `[Calendar] Low contrast on ${contextLabel}: ${bgHex} / ${fgHex} (ratio ${ratio.toFixed(\n 2,\n )}, target 4.5). Pass a matching textColor/fgHex, pick a higher-contrast background, or omit textColor to let the kit choose a compliant ink.`,\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Ink derivation — bg-only caller colours */\n/* ------------------------------------------------------------------ */\n\nexport type EventInk = 'on-light' | 'on-dark';\n\n/**\n * Pick the ink for an arbitrary opaque bg hex. Returns `null` when the\n * input can't be parsed (`#rgb` / `#rrggbb` only).\n *\n * The threshold 0.1791 is the relative luminance at which\n * `contrast(bg, #fff) === contrast(bg, #000)`; the better of the two\n * always yields ≥ 4.58:1 (the minimum, at a mid-grey ≈ `#757575`) —\n * provably WCAG AA-safe for any opaque background.\n */\nexport function resolveInk(bgHex: string): EventInk | null {\n const bg = parseHex(bgHex);\n if (!bg) return null;\n // threshold where contrast(bg, #fff) === contrast(bg, #000)\n return relativeLuminance(bg) > 0.1791 ? 'on-light' : 'on-dark';\n}\n\n/**\n * DEV-only, one-shot warning for a caller `backgroundColor` the kit can't\n * parse (`rgb(…)`, keywords, malformed hex). The browser can still paint\n * it, but the text falls back to the token default and contrast can't be\n * verified. Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnUnparseableBackground(\n bgHex: string,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (parseHex(bgHex)) return;\n\n const key = `unparseable|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Unparseable backgroundColor on ${contextLabel}: \"${bgHex}\". ` +\n `Expected #rgb or #rrggbb — contrast cannot be verified and the text ` +\n `colour falls back to the token default.`,\n );\n}\n\n/**\n * DEV-only, one-shot warning for a near-white `backgroundColor`\n * (relative luminance > 0.9) supplied without a `borderColor` — the\n * event may be invisible against the calendar grid. The kit warns, it\n * does not repaint (delineation is decorative under WCAG 1.4.11 and the\n * consumer owns the picker colour). Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnLowDelineation(bgHex: string, contextLabel: string): void {\n if (!import.meta.env.DEV) return;\n\n const bg = parseHex(bgHex);\n if (!bg) return;\n if (relativeLuminance(bg) <= 0.9) return;\n\n const key = `delineation|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Light backgroundColor without borderColor on ${contextLabel}: ` +\n `${bgHex} may be invisible against the grid — pass a borderColor ` +\n `(the platform convention sends a light-grey border for white backgrounds).`,\n );\n}\n","/* ------------------------------------------------------------------ */\n/* CalendarEventCard — the single painted surface of a calendar event. */\n/* */\n/* Colour model (platform parity): the caller's picker hex */\n/* (backgroundColor / textColor / borderColor) is the ONLY thing that */\n/* paints the card. `status` never paints the surface — it selects an */\n/* icon and (for `cancelled`) a line-through. When no picker colour */\n/* is supplied the surface falls back to the theme's --primary / */\n/* --primary-foreground pair. */\n/* */\n/* Non-interactive by design: inside FullCalendar the outer harness */\n/* anchor owns click/drag/focus; standalone consumers wrap the card in */\n/* their own button/link. No onClick in the contract. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef } from 'react';\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n ThumbsUp,\n Clock,\n Stethoscope,\n Check,\n Ban,\n UserX,\n Globe,\n TriangleAlert,\n HeartPulse,\n Euro,\n Video,\n Repeat,\n EyeOff,\n ClipboardCheck,\n type LucideIcon,\n} from 'lucide-react';\n// Type-only import — erased at build, no runtime cycle with calendar.tsx's\n// runtime import of this card. Do NOT convert to a value import.\nimport type { CalendarEventStatus } from '../calendar/calendar';\nimport {\n warnLowContrast,\n resolveInk,\n warnUnparseableBackground,\n warnLowDelineation,\n} from '../_shared/contrast-warning';\n\n/* ------------------------------------------------------------------ */\n/* Status lookups */\n/* ------------------------------------------------------------------ */\n\nexport const STATUS_ICON: Record<CalendarEventStatus, LucideIcon> = {\n confirmed: ThumbsUp,\n waiting: Clock,\n in_care: Stethoscope,\n done: Check,\n cancelled: Ban,\n absent: UserX,\n};\n\n/* Status → i18n key lookup. Kept as a literal object (not a template)\n so static-analysis extractors can find every key. Keys already exist\n in all 18 locale bundles — do not add new ones here. */\n/* Indicator DISC — option D of the design review: each glyph in a small\n circle on the plain card surface (hairline border + row-lift shadow)\n with the SEMANTIC colour as icon ink. Chip-grade contrast on any\n picker colour without a plate; ink tokens mirror Badge's variants so\n the vocabulary stays one system. */\nconst INDICATOR_DISC_BASE =\n 'ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-full)] ds:bg-[color:var(--card)] ds:border ds:border-[color:var(--border)] ds:shadow-[var(--shadow-sm)]';\n\n/* DETAILS-PENDING bar — the Skeleton component's own classes, inlined on\n a <span>: Skeleton renders a <div>, which cannot live inside the card's\n inline text cell. Decorative (aria-hidden) because the composed\n aria-label already carries the localised \"loading details\" word. */\nconst PENDING_BAR_CLASS =\n 'ds:inline-block ds:h-3 ds:w-[6ch] ds:align-middle ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)] ds:animate-[skeleton-pulse_calc(var(--animation-duration)*8)_ease-in-out_infinite] ds:motion-reduce:animate-none ds:forced-colors:bg-[GrayText] ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText] ds:forced-colors:animate-none';\n\ntype IndicatorTone = 'success' | 'info' | 'warning' | 'error' | 'accent';\n\nconst INDICATOR_DISC_TONE: Record<IndicatorTone, string> = {\n success: 'ds:text-[color:var(--success-foreground)]',\n info: 'ds:text-[color:var(--info-foreground)]',\n warning: 'ds:text-[color:var(--warning-foreground)]',\n error: 'ds:text-[color:var(--error-foreground)]',\n // Same AA-clearing accent mix Badge's accentSoft uses for its ink.\n accent:\n 'ds:text-[color:color-mix(in_srgb,var(--accent)_40%,var(--foreground))]',\n};\n\n/* Status → disc tone — the same semantic mapping as the accent bar. */\nconst STATUS_DISC_TONE: Record<CalendarEventStatus, IndicatorTone> = {\n confirmed: 'success',\n waiting: 'info',\n in_care: 'accent',\n done: 'success',\n cancelled: 'error',\n absent: 'warning',\n};\n\nexport const STATUS_LABEL_KEYS: Record<CalendarEventStatus, string> = {\n confirmed: 'calendar.status.confirmed',\n waiting: 'calendar.status.waiting',\n in_care: 'calendar.status.inCare',\n done: 'calendar.status.done',\n cancelled: 'calendar.status.cancelled',\n absent: 'calendar.status.absent',\n};\n\nexport const EVENT_FLAGS = [\n {\n field: 'hasUnassignedPatient',\n Icon: TriangleAlert,\n labelKey: 'calendarWorkspace.details.indicators.unassignedPatient',\n tone: 'warning',\n },\n {\n field: 'hasHighlightedAnamnesis',\n Icon: HeartPulse,\n labelKey: 'calendarWorkspace.details.indicators.anamnesis',\n tone: 'accent',\n },\n {\n field: 'hasBillableAmount',\n Icon: Euro,\n labelKey: 'calendarWorkspace.details.indicators.billable',\n tone: 'warning',\n },\n {\n field: 'isBookedOnline',\n Icon: Globe,\n labelKey: 'calendarWorkspace.details.indicators.bookedOnline',\n tone: 'info',\n },\n {\n field: 'isTelehealth',\n Icon: Video,\n labelKey: 'calendarWorkspace.details.indicators.telehealth',\n tone: 'info',\n },\n {\n field: 'isRecurring',\n Icon: Repeat,\n labelKey: 'calendarWorkspace.details.indicators.recurring',\n tone: 'info',\n },\n] as const;\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst calendarEventCardVariants = cva(\n [\n // FullCalendar supplies the box. The card is the `eventcard` size\n // container: the `ds:eventcard-*` tier variants (declared in\n // src/styles.css) read its width and height to prioritise identity,\n // then treatment, time and markers.\n 'calendar-event-card ds:relative ds:block ds:[container-name:eventcard]',\n 'ds:w-full',\n 'ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n // The type-role alias, so the text (and with it every em tier\n // threshold) grows one step under .theme-accessible.\n 'ds:text-[length:var(--type-body-sm-size)]',\n 'ds:font-[var(--font-weight-medium)]',\n 'ds:leading-tight ds:text-start',\n 'ds:overflow-hidden',\n // kept verbatim from the former base (inert on a non-focusable div\n // inside FC; harmless)\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // SINGLE PAINTED SURFACE — always present, never conditional. One\n // declaration per paint channel; value chain = \"caller custom prop,\n // else token\". This structurally eliminates the CVA-vs-override\n // specificity race (the old double-paint bug) — stylesheet order\n // becomes irrelevant.\n 'ds:[background-color:var(--calendar-event-bg,var(--primary))]',\n 'ds:[color:var(--calendar-event-text,var(--primary-foreground))]',\n 'ds:border ds:[border-color:var(--calendar-event-border,transparent)]',\n ].join(' '),\n {\n variants: {\n layout: {\n // Timed grids: FullCalendar supplies a definite block size. A\n // standalone card with no height falls back to two lines.\n grid: [\n 'ds:h-full ds:[container-type:size] ds:[min-block-size:0]',\n 'ds:[contain-intrinsic-block-size:calc(var(--type-body-sm-size)*var(--calendar-event-line-height)*2)]',\n ].join(' '),\n // Month cells: exactly one line.\n month: [\n 'calendar-event-card--month ds:[container-type:size]',\n 'ds:[block-size:calc(var(--type-body-sm-size)*var(--calendar-event-line-height)_+_var(--spacing-2xs))]',\n ].join(' '),\n // Lists and timelines size from content: width tiers only.\n flow: [\n 'calendar-event-card--flow ds:[container-type:inline-size]',\n 'ds:[min-block-size:calc(var(--type-body-sm-size)*var(--calendar-event-line-height))]',\n ].join(' '),\n },\n // Do not add colour classes to this axis — status is icon + aria\n // only; a unit test asserts identical computed background\n // across all six statuses.\n status: {\n none: '',\n confirmed: '',\n waiting: '',\n in_care: '',\n done: '',\n cancelled: 'ds:line-through',\n absent: '',\n },\n bookedOnline: {\n // class name kept as a stable inert DOM hook; the stripe paint\n // lives here (moved from fullcalendar-theme.css) so it works in\n // the card's own stories, outside .fc-theme-alfadocs.\n // currentcolor = resolved ink, so stripes stay visible over any\n // picker colour.\n true: 'event-booked-online ds:bg-[image:repeating-linear-gradient(45deg,transparent,transparent_4px,color-mix(in_srgb,currentcolor_10%,transparent)_4px,color-mix(in_srgb,currentcolor_10%,transparent)_8px)]',\n false: '',\n },\n // Task treatment: CUSTOM-PROPERTY assignments only — the consuming\n // background-color / color / border-color declarations stay in the\n // base above, so this cannot re-open the CVA-vs-override specificity\n // race, and a caller's inline picker hex (set as the same custom\n // properties via `style`) still wins. `border-dashed` is a\n // border-style declaration — no property collision either.\n kind: {\n // The appointment's COLOUR IDENTITY edge — a thick start border\n // in the event colour, platform-agenda style, so the colour\n // reads even on sliver-height cards. Tasks keep the 1px edge:\n // muted to-dos carry no colour identity.\n appointment: 'ds:border-s-4',\n // Draft treatment — an appointment being COMPOSED, not yet saved\n // (the slot a user just picked, mirrored on the grid while the\n // editor is open). Same custom-property-only discipline as\n // `task`: dashed outline over a light primary tint, so the\n // placeholder reads as pending rather than as a booked slot.\n draft: [\n 'ds:border-dashed',\n 'ds:[--calendar-event-bg:color-mix(in_srgb,var(--primary)_10%,var(--card))]',\n 'ds:[--calendar-event-text:var(--foreground)]',\n 'ds:[--calendar-event-border:var(--primary)]',\n ].join(' '),\n // Details pending — the block IS a booked appointment, so it\n // keeps the colour-identity edge and assigns no paint of its own.\n // Only the NAME is missing; the bar above stands in for it.\n 'pending-details': 'ds:border-s-4',\n task: [\n 'ds:border-dashed',\n 'ds:[--calendar-event-bg:var(--muted)]',\n 'ds:[--calendar-event-text:var(--muted-foreground)]',\n 'ds:[--calendar-event-border:color-mix(in_srgb,currentcolor_45%,transparent)]',\n ].join(' '),\n },\n // Tinted colour scheme — the chip-family look: the picker colour\n // becomes a SOLID BORDER over a light tint of itself (theme-aware\n // via color-mix with --card), text on the theme's foreground\n // tokens. Custom-property assignments only — the painted\n // declarations stay in the base. The runtime hex arrives as\n // `--calendar-event-accent` (inline). Never combined with the task\n // variant: the component forces `solid` for tasks so exactly one\n // class-level assignment of each property exists per render.\n colorStyle: {\n solid: '',\n tinted: [\n 'ds:[--calendar-event-bg:color-mix(in_srgb,var(--calendar-event-accent,var(--primary))_12%,var(--card))]',\n 'ds:[--calendar-event-text:var(--foreground)]',\n 'ds:[--calendar-event-border:var(--calendar-event-accent,var(--primary))]',\n ].join(' '),\n },\n },\n defaultVariants: {\n layout: 'grid',\n status: 'none',\n bookedOnline: false,\n kind: 'appointment',\n colorStyle: 'solid',\n },\n },\n);\n\n/* Card slots. The `event-card-*` class names are inert DOM hooks for tests\n and hosts; every style is a `ds:` utility. Tier variants apply to timed\n grids; month and flow replace the ones they override (see each slot). */\n\nconst cardContent = [\n 'event-card-content ds:grid ds:grid-cols-[minmax(0,1fr)_auto] ds:items-start',\n 'ds:gap-x-[var(--spacing-2xs)] ds:leading-[var(--calendar-event-line-height)]',\n // Stretch, so a secondary line is as wide as the card and a long word\n // wraps inside it rather than running past the edge.\n 'ds:eventcard-narrow:flex ds:eventcard-narrow:flex-col ds:eventcard-narrow:items-stretch',\n // A 15-minute compact tile: the meta size on a tight line.\n 'ds:eventcard-tiny:text-[length:var(--type-meta-size)] ds:eventcard-tiny:leading-[var(--calendar-event-compact-line-height)]',\n].join(' ');\n\nconst cardHeading = [\n 'event-card-heading ds:flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ds:min-w-0',\n 'ds:eventcard-narrow:w-full',\n 'ds:eventcard-narrow-tall:flex-col ds:eventcard-narrow-tall:items-stretch ds:eventcard-narrow-tall:gap-0',\n].join(' ');\n\nconst cardName = cva(\n [\n 'event-card-name ds:min-w-0 ds:flex-1 ds:font-[var(--font-weight-semibold)]',\n // Wrap at spaces first; break inside a word only when it cannot fit.\n 'ds:wrap-break-word',\n 'ds:eventcard-narrow:pe-[var(--spacing-xs)]',\n ].join(' '),\n {\n variants: {\n layout: {\n grid: [\n 'ds:line-clamp-1 ds:eventcard-h3:line-clamp-2',\n // Tall slivers: the name runs down the card.\n 'ds:eventcard-sliver-tall:block ds:eventcard-sliver-tall:[writing-mode:vertical-rl] ds:eventcard-sliver-tall:[text-orientation:mixed]',\n 'ds:eventcard-sliver-tall:whitespace-nowrap ds:eventcard-sliver-tall:text-ellipsis ds:eventcard-sliver-tall:flex-none ds:eventcard-sliver-tall:pe-0',\n 'ds:eventcard-sliver-tall:[max-inline-size:calc(100cqmax_-_var(--spacing-md))]',\n 'ds:eventcard-sliver-h2:line-clamp-2 ds:eventcard-sliver-h2:pe-0',\n // Too thin for a legible line: colour and the priority marker.\n 'ds:eventcard-hairline:hidden',\n ].join(' '),\n month: 'ds:line-clamp-1',\n flow: 'ds:line-clamp-2',\n },\n // Room for the one-line \"marker +N\" cluster that sits over the end:\n // sized in em of the card text, like the cluster it clears.\n hiddenMarkers: {\n true: 'ds:eventcard-narrow-count:pe-[2.25em]',\n false: '',\n },\n },\n },\n);\n\n/* With a surname to show, slivers swap the full title for it. */\nconst cardFullTitle = cva('event-card-full-title', {\n variants: {\n hasShortTitle: { true: 'ds:eventcard-sliver:hidden', false: '' },\n },\n});\n\nconst cardKindIcon =\n 'event-card-kind-icon ds:inline ds:size-[1em] ds:me-[var(--spacing-2xs)] ds:align-text-bottom';\n\nconst cardTime = cva(\n 'event-card-time ds:hidden ds:shrink-0 ds:whitespace-nowrap ds:text-[length:var(--type-meta-size)]',\n {\n variants: {\n layout: {\n // Wide cards, and tall cards from 112px, show the time; tall narrow\n // cards put the start under the name.\n grid: 'ds:eventcard-w176:inline ds:eventcard-tall:inline ds:eventcard-narrow-tall:block',\n month: 'ds:eventcard-w176:inline',\n flow: 'ds:eventcard-w176:inline',\n },\n },\n },\n);\n\nconst cardStart = cva('event-card-start', {\n variants: {\n layout: {\n grid: 'ds:eventcard-w256:hidden',\n month: '',\n flow: 'ds:eventcard-w256:hidden',\n },\n },\n});\n\nconst cardRange = cva('event-card-range', {\n variants: {\n layout: {\n grid: 'ds:hidden ds:eventcard-w256:inline',\n month: 'ds:hidden',\n flow: 'ds:hidden ds:eventcard-w256:inline',\n },\n },\n});\n\nconst secondaryLine =\n 'ds:col-span-full ds:overflow-hidden ds:text-[length:var(--type-meta-size)] ds:wrap-break-word';\n\nconst cardSuffix = cva(`event-card-suffix ${secondaryLine}`, {\n variants: {\n layout: {\n grid: [\n 'ds:hidden ds:eventcard-h2:line-clamp-1',\n 'ds:eventcard-narrow:order-2 ds:eventcard-narrow-h2:hidden ds:eventcard-narrow-h5:line-clamp-1',\n 'ds:eventcard-sliver:hidden ds:eventcard-h7-mid:line-clamp-2',\n ].join(' '),\n month: 'ds:hidden',\n flow: 'ds:line-clamp-1 ds:eventcard-narrow:order-2',\n },\n },\n});\n\nconst cardContext = cva(`event-card-context ${secondaryLine}`, {\n variants: {\n layout: {\n grid: 'ds:hidden ds:eventcard-narrow:order-3 ds:eventcard-context:line-clamp-1',\n month: 'ds:hidden',\n flow: 'ds:hidden',\n },\n },\n});\n\n/* One-line narrow cards: the cluster sits over the end of the name. */\nconst NARROW_OVERLAY_MARKERS =\n 'ds:eventcard-narrow:absolute ds:eventcard-narrow:end-0 ds:eventcard-narrow:[inset-block-end:0] ds:eventcard-narrow:gap-0';\n\nconst cardMarkers = cva(\n 'event-card-markers ds:flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:col-[2] ds:row-[1]',\n {\n variants: {\n layout: {\n grid: [\n NARROW_OVERLAY_MARKERS,\n 'ds:eventcard-narrow-h2:static ds:eventcard-narrow-h2:gap-[var(--spacing-2xs)] ds:eventcard-narrow-h2:order-1',\n 'ds:eventcard-tall:row-auto ds:eventcard-tall:col-span-full',\n ].join(' '),\n month: NARROW_OVERLAY_MARKERS,\n // Lists and timelines have no height tiers, so a narrow flow card\n // keeps its markers in the column, between name and treatment,\n // instead of laying them over the treatment line. The row wraps so\n // a slim card's dot never falls off the edge.\n flow: 'ds:eventcard-narrow:order-1 ds:eventcard-narrow:flex-wrap',\n },\n },\n },\n);\n\n/* Marker visibility by priority rank: the first always shows; later ones\n join as the card widens, and all show on tall wide cards. Month shows\n the first only. */\nconst cardMarker = cva(\n `event-card-marker ${INDICATOR_DISC_BASE} ds:size-[1em] ds:[&_svg]:size-[0.75em] ds:eventcard-narrow:size-[0.75em] ds:eventcard-narrow-h2:size-[1em]`,\n {\n variants: {\n rank: {\n first: 'ds:inline-flex',\n second: 'ds:hidden',\n third: 'ds:hidden',\n rest: 'ds:hidden',\n },\n layout: { grid: '', month: '', flow: '' },\n },\n compoundVariants: [\n {\n layout: ['grid', 'flow'],\n rank: 'second',\n class: 'ds:eventcard-w256:inline-flex',\n },\n {\n layout: ['grid', 'flow'],\n rank: 'third',\n class: 'ds:eventcard-w352:inline-flex',\n },\n {\n layout: ['grid', 'flow'],\n rank: ['second', 'third', 'rest'],\n class: 'ds:eventcard-tall-wide:inline-flex',\n },\n ],\n },\n);\n\nconst MARKER_RANK = ['first', 'second', 'third'] as const;\n\n/* \"+N\" after the first `capacity` markers; at most one shows per tier. */\nconst cardMore = cva(\n 'event-card-more ds:text-[length:var(--type-meta-size)] ds:whitespace-nowrap',\n {\n variants: {\n capacity: {\n 1: 'event-card-more-1',\n 2: 'event-card-more-2 ds:hidden',\n 3: 'event-card-more-3 ds:hidden',\n },\n layout: { grid: '', month: '', flow: '' },\n },\n compoundVariants: [\n { layout: 'month', capacity: 1, class: 'ds:inline' },\n {\n layout: 'grid',\n capacity: 1,\n class: [\n 'ds:inline ds:eventcard-w256:hidden ds:eventcard-narrow:hidden',\n 'ds:eventcard-narrow-count:inline ds:eventcard-narrow-h2:inline ds:eventcard-tall-wide:hidden',\n ].join(' '),\n },\n // Flow keeps narrow markers in the column, with room to count from\n // 64px; slimmer flow cards fall back to the dot.\n {\n layout: 'flow',\n capacity: 1,\n class:\n 'ds:inline ds:@max-[64px]/eventcard:hidden ds:eventcard-w256:hidden',\n },\n {\n layout: ['grid', 'flow'],\n capacity: 2,\n class:\n 'ds:eventcard-w256:inline ds:eventcard-w352:hidden ds:eventcard-tall-wide:hidden',\n },\n {\n layout: ['grid', 'flow'],\n capacity: 3,\n class: 'ds:eventcard-w352:inline ds:eventcard-tall-wide:hidden',\n },\n ],\n },\n);\n\n/* The sliver cue: a dot saying \"more markers than shown\", where \"+N\" does\n not fit. Rendered only when markers are actually hidden. Month always\n counts, so it has none. */\nconst sliverCue = cva(\n 'event-card-sliver-cue ds:hidden ds:items-center ds:text-[length:var(--type-meta-size)]',\n {\n variants: {\n layout: {\n grid: 'ds:eventcard-narrow:flex ds:eventcard-narrow-count:hidden ds:eventcard-narrow-h2:hidden',\n month: '',\n flow: 'ds:@max-[64px]/eventcard:flex',\n },\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\n/**\n * The single painted surface of a calendar event.\n *\n * Colour model (platform parity): the caller's picker hex\n * (`backgroundColor` / `textColor` / `borderColor`) is the ONLY thing that\n * paints the card. `status` never paints the surface — it selects an icon\n * and (for `cancelled`) a line-through.\n *\n * Non-interactive by design: inside FullCalendar the outer harness anchor\n * owns click/drag/focus; standalone consumers wrap the card in their own\n * button/link. No onClick in the contract.\n */\nexport interface CalendarEventCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /**\n * Primary line. Pass the ALREADY-MASKED title when privacy applies — the\n * card never receives a name it must not render, so it cannot leak it\n * (visually or via the composed aria-label).\n */\n title: string;\n /** Optional surname/short form for slivers. Ignored when privacyMasked. */\n shortTitle?: string;\n /** Localised start time for narrow cards. No parsing of rangeText. */\n startText?: string;\n /** Month keeps one line; flow preserves intrinsic height in lists/timelines. */\n layout?: 'grid' | 'month' | 'flow';\n /** Opposite resource axis: operator initials or chair, on tall cards. */\n contextLabel?: string;\n /**\n * Full name behind `contextLabel`, used in the accessible name instead of\n * it, so initials such as \"DA\" are not read out letter by letter. Never\n * rendered visually.\n */\n contextName?: string;\n /**\n * Secondary description, clamped to the lines the card can hold. Note: the\n * Calendar's privacy mode does NOT mask the suffix (current behaviour,\n * preserved deliberately).\n */\n suffix?: string;\n /**\n * Pre-formatted, localised time range (e.g. \"09:00 – 09:45\"). The\n * Calendar adapter computes it via Intl.DateTimeFormat.formatRange.\n * Included in the composed aria-label whenever present (even when the\n * visual time line is suppressed via showTime/allDay — matches today's\n * Calendar behaviour byte-for-byte).\n */\n rangeText?: string;\n /**\n * Gates the VISUAL time line only (aria keeps rangeText). Mirrors\n * CalendarProps.showTime. @default true\n */\n showTime?: boolean;\n /**\n * All-day events suppress the visual time line (aria keeps rangeText).\n * @default false\n */\n allDay?: boolean;\n\n /**\n * Lifecycle state (6-state, matches the platform DoctorAppointment\n * lifecycle) → status icon + line-through for `cancelled` +\n * localised label in the aria-label. NEVER paints the\n * card surface.\n */\n status?: CalendarEventStatus;\n\n /**\n * Runtime hex (#rgb or #rrggbb) from the consumer's colour picker — THE\n * painted surface. Injected as `--calendar-event-bg` via the sanctioned\n * inline custom-property pattern (23-constraints §inline-style exception).\n */\n backgroundColor?: string;\n /**\n * Runtime hex paired with backgroundColor. When omitted while\n * backgroundColor is set, the card auto-derives black/white ink by\n * luminance (provably WCAG AA ≥ 4.58:1 for any opaque colour).\n */\n textColor?: string;\n /**\n * Runtime hex border for delineating light surfaces. The platform sends\n * '#cccccc' when backgroundColor is '#ffffff' and omits it otherwise.\n * Falls back to transparent; appointments have a 4px start edge and\n * a 1px border elsewhere (tasks and drafts have 1px on every side), so toggling never shifts layout and event boundaries\n * survive forced-colors / Windows High Contrast for free.\n */\n borderColor?: string;\n\n /* Indicator icons — names identical to CalendarEvent fields (1:1 map). */\n /** Globe icon + diagonal stripe overlay. */\n isBookedOnline?: boolean;\n /** AlertTriangle icon. */\n hasUnassignedPatient?: boolean;\n /** HeartPulse icon. */\n hasHighlightedAnamnesis?: boolean;\n /** Euro icon. */\n hasBillableAmount?: boolean;\n /** Video icon. */\n isTelehealth?: boolean;\n /**\n * Repeat icon — this event belongs to a REPEATING SERIES. Set it on\n * every occurrence, not only the first: the flag answers \"will moving\n * or deleting this touch other appointments?\", which is true of a\n * modified occurrence too. Series ROLE (which row owns the rule) is a\n * separate concern — see `CalendarEvent.isRecurrenceParent`.\n */\n isRecurring?: boolean;\n /**\n * Task treatment — a calendar-scheduled to-do renders distinctly from an\n * appointment: dashed outline (derived from the resolved ink when no\n * `borderColor` is supplied), muted default surface (an explicit\n * `backgroundColor`/`textColor` still wins), a leading clipboard glyph,\n * and a localised \"task\" word appended to the accessible name. Emitted as\n * `data-kind=\"task\"` for DOM hooks.\n */\n isTask?: boolean;\n /**\n * Draft treatment — a placeholder for an appointment being composed:\n * the slot the user just picked, mirrored on the grid while the editor\n * is open. Dashed outline over a light primary tint, with a localised\n * \"draft\" word appended to the accessible name. Emitted as\n * `data-kind=\"draft\"`. Takes precedence over `isTask`, and like a task\n * it forces the solid paint path so exactly one class-level assignment\n * of each paint custom property exists per render.\n */\n isDraft?: boolean;\n /**\n * Details-pending treatment — a REAL booked appointment an\n * occupancy-first host drew from the slot it occupies while it still\n * fetches whose it is. The card keeps its colour and size and renders an\n * `aria-hidden` skeleton bar where the title goes, with the localised\n * \"loading details\" word in the accessible name and\n * `data-kind=\"pending-details\"` as the hook. Wins over `isDraft`/`isTask`.\n */\n detailsPending?: boolean;\n /**\n * Colour scheme for the picker colour. `'solid'` (default) is the\n * platform model — the hex paints the whole surface, ink auto-derived.\n * `'tinted'` is the chip-family scheme: the hex becomes a SOLID BORDER\n * over a light tint of itself (theme-aware via color-mix with `--card`),\n * with text on the theme's foreground tokens — `textColor` and\n * `borderColor` are ignored under it. Tasks keep their muted dashed\n * treatment regardless.\n */\n colorStyle?: 'solid' | 'tinted';\n\n /**\n * Resource title (chair/operator) woven into the composed aria-label\n * only — never rendered visually. The Calendar adapter resolves\n * resourceId → title before passing it.\n */\n resourceLabel?: string;\n /**\n * The title is a privacy MASK (the Calendar's privacy mode swapped the\n * patient name for `privacyModeTitle`). Renders a crossed-out-eye glyph\n * beside the mask so the redaction is legible as deliberate, with its\n * own breathing room after the time.\n */\n privacyMasked?: boolean;\n /**\n * Stable event id → emitted as `data-event-id` (Calendar.focusEvent\n * targets it) and used as the contrast-warning dedup context.\n */\n eventId?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const CalendarEventCard = forwardRef<\n HTMLDivElement,\n CalendarEventCardProps\n>(\n (\n {\n title,\n shortTitle,\n startText,\n layout = 'grid',\n contextLabel,\n contextName,\n suffix,\n rangeText,\n showTime = true,\n allDay = false,\n status,\n backgroundColor,\n textColor,\n borderColor,\n isBookedOnline = false,\n hasUnassignedPatient,\n hasHighlightedAnamnesis,\n hasBillableAmount,\n isTelehealth,\n isRecurring,\n isTask = false,\n isDraft = false,\n detailsPending = false,\n colorStyle = 'solid',\n resourceLabel,\n privacyMasked = false,\n eventId,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n\n const markers = [\n ...(status\n ? [\n {\n id: 'status',\n Icon: STATUS_ICON[status],\n label: t(STATUS_LABEL_KEYS[status]),\n tone: STATUS_DISC_TONE[status],\n },\n ]\n : []),\n ...EVENT_FLAGS.filter(({ field }) =>\n Boolean(\n {\n hasUnassignedPatient,\n hasHighlightedAnamnesis,\n hasBillableAmount,\n isBookedOnline,\n isTelehealth,\n isRecurring,\n }[field],\n ),\n ).map(({ field, Icon, labelKey, tone }) => ({\n id: field,\n Icon,\n label: t(labelKey),\n tone,\n })),\n ];\n const statusLabel = status ? t(STATUS_LABEL_KEYS[status]) : undefined;\n const kindLabel = detailsPending\n ? t('calendar.eventKind.pendingDetails')\n : isDraft\n ? t('calendar.eventKind.draft')\n : isTask\n ? t('calendar.eventKind.task')\n : undefined;\n\n /* Accessible name — the Calendar's historical composition, with the\n localised \"task\" word appended for task cards so screen-reader users\n get the same appointment-vs-task distinction the dashed outline and\n clipboard glyph carry visually. An explicit consumer-supplied\n aria-label wins. rangeText is always included when present, even when\n the visual time line is hidden. */\n const ariaLabel =\n ariaLabelProp ??\n [\n title,\n rangeText,\n suffix,\n resourceLabel,\n // A blank name falls back to the visible label rather than\n // silencing the context altogether.\n contextName?.trim() ? contextName : contextLabel,\n statusLabel,\n kindLabel,\n ...markers\n .filter((marker) => marker.id !== 'status')\n .map((marker) => marker.label),\n ]\n .filter(Boolean)\n .join(', ');\n\n const kind = detailsPending\n ? 'pending-details'\n : isDraft\n ? 'draft'\n : isTask\n ? 'task'\n : 'appointment';\n\n /* Tasks force the solid path — their muted variant owns the paint\n custom properties, so the tinted class must never co-assign them. */\n const tinted = !isTask && !isDraft && colorStyle === 'tinted';\n\n /* Ink derivation — solid scheme only, when the caller paints the\n surface without pairing a text colour. */\n const ink =\n !tinted && !textColor && backgroundColor\n ? resolveInk(backgroundColor)\n : null;\n\n /* DEV-only guardrails — every helper no-ops in production and dedupes\n per session, so calling during render is safe. The tinted scheme\n paints text on theme tokens over a 12% tint, so the solid-scheme\n pair checks don't apply there. */\n const warnContext = eventId ? `event ${eventId}` : 'calendar-event-card';\n if (!tinted) {\n warnLowContrast(backgroundColor, textColor, warnContext);\n if (backgroundColor && !textColor) {\n // no-ops when the hex is parseable (i.e. when resolveInk succeeded)\n warnUnparseableBackground(backgroundColor, warnContext);\n }\n if (backgroundColor && !borderColor) {\n // no-ops unless the background is near-white (luminance > 0.9)\n warnLowDelineation(backgroundColor, warnContext);\n }\n }\n\n /* Per-event colour override: the consuming app passes runtime hex from\n its colour picker. 23-constraints permits inline `style` only as a\n CSS custom-property setter for runtime values that can't be\n enumerated at build time — the consuming background-color / color /\n border-color declarations live in the CVA base as Tailwind arbitrary\n values with token fallbacks. */\n const colourOverrides: CSSProperties | undefined = tinted\n ? backgroundColor\n ? ({ '--calendar-event-accent': backgroundColor } as CSSProperties)\n : undefined\n : backgroundColor || textColor || borderColor\n ? ({\n ...(backgroundColor\n ? { '--calendar-event-bg': backgroundColor }\n : {}),\n ...(textColor\n ? { '--calendar-event-text': textColor }\n : ink === 'on-light'\n ? { '--calendar-event-text': 'var(--event-ink-on-light)' }\n : ink === 'on-dark'\n ? { '--calendar-event-text': 'var(--event-ink-on-dark)' }\n : {}),\n ...(borderColor ? { '--calendar-event-border': borderColor } : {}),\n } as CSSProperties)\n : undefined;\n\n const mergedStyle: CSSProperties | undefined =\n style || colourOverrides ? { ...style, ...colourOverrides } : undefined;\n\n /* A surname for slivers, never under privacy. */\n const showShortTitle = Boolean(\n !privacyMasked && shortTitle?.trim() && shortTitle !== title,\n );\n\n return (\n <div\n ref={ref}\n role=\"group\"\n {...rest}\n className={calendarEventCardVariants({\n layout,\n status: status ?? 'none',\n bookedOnline: isBookedOnline,\n kind,\n colorStyle: tinted ? 'tinted' : 'solid',\n className,\n })}\n // eslint-disable-next-line react/forbid-dom-props -- caller-supplied event bg/text/border hex injected via CSS variables (23-constraints §inline-style exception)\n style={mergedStyle}\n aria-label={ariaLabel}\n data-component=\"calendar-event-card\"\n data-event-id={eventId}\n data-kind={kind}\n data-status={status ?? 'none'}\n data-contrast={\n tinted ? 'tinted' : textColor ? 'custom' : (ink ?? 'default')\n }\n >\n <span className={cardContent} aria-hidden=\"true\">\n <span className={cardHeading}>\n <span\n className={cardName({\n layout,\n hiddenMarkers: markers.length > 1,\n })}\n >\n {detailsPending ? (\n <span aria-hidden=\"true\" className={PENDING_BAR_CLASS} />\n ) : (\n <>\n {isTask ? <ClipboardCheck className={cardKindIcon} /> : null}\n {privacyMasked ? <EyeOff className={cardKindIcon} /> : null}\n <span\n className={cardFullTitle({\n hasShortTitle: showShortTitle,\n })}\n >\n {title}\n </span>\n {showShortTitle ? (\n <span className=\"event-card-short-title ds:hidden ds:eventcard-sliver:inline\">\n {shortTitle}\n </span>\n ) : null}\n </>\n )}\n </span>\n {showTime && !allDay && rangeText ? (\n <span className={cardTime({ layout })}>\n {startText ? (\n <>\n <span className={cardStart({ layout })}>{startText}</span>\n <span className={cardRange({ layout })}>{rangeText}</span>\n </>\n ) : (\n rangeText\n )}\n </span>\n ) : null}\n </span>\n {suffix ? (\n <span className={cardSuffix({ layout })}>{suffix}</span>\n ) : null}\n {contextLabel ? (\n <span className={cardContext({ layout })}>{contextLabel}</span>\n ) : null}\n {markers.length > 0 ? (\n <span className={cardMarkers({ layout })}>\n {markers.map(({ id, Icon, tone }, index) => (\n <span\n key={id}\n data-marker={id}\n aria-hidden=\"true\"\n className={cardMarker({\n rank: MARKER_RANK[index] ?? 'rest',\n layout,\n className: INDICATOR_DISC_TONE[tone],\n })}\n >\n <Icon aria-hidden=\"true\" />\n </span>\n ))}\n {([1, 2, 3] as const).map((capacity) =>\n markers.length > capacity ? (\n <span\n key={capacity}\n className={cardMore({ capacity, layout })}\n >\n {t('calendar.card.more', {\n number: markers.length - capacity,\n })}\n </span>\n ) : null,\n )}\n {markers.length > 1 && layout !== 'month' ? (\n <span className={sliverCue({ layout })}>·</span>\n ) : null}\n </span>\n ) : null}\n </span>\n </div>\n );\n },\n);\nCalendarEventCard.displayName = 'CalendarEventCard';\n"],"names":["parseHex","hex","trimmed","body","r","g","b","relativeLuminance","lin","c","warnLowContrast","bgHex","fgHex","contextLabel","resolveInk","bg","STATUS_ICON","ThumbsUp","Clock","Stethoscope","Check","Ban","UserX","INDICATOR_DISC_BASE","PENDING_BAR_CLASS","INDICATOR_DISC_TONE","STATUS_DISC_TONE","STATUS_LABEL_KEYS","EVENT_FLAGS","TriangleAlert","HeartPulse","Euro","Globe","Video","Repeat","calendarEventCardVariants","cva","cardContent","cardHeading","cardName","cardFullTitle","cardKindIcon","cardTime","cardStart","cardRange","secondaryLine","cardSuffix","cardContext","NARROW_OVERLAY_MARKERS","cardMarkers","cardMarker","MARKER_RANK","cardMore","sliverCue","CalendarEventCard","forwardRef","title","shortTitle","startText","layout","contextName","suffix","rangeText","showTime","allDay","status","backgroundColor","textColor","borderColor","isBookedOnline","hasUnassignedPatient","hasHighlightedAnamnesis","hasBillableAmount","isTelehealth","isRecurring","isTask","isDraft","detailsPending","colorStyle","resourceLabel","privacyMasked","eventId","className","style","ariaLabelProp","rest","ref","t","useTranslation","markers","field","Icon","labelKey","tone","statusLabel","kindLabel","ariaLabel","marker","kind","tinted","ink","colourOverrides","mergedStyle","showShortTitle","jsx","jsxs","Fragment","ClipboardCheck","EyeOff","id","index","capacity"],"mappings":";;;;;;;;;;;;;;;;AAgCA,SAASA,GAASC,GAA8C;AAC9D,MAAI,OAAOA,KAAQ,SAAU,QAAO;AACpC,QAAMC,IAAUD,EAAI,KAAA;AACpB,MAAI,CAACC,EAAQ,WAAW,GAAG,EAAG,QAAO;AACrC,QAAMC,IAAOD,EAAQ,MAAM,CAAC;AAC5B,MAAIE,GACAC,GACAC;AACJ,MAAIH,EAAK,WAAW,GAAG;AACrB,QAAI,CAAC,iBAAiB,KAAKA,CAAI,EAAG,QAAO;AACzC,IAAAC,IAAI,SAASD,EAAK,CAAC,IAAIA,EAAK,CAAC,GAAG,EAAE,GAClCE,IAAI,SAASF,EAAK,CAAC,IAAIA,EAAK,CAAC,GAAG,EAAE,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AAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAL,GAAkB,cAAc;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-summary-BanguTa6.js","sources":["../../node_modules/lucide-react/dist/esm/icons/contact-round.mjs","../../src/components/entity-summary/entity-summary.agent.ts","../../src/components/entity-summary/entity-summary.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 2v2\", key: \"scm5qe\" }],\n [\"path\", { d: \"M17.915 22a6 6 0 0 0-12 0\", key: \"suqz9p\" }],\n [\"path\", { d: \"M8 2v2\", key: \"pbkmx\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"rect\", { x: \"3\", y: \"4\", width: \"18\", height: \"18\", rx: \"2\", key: \"12vinp\" }]\n];\nconst ContactRound = createLucideIcon(\"contact-round\", __iconNode);\n\nexport { __iconNode, ContactRound as default };\n//# sourceMappingURL=contact-round.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — EntitySummary. */\n/* */\n/* The AI narrative brief (\"Sintesi IA\") for an entity. The agent can */\n/* read the brief's STRUCTURE (generated-at + section ids / headings / */\n/* tone / item counts — fixed category labels, never the entity name or */\n/* the bullet items, both PHI) and drive the two affordances: regenerate */\n/* the brief and dismiss the panel. Generation itself is gated upstream */\n/* by AiConsentBanner; this adapter only re-requests an already-consented */\n/* brief. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { EntitySummaryHandle } from './entity-summary';\n\nexport const entitySummaryAgent: AgentAdapter<EntitySummaryHandle> = {\n id: 'entity-summary',\n // 'close' backs close; regenerate is a host-driven refresh with no\n // dedicated capability in the closed vocabulary.\n capabilities: ['close'],\n state: {\n sections: {\n type: 'Array<{ id: string; heading: string; tone: \"default\" | \"attention\"; itemCount: number }>',\n descriptionKey: 'ui.agent.entitySummary.state.sections',\n description:\n 'Structural section list — ids, fixed category headings, tone and item counts. Never the entity name or the bullet items (both PHI).',\n read: (handle) => handle.getState().sections,\n },\n generatedAtIso: {\n type: 'string | undefined',\n descriptionKey: 'ui.agent.entitySummary.state.generatedAtIso',\n description: 'ISO-8601 instant the brief was generated, when known.',\n read: (handle) => handle.getState().generatedAtIso,\n },\n },\n actions: {\n regenerate: {\n // Re-requests a fresh brief from the model — reaches an external system.\n safety: 'write',\n openWorld: true,\n descriptionKey: 'ui.agent.entitySummary.actions.regenerate',\n description:\n 'Request the host to regenerate the AI brief. No-op when the regenerate affordance is not available.',\n invoke: (handle) => {\n if (handle.canRegenerate()) handle.regenerate();\n },\n },\n close: {\n // Ephemeral panel-visibility change — read.\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.entitySummary.actions.close',\n description:\n 'Dismiss the summary panel. No-op when the close affordance is not available (e.g. docked in the rail).',\n invoke: (handle) => {\n if (handle.canClose()) handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'entity-summary',\n description: 'Marks the EntitySummary panel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific summary panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ContactRound, Clock, RefreshCw, X } from 'lucide-react';\nimport { Alert } from '../alert';\nimport { Avatar } from '../avatar';\nimport { Button } from '../button';\nimport { Card } from '../card';\nimport { IconButton } from '../button/icon-button';\nimport { Link } from '../link';\nimport { PanelHeader } from '../panel-header';\nimport { Timestamp } from '../timestamp';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { entitySummaryAgent } from './entity-summary.agent';\n\n/* ------------------------------------------------------------------ */\n/* EntitySummary — the AI narrative brief for an entity. */\n/* */\n/* The kit form of platform's \"Sintesi IA\": a generated, sectioned */\n/* brief of a patient / care plan — header (entity · generated-at · */\n/* regenerate · corpus stats), N labelled sections of bullet items */\n/* (with inline entity links), and a BETA disclaimer. The `attention` */\n/* section tone carries the clinically valuable risk flags. */\n/* */\n/* The kit owns the layout, i18n and theming; the consumer passes */\n/* structured `sections` (data-in) so the brief re-themes and */\n/* localises rather than rendering a model HTML blob. Gate generation */\n/* behind `AiConsentBanner` upstream. */\n/* ------------------------------------------------------------------ */\n\n/** A corpus stat shown in the header (e.g. `{ value: 5, label: 'care plans' }`). */\nexport interface EntitySummaryStat {\n value: string | number;\n label: string;\n}\n\n/** One narrative section — a heading over a list of bullet items. */\nexport interface EntitySummarySection {\n id: string;\n heading: string;\n /**\n * Leading glyph for the section. On default sections it's the scannability\n * anchor shown in a `--primary`-tinted medallion beside the heading (e.g. a\n * calendar for \"Scheduled\", a wallet for \"Financial\"); omit it to render no\n * medallion. On `attention` sections it overrides the warning Alert's icon\n * (which defaults to an alert triangle).\n */\n icon?: ReactNode;\n /**\n * `attention` renders the section as the kit's warning `Alert` — the\n * standard risk-flag treatment (border, warning surface, alert glyph,\n * `--warning-foreground` text) — for clinically important callouts.\n */\n tone?: 'default' | 'attention';\n /** Bullet items — `ReactNode` so consumers compose inline entity links. */\n items: ReactNode[];\n}\n\n/**\n * Curated agent handle for EntitySummary. Exposes structural state only —\n * never the entity name or the section items (both PHI). See\n * `entity-summary.agent.ts`.\n */\nexport interface EntitySummaryHandle {\n /** Structural snapshot — generated-at + section ids/headings/tone/count. No PHI. */\n getState: () => {\n generatedAtIso?: string;\n sections: Array<{\n id: string;\n heading: string;\n tone: 'default' | 'attention';\n itemCount: number;\n }>;\n };\n /** Whether the regenerate affordance is available. */\n canRegenerate: () => boolean;\n /** Request the host to regenerate the brief (mirrors onRegenerate). */\n regenerate: () => void;\n /** Whether the close affordance is available. */\n canClose: () => boolean;\n /** Dismiss the panel (mirrors onClose). */\n close: () => void;\n}\n\nexport interface EntitySummaryProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific summary panel.\n */\n id?: string;\n /** Panel title. Defaults to the localised \"AI summary\". */\n title?: string;\n /** Entity name shown beside its avatar in the header (links when `entityHref` is set). */\n entityName?: string;\n /** Entity href for the name link. */\n entityHref?: string;\n /** Avatar image URL for the entity. Falls back to initials derived from `entityName`. */\n entityAvatarSrc?: string;\n /** ISO-8601 instant the brief was generated. */\n generatedAtIso?: string;\n /** Corpus the brief was built from, shown as a compact KPI card. */\n stats?: EntitySummaryStat[];\n /** The narrative sections, in order. */\n sections: EntitySummarySection[];\n /** Regenerate the brief. Omit to hide the affordance. */\n onRegenerate?: () => void;\n /** Regenerate-button label. */\n regenerateLabel?: string;\n /**\n * Dismiss the panel. Renders a close button in the panel header for\n * STANDALONE use (outside the rail). When docked in `ControlRoomRail`, omit\n * this — the rail injects its own close via `PanelHeaderActionsProvider`\n * (passing it while docked would render a duplicate close control).\n */\n onClose?: () => void;\n /** Footer disclaimer. Defaults to the BETA clinical-judgement note. */\n disclaimer?: ReactNode;\n /** BCP-47 locale for the generated-at timestamp. */\n locale?: string;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Section presentation. The `attention` tone renders a different */\n/* element tree (the kit's warning Alert) rather than a class variant, */\n/* so the branch lives in `Section`; these constants carry the shared */\n/* class sets for the default (prose) sections. */\n/* ------------------------------------------------------------------ */\n\n// The default section's leading icon chip — a --primary-tinted medallion\n// that anchors the heading. No tone variants: the attention tone is owned\n// by the Alert primitive, so this stays a plain class set.\nconst MEDALLION_CLASSES =\n 'ds:flex ds:size-7 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-md)] ds:[&_svg]:size-4 ds:bg-primary/10 ds:text-[color:var(--primary)]';\n\n// The bullet list shared by every section — indented disc items.\nconst ITEMS_CLASSES =\n 'ds:m-0 ds:flex ds:list-disc ds:flex-col ds:gap-[var(--spacing-2xs)] ds:ps-[var(--spacing-md)] type-body-sm';\n\nexport const EntitySummary = forwardRef<HTMLElement, EntitySummaryProps>(\n function EntitySummary(\n {\n id,\n title,\n entityName,\n entityHref,\n entityAvatarSrc,\n generatedAtIso,\n stats,\n sections,\n onRegenerate,\n regenerateLabel,\n onClose,\n disclaimer,\n locale,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const headingId = useId();\n const heading =\n title ?? t('entitySummary.title', { defaultValue: 'AI summary' });\n\n /* ----- Agent handle (structural state + regenerate / close) ----- */\n const sectionsRef = useRef(sections);\n sectionsRef.current = sections;\n const generatedAtRef = useRef(generatedAtIso);\n generatedAtRef.current = generatedAtIso;\n const onRegenerateRef = useRef(onRegenerate);\n onRegenerateRef.current = onRegenerate;\n const onCloseRef = useRef(onClose);\n onCloseRef.current = onClose;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<EntitySummaryHandle>(\n () => ({\n // Structural only — section headings are fixed category labels, never\n // the entity name or the bullet items (both PHI).\n getState: () => ({\n generatedAtIso: generatedAtRef.current,\n sections: sectionsRef.current.map((s) => ({\n id: s.id,\n heading: s.heading,\n tone: s.tone ?? 'default',\n itemCount: s.items.length,\n })),\n }),\n canRegenerate: () => !!onRegenerateRef.current,\n regenerate: () => onRegenerateRef.current?.(),\n canClose: () => !!onCloseRef.current,\n close: () => onCloseRef.current?.(),\n }),\n [],\n );\n useAgentRegistration(entitySummaryAgent, handle, id);\n\n // The generated-at line — the brief's \"subtitle\" under the entity name,\n // or a standalone line when there's no entity. A clock glyph leads it.\n const generatedLine = generatedAtIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] type-meta ds:text-[color:var(--muted-foreground)]\">\n <Clock aria-hidden=\"true\" className=\"ds:size-3.5 ds:shrink-0\" />\n <span>\n {t('entitySummary.generatedAt', { defaultValue: 'Generated' })}\n </span>\n <Timestamp value={generatedAtIso} format=\"absolute\" locale={locale} />\n </span>\n ) : null;\n\n return (\n <section\n ref={rootRef}\n data-component=\"entity-summary\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Header — the shared rail-panel pattern. Title + Regenerate;\n the close affordance is injected by the rail, not the panel. */}\n <PanelHeader\n title={heading}\n icon={<ContactRound aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n actions={\n onRegenerate || onClose ? (\n <>\n {onRegenerate ? (\n <Button\n type=\"button\"\n size=\"sm\"\n intent=\"ghost\"\n startIcon={<RefreshCw aria-hidden=\"true\" />}\n onClick={onRegenerate}\n >\n {regenerateLabel ??\n t('entitySummary.regenerate', {\n defaultValue: 'Regenerate',\n })}\n </Button>\n ) : null}\n {onClose ? (\n <IconButton\n icon={<X aria-hidden=\"true\" />}\n size=\"sm\"\n intent=\"ghost\"\n aria-label={t('common.close', { defaultValue: 'Close' })}\n onClick={onClose}\n />\n ) : null}\n </>\n ) : undefined\n }\n />\n\n {/* Body */}\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {entityName || generatedAtIso || (stats && stats.length > 0) ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Identity — the entity's avatar + name, generated-at as the\n subtitle beneath. Without a name, the generated line stands\n alone. */}\n {entityName ? (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Avatar\n name={entityName}\n src={entityAvatarSrc}\n size=\"sm\"\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {entityHref ? (\n <Link\n href={entityHref}\n className=\"type-body-sm ds:font-semibold\"\n >\n {entityName}\n </Link>\n ) : (\n <span className=\"type-body-sm ds:font-semibold ds:text-[color:var(--foreground)]\">\n {entityName}\n </span>\n )}\n {generatedLine}\n </div>\n </div>\n ) : (\n generatedLine\n )}\n\n {/* Corpus stats — a compact KPI card: value over label, with a\n hairline divider between cells. */}\n {stats && stats.length > 0 ? (\n <Card variant=\"elevated\">\n {/* eslint-disable-next-line jsx-a11y/no-redundant-roles -- role=\"list\" restores list semantics that ds:list-none strips in Safari/VoiceOver */}\n <ul\n role=\"list\"\n className=\"ds:m-0 ds:flex ds:list-none ds:items-stretch\"\n >\n {stats.map((stat, index) => (\n <li\n key={`${stat.label}-${index}`}\n className={[\n 'ds:flex ds:flex-1 ds:flex-col ds:items-center ds:gap-[var(--spacing-2xs)] ds:p-[var(--spacing-sm)] ds:text-center',\n index > 0\n ? 'ds:border-s ds:border-[color:var(--card-border)]'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <span className=\"type-metric ds:[--type-metric-size:var(--font-size-lg)] ds:text-[color:var(--foreground)]\">\n {stat.value}\n </span>\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {stat.label}\n </span>\n </li>\n ))}\n </ul>\n </Card>\n ) : null}\n </div>\n ) : null}\n\n {/* Sections */}\n {sections.map((section) => (\n <Section key={section.id} section={section} />\n ))}\n\n {/* Disclaimer */}\n <p className=\"ds:m-0 type-meta ds:text-[color:var(--muted-foreground)]\">\n {disclaimer ??\n t('entitySummary.disclaimer', {\n defaultValue:\n 'Does not replace clinical judgement · verify accuracy before clinical use · BETA',\n })}\n </p>\n </div>\n </section>\n );\n },\n);\n\nfunction Section({ section }: { section: EntitySummarySection }): ReactNode {\n const headingId = useId();\n\n // The risk-flag section composes the kit's warning `Alert` primitive rather\n // than re-painting the warning tokens by hand — same border, surface, alert\n // glyph, and `--warning-foreground` treatment as every other warning in the\n // app. `live=\"off\"`: the brief is static content, not a just-occurred event,\n // so the items read in normal flow instead of being announced assertively.\n // A per-section `icon` overrides Alert's default alert triangle.\n if (section.tone === 'attention') {\n // The shared `--shadow-card` lifts the warning callout to the same\n // elevation as the surrounding section cards, so the stack reads as one\n // set of raised panels rather than a flat warning band among cards.\n return (\n <Alert\n variant=\"warning\"\n live=\"off\"\n icon={section.icon}\n className=\"ds:shadow-[var(--shadow-card)]\"\n >\n <Alert.Title as=\"h3\">{section.heading}</Alert.Title>\n <ul className={ITEMS_CLASSES}>\n {section.items.map((item, index) => (\n <li key={index}>{item}</li>\n ))}\n </ul>\n </Alert>\n );\n }\n\n // Default sections are raised cards — the scannable \"panel per topic\" stack,\n // matching platform's Sintesi IA. The card owns its own padding (so we drive\n // it from a single content div rather than Card.Header/Body) and is named by\n // its heading for assistive tech.\n return (\n <Card variant=\"elevated\" aria-labelledby={headingId}>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {section.icon ? (\n <span aria-hidden=\"true\" className={MEDALLION_CLASSES}>\n {section.icon}\n </span>\n ) : null}\n <h3\n id={headingId}\n className=\"ds:m-0 type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </h3>\n </div>\n <ul className={`${ITEMS_CLASSES} ds:text-[color:var(--foreground)]`}>\n {section.items.map((item, index) => (\n <li key={index}>{item}</li>\n ))}\n </ul>\n </div>\n </Card>\n );\n}\n"],"names":["__iconNode","ContactRound","createLucideIcon","entitySummaryAgent","handle","MEDALLION_CLASSES","ITEMS_CLASSES","EntitySummary","forwardRef","id","title","entityName","entityHref","entityAvatarSrc","generatedAtIso","stats","sections","onRegenerate","regenerateLabel","onClose","disclaimer","locale","className","ariaLabel","rest","ref","t","useTranslation","headingId","useId","heading","sectionsRef","useRef","generatedAtRef","onRegenerateRef","onCloseRef","rootRef","useImperativeHandle","useMemo","s","_a","useAgentRegistration","generatedLine","jsxs","jsx","Clock","Timestamp","PanelHeader","Fragment","Button","RefreshCw","IconButton","X","Avatar","Link","Card","stat","index","section","Section","Alert","item"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAAA,EAC1D,CAAC,QAAQ,EAAE,GAAG,UAAU,KAAK,QAAO,CAAE;AAAA,EACtC,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,UAAU;AAAA,EACxD,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,KAAK,OAAO,MAAM,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAChF,GACMC,KAAeC,EAAiB,iBAAiBF,CAAU,GCDpDG,KAAwD;AAAA,EACnE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,OAAO;AAAA,EACtB,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,WAAW;AAAA,IAAA;AAAA,IAEtC,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,WAAW;AAAA,IAAA;AAAA,EACtC;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA;AAAA,MAEV,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ,CAACA,MAAW;AAClB,QAAIA,EAAO,mBAAiBA,EAAO,WAAA;AAAA,MACrC;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA;AAAA,MAEL,QAAQ;AAAA,MACR,YAAY;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{"version":3,"file":"header-settings-DsvheAOt.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses HTML lang first when followHtmlLang is enabled; otherwise storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n \"Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm. On a site with one address per language, the host may then load that language's address.\",\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ArrowLeft, ChevronRight, Settings } from 'lucide-react';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport {\n LocalePicker,\n persistLocalePreference,\n reportLocaleChange,\n type LocaleChangeHandler,\n useInitialLocale,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { useMediaQuery } from '../../hooks/use-media-query';\nimport { useDocumentDirection } from '../../hooks/use-direction';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\nimport { useLengthTokenPx } from '../_shared/length-token';\nimport {\n accessibleTargetSquareClass,\n accessibleTargetSquareFromSmClass,\n} from '../_shared/accessible-target';\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\n// In the standard themes the cog keeps its IconButton box at every size, so\n// `sm` is as tall as a `Button size=\"sm\"` beside it: 44px on phones, 32px\n// from `sm:` up. The hit area still reaches --min-target-size at every width.\n// IconButton hides its `::before` hit box from `sm:` up; this rule is keyed\n// on the button's own marker, so it outranks that rule whatever order the\n// CSS is emitted in (as in DashboardGrid). The box reaches 6px past each\n// edge, no more than the header's --spacing-sm gap.\n// In the accessible themes the cog grows to the 48px target instead, as the\n// kit's other compact controls do (RowActions, DataGrid), so it never looks\n// smaller there than it did before. `lg` (48px) already meets the target.\nconst triggerVariants = cva('', {\n variants: {\n size: {\n // Button sm is 44px tall on phones; IconButton sm is only 32px wide.\n // The unscoped floor's `auto` fallback would undo that phone minimum,\n // so `sm` takes the floor scoped from `sm:` up.\n sm: `ds:min-w-[var(--min-target-size)] ds:sm:min-w-0 ds:data-[component=icon-button]:sm:before:block ${accessibleTargetSquareFromSmClass}`,\n md: `ds:data-[component=icon-button]:sm:before:block ${accessibleTargetSquareClass}`,\n lg: '',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n// The language flyout hosts the searchable locale list, so it takes a\n// popover width rather than the menu's minimum.\nconst languageFlyoutClasses = 'ds:w-[var(--popover-size-md)]';\n\nconst panelVariants = cva('', {\n variants: {\n language: {\n true: 'ds:[inline-size:var(--popover-size-md)] ds:[min-inline-size:0] ds:[max-inline-size:calc(100vw_-_2_*_var(--spacing-lg))] ds:[&_input]:min-w-0',\n false: '',\n },\n },\n});\n\ntype PhoneView = 'main' | 'language' | 'appearance';\n\nconst phoneRowClasses = cva(\n 'ds:flex ds:flex-1 ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]',\n);\n\nfunction SettingRowLabel({\n label,\n value,\n lang,\n}: {\n label: string;\n value: string;\n lang?: string;\n}) {\n return (\n <span className={phoneRowClasses()}>\n <span className=\"ds:truncate\">{label}</span>\n <span\n lang={lang}\n className=\"ds:shrink-0 ds:text-muted-foreground ds:[[data-highlighted]_&]:text-current\"\n >\n {value}\n </span>\n </span>\n );\n}\n\nfunction isLocale(tag: string): tag is Locale {\n return Object.prototype.hasOwnProperty.call(LOCALE_META, tag);\n}\n\n/* ------------------------------------------------------------------ */\n/* LanguageSub */\n/* */\n/* One menu row naming the setting and showing the current language */\n/* (\"Language · English ›\"), laid out like DropdownMenu.ChoiceSub. It */\n/* opens a flyout beside the menu holding LocalePicker.SearchList, so */\n/* the 18 locales stay searchable. The flyout is a dialog, not a menu: */\n/* it holds a search combobox and a listbox, which a menu may not own. */\n/* ------------------------------------------------------------------ */\n\nfunction LanguageSub({\n locale,\n onLocaleChange,\n}: {\n locale: string;\n onLocaleChange?: LocaleChangeHandler;\n}) {\n const { t } = useTranslation('ui');\n const current = LOCALE_META[isLocale(locale) ? locale : 'en'];\n\n // Radix focuses the flyout itself when a keyboard user opens it. Hand\n // that focus on to the search field so typing filters at once.\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n event.currentTarget\n .querySelector<HTMLInputElement>('input')\n ?.focus({ preventScroll: true });\n };\n\n // The flyout closes on the \"back\" arrow (ArrowLeft, or ArrowRight in\n // RTL). Inside the search field that key moves the caret instead,\n // unless the caret is already at the start of the field. Capture\n // phase, so Radix's own handler on the flyout never sees the key.\n const handleKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) return;\n // Keys pressed while an IME is composing (Japanese, Chinese) belong to\n // the composition, never to the menu.\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n if (target.selectionStart !== 0 || target.selectionEnd !== 0) {\n event.stopPropagation();\n }\n };\n\n return (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger aria-haspopup=\"dialog\" data-value={current.code}>\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:truncate\">\n {t('navigation.headerSettings.language.label')}\n </span>\n <span\n lang={current.code}\n className=\"ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:[[data-highlighted]_&]:text-current\"\n >\n {current.nativeName}\n </span>\n </span>\n </DropdownMenu.SubTrigger>\n {/* Radix renders a `menu`; override to `dialog` and drop the\n menu-only `aria-orientation`, which a dialog may not carry. */}\n <DropdownMenu.SubContent\n role=\"dialog\"\n aria-orientation={undefined}\n className={languageFlyoutClasses}\n onFocus={handleFocus}\n onKeyDownCapture={handleKeyDownCapture}\n // Escape that cancels an IME conversion must not close the menu.\n onEscapeKeyDown={(escapeEvent) => {\n if (escapeEvent.isComposing) escapeEvent.preventDefault();\n }}\n >\n <LocalePicker.SearchList onLocaleChange={onLocaleChange} />\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. In the standard themes the cog shows that button's own\n * box; in the accessible themes `sm` and `md` grow to the 48px target.\n * Defaults to `md`. The hit area always meets `--min-target-size`,\n * including on desktop: where the cog is smaller, an invisible box\n * around it makes up the difference.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row: in the standard themes the cog is then as\n * tall as those buttons.\n *\n * The menu itself (language, appearance and accessible-mode rows)\n * stays at kit defaults regardless — this prop only sizes the\n * trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n /**\n * With no saved choice, start from the page's HTML lang before falling back\n * to the browser. Defaults to false. The first locale surface's mount effect\n * decides for the app lifecycle; pass the same option to LocalePicker.\n */\n initialLocaleFromHtmlLang?: boolean;\n /**\n * The page's HTML lang decides the starting locale, ahead of a saved\n * choice. For sites with one address per language, where the address\n * decides. Defaults to false. Pass the same option to LocalePicker.\n */\n followHtmlLang?: boolean;\n /**\n * Called after a language picked in the menu (or set through the agent\n * handle) has been applied and changed the language. Not called for the\n * starting locale. A site with one address per language navigates to\n * `resolved` here.\n */\n onLocaleChange?: LocaleChangeHandler;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface, laid out as a View */\n/* menu: Language, Appearance (light / dark / system) and an Accessible */\n/* mode SwitchItem. On phones the lists replace the panel with a Back */\n/* row; on larger screens they open beside it. Every row uses the hooks */\n/* (`useLocale`, `useTheme`) as the standalone components, so there is */\n/* no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n initialLocaleFromHtmlLang = false,\n followHtmlLang = false,\n onLocaleChange,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation('ui');\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n // The language search only mounts with its flyout, so apply the saved\n // (or HTML/browser) language here, on mount.\n useInitialLocale(initialLocaleFromHtmlLang, followHtmlLang);\n const onLocaleChangeRef = useRef(onLocaleChange);\n onLocaleChangeRef.current = onLocaleChange;\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // PublicHeader uses ds:md:hidden / ds:hidden ds:md:flex for its phone\n // sheet and inline actions. Match that same Tailwind md boundary (768px).\n const isPhone = useMediaQuery('(width < 48rem)');\n const direction = useDocumentDirection();\n const [phoneView, setPhoneView] = useState<PhoneView>('main');\n const view = isPhone ? phoneView : 'main';\n const panelRef = useRef<HTMLDivElement>(null);\n const languageRowRef = useRef<HTMLDivElement>(null);\n const appearanceRowRef = useRef<HTMLDivElement>(null);\n const returnFocusRef = useRef<Exclude<PhoneView, 'main'> | null>(null);\n const activationRef = useRef('keyboard');\n\n useIsomorphicLayoutEffect(() => {\n if (!isPhone && phoneView !== 'main') {\n returnFocusRef.current = phoneView;\n setPhoneView('main');\n }\n if (view === 'language') {\n panelRef.current\n ?.querySelector<HTMLElement>(\n activationRef.current === 'keyboard' ? 'input' : 'button',\n )\n ?.focus({ preventScroll: true });\n } else if (view === 'appearance') {\n panelRef.current\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n } else if (returnFocusRef.current) {\n const section = returnFocusRef.current;\n // Desktop renders SubTrigger/ChoiceSub in place of the phone rows.\n const row = isPhone\n ? (section === 'language' ? languageRowRef : appearanceRowRef).current\n : panelRef.current?.querySelector<HTMLElement>(\n `[role=\"menuitem\"][aria-haspopup=\"${section === 'language' ? 'dialog' : 'menu'}\"]`,\n );\n row?.focus({ preventScroll: true });\n returnFocusRef.current = null;\n }\n }, [isPhone, phoneView, view]);\n\n const handlePhoneRowKeyDown = (\n event: KeyboardEvent<HTMLDivElement>,\n section: Exclude<PhoneView, 'main'>,\n ) => {\n if (event.nativeEvent.isComposing) return;\n const forwardKey = direction === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n if (\n event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === forwardKey\n )\n activationRef.current = 'keyboard';\n if (event.key === forwardKey) {\n event.preventDefault();\n setPhoneView(section);\n }\n };\n\n const goBack = () => {\n if (view === 'main') return;\n returnFocusRef.current = view;\n setPhoneView('main');\n };\n\n const handlePhoneKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (view === 'main') return;\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft'))\n return;\n const target = event.target;\n // As in LanguageSub, leave the caret alone until it reaches the start.\n if (\n target instanceof HTMLInputElement &&\n (target.selectionStart !== 0 || target.selectionEnd !== 0)\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n goBack();\n };\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Share persistence and session preference with every locale picker.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n persistLocalePreference(next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n const previous = localeRef.current;\n setLocaleRef.current(next as Locale);\n reportLocaleChange(\n onLocaleChangeRef.current,\n next as Locale,\n previous as Locale,\n );\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n // Keep the panel clear of the screen edge by the phone menu's own\n // side margin. In the PublicHeader sheet the gear is\n // 24px from the edge and an end-aligned 224px panel would otherwise be\n // pushed flush against it. On desktop it never reaches the edge.\n const edgeMargin = useLengthTokenPx('--spacing-lg', forwardedRef, 24);\n const languageLabel = t('navigation.headerSettings.language.label');\n const appearanceLabel = t('navigation.headerSettings.appearance.label');\n const currentLocale = LOCALE_META[isLocale(locale) ? locale : 'en'];\n const appearanceOptions = [\n {\n value: 'light',\n label: t('navigation.headerSettings.appearance.light'),\n },\n { value: 'dark', label: t('navigation.headerSettings.appearance.dark') },\n {\n value: 'system',\n label: t('navigation.headerSettings.appearance.system'),\n },\n ] as const;\n const backLabel = t('navigation.headerSettings.back');\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root\n onOpenChange={(open) => {\n if (!open) {\n returnFocusRef.current = null;\n setPhoneView('main');\n }\n }}\n >\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n className={triggerVariants({ size })}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content\n ref={panelRef}\n align={align}\n collisionPadding={edgeMargin}\n className={panelVariants({ language: view === 'language' })}\n {...(view === 'language'\n ? {\n role: 'dialog',\n 'aria-orientation': undefined,\n 'aria-label': languageLabel,\n 'aria-labelledby': undefined,\n }\n : {})}\n onKeyDownCapture={handlePhoneKeyDown}\n onEscapeKeyDown={(event) => {\n if (event.isComposing) event.preventDefault();\n }}\n >\n {view === 'language' ? (\n <div\n role=\"presentation\"\n onKeyDown={(event) => {\n // The dialog owns typing and Tab, not Radix's menu\n // typeahead. Its two tab stops are Back and search.\n if (\n event.key === 'Tab' &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey\n ) {\n event.preventDefault();\n event.currentTarget\n .querySelector<HTMLElement>(\n event.target instanceof HTMLInputElement\n ? 'button'\n : 'input',\n )\n ?.focus();\n }\n event.stopPropagation();\n }}\n >\n <Button\n intent=\"ghost\"\n size=\"sm\"\n className=\"ds:w-full ds:justify-start ds:text-start ds:font-normal ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:gap-[var(--spacing-sm)] ds:[&>span:last-child]:flex-1\"\n startIcon={<ArrowLeft aria-hidden className=\"ds:size-4\" />}\n flipIconInRtl\n onClick={goBack}\n >\n <SettingRowLabel label={backLabel} value={languageLabel} />\n </Button>\n <DropdownMenu.Separator />\n <LocalePicker.SearchList onLocaleChange={onLocaleChange} />\n </div>\n ) : view === 'appearance' ? (\n <>\n <DropdownMenu.Item\n startIcon={\n <ArrowLeft\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onSelect={(event) => {\n event.preventDefault();\n goBack();\n }}\n >\n <SettingRowLabel label={backLabel} value={appearanceLabel} />\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.RadioGroup\n aria-label={appearanceLabel}\n value={theme.theme}\n onValueChange={(next) =>\n theme.setTheme(next as ThemePreference)\n }\n >\n {appearanceOptions.map((option) => (\n <DropdownMenu.RadioItem\n key={option.value}\n value={option.value}\n onSelect={(event) => event.preventDefault()}\n >\n {option.label}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </>\n ) : (\n <>\n {isPhone ? (\n <DropdownMenu.Item\n ref={languageRowRef}\n aria-haspopup=\"dialog\"\n data-value={currentLocale.code}\n endIcon={\n <ChevronRight\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onPointerDown={(event) => {\n activationRef.current = event.pointerType;\n }}\n onKeyDown={(event) =>\n handlePhoneRowKeyDown(event, 'language')\n }\n onSelect={(event) => {\n event.preventDefault();\n setPhoneView('language');\n }}\n >\n <SettingRowLabel\n label={languageLabel}\n value={currentLocale.nativeName}\n lang={currentLocale.code}\n />\n </DropdownMenu.Item>\n ) : (\n <LanguageSub\n locale={locale}\n onLocaleChange={onLocaleChange}\n />\n )}\n <DropdownMenu.Separator />\n {isPhone ? (\n <DropdownMenu.Item\n ref={appearanceRowRef}\n aria-haspopup=\"menu\"\n data-value={theme.theme}\n endIcon={\n <ChevronRight\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onPointerDown={(event) => {\n activationRef.current = event.pointerType;\n }}\n onKeyDown={(event) =>\n handlePhoneRowKeyDown(event, 'appearance')\n }\n onSelect={(event) => {\n event.preventDefault();\n setPhoneView('appearance');\n }}\n >\n <SettingRowLabel\n label={appearanceLabel}\n value={\n appearanceOptions.find(\n (option) => option.value === theme.theme,\n )?.label ?? ''\n }\n />\n </DropdownMenu.Item>\n ) : (\n <DropdownMenu.ChoiceSub\n label={appearanceLabel}\n value={theme.theme}\n onValueChange={theme.setTheme}\n options={appearanceOptions}\n />\n )}\n {/* Writes through useTheme, so the document gets the\n `theme-accessible` class at once (including the Lexend\n swap for Latin scripts, see src/tokens/index.css). */}\n <DropdownMenu.SwitchItem\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n >\n {t('navigation.headerSettings.appearance.accessible')}\n </DropdownMenu.SwitchItem>\n </>\n )}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","triggerVariants","accessibleTargetSquareFromSmClass","accessibleTargetSquareClass","languageFlyoutClasses","panelVariants","phoneRowClasses","SettingRowLabel","label","value","lang","jsxs","jsx","isLocale","tag","LanguageSub","onLocaleChange","t","useTranslation","current","handleFocus","event","_a","handleKeyDownCapture","target","DropdownMenu","escapeEvent","LocalePicker","HeaderSettings","forwardRef","props","ref","align","size","disabled","initialLocaleFromHtmlLang","followHtmlLang","className","id","rest","theme","useTheme","setLocaleI18n","useLocale","useInitialLocale","onLocaleChangeRef","useRef","forwardedRef","useImperativeHandle","isPhone","useMediaQuery","direction","useDocumentDirection","phoneView","setPhoneView","useState","view","panelRef","languageRowRef","appearanceRowRef","returnFocusRef","activationRef","useIsomorphicLayoutEffect","_b","_d","_c","section","row","_e","handlePhoneRowKeyDown","forwardKey","goBack","handlePhoneKeyDown","setLocaleWithPersistence","useCallback","next","persistLocalePreference","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","previous","reportLocaleChange","useAgentRegistration","accessibleChecked","edgeMargin","useLengthTokenPx","languageLabel","appearanceLabel","currentLocale","appearanceOptions","backLabel","open","IconButton","Settings","Button","ArrowLeft","Fragment","option","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;;AAOO,MAAMA,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,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